4images Forum & Community

4images Issues / Ausgaben => Installation, Update & Configuration => Topic started by: cloe on July 27, 2007, 02:00:24 PM

Title: {comment_user_info} in comment_bit.html
Post by: cloe 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  :?:
Title: Re: {comment_user_info} in comment_bit.html
Post by: cloe on August 02, 2007, 03:12:56 PM
Is it really nobody that know how i can resolve this??  :?
Title: Re: {comment_user_info} in comment_bit.html
Post by: thunderstrike on August 02, 2007, 03:15:43 PM
Read topic last hour. Dont know the mean ... explain ?
Title: Re: {comment_user_info} in comment_bit.html
Post by: manurom 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:

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.
Title: Re: {comment_user_info} in comment_bit.html
Post by: cloe 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
Title: Re: {comment_user_info} in comment_bit.html
Post by: manurom 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.
Title: Re: {comment_user_info} in comment_bit.html
Post by: cloe 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..
Title: Re: {comment_user_info} in comment_bit.html
Post by: haider512 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..