|
Page 1 of 2
|
DWho
Joined: August 2006
Posts: 1307
Location: hampshire
|
FAP CUSTOMIZATION - Link To Personal Sub Cat In Lang File
Hi
I would like to place a link in a lang file that goes to members personal sub cat..
I manages to get a link to work to goto members personal album I used...
<a href="' . append_sid('album.' . $phpEx . '?user_id=' . $userdata['user_id']) . '">
this works fine..
all my membes have one sub cat and I would also like to point a link to there is this possible I have tried
('album_cat.' . $phpEx . '?cat_id=' . $cat_id . 'user_id=' . $userdata['user_id'])
but it does not work...
I would like the link to show you the members upload avatar page which is this link profile.php?mode=editprofile&cpl_mode=avatar
or is it possible to just add a link in the tpl file and which files do I need to edit... sorry if this is not in the right forum...
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#1 Sun 04 Jan, 2009 02:10 |
|
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: Link To Personal Sub Cat In Lang File
Not sure I understand exactly what you are asking
Your members only have 1 sub-cat in their personal gallery and you want a link to that sub-cat .
Are you saying that you want that link to show on the user's Avatar Control Panel page
Moved to proper forum - FAP General Discussions And Customizations
|
#2 Mon 05 Jan, 2009 04:17 |
|
DWho
Joined: August 2006
Posts: 1307
Location: hampshire
|
Re: Link To Personal Sub Cat In Lang File
Not sure I understand exactly what you are asking
Your members only have 1 sub-cat in their personal gallery and you want a link to that sub-cat .
Are you saying that you want that link to show on the user's Avatar Control Panel page
yes exactly if that is possible... thanks for reading
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#3 Mon 05 Jan, 2009 09:41 |
|
Artie
Joined: January 2007
Posts: 833
Location: Lone Star State
|
Re: Link To Personal Sub Cat In Lang File
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.
COPY
//////////////////////////////////////
$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']);
}
//////////////////////////////////////
ADD TO cpl_menu.php (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.
Edited by Artie, Wed 07 Jan, 2009 01:36: newer version below |
#4 Mon 05 Jan, 2009 15:33 |
|
DWho
Joined: August 2006
Posts: 1307
Location: hampshire
|
Re: Link To Personal Sub Cat In Lang File
excellant thank you
what if I would like it just by the upload avatar area which php file would I need .. and what code do I place in the tpl file...
thanks again
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#5 Mon 05 Jan, 2009 16:09 |
|
Artie
Joined: January 2007
Posts: 833
Location: Lone Star State
|
Re: Link To Personal Sub Cat In Lang File
It would be the same php file, but the tpl would be profile_add_body.tpl
Put your link in the area between
<!-- BEGIN switch_cpl_avatar -->
AND
<!-- END switch_cpl_avatar -->
|
#6 Mon 05 Jan, 2009 17:19 |
|
DWho
Joined: August 2006
Posts: 1307
Location: hampshire
|
Re: Link To Personal Sub Cat In Lang File
sorry really confused now... I cannot find cpl_menu.php in any of the files (using latest version)
and still not sure what to place in tpl file...
sorry for being a pain..
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#7 Mon 05 Jan, 2009 17:39 |
|
Artie
Joined: January 2007
Posts: 833
Location: Lone Star State
|
Re: Link To Personal Sub Cat In Lang File
I'm sorry that php file is no longer used... I need to update to the current version of IP .....
I'll have to get back to you on this after I upgrade.(I've put it off long enough )
But the new php file would be usercp_register.php if you wish to try yourself.
|
#8 Mon 05 Jan, 2009 23:30 |
|
DWho
Joined: August 2006
Posts: 1307
Location: hampshire
|
Re: Link To Personal Sub Cat In Lang File
no worries I thought it was either you or me... LOL
I had a go using usercp_register.php
but I cannot get the right code for the tpl file...
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#9 Mon 05 Jan, 2009 23:44 |
|
Artie
Joined: January 2007
Posts: 833
Location: Lone Star State
|
Re: Link To Personal Sub Cat In Lang File
OK, I'm now using ver 1.2.0.27
You almost need to be specific where you want the link on the page, because it does make a difference where you need to place the code.
The following code should allow you to place it as shown in the attach pic below.
OPEN profile_add_body.tpl
FIND
<tr>
<td class="row-header" colspan="2"><span>{L_AVATAR_PANEL}</span></td>
</tr>
AFTER ADD
<tr>
<td colspan="2"><span><a href="{U_USER_SUBCAT}">{L_USER_SUBCAT}</a></span></td>
</tr>
OPEN includesusercp_register.php
FIND
$template->assign_block_vars('switch_cpl_avatar', array() );
BEFORE ADD
//////////////////////////////////////
$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']);
}
//////////////////////////////////////
FIND
'L_PROFILE' => $lang['Avatar_panel']));
BEFORE ADD
'U_USER_SUBCAT' => $u_personal_gallery,
'L_USER_SUBCAT' => "HERE IS YOUR SUB_CAT LINK",
MODIFY TO SUIT YOUR NEEDS
|
#10 Tue 06 Jan, 2009 01:00 |
|
DWho
Joined: August 2006
Posts: 1307
Location: hampshire
|
Re: Link To Personal Sub Cat In Lang File
Hi Artie
Thanks for the help with this... I have followed your guide above exactly and checked it 3 times... but for some reasons the link just sends you to the members 1st personal gallery and not the sub_cat...
I have checked to see if the member has a sub cat which they do... but for some reason it will not pick it up..
any ideas..
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#11 Tue 06 Jan, 2009 10:17 |
|
Artie
Joined: January 2007
Posts: 833
Location: Lone Star State
|
Re: Link To Personal Sub Cat In Lang File
Works fine for me
You must inserted something in the wrong place... hard to say without seeing your modded files/code.
|
#12 Tue 06 Jan, 2009 23:22 |
|
DWho
Joined: August 2006
Posts: 1307
Location: hampshire
|
Re: Link To Personal Sub Cat In Lang File
Hi
Well after checking and rechecking
I replace this part
$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);
}
with this
$sql = "SELECT * FROM " . ALBUM_TABLE . " AS p, " . ALBUM_CAT_TABLE . " AS c
WHERE c.cat_user_id = " . $userdata['user_id'] . "
AND p.pic_cat_id = c.cat_id
AND p.pic_approval = 1
ORDER BY pic_time DESC";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query recent pics information', '', __LINE__, __FILE__, $sql);
}
and all works good...
thanks though I do not know why mine is different to yours
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#13 Wed 07 Jan, 2009 00:20 |
|
Artie
Joined: January 2007
Posts: 833
Location: Lone Star State
|
Re: Link To Personal Sub Cat In Lang File
thanks though I do not know why mine is different to yours
Me either .... glad you made it work for you.
|
#14 Wed 07 Jan, 2009 01:38 |
|
DWho
Joined: August 2006
Posts: 1307
Location: hampshire
|
Re: Link To Personal Sub Cat In Lang File
Thanks again for the help...
____________ Mods and themes for Icy Phoenix 1.3
IcyPhoenix UK is off-line permanently due to lack of time to update mods.
if anyone is interested in my templates I will upgrade them to Icy 2.0.
|
#15 Wed 07 Jan, 2009 10:57 |
|
|
Page 1 of 2
|
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
|
|
|
|