modding user gallery.. help needed modding user gallery.. help needed
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

modding user gallery.. help needed

Started by MrOrange, September 10, 2006, 04:08:48 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MrOrange

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

$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