Joined: Mar 03, 2003 Posts: 6276 Location: Washington Township, NJ, USA
Posted: Mon Apr 19, 2004 5:57 pm Post subject: [RELEASE] Creating new album upon user registration
Automatically Create User Album Upon Registration
This MOD allows you to give your users the option to automatically create a new top-level album for themselves in your Gallery. To see it in action, visit http://phpnuke.nukedgallery.net/ and set up an account. This should make that user the owner so that they can set the permissions. If not, please post here and I will post a fix.
Before you start, the standard disclaimer applies:
Back up all files before applying this modification. Back up your database before modification. If you don't, your computer may melt
Add a new field to your users_temp table with the following properties:
Code: › Field name: empty_album
Type: varchar(255)
Null: No
Add a new field to your users table with the following properties:
Code: › Field Name: user_album
Type: tiny_int(1)
Null: No
Default: 0
Open modules/Your_Account/index.php and make the following changes:
#
# REPLACE WITH
#
echo ""._YOUAREREGISTERED."";
if($emptyAlbum == "Yes") {
echo "<br><br>Your new album will be created once your account has been activated.";
}
echo "<br><br>"
Edit: Cosmetic edit to highlight database tables which need modification.
Edit 2: There appears to be a problem with setting album ownership. Until I can get this resolved (not sure if it's a 1.4.3 error or not), you should manually set ownership of albums to the user.
Edit 3: Clarified location of one code block.
Edit 4: Adding missing '' around sql variable.
Edit 5: Fixed album permissions error. Now, there is apparantly a problem with GoogleTapped sites. If you can fix this, let me know (there are a ton of different GT implementations floating around).
_________________
Last edited by dari on Tue Jun 29, 2004 5:06 pm; edited 7 times in total
Posted: Mon Apr 19, 2004 10:44 pm Post subject: Re: [RELEASE] Creating new album upon user registration
I'll take a look at it. I have to learn the structure and what's going on with the code before I go tweeking it to much at this point. I'll keep track of my changes and post them when I'm done.
what's on your line 37?
make sure that when you're copying/pasting the code from here that if it looks like it's been wrapped to multiple lines, you edit it to be only on one line (so that php parses it correctly). _________________
Posted: Fri Apr 23, 2004 4:06 am Post subject: Re: [RELEASE] Creating new album upon user registration
here is the line 37 in Your_account/index.php
if ($db->sql_numrows($db->sql_query("SELECT user_email FROM ".$user_prefix."_users_temp WHERE user_email='$user_email'")) > 0) $stop = "<center>"._EMAILREGISTERED."</center><br>";
the code is written in one line . I checked all the code and it seems correct
Joined: Mar 03, 2003 Posts: 6276 Location: Washington Township, NJ, USA
Posted: Fri Apr 23, 2004 9:34 am Post subject: Re: [RELEASE] Creating new album upon user registration
i don't touch that line....go through your modifications and make sure that you copied/pasted everything properly, and that long lines didn't wrap, etc.... _________________
Posted: Mon May 17, 2004 2:59 am Post subject: Re: [RELEASE] Creating new album upon user registration
When I make the changes, the signup goes smooth, but then when the user clicks the link in the email to activate their account, they see this error on the page....
Warning: Invalid argument supplied for foreach() in /home/XXXXXXX/public_html/modules/gallery/session.php on line 64
Fatal error: Call to a member function on a non-object in /home/XXXXXXX/public_html/modules/Your_Account/index.php on line 208
Posted: Mon May 17, 2004 3:09 am Post subject: Re: [RELEASE] Creating new album upon user registration
Is there an easy way to make the new user's album in an existing album -- like Member's Albums -- as a subalbum? It seems like the top level of the gallery could get very cluttered very quickly with new member's albums.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum