|
Page 1 of 1
|
luckyou03 
Joined: March 2007
Posts: 30
Location:
|
 FAP CUSTOMIZATION - Wanting To Add A Personal Gallery Management Link
Im using a profile information organizer hack, user cp organize to be specific. Well Im trying to add links in the profile control panel to manage your personal categories. I got the upload and my pictures figured out. Here is what i added
'U_YOUR_PERSONAL_GALLERY' => append_sid("album.$phpEx?user_id=". $userdata['user_id']),
'UPLOAD_PERSONAL_GALLERY' => append_sid("album_upload.php?cat_id=1&user_id=". $userdata['user_id']),
'U_USERS_PERSONAL_GALLERIES' => append_sid("album_personal_index.$phpEx"),
'U_PERSONAL_CAT_ADMIN' => append_sid("album_personal_cat_admin.$phpEx?cat_id=$cat_id"),
the problem im having is with this line
'U_PERSONAL_CAT_ADMIN' => append_sid("album_personal_cat_admin.$phpEx?cat_id=$cat_id"),
It cant find the $cat_id. what would i need to add to this non album page to pull the users personal $cat_id
thanks
Adam
|
#1 Mon 26 Mar, 2007 07:30 |
|
Sponsors

|
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.
|
|
Artie 
Joined: January 2007
Posts: 833
Location:  Lone Star State
|
 Re: Wanting To Add A Personal Gallery Management Link
I think adding something like this may work
$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&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.'&user_id=' . $album_user_id);
}
$db->sql_freeresult($result);
'U_PERSONAL_CAT_ADMIN' => $create_personal_cat_manage_link,
You'll also need $cat_id for your UPLOAD_PERSONAL_GALLERY
|
#2 Tue 27 Mar, 2007 02:28 |
|
luckyou03 
Joined: March 2007
Posts: 30
Location:
|
 Re: Wanting To Add A Personal Gallery Management Link
First off, thank you. I tried the code and im getting errors maybe if you looked at the whole thing it might be better, its not to big.
<?php
/***************************************************************************
* cpl_menu.php
* -------------------
* mod version : 1.0.5
* date : Monday, 08.22.2005
* copyright : Dustin < adminkrez@dumbassjones.com >
*
***************************************************************************/
/***************************************************************************
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
$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_append_uid('album_personal_cat_admin.' . $phpEx . '?action=create&user_id=' . $album_user_id));
}
else
$thisrow = $db->sql_numrows($result) ;
$cat_id = $thisrow['cat_id'];
$create_personal_cat_manage_link = append_sid(album_append_uid('album_personal_cat_admin.' . $phpEx . '?cat_id='.$cat_id.'user_id=' . $album_user_id));
}
$db->sql_freeresult($result);
$template->set_filenames(array(
'cpl_menu_output' => 'profile_cpl_menu.tpl')
);
$template->assign_vars(array(
'L_CPL_REG_INFO' => $lang['Registration_info'],
'L_CPL_PROFILE_INFO' => $lang['Profile_info'],
'L_CPL_AVATAR_PANEL' => $lang['Avatar_panel'],
'L_CPL_PREFERENCES' => $lang['Preferences'],
'L_CPL_SETTINGS_OPTIONS' => $lang['Cpl_Settings_Options'],
'L_CPL_BOARD_SETTINGS' => $lang['Cpl_Board_Settings'],
'L_CPL_PRIVATE_MESSAGES' => $lang['Private_Messages'],
'L_CPL_NEWMSG' => $lang['Cpl_NewMSG'],
'L_CPL_PERSONAL_PROFILE' => $lang['Cpl_Personal_Profile'],
'L_CPL_VIEW_PROFILE' => $lang['Cpl_View_Profile'],
'U_CPL_NEWMSG' => append_sid('privmsg.'.$phpEx.'?mode=post'),
'U_CPL_REGISTRATION_INFO' => append_sid('profile.'.$phpEx.'?mode=editprofile&cpl_mode=reg_info'),
'U_CPL_PROFILE_INFO' => append_sid('profile.'.$phpEx.'?mode=editprofile&cpl_mode=profile_info'),
'U_CPL_PREFERENCES' => append_sid('profile.'.$phpEx.'?mode=editprofile&cpl_mode=preferences'),
'U_CPL_BOARD_SETTINGS' => append_sid('profile.'.$phpEx.'?mode=editprofile&cpl_mode=board_settings'),
'U_CPL_AVATAR_PANEL' => append_sid('profile.'.$phpEx.'?mode=editprofile&cpl_mode=avatar'),
'U_YOUR_PERSONAL_GALLERY' => append_sid("album.$phpEx?user_id=". $userdata['user_id']),
'UPLOAD_PERSONAL_GALLERY' => append_sid("album_upload.php?cat_id=1&user_id=". $userdata['user_id']),
'U_USERS_PERSONAL_GALLERIES' => append_sid("album_personal_index.$phpEx"),
'U_PERSONAL_CAT_ADMIN' => $create_personal_cat_manage_link,
));
$template->assign_var_from_handle('CPL_MENU_OUTPUT', 'cpl_menu_output');
?>
The first error i got was
Parse error: syntax error, unexpected '}' in /home/sweetpro/public_html/cpl_menu.php on line 48
so i removed the } and got this error
Fatal error: Call to undefined function: album_append_uid() in /home/sweetpro/public_html/cpl_menu.php on line 46
|
#3 Tue 27 Mar, 2007 04:00 |
|
Artie 
Joined: January 2007
Posts: 833
Location:  Lone Star State
|
 Re: Wanting To Add A Personal Gallery Management Link
I have edited the code that I supplied above..... try it now.
|
#4 Tue 27 Mar, 2007 04:27 |
|
luckyou03 
Joined: March 2007
Posts: 30
Location:
|
 Re: Wanting To Add A Personal Gallery Management Link
The code didn't cause any errors but its not pulling the cat id tho. any ideas?
|
#5 Tue 27 Mar, 2007 04:36 |
|
Artie 
Joined: January 2007
Posts: 833
Location:  Lone Star State
|
 Re: Wanting To Add A Personal Gallery Management Link
Oooops !
change
$thisrow = $db->sql_numrows($result) ;
to
$thisrow = $db->sql_fetchrow($result);
|
#6 Tue 27 Mar, 2007 04:48 |
|
luckyou03 
Joined: March 2007
Posts: 30
Location:
|
 Re: Wanting To Add A Personal Gallery Management Link
One more little thing for people wanting to use this in the future
Find
$create_personal_cat_manage_link = append_sid('album_personal_cat_admin.' . $phpEx . '?cat_id='.$cat_id.'user_id=' . $album_user_id);
and change to
$create_personal_cat_manage_link = append_sid('album_personal_cat_admin.' . $phpEx . '?cat_id='.$cat_id.'&user_id=' . $album_user_id);
After that it works excellent,
Thank you
|
#7 Tue 27 Mar, 2007 05:03 |
|
Artie 
Joined: January 2007
Posts: 833
Location:  Lone Star State
|
 Re: Wanting To Add A Personal Gallery Management Link
Glad you got it working.
Good eye on the &
|
#8 Tue 27 Mar, 2007 18:23 |
|
meanieme
Joined: April 2007
Posts: 9
|
 Re: Wanting To Add A Personal Gallery Management Link
is cat_id of user's personal gallery always the same as user's id?
because i tried putting your code in page_header since i want the management link in the overall header but it screws up
so instead of your code, i simply put in page_header.php
$template->assign_vars(array(
'U_PERSONAL_CAT_ADMIN' => append_sid('album_personal_cat_admin.' . $phpEx . '?cat_id='.$userdata['user_id'].'&user_id=' . $userdata['user_id']),
now it seems to be working.....well, unless cat_id of user will change....then i have a problem
|
#9 Tue 24 Apr, 2007 20:04 |
|
Artie 
Joined: January 2007
Posts: 833
Location:  Lone Star State
|
 Re: Wanting To Add A Personal Gallery Management Link
They are not the same, it just happened to work out that way for you.
It may work without specifying the cat_id, altogether. Try it by just adding the user_id part to the url
|
#10 Wed 25 Apr, 2007 00:37 |
|
meanieme
Joined: April 2007
Posts: 9
|
 Re: Wanting To Add A Personal Gallery Management Link
i removed cat_id, so far seems to work...so with this should just be one liner and thus won't need the sql call for cat_id
love simplicity thanks!
|
#11 Wed 25 Apr, 2007 08:27 |
|
Artie 
Joined: January 2007
Posts: 833
Location:  Lone Star State
|
 Re: Wanting To Add A Personal Gallery Management Link
You are welcome
|
#12 Thu 26 Apr, 2007 23:01 |
|
Pete_Z 
Joined: January 2007
Posts: 46
|
 Re: Wanting To Add A Personal Gallery Management Link
Hello, I find this helpful... but what are the {links_name} ? I cant figure that part out...
|
#13 Sun 18 May, 2008 07:58 |
|
|
Page 1 of 1
|
Was this topic useful?
Was this topic useful?
Link this topic |
URL |
|
BBCode |
|
HTML |
|
You cannot post new topics You cannot reply to topics You cannot edit your posts You cannot delete your posts You cannot vote in polls You cannot attach files You can download files You cannot post calendar events
|
|
|
|