forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: MrOrange on September 10, 2006, 04:08:48 am

Title: modding user gallery.. help needed
Post by: MrOrange on September 10, 2006, 04:08:48 am
Hi Guys,

Im trying/wanting to setup CPG to allow user registrations (atm im uploading the content) and have some specific wants/needs I'm hoping someone can help me with.

The gallery is for a car club and I'm wanting to setup User Gallery's as a 'Member's Rides' section for user's to upload pictures of their own car directly into this category.

So far I have these requirements;
1) Automatically create an album when a user is activated named the same as the username (ok got this sorted from http://forum.coppermine-gallery.net/index.php?topic=35121.0)

2) Limit users to only 1 album (so far I've just removed the link to albmgr.php when logged in as a user)

3 Have the albums created in my first point use 'Members Rides' (renamed User Gal, cat=1 etc) as the parent Category.

4) Allow users to still modify only the album where their username matches the name.

Im using the following code to create the album when I activate the user. It sets the category as 10000 + UserID

Code: [Select]
$catid = $row['user_id'] + FIRST_USER_CAT;
    cpg_db_query("INSERT INTO {$CONFIG['TABLE_ALBUMS']} (`title`, `category`) VALUES ('".addslashes($user_name)."', $catid)");

The problem with this is when viewing cat=1 (Members rides) it lists another sub-category named the username, then inside that category the actual album also named the username.

How can I make the albums list directly under Members Rides (User Gal, cat=1 etc) rather than in another sub-category?

If this is too complex to post code examples if you could tell me what files/what functions I would need to modify and general logic I could probably figure it out.

Cheers,
James