[info module] How to link photo owner to profile page?
skunker
Joined: 2005-02-04
Posts: 344 |
Posted: Sat, 2012-04-14 00:01 | |||
Hi all,
|
||||
skunker
Joined: 2005-02-04
Posts: 344 |
Posted: Sat, 2012-04-14 00:01 | |||
Hi all,
|
||||
Posts: 27300
If the user sets the url in their profile when they/admin set up the user then it will be a link to that url.
you could edit the info_block.php file to add:
user_profile::url($user->id)
that should get the profile page.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 344
Thanks Dave, will give that a shot.
Posts: 344
Well Dave, I tried to play around with it for an hour and couldn't quite get it to display correctly. Here's the block code:
if ($theme->item->owner && module::get_var("info", "show_owner")) {
$display_name = $theme->item->owner->display_name();
if ($theme->item->owner->url) {
$info["owner"] = array(
"label" => t("Owner:"),
"value" => user_profile::url($user->id) .
html::clean($display_name) . "</a>"
);
The bold part is what I've been messing with (did not include the Bold tag in the code). Two things: 1.) How do I correctly write it so it will display a hyperlink? 2.) I can't figure out the $user variable to have it print the user ID # instead of the user name. The way it is written now (as shown) outputs the username, but not the ID. I studied the way the COMMENTS BLOCK handled the user profile links and it showed it as $author_id so I'm wondering if perhaps it's $user_id .
Posts: 27300
I'm a bit confused as to what you are after.
I understand you want a link to the user profile page but why? If it is a link and the user is not that user they will get a 404/permissions/dang page.
In your example if I visit and I click on the historykid link I would get a 404/permissions/dang page.
I need a better user story to understand what you are after.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 344
Dave,
Thank you for responding. All I am trying to do is have a "Uploaded by: John" link that, when is clicked, it will take the visitor to the uploader's profile page. That's why I was wondering if we could customize the info module so instead of having the URL link, it would go to the user's profile page. I don't know why you said "If it is a link and the user is not that user they will get a 404/permissions/dang page" because if I click the "historykid" profile link from the RECENT COMMENTS block, I am able to go to the historykid profile page and see his profile. I want to use that same functionality in the info module and direct the visitor to historykid's profile page.
Does that make sense?
Posts: 27300
as a guest? I bet it is because you are admin?
I might be missing something here as I don't use the info module or the comment module/block that but but is the user's profile page only advisable to the user only?
Needing a link to understand now is better that your user story.
here is what I did to get a modal window to pop up to contact the item owner.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 27300
OK I get it now. A logged in user can view the profile. Guests will still get a 404.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 344
Wow, Dave. Thanks! Where do I paste that? Do I erase the code in the info_block.php file and replace it with what you wrote?
Posts: 27300
That is the whole info_block.php file
don't forget the first 19 or so lines.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 344
Thanks, Dave. That worked well. Now I just need to work on customizing the 404 page so the guest can register and view the profile.
Posts: 27300
gallery/modules/views/error_404.html.php
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team