Author Topic: {comment_user_info} in comment_bit.html  (Read 8475 times)

0 Members and 1 Guest are viewing this topic.

Offline cloe

  • Full Member
  • ***
  • Posts: 120
    • View Profile
{comment_user_info} in comment_bit.html
« on: July 27, 2007, 02:00:24 PM »
In comment_bit.html you have this code: {comment_user_info}
This code generate when i am logged in:

Admin

Join Date: xx.xx.xxxx
Comments: xx

So if i remove that code, all of this go away.

But I want to have 3 differnt codes. One for Admin or Member (for members) One for Join Date and one for Comments.. So i have more controll on how i can display those things.
Is this possible??
I'll hope that someone can help me out here  :?:
« Last Edit: July 30, 2007, 09:12:33 PM by cloe »
Peace And Luv :)

--Cecilie--

http://www.cloevvold-photo.com

Offline cloe

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: {comment_user_info} in comment_bit.html
« Reply #1 on: August 02, 2007, 03:12:56 PM »
Is it really nobody that know how i can resolve this??  :?
Peace And Luv :)

--Cecilie--

http://www.cloevvold-photo.com

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: {comment_user_info} in comment_bit.html
« Reply #2 on: August 02, 2007, 03:15:43 PM »
Read topic last hour. Dont know the mean ... explain ?
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 ?

manurom

  • Guest
Re: {comment_user_info} in comment_bit.html
« Reply #3 on: August 02, 2007, 03:49:05 PM »
Hello;
I suppose you want to have 3 different tags instead of one: user type, join date and number of comments...?

Try this:
->->->->-> First to do: make a backup of the file details.php
open the file details.php (v 1.7.4) and find:
Code: [Select]
        $comment_user_info .= "<br />";
        $comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_joindate']])) ? "<br />".$lang['join_date']." ".format_date($config['date_format'], $comment_row[$i][$user_table_fields['user_joindate']]) : "";
        $comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_comments']])) ? "<br />".$lang['comments']." ".$comment_row[$i][$user_table_fields['user_comments']] : "";
      }

      $comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";

      $admin_links = "";
      if ($user_info['user_level'] == ADMIN) {
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }
      elseif ($is_image_owner) {
        $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      }

      $site_template->register_vars(array(
        "comment_id" => $comment_row[$i]['comment_id'],
        "comment_user_id" => $comment_user_id,
        "comment_user_status_img" => $comment_user_status_img,
        "comment_user_name" => $comment_user_name,
        "comment_user_info" => $comment_user_info,
(in my own file, it is from line #396 to line #418 included)

change these lines to:
Code: [Select]
//        $comment_user_info .= "<br />";
        $comment_user_date .= (isset($comment_row[$i][$user_table_fields['user_joindate']])) ? "<br />".$lang['join_date']." ".format_date($config['date_format'], $comment_row[$i][$user_table_fields['user_joindate']]) : "";
        $comment_user_comments .= (isset($comment_row[$i][$user_table_fields['user_comments']])) ? "<br />".$lang['comments']." ".$comment_row[$i][$user_table_fields['user_comments']] : "";
      }

      $comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";

      $admin_links = "";
      if ($user_info['user_level'] == ADMIN) {
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }
      elseif ($is_image_owner) {
        $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      }

      $site_template->register_vars(array(
        "comment_id" => $comment_row[$i]['comment_id'],
        "comment_user_id" => $comment_user_id,
        "comment_user_status_img" => $comment_user_status_img,
        "comment_user_name" => $comment_user_name,
        "comment_user_info" => $comment_user_info,
        "comment_user_date" => $comment_user_date,
        "comment_user_comments" => $comment_user_comments,

You have now 3 tags:
  • {comment_user_info} to display the user type
  • {comment_user_date} to display the join date
  • {comment_user_comments} to display the number of comments

Open templates/your_template/comment_bit.html, and place the new 2 tags and the existing tag {comment_user_info} in the code where you need them to be shown.

Regards.

Offline cloe

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: {comment_user_info} in comment_bit.html
« Reply #4 on: August 03, 2007, 02:06:28 AM »
Hello;
I suppose you want to have 3 different tags instead of one: user type, join date and number of comments...?

Try this:
->->->->-> First to do: make a backup of the file details.php
open the file details.php (v 1.7.4) and find:
Code: [Select]
        $comment_user_info .= "<br />";
        $comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_joindate']])) ? "<br />".$lang['join_date']." ".format_date($config['date_format'], $comment_row[$i][$user_table_fields['user_joindate']]) : "";
        $comment_user_info .= (isset($comment_row[$i][$user_table_fields['user_comments']])) ? "<br />".$lang['comments']." ".$comment_row[$i][$user_table_fields['user_comments']] : "";
      }

      $comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";

      $admin_links = "";
      if ($user_info['user_level'] == ADMIN) {
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }
      elseif ($is_image_owner) {
        $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      }

      $site_template->register_vars(array(
        "comment_id" => $comment_row[$i]['comment_id'],
        "comment_user_id" => $comment_user_id,
        "comment_user_status_img" => $comment_user_status_img,
        "comment_user_name" => $comment_user_name,
        "comment_user_info" => $comment_user_info,
(in my own file, it is from line #396 to line #418 included)

change these lines to:
Code: [Select]
//        $comment_user_info .= "<br />";
        $comment_user_date .= (isset($comment_row[$i][$user_table_fields['user_joindate']])) ? "<br />".$lang['join_date']." ".format_date($config['date_format'], $comment_row[$i][$user_table_fields['user_joindate']]) : "";
        $comment_user_comments .= (isset($comment_row[$i][$user_table_fields['user_comments']])) ? "<br />".$lang['comments']." ".$comment_row[$i][$user_table_fields['user_comments']] : "";
      }

      $comment_user_ip = ($user_info['user_level'] == ADMIN) ? $comment_row[$i]['comment_ip'] : "";

      $admin_links = "";
      if ($user_info['user_level'] == ADMIN) {
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=editcomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= "<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php?goto=".urlencode("comments.php?action=removecomment&amp;comment_id=".$comment_row[$i]['comment_id']))."\" target=\"_blank\">".$lang['delete']."</a>";
      }
      elseif ($is_image_owner) {
        $admin_links .= ($config['user_edit_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=editcomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['edit']."</a>&nbsp;";
        $admin_links .= ($config['user_delete_comments'] != 1) ? "" : "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=removecomment&amp;".URL_COMMENT_ID."=".$comment_row[$i]['comment_id'])."\">".$lang['delete']."</a>";
      }

      $site_template->register_vars(array(
        "comment_id" => $comment_row[$i]['comment_id'],
        "comment_user_id" => $comment_user_id,
        "comment_user_status_img" => $comment_user_status_img,
        "comment_user_name" => $comment_user_name,
        "comment_user_info" => $comment_user_info,
        "comment_user_date" => $comment_user_date,
        "comment_user_comments" => $comment_user_comments,

You have now 3 tags:
  • {comment_user_info} to display the user type
  • {comment_user_date} to display the join date
  • {comment_user_comments} to display the number of comments

Open templates/your_template/comment_bit.html, and place the new 2 tags and the existing tag {comment_user_info} in the code where you need them to be shown.

Regards.



Thanks a lot :)... That is exactly what I want... And it works almost perfect :)
Remains one problem.. With this code it shows just like I want it to be on the admin comments... But on all member comments, is the join date and comments showing twice..
On join Date for member is the actual join date showing, but the admin join Date is altso showing there... And the same is for comments.

Se attachment, and you see what i mean  :wink:

do you have a fix for this?

Best Reguards
« Last Edit: August 03, 2007, 06:00:58 AM by cloe »
Peace And Luv :)

--Cecilie--

http://www.cloevvold-photo.com

manurom

  • Guest
Re: {comment_user_info} in comment_bit.html
« Reply #5 on: August 03, 2007, 09:24:23 AM »
My bad! :oops:
I forgot two dots.

Please replace:
Code: [Select]
$comment_user_date .=by
Code: [Select]
$comment_user_date =
and
Code: [Select]
$comment_user_comments .=by
Code: [Select]
$comment_user_comments =
(in fact, just erase the dot before the sign "equal").
Very sorry.

Offline cloe

  • Full Member
  • ***
  • Posts: 120
    • View Profile
Re: {comment_user_info} in comment_bit.html
« Reply #6 on: August 03, 2007, 05:31:01 PM »
My bad! :oops:
I forgot two dots.

Please replace:
Code: [Select]
$comment_user_date .=by
Code: [Select]
$comment_user_date =
and
Code: [Select]
$comment_user_comments .=by
Code: [Select]
$comment_user_comments =
(in fact, just erase the dot before the sign "equal").
Very sorry.


Thanks a LOT :)

It works perfectly...  In fact this is something that everyone should do that has the avatar installed, It looks so much cleaner and better now :)

Best Reguards..
Peace And Luv :)

--Cecilie--

http://www.cloevvold-photo.com

Offline haider512

  • Full Member
  • ***
  • Posts: 153
    • View Profile
Re: {comment_user_info} in comment_bit.html
« Reply #7 on: December 19, 2010, 11:34:50 PM »
Many thanks...it almost solved all my problem for comment too.. i also asked for help..but i asked for help too many times here ..may b thats why helpers got headache from me and didnt replied to topic..lolz...
and to b honest i was so lazy or dumb that i didnt searched on this topic before, and created the topic for help....its good that i searched here..

just recently bought a reseller package for new server..and gonna move all my files to new server and then will gonna set it up there and gonna do editings after that..but now..going to sleep..

but really thanks for this topic/thread.. its very useful..
im bookmarking it..


==================================

did little bit changes today... So thankful to cloe cuz he/she started this topic and ultimate thankful to Manurom who solved this issue..

« Last Edit: December 23, 2010, 12:56:55 AM by haider512 »

 

Post your comments here