Icy Phoenix

     
 


This forum is locked: you cannot post, reply or edit topics.  This topic is locked: you cannot edit posts or make replies. 
Page 1 of 2
Goto page 1, 2  Next
 
Reply with quote Download Post 
Post FAP CUSTOMIZATION - Sub Cat Link On Profile Page 
 
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...

   
 




____________
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.
 
DWhoSend private messageVisit poster's website  
Back to topPage bottom
Icy Phoenix is an open source project, you can show your appreciation and support future development by donating to the project.

Support us
 
Reply with quote Download Post 
Post 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

   
 




____________
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.
 
DWhoSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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

Code: [Download] [Hide] [Select]
<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:
Code: [Download] [Hide] [Select]

<tr><th colspan="2"><span class="genmed"><b>{L_INVISION_INFO}</b></span></th></tr>



after add:
Code: [Download] [Hide] [Select]
                            <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.
 



 
moreteavicarSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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"
 



 
moreteavicarSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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

   
 




____________
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.
 
DWhoSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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...
 



 
moreteavicarSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Sub Cat Link On Profile Page 
 
moreteavicar wrote: [View Post]
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...


thank you I realply appreciate that ......I just couldnt see how to get it to work...
 




____________
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.
 
DWhoSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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
Code: [Download] [Hide] [Select]
$recentrow[] = $row;

AFTER ADD
Code: [Download] [Hide] [Select]
if ($row['cat_parent'] > 0) $sub_cat_id = $row['cat_id'];


FIND
Code: [Download] [Hide] [Select]
// Mighty Gorgon - Full Album Pack - END

BEFORE ADD
Code: [Download] [Hide] [Select]
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']);
}


FIND
Code: [Download] [Hide] [Select]
'U_PERSONAL_GALLERY' => append_sid('album.' . $phpEx . '?user_id=' . $profiledata['user_id']),

REPLACE WITH
Code: [Download] [Hide] [Select]
'U_PERSONAL_GALLERY' => $u_personal_gallery,

 



 
Edited by Artie, Tue 11 Mar, 2008 00:42: Code corrected
ArtieSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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.
 




____________
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.
 
DWhoSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post 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...

Quote:
      
just one extra thing would the same code work on profile_main.php ?

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.
 



 
moreteavicarSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post 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...

   

I will not place this in profile_main.php
 




____________
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.
 
DWhoSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Sub Cat Link On Profile Page 
 
DWho wrote: [View Post]
.. I did a test user and it will only show their first album.. but it is very close...


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]
...(all my members have 1 sub cat...)

Artie wrote: [View Post]

... and assuming that the user has only 1 subcat the following code change should work for you.


 



 
ArtieSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Sub Cat Link On Profile Page 
 
LOL sorry Artie, I didn't spot
Quote:
(all my members have 1 sub cat...)
  
 



 
moreteavicarSend private message  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Sub Cat Link On Profile Page 
 
Artie wrote: [View Post]
DWho wrote: [View Post]
.. I did a test user and it will only show their first album.. but it is very close...


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]
...(all my members have 1 sub cat...)

Artie wrote: [View Post]

... and assuming that the user has only 1 subcat the following code change should work for you.



yes that is correct... all my users have 1 sub cat each as I use this mod here am I getting confused here....

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
 




____________
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.
 
DWhoSend private messageVisit poster's website  
Back to topPage bottom
Reply with quote Download Post 
Post Re: Sub Cat Link On Profile Page 
 
DWho wrote: 

yes that is correct... all my users have 1 sub cat each as I use this mod here am I getting confused here....
I thought you may be using that mod, but I too was a bit confused

DWho wrote: 

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


In the code I provided to you (I have since corrected the code above)
REPLACE
Code: [Download] [Hide] [Select]
$sub_cat_id = ($row['cat_parent'] > 0) ? $row['cat_id'] : '';

WITH
Code: [Download] [Hide] [Select]
if ($row['cat_parent'] > 0) $sub_cat_id = $row['cat_id'];


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
 



 
ArtieSend private message  
Back to topPage bottom
This forum is locked: you cannot post, reply or edit topics.  This topic is locked: you cannot edit posts or make replies.  Page 1 of 2
Goto page 1, 2  Next


Display posts from previous:    

HideWas this topic useful?

Link this topic
URL
BBCode
HTML




 
Permissions List
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


  

 

  cron