https://www.icyphoenix.com/viewtopic.php?f=26&t=5259&p=35396#p35396
-----------------------------------
Artie
Mon 05 Jan, 2009 15:33

Re: Link To Personal Sub Cat In Lang File
-----------------------------------
[strike]There are 2 different tpl files for the Avatar CP ... I assume you want the link in the menu on the left side of the page.
You can copy code from profile_main.php to cpl_menu.php and that should give you your sub_cat_id.
[/strike]

[b]COPY[/b] 
[codeblock]//////////////////////////////////////
$sql = "SELECT * FROM " . ALBUM_CAT_TABLE . " 
		WHERE cat_user_id = " . $userdata['user_id']; 

if( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, 'Could not query album information', '', __LINE__, __FILE__, $sql);
}

while($row = $db->sql_fetchrow($result))
{ 
	$sub_cat_id = ($row['cat_parent'] > 0) ? $row['cat_id'] : '';
}

$db->sql_freeresult($result);

if (!empty($sub_cat_id))
{
	$u_personal_gallery = append_sid('album_cat.' . $phpEx . '?cat_id=' . $sub_cat_id .'&user_id=' . $userdata['user_id']);
}
else
{ 
  $u_personal_gallery = append_sid('album.' . $phpEx . '?user_id=' . $userdata['user_id']);
}
//////////////////////////////////////[/codeblock]

[strike][b]ADD TO cpl_menu.php[/b] (you can add just before the template variables are assigned)

Assign and add some template variables and it should work ..... keep in mind that if a user has more than 1 sub_cat, then the link will take you to the last sub_cat that was created.[/strike]


