Hi is it possible to place a link to a members personal album sub category on their profile page...? (all my members have 1 sub cat...)
or hint as to where to look ... been looking for a few hours now and totally lost...
Thanks for any help and for reading...
:mrgreen: :mrgreen:
FAP CUSTOMIZATION - Sub Cat Link On Profile Page
Subject: Re: Sub Cat Link On Profile Page
hi
if anyone even has a smallest of clues how or if this is possible I really would be very appreciated
:mrgreen: :mrgreen:
if anyone even has a smallest of clues how or if this is possible I really would be very appreciated
:mrgreen: :mrgreen:
Subject: Re: Sub Cat Link On Profile Page
Well I have a reasonable idea how to do this (assuming I understand your question correctly), its not too hard.
1) There already exists a link variable to a user's album from the profile page, in the top nav links section.
2) You can use the same link variable and put it anywhere. The actual code is
File to edit is:
templates/mg_themes/profile_view_body.tpl
Usage
Depending on where you want to put the link, e.g. suppose you want it at top of the "Information" table:
look for:
<tr><th colspan="2"><span class="genmed"><b>{L_INVISION_INFO}</b></span></th></tr>
after add:
The file is html so you should be able to work out what needs to be done to place the link where you want it.
1) There already exists a link variable to a user's album from the profile page, in the top nav links section.
2) You can use the same link variable and put it anywhere. The actual code is
<a href="{U_PERSONAL_GALLERY}" class="gensmall">{L_PERSONAL_GALLERY}</a>
File to edit is:
templates/mg_themes/profile_view_body.tpl
Usage
Depending on where you want to put the link, e.g. suppose you want it at top of the "Information" table:
look for:
<tr><th colspan="2"><span class="genmed"><b>{L_INVISION_INFO}</b></span></th></tr>
after add:
<tr>
<td valign="top" class="row2" width="30%"><b><span class="genmed">Personal Gallery</span></b></td>
<td class="row1"><a href="{U_PERSONAL_GALLERY}" class="gensmall">{L_PERSONAL_GALLERY}</a></td>
</tr>
<td valign="top" class="row2" width="30%"><b><span class="genmed">Personal Gallery</span></b></td>
<td class="row1"><a href="{U_PERSONAL_GALLERY}" class="gensmall">{L_PERSONAL_GALLERY}</a></td>
</tr>
The file is html so you should be able to work out what needs to be done to place the link where you want it.
Subject: Re: Sub Cat Link On Profile Page
This question does remind me of a problem in the language packs - if user doesn't have an album, then you will get the message:
"Invalid combination of category id and authentication data" which is undesirable.
Actually the file responsible is album_hierarchy_auth.php, so look for that line in there and edit it to suit your prefs.... like "This User's Album / Album Category does not exist"
"Invalid combination of category id and authentication data" which is undesirable.
Actually the file responsible is album_hierarchy_auth.php, so look for that line in there and edit it to suit your prefs.... like "This User's Album / Album Category does not exist"
Subject: Re: Sub Cat Link On Profile Page
thanks for the reply... nearly what I wanted I was wondering if you could link to a users sub category of their personal album....
instead of their main personal album...
also thankyou for the heads up with album_hierarchy_auth.php
:mrgreen: :mrgreen:
instead of their main personal album...
also thankyou for the heads up with album_hierarchy_auth.php
:mrgreen: :mrgreen:
Subject: Re: Sub Cat Link On Profile Page
Ah... ok, I should have read more carefully...
OK, what you want is a bit more involved, though not that difficult it requires going through the album_cat table, finding all cat_ids in the table that belong to cat_user_id (which is the same as the user profile being viewed).... and then generating links for those cat_ids... problem here is unknown number of sub cats, which means compromise on the way data is parsed (all this would be done from includes/usercp_viewprofile).
If I get some time I'll think how best to do it...
OK, what you want is a bit more involved, though not that difficult it requires going through the album_cat table, finding all cat_ids in the table that belong to cat_user_id (which is the same as the user profile being viewed).... and then generating links for those cat_ids... problem here is unknown number of sub cats, which means compromise on the way data is parsed (all this would be done from includes/usercp_viewprofile).
If I get some time I'll think how best to do it...
Subject: Re: Sub Cat Link On Profile Page
thank you I realply appreciate that ......I just couldnt see how to get it to work...
moreteavicar wrote: [View Post]
thank you I realply appreciate that ......I just couldnt see how to get it to work...
Subject: Re: Sub Cat Link On Profile Page
I have moved this topic to the Customizations forum where it is more suited
Assuming you want to direct the existing link to a user's sub-cat and assuming that the user has only 1 subcat the following code change should work for you.
OPEN includes/usercp_viewprofile.php
FIND
AFTER ADD
FIND
BEFORE ADD
FIND
REPLACE WITH
Assuming you want to direct the existing link to a user's sub-cat and assuming that the user has only 1 subcat the following code change should work for you.
OPEN includes/usercp_viewprofile.php
FIND
AFTER ADD
FIND
BEFORE ADD
if (!empty($sub_cat_id))
{
$u_personal_gallery = append_sid('album_cat.' . $phpEx . '?cat_id=' . $sub_cat_id .'&user_id=' . $profiledata['user_id']);
}
else
{
$u_personal_gallery = append_sid('album.' . $phpEx . '?user_id=' . $profiledata['user_id']);
}
{
$u_personal_gallery = append_sid('album_cat.' . $phpEx . '?cat_id=' . $sub_cat_id .'&user_id=' . $profiledata['user_id']);
}
else
{
$u_personal_gallery = append_sid('album.' . $phpEx . '?user_id=' . $profiledata['user_id']);
}
FIND
'U_PERSONAL_GALLERY' => append_sid('album.' . $phpEx . '?user_id=' . $profiledata['user_id']),
REPLACE WITH
Subject: Re: Sub Cat Link On Profile Page
Thank you works perfectly...
just one extra thing would the same code work on profile_main.php ?
thank you again very much.
just one extra thing would the same code work on profile_main.php ?
thank you again very much.
Subject: Re: Sub Cat Link On Profile Page
Hmmm, I could be wrong, but I do not think this method will generate links to all a user's sub cats, but only one sub cat... I would have though that you need to search SQL for every instance of a cat belonging to the $user and building an array...
You should'nt put this in profile_main.php, because in there the user variable is not grabbed from the URL. When you are viewing a profile, this tells profile.php to include usercp_viewprofile.php. It is in usercp_viewprofile.php that the user_id of the profile being viewed is grabbed and used in generating all profile specific data.
Quote:
You should'nt put this in profile_main.php, because in there the user variable is not grabbed from the URL. When you are viewing a profile, this tells profile.php to include usercp_viewprofile.php. It is in usercp_viewprofile.php that the user_id of the profile being viewed is grabbed and used in generating all profile specific data.
Subject: Re: Sub Cat Link On Profile Page
Hi
Yes I have tested this and it only works for me as admin of the site... I did a test user and it will only show their first album.. but it is very close...
:mrgreen: :mrgreen:
I will not place this in profile_main.php
Yes I have tested this and it only works for me as admin of the site... I did a test user and it will only show their first album.. but it is very close...
:mrgreen: :mrgreen:
I will not place this in profile_main.php
Subject: Re: Sub Cat Link On Profile Page
From your previous post, you stated that your users only have 1 sub-cat. From that I assumed that 1 sub-cat was all that would exist for a user. :?
DWho wrote: [View Post]
From your previous post, you stated that your users only have 1 sub-cat. From that I assumed that 1 sub-cat was all that would exist for a user. :?
DWho wrote: [View Post]
Subject: Re: Sub Cat Link On Profile Page
yes that is correct... all my users have 1 sub cat each as I use this mod here am I getting confused here.... :oops:
ok when I log in as admin I can click on my personal gallery and it goes to my admin sub cat....
if I click my test accounts personal gallery link it goes to their first album and not their sub cat..
if I log in as a test account click the the same link it goes to the admins sub cat
but my test accounts link to personal gallery will goto their first album
if I am not explaining this correctly I do apologise
Artie wrote: [View Post]
yes that is correct... all my users have 1 sub cat each as I use this mod here am I getting confused here.... :oops:
ok when I log in as admin I can click on my personal gallery and it goes to my admin sub cat....
if I click my test accounts personal gallery link it goes to their first album and not their sub cat..
if I log in as a test account click the the same link it goes to the admins sub cat
but my test accounts link to personal gallery will goto their first album
if I am not explaining this correctly I do apologise
Subject: Re: Sub Cat Link On Profile Page
In the code I provided to you (I have since corrected the code above)
REPLACE
WITH
Note: That if user does not have any pics in the subcat then the link will not take you to the subcat, but will take you too the user's main album
I thought you may be using that mod, but I too was a bit confused :mricy:DWho wrote:
DWho wrote:
In the code I provided to you (I have since corrected the code above)
REPLACE
WITH
Note: That if user does not have any pics in the subcat then the link will not take you to the subcat, but will take you too the user's main album
Page 1 of 2
You cannot post new topicsYou 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
This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by Icy Phoenix based on phpBB
Generation Time: 0.106s (PHP: 20% SQL: 80%)
SQL queries: 11 - Debug Off - GZIP Enabled