Author Topic: [Mod] Show user's comments from his profile  (Read 128069 times)

0 Members and 2 Guests are viewing this topic.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: [Mod] Show user's comments from his profile
« Reply #75 on: January 08, 2008, 03:21:39 AM »
Problem with MOD is no use universal function for set in all PHP file. MOD is need for copy in each file ...
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline Joss

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • All about digital photography
Re: [Mod] Show user's comments from his profile
« Reply #76 on: March 29, 2008, 05:21:28 PM »
Hi all,

there is my summary of changes in the MOD code for paging:

1. Make all from initial steps:
www.4homepages.de/forum/index.php?topic=4131.0

In step 1 please note, that in 1.7.6 the

Code: [Select]
"user_name" => (isset($user_row['user_name'])) ? htmlspecialchars($user_row['user_name']) : REPLACE_EMPTY,must be replaced by
Code: [Select]
"user_name" => (isset($user_row['user_name'])) ? format_text($user_row['user_name'], 2) : REPLACE_EMPTY,
2. Make steps from:
http://www.4homepages.de/forum/index.php?topic=4131.msg19659#msg19659

3. Make changes from:
http://www.4homepages.de/forum/index.php?topic=4131.msg26196#msg26196

4. Fix a bug in paging as described in:
http://www.4homepages.de/forum/index.php?topic=4131.msg28061#msg28061

5. Please note, you must add submit button for Opera browser in commentsperpage_dropdown_form.html, e.g.:
Code: [Select]
<table border="0" cellspacing="0" cellpadding="0">
<form method="post" action="{self}#comments" name="commentsperpage">
<tr>
<td>{lang_comments_per_page}&nbsp;</td>
<td>{commentsperpage_dropdown}</td>
<td valign="top">
<input type="submit" value="{lang_go}" class="button" />
</td>
</tr>
{if action}<input type="hidden" name="action" value="{action}">{endif action}
{if user_id}<input type="hidden" name="user_id" value="{user_id}">{endif user_id}
</form>
</table>
Digital Photo Gallery: http://gallery.imagemaster.ru

Offline k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [Mod] Show user's comments from his profile
« Reply #77 on: February 24, 2010, 01:55:03 PM »
Is it possible to put a link back to the user's profile to the page with his comments?  :)
( that is - link to: /member.php?action=showprofile&user_id=XX, from: /member.php?action=showcomments&user_id=XX )
because right now the only way to get back - is to press "Back" in the browser, and if someone browsed throught the comments pages - he'll get a long way back to a profile...  :?


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: [Mod] Show user's comments from his profile
« Reply #78 on: February 24, 2010, 03:15:10 PM »
In member.php find:
  $txt_clickstream $lang['member_comments'].(($user_id == GUEST) ? $lang['userlevel_guest'] : $comment_user_name);


Replace it with:
  $txt_clickstream $lang['member_comments'].(($user_id == GUEST) ? $lang['userlevel_guest'] : '<a href="' . (!empty($url_show_profile) ? str_replace("{user_id}"$user_id$url_show_profile) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;" URL_USER_ID "=" $user_id)) . '">' $comment_user_name '</a>');


it should now show link back to user profile page in clickstream. I've updated original code.
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 k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [Mod] Show user's comments from his profile
« Reply #79 on: February 25, 2010, 11:53:48 AM »
Yeah, there's a link back to profile now in the clickstream , thanks! :thumbup:

And another small question from me  :P
Is it possible to put user name in clickstream (not necessarily with link this time) for pages like: /member.php?action=showprofile&user_id=XX and: /member.php?action=mailform&user_id=XX ?  :roll:
Right now it's just "Profile", and not "Profile of XX" ...

I've found the necessary snippets of code in member.php:

if ($action == "mailform") {
  $txt_clickstream = $lang['profile'];


and:

if ($action == "showprofile") {
  $txt_clickstream = $lang['profile'];


And tried to add .(($user_id == GUEST) ? $lang['userlevel_guest'] : $user_info['user_name']); - but again - it now shows my name in clickstream instead of the name of the profile owner  :D


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: [Mod] Show user's comments from his profile
« Reply #80 on: February 25, 2010, 02:25:16 PM »
Find:
      $content $site_template->parse_template("member_mailform");
Insert below:
      $txt_clickstream $lang['profile_of'] . ' <a href="' . (!empty($url_show_profile) ? str_replace("{user_id}"$user_row['user_id'], $url_show_profile) : $site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;" URL_USER_ID "=" $user_row['user_id'])) . '">' format_text($user_row['user_name'], 2) . '</a>');




Find:
    $content $site_template->parse_template("member_profile");
Insert below:
    $txt_clickstream $lang['profile_of'] . " " format_text($user_row['user_name'], 2);


This should do it ;)
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 k1lljoy

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • Razruha.Ru
Re: [Mod] Show user's comments from his profile
« Reply #81 on: February 26, 2010, 11:28:35 AM »
V@no, thanks, it worked out!  :D
At first It was displaying an error - something like "unexpected string", I think You put unnecessary ")" sign, maybe the last one - for I cleared it away and everything started working as a Swiss clock  :D

May I now spipe out the first instance of $txt_clickstream = $lang['profile']; , which is right after: if ($action == "mailform") {   and if ($action == "showprofile") {
or they both should better stay on their present places? :P


Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [Mod] Show user's comments from his profile
« Reply #82 on: July 31, 2010, 09:49:21 PM »
in step 1....

you said find

$site_template->register_vars(array(
      "user_id" => $user_row['user_id'],
      "user_name" => (isset($user_row['user_name'])) ? htmlspecialchars($user_row['user_name']) : REPLACE_EMPTY,


but i have version 1.77 and some of the syntax inside has changed, for example my one looks like this

$site_template->register_vars(array(
      "user_id" => $user_row['user_id'],
      "user_name" => (isset($user_row['user_name'])) ? format_text($user_row['user_name'], 2) : REPLACE_EMPTY,


can i still proceed with MOD?

thanks vano

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: [Mod] Show user's comments from his profile
« Reply #83 on: July 31, 2010, 10:01:56 PM »
Yes, you found the correct lines. the new code needs to be added below these lines.
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)