Author Topic: View comment_user images in comment_bit  (Read 3953 times)

0 Members and 1 Guest are viewing this topic.

Offline nfprehn

  • Newbie
  • *
  • Posts: 41
    • View Profile
    • How to become a model
View comment_user images in comment_bit
« on: July 22, 2006, 04:25:31 PM »
I have been trying to play around with this but just cannot figure it out.

I would like there to be a link in comment_bit.html which directs to all the images posted by the commentator.

A bit like:

[qcode]<a href="{url_show_comment_user_images}">Display all images by {comment_user_name}</a><br />[/qcode]

My guess is that the following in functions.php needs to be replicated and amended...
[qcode]{
    $user_name = format_text($image_row[$user_table_fields['user_name']], 2);

    $user_profile_link = (!empty($url_show_profile)) ? str_replace("{user_id}", $image_row['user_id'], $url_show_profile) : ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$image_row['user_id'];
    $user_name_link = "<a href=\"".$site_sess->url($user_profile_link)."\">".$user_name."</a>";
$user_images_link = "<a href=\"search.php?search_user=".$user_name."\">".$lang['pictures']."</a>";
  }
  else {
    $user_name = format_text($lang['userlevel_guest'], 2);
    $user_name_link = $user_name;
   $user_images_link = $user_name;
  }
[/qcode]

Has anyone managed this, or knows how to do it?

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: View comment_user images in comment_bit
« Reply #1 on: July 22, 2006, 07:25:22 PM »
in details.php find:
Code: [Select]
        "comment_user_ip" => $comment_user_ip,
Insert below:
Code: [Select]
        "lang_show_user_images" => preg_replace("/".$site_template->start."user_name".$site_template->end."/siU", format_text($comment_row[$i][$user_table_fields['user_name']], 2), $lang['show_user_images']),
        "url_show_user_images" => ($comment_user_id != GUEST) ? $site_sess->url(ROOT_PATH."search.php?search_user=".urlencode($comment_row[$i][$user_table_fields['user_name']])) : REPLACE_EMPTY,

Then in comment_bit.html template use:
Code: [Select]
{if url_show_user_images}<a href="{url_show_user_images}">{lang_show_user_images}</a>{endif url_show_user_images}
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline nfprehn

  • Newbie
  • *
  • Posts: 41
    • View Profile
    • How to become a model
Re: View comment_user images in comment_bit
« Reply #2 on: July 25, 2006, 09:12:33 PM »
Thanks a million V@no.

It works really well with the personal image MOD, if you use:

[qcode]{if comment_userpic}   
{if url_show_user_images}<a href="{url_show_user_images}"><img src="{comment_userpic}" border="0"></a>
{endif url_show_user_images} <br/>
{endif comment_userpic} <br/>[/qcode]