https://www.icyphoenix.com/viewtopic.php?f=26&t=1436&p=10920#p10920
-----------------------------------
Artie
Tue 27 Mar, 2007 02:28

Re: Wanting To Add A Personal Gallery Management Link
-----------------------------------
I think  adding something like this may work


[codeblock]$album_user_id = $userdata['user_id'];

$sql = "SELECT c.cat_id
				FROM ". ALBUM_CAT_TABLE ." AS c
				WHERE c.cat_user_id = '$album_user_id' AND c.cat_parent = 0
				LIMIT 1";

		if( !($result = $db->sql_query($sql)) )
		{
			message_die(GENERAL_ERROR, 'Could not query category information', '', __LINE__, __FILE__, $sql);
		}

		if ($db->sql_numrows($result) == 0)
		{

			$create_personal_cat_manage_link = append_sid('album_personal_cat_admin.' . $phpEx . '?action=create&amp;user_id=' . $album_user_id);
			
		}
		else
                {
		        $thisrow = $db->sql_numrows($result) ;
                        $cat_id = $thisrow['cat_id'];
			$create_personal_cat_manage_link = append_sid('album_personal_cat_admin.' . $phpEx . '?cat_id='.$cat_id.'&amp;user_id=' . $album_user_id);
		}
		$db->sql_freeresult($result);
		
		[/codeblock]

[codeblock]'U_PERSONAL_CAT_ADMIN' => $create_personal_cat_manage_link,[/codeblock]

You'll also need $cat_id for your UPLOAD_PERSONAL_GALLERY


