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

0 Members and 1 Guest are viewing this topic.

Offline Art1977

  • Newbie
  • *
  • Posts: 37
    • View Profile
    • http://www.d-mack.de
sorry
« Reply #30 on: May 28, 2003, 03:11:11 AM »
sorry but i only see 1 comment ..........

if the ftp is working i will upload the modification and show u the link, so u can see what i mean

we have 3 o´clock and i have to get up at 7 to go to the university
good night and thx for your help .

cu tomorrow
Art

Offline Art1977

  • Newbie
  • *
  • Posts: 37
    • View Profile
    • http://www.d-mack.de
i found my mistake
« Reply #31 on: May 28, 2003, 03:19:00 AM »
if i change the value of the dropdown menu _ how many comments per page on any site this always affects all other sites .

Offline www.girls-on-bikes.com

  • Full Member
  • ***
  • Posts: 145
    • View Profile
    • http://www.girls-on-bikes.com/
[Mod] Show user's commets from his profile
« Reply #32 on: June 03, 2003, 06:03:12 AM »
I seem to be having some problems:
http://new.girls-on-bikes.com/member.php?action=showprofile&user_id=1

It's not pulling the text or the URL for show comments.
Any ideas?

Thanks

Offline ollihart

  • Pre-Newbie
  • Posts: 5
    • View Profile
[Mod] Show user's commets from his profile
« Reply #33 on: June 03, 2003, 09:17:17 AM »
Where I can find the mod "Display all images added by user" ???

O.

Offline www.girls-on-bikes.com

  • Full Member
  • ***
  • Posts: 145
    • View Profile
    • http://www.girls-on-bikes.com/
[Mod] Show user's commets from his profile
« Reply #34 on: June 03, 2003, 09:20:03 AM »
Umm, isn't that a standard feature?

Offline ollihart

  • Pre-Newbie
  • Posts: 5
    • View Profile
[Mod] Show user's commets from his profile
« Reply #35 on: June 03, 2003, 09:28:13 AM »
Upps, oh yes ,,,

nobody is perfect ...

Offline Art1977

  • Newbie
  • *
  • Posts: 37
    • View Profile
    • http://www.d-mack.de
Hi V@no
« Reply #36 on: June 04, 2003, 01:34:52 AM »
Nice mod everything works
but when i try to include the dropdown menu for how many comments of the user per page . everytime i get an error. The paging function is ok. but the dropdown menu does not work

the code i added after :
Code: [Select]
if (isset($session_info['commentperpage'])) {
  $commentperpage = $session_info['commentperpage'];
}
else {
  $commentperpage = 5;
}



is:
--------------------------
Code: [Select]
$commentsperpage_dropdown = "\n<select name=\"commentsetperpage\" onchange=\"if (this.options[this.selectedIndex].value != 0){ forms['commentsperpage'].submit() }\" class=\"select\">\n";
    for($i = 1; $i <= 50; $i++) {
      $setvalue = 1 * $i;
      $commentsperpage_dropdown .= "<option value=\"".$setvalue."\"";
        if ($setvalue == $commentperpage) {
        $commentsperpage_dropdown .= " selected=\"selected\"";
      }
      $commentsperpage_dropdown .= ">";
      $commentsperpage_dropdown .= $setvalue;
      $commentsperpage_dropdown .= "</option>\n";
    }
    $commentsperpage_dropdown .= "</select>\n";

    $site_template->register_vars("commentsperpage_dropdown", $commentsperpage_dropdown);
    $commentsperpage_dropdown_form = $site_template->parse_template("commentsperpage_dropdown_form");
    $site_template->register_vars("commentsperpage_dropdown_form", $commentsperpage_dropdown_form);


at the commandline normaly is shown : http://............/4images1.7/4images/member.phpaction=showcomments&user_id=3&page=2

but after the choice of the number of comments this is started :
http://........./4images1.7/4images/member.php?page=2#comments


The next problem is:

I want the last comments shown like the users comments ....
what do i have to change and what is this => and this -> in php?
is like a pointer in C?

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
[Mod] Show user's commets from his profile
« Reply #37 on: June 04, 2003, 02:22:18 AM »
where did u get that code? :?
anyway, firt off all, did u create commentsperpage_dropdown_form.html template?
with code:
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>
</tr>
</form>
</table>

actualy seems u did...then, here is what I have right now in my member.php:
Code: [Select]
//-----------------------------------------------------
//---Show Member Comments-------------------------------
//-----------------------------------------------------

if ($action == "showcomments") {
  if (isset($HTTP_GET_VARS[URL_USER_ID]) || isset($HTTP_POST_VARS[URL_USER_ID])) {
    $user_id = (isset($HTTP_GET_VARS[URL_USER_ID])) ? intval($HTTP_GET_VARS[URL_USER_ID]) : intval($HTTP_POST_VARS[URL_USER_ID]);
    if (!$user_id) {
      $num_comments = "";
      $user_id = GUEST;
    }
if (isset($HTTP_POST_VARS['commentsetperpage']) || isset($HTTP_GET_VARS['commentsetperpage'])) {
 $commentsetperpage = (intval($HTTP_POST_VARS['commentsetperpage']) ) ? intval($HTTP_POST_VARS['commentsetperpage']) : intval($HTTP_GET_VARS['commentsetperpage']);
 if ($commentsetperpage) {
   $site_sess->set_session_var("commentperpage", $commentsetperpage);
   $session_info['commentperpage'] = $commentsetperpage;
 }
}

if (isset($session_info['commentperpage'])) {
 $commentperpage = $session_info['commentperpage'];
}
else {
 $commentperpage = 5;
}
$commentsperpage_dropdown = "\n<select name=\"commentsetperpage\" onchange=\"if (this.options[this.selectedIndex].value != 0){ forms['commentsperpage'].submit() }\" class=\"select\">\n";
for($i = 1; $i <= 10; $i++) {
 $setvalue = 5 * $i;
 $commentsperpage_dropdown .= "<option value=\"".$setvalue."\"";
   if ($setvalue == $commentperpage) {
   $commentsperpage_dropdown .= " selected=\"selected\"";
 }
 $commentsperpage_dropdown .= ">";
 $commentsperpage_dropdown .= $setvalue;
 $commentsperpage_dropdown .= "</option>\n";
}
$commentsperpage_dropdown .= "</select>\n";

$site_template->register_vars("commentsperpage_dropdown", $commentsperpage_dropdown);
$commentsperpage_dropdown_form = $site_template->parse_template("commentsperpage_dropdown_form");
$site_template->register_vars("commentsperpage_dropdown_form", $commentsperpage_dropdown_form);

  $sql = "SELECT COUNT(user_id) AS comments
      FROM ".COMMENTS_TABLE."
      WHERE user_id = ".$user_id;
$result = $site_db->query_firstrow($sql);
$num_comments = $result['comments'];
$site_db->free_result();
$num_rows_all = (isset($num_comments)) ? $num_comments : 0;
$link_arg = $site_sess->url(ROOT_PATH."member.php?action=showcomments&user_id=$user_id");
include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page, $commentperpage, $num_rows_all, $link_arg, $lang['comment_stats']);
$offset = $getpaging->get_offset();
$site_template->register_vars(array(
 "paging" => $getpaging->get_paging(),
 "paging_stats" => $getpaging->get_paging_stats()
));

  $additional_sql = "";
  $table_fields = $site_db->get_table_fields(USERS_TABLE);
  foreach ($additional_user_fields as $key => $val) {
    if (isset($HTTP_POST_VARS[$key]) && isset($table_fields[$key])) {
      $additional_sql .= ", $key = '".un_htmlspecialchars(trim($HTTP_POST_VARS[$key]))."'";
    }
  }

  $sql = "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_ip, c.comment_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_email").get_user_table_field(", u.", "user_showemail").get_user_table_field(", u.", "user_invisible").get_user_table_field(", u.", "user_joindate").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").get_user_table_field(", u.", "user_homepage").get_user_table_field(", u.", "user_icq").$additional_sql."
          FROM ".COMMENTS_TABLE." c
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          WHERE c.user_id = $user_id
          ORDER BY c.comment_date DESC, c.image_id ASC
          LIMIT $offset, $commentperpage";
  $result = $site_db->query($sql);
  $comment_row = array();
  while ($row = $site_db->fetch_array($result)) {
    $comment_row[] = $row;
  }
  $site_db->free_result($result);
  $num_comments = sizeof($comment_row);
}
  else {
    $num_comments = "";
}
  if (!$num_comments) {
    $comments = "<TABLE width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"bordercolor\"><tr><td class=\"commentrow1\" colspan=\"2\">".$lang['member_no_comments']."</td></tr></table>";
  }
  else {
    $comments = "";
    $bgcounter = 0;
   $comments ="<TABLE width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"bordercolor\">\n<TR>\n<TD>\n<TABLE width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\">\n";
   $current = "";
    for ($i = 0; $i < $num_comments; $i++) {
     $image_id = $comment_row[$i]['image_id'];
      $sql = "SELECT i.image_id, i.cat_id, i.image_name, c.cat_name, i.image_media_file, i.image_thumb_file, i.image_allow_comments
            FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
            LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
            WHERE i.image_id = $image_id AND c.cat_id = i.cat_id";
      $image_row = $site_db->query_firstrow($sql);
      $cat_id = (isset($image_row['cat_id'])) ? $image_row['cat_id'] : 0;
     $image_allow_comments = (check_permission("auth_readcomment", $cat_id)) ? $image_row['image_allow_comments'] : 0;
     if ($image_allow_comments == 1){
     if ($current != $comment_row[$i]['image_id']) {
      $comments .= ($i == 0) ? "" : "</TABLE>\n</TD>\n</TR>\n</TABLE>\n<br>\n<TABLE width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"bordercolor\">\n<TR>\n<TD>\n<TABLE width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\">\n";
      $same = 1;
     }else{
      $same = 0;
     }
      $row_bg_number = ($bgcounter++ % 2 == 0) ? 1 : 2;

      $comment_user_name = $comment_row[$i]['comment_user_name'];
      $comment_user_info = $lang['userlevel_guest'];

      $comment_user_id = $comment_row[$i]['user_id'];
     $user_row_comment = get_user_info($comment_user_id);
      if (isset($comment_row[$i][$user_table_fields['user_name']]) && $comment_user_id != GUEST) {
        $comment_user_name = $comment_row[$i][$user_table_fields['user_name']];

        $comment_user_info .= "<br />";
      }

      $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=\"admin_edit\">".$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=\"admin_edit\">".$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>";
      }
     $show_link = (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id)) ? 0 : 1;
      $text = $comment_row[$i]['comment_text'];
if (strlen($text) > 100) {
$text = substr($text, 0, 100)."<br />...";
}
      $site_template->register_vars(array(
      "comment_image" => ($same) ? get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, 0, 1) : "",
      "comment_image_name" => (!$show_link) ? $image_row['image_name'] : "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row[$i]['image_id'].((!empty($mode)) ? "&amp;mode=".$mode : ""))."\">".$image_row['image_name']."</a>",
      "comment_cat_name" => (!check_permission("auth_viewcat", $cat_id)) ? $image_row['cat_name'] : "<a href=\"".$site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id)."\" class=\"smalltext\">".$image_row['cat_name']."</a>",
      "lang_control_panel" => $lang['comments'],
      "lang_comments_per_page" => $lang['comments_per_page'],
        "comment_id" => $comment_row[$i]['comment_id'],
        "comment_user_id" => $comment_user_id,
        "comment_user_name" => $comment_user_name,
        "comment_user_info" => $comment_user_info,
        "comment_user_ip" => $comment_user_ip,
        "comment_headline" => format_text($comment_row[$i]['comment_headline'], 0, $config['wordwrap_comments'], 0, 0, 1),
        "comment_text" => format_text($text, $config['html_comments'], $config['wordwrap_comments'], $config['bb_comments'], $config['bb_img_comments'], 1),
        "comment_date" => format_date($config['date_format']." ".$config['time_format'], $comment_row[$i]['comment_date']),
        "row_bg_number" => $row_bg_number,
        "admin_links" => $admin_links
      ));
      $comments .= $site_template->parse_template("member_comment_bit");

     $current = $comment_row[$i]['image_id'];
}
    } // end while
  } //end else
  $comments .= "</TABLE>\n</TD>\n</TR>\n</TABLE>\n";
  $content = $comments;
  $txt_clickstream = $lang['member_comments'].$comment_user_name;
$control_panel = $lang['comments'];
}
//---End Member Comments----
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 Art1977

  • Newbie
  • *
  • Posts: 37
    • View Profile
    • http://www.d-mack.de
Hi
« Reply #38 on: June 04, 2003, 02:32:44 AM »
thanx

i created the comments_perpage_dropdownform

and for securtity i copied your code in my member.php
but i get the same error.

after i choose in the dropdown menu how many comments i want to show
the page opens

password forgotten.

Offline www.girls-on-bikes.com

  • Full Member
  • ***
  • Posts: 145
    • View Profile
    • http://www.girls-on-bikes.com/
[Mod] Show user's commets from his profile
« Reply #39 on: June 04, 2003, 02:36:39 AM »
My request for help got drown out...
Can somebody check it out?
Thanks

Offline Art1977

  • Newbie
  • *
  • Posts: 37
    • View Profile
    • http://www.d-mack.de
and the second problem is
« Reply #40 on: June 04, 2003, 02:38:25 AM »
and the second problem is :

where do i have to change the code to display the "last comments" like the member comments!

Code: [Select]

<?php 
$templates_used 
'whos_online,comment_short_bit,last_comments,commentsperpage_dropdown_form';
$main_template 'last_comments';

define&#40;'GET_CACHES', 1&#41;;
define&#40;'ROOT_PATH', './'&#41;;
define&#40;'GET_USER_ONLINE', 1&#41;;
include&#40;ROOT_PATH.'global.php'&#41;;
require&#40;ROOT_PATH.'includes/sessions.php'&#41;;
$user_access get_permission&#40;&#41;;
if &#40;isset&#40;$HTTP_GET_VARS['template'&#93;&#41; || isset&#40;$HTTP_POST_VARS['template'&#93;&#41;&#41; &#123;
  
$template = &#40;isset&#40;$HTTP_GET_VARS['template'&#93;&#41;&#41; ? stripslashes&#40;trim&#40;$HTTP_GET_VARS['template'&#93;&#41;&#41; &#58; stripslashes&#40;trim&#40;$HTTP_POST_VARS['template'&#93;&#41;&#41;;
  
if &#40;!file_exists&#40;TEMPLATE_PATH."/".$template.".".$site_template->template_extension&#41;&#41; &#123;
    
$template "";
  &
#125;
  
else &#123;
    
$main_template $template;
  &
#125;
&#125;
else &#123;
  
$template "";
&
#125;
include&#40;ROOT_PATH.'includes/page_header.php'&#41;;


//-----------------------------------------------------
//--- Clickstream -------------------------------------
//-----------------------------------------------------
$clickstream "<span class=\"clickstream\"><a href=\"".$site_sess->url&#40;ROOT_PATH."index.php"&#41;."\" class=\"clickstream\">".$lang['home'&#93;."</a>".$config['category_separator'&#93;.get_category_path&#40;$cat_id&#41;."</span>";



//-----------------------------------------------------
//--- Letzte Kommentare
//-----------------------------------------------------
 
if &#40;isset&#40;$HTTP_POST_VARS['commentsetperpage'&#93;&#41; || isset&#40;$HTTP_GET_VARS['commentsetperpage'&#93;&#41;&#41; &#123; 
  
$commentsetperpage = &#40;intval&#40;$HTTP_POST_VARS['commentsetperpage'&#93;&#41; &#41; ? intval&#40;$HTTP_POST_VARS['commentsetperpage'&#93;&#41; &#58; intval&#40;$HTTP_GET_VARS['commentsetperpage'&#93;&#41;; 
  
if &#40;$commentsetperpage&#41; &#123; 
    
$site_sess->set_session_var&#40;"commentperpage", $commentsetperpage&#41;; 
    
$session_info['commentperpage'&#93; = $commentsetperpage; 
  
&#125; 
&#125; 

if &#40;isset&#40;$session_info['commentperpage'&#93;&#41;&#41; &#123; 
  
$commentperpage $session_info['commentperpage'&#93;; 
&#125; 
else &#123; 
  
$commentperpage 5
&
#125; 
$commentsperpage_dropdown "\n<select name=\"commentsetperpage\" onchange=\"if &#40;this.options[this.selectedIndex&#93;.value != 0&#41;&#123; forms['commentsperpage'&#93;.submit&#40;&#41; &#125;\" class=\"select\">\n"
    for&
#40;$i = 1; $i <= 50; $i++&#41; &#123; 
      
$setvalue $i
      
$commentsperpage_dropdown .= "<option value=\"".$setvalue."\""
        if &
#40;$setvalue == $commentperpage&#41; &#123; 
        
$commentsperpage_dropdown .= " selected=\"selected\""
      &
#125; 
      
$commentsperpage_dropdown .= ">"
      
$commentsperpage_dropdown .= $setvalue
      
$commentsperpage_dropdown .= "</option>\n"
    &
#125; 
    
$commentsperpage_dropdown .= "</select>\n"

    
$site_template->register_vars&#40;"commentsperpage_dropdown", $commentsperpage_dropdown&#41;; 
    
$commentsperpage_dropdown_form $site_template->parse_template&#40;"commentsperpage_dropdown_form"&#41;; 
    
$site_template->register_vars&#40;"commentsperpage_dropdown_form", $commentsperpage_dropdown_form&#41;; 
      
$sql "SELECT COUNT&#40;image_id&#41; AS comments
      FROM "
.COMMENTS_TABLE.
      WHERE image_id = 
$image_id"
    
$result $site_db->query_firstrow&#40;$sql&#41;; 
    
$site_db->free_result&#40;&#41;; 
    
$num_comments $result['comments'&#93;; 
    
if &#40;$action == "postcomment"&#41; &#123; 
        
$page ceil&#40;$num_comments / $commentperpage&#41;; 
    
&#125; 
    
$num_rows_all = &#40;isset&#40;$num_comments&#41;&#41; ? $num_comments &#58; 0; 
    
$link_arg $site_sess->url&#40;ROOT_PATH."last_comments.php?image_id=$image_id"&#41;; 
    
include&#40;ROOT_PATH.'includes/paging.php'&#41;; 
    
$getpaging = new Paging&#40;$page, $commentperpage, $num_rows_all, $link_arg, $lang['comment_stats'&#93;, "comments"&#41;; 
    
$offset $getpaging->get_offset&#40;&#41;; 
    
$site_template->register_vars&#40;array&#40; 
      
"paging" => $getpaging->get_paging&#40;&#41;, 
      
"paging_stats" => &#40;$num_comments&#41; ? $getpaging->get_paging_stats&#40;&#41; &#58; "" 
    
&#41;&#41;;             

$additional_sql ""
      
$table_fields $site_db->get_table_fields&#40;USERS_TABLE&#41;; 
      
foreach &#40;$additional_user_fields as $key => $val&#41; &#123; 
        
if &#40;isset&#40;$HTTP_POST_VARS[$key&#93;&#41; && isset&#40;$table_fields[$key&#93;&#41;&#41; &#123; 
          
$additional_sql .= ", $key = '".un_htmlspecialchars&#40;trim&#40;$HTTP_POST_VARS[$key&#93;&#41;&#41;."'"; 
        
&#125; 
      
&#125; 
  
$sql "SELECT c.comment_id, c.image_id, c.user_id, c.user_name AS comment_user_name, c.comment_headline, c.comment_text, c.comment_date".get_user_table_field&#40;", u.", "user_level"&#41;.get_user_table_field&#40;", u.", "user_name"&#41;.get_user_table_field&#40;", u.", "user_lastaction"&#41;.get_user_table_field&#40;", u.", "user_comments"&#41;.$additional_sql." 
          
FROM ".COMMENTS_TABLE." 
          LEFT JOIN 
".USERS_TABLE." u ON &#40;".get_user_table_field&#40;"u.", "user_id"&#41;." = c.user_id&#41; 
          
ORDER BY c.comment_date DESC 
          LIMIT $offset
$commentperpage";
  
$result = $site_db->query&#40;$sql&#41;; 
  
$comment_row = array&#40;&#41;; 
  while &#40;
$row = $site_db->fetch_array&#40;$result&#41;&#41; &#123; 
    
$comment_row[&#93; = $row
  &#125; 
  
$site_db->free_result&#40;$result&#41;; 
  
$num_comments = sizeof&#40;$comment_row&#41;; 
  if &#40;!
$num_comments&#41; &#123; 
    
$comments_short = "<tr><td class=\"commentrow1\" colspan=\"2\">".$lang['no_comments'&#93;."</td></tr>"; 
  
&#125; 
  
else &#123; 
    
$comments_short ""
    for &
#40;$i = 0; $i < $num_comments; $i++&#41; &#123; 
        
$image_id $comment_row[$i&#93;['image_id'&#93;; 
        
$sql "SELECT i.image_id, i.cat_id, i.image_name, c.cat_name, i.image_media_file, i.image_thumb_file
                FROM "
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c 
                LEFT JOIN "
.USERS_TABLE." u ON &#40;".get_user_table_field&#40;"u.", "user_id"&#41;." = i.user_id&#41; 
                
WHERE i.image_id $image_id AND c.cat_id i.cat_id"; 
        
$image_row = $site_db->query_firstrow&#40;$sql&#41;; 
        
$cat_id = &#40;isset&#40;$image_row['cat_id'&#93;&#41;&#41; ? $image_row['cat_id'&#93; &#58; 0; 
      if &#40;check_permission&#40;"
auth_readcomment", $cat_id&#41;&#41;&#123; 
        
$comment_user_name = htmlspecialchars&#40;$comment_row[$i&#93;['comment_user_name'&#93;&#41;; 
        
$comment_user_info = $lang['userlevel_guest'&#93;; 
        
$comment_user_id = $comment_row[$i&#93;['user_id'&#93;; 
        
$user_row_comment = get_user_info&#40;$comment_user_id&#41;; 
        
$comment_user_profile_link = ""; 
        
$comment_user_info = $lang['userlevel_guest'&#93;; 
        if &#40;!isset&#40;
$comment_row[$i&#93;[$user_table_fields['user_level'&#93;&#93;&#41; || &#40;isset&#40;$comment_row[$i&#93;[$user_table_fields['user_level'&#93;&#93;&#41; && $comment_row[$i&#93;[$user_table_fields['user_level'&#93;&#93; == USER&#41;&#41; &#123; 
          
$comment_user_info = $lang['userlevel_user'&#93;; 
        &#125; 
        elseif &#40;
$comment_row[$i&#93;[$user_table_fields['user_level'&#93;&#93; == ADMIN&#41; &#123; 
          
$comment_user_info = $lang['userlevel_admin'&#93;; 
        &#125; 
        if &#40;isset&#40;
$comment_row[$i&#93;[$user_table_fields['user_name'&#93;&#93;&#41; && $comment_user_id != GUEST&#41; &#123; 
          
$comment_user_name = htmlspecialchars&#40;$comment_row[$i&#93;[$user_table_fields['user_name'&#93;&#93;&#41;; 
          
$comment_user_profile_link = !empty&#40;$url_show_profile&#41; ? $site_sess->url&#40;preg_replace&#40;"/&#123;user_id&#125;/", $comment_user_id, $url_show_profile&#41;&#41; &#58; $site_sess->url&#40;ROOT_PATH."member.php?action=showprofile&amp;".URL_USER_ID."=".$comment_user_id&#41;; 
        
&#125; 
          
$comment_user_profile_link = &#40;$comment_user_profile_link&#41; ? "<a href=\"".$comment_user_profile_link."\">".$comment_user_name."</a>" &#58; $comment_user_name; 
        
if &#40;!get_file_path&#40;$image_row['image_thumb_file'&#93;, "thumb", $image_row['cat_id'&#93;, 0, 0&#41;&#41; &#123; 
        
$thumb_file ICON_PATH."/".get_file_extension&#40;$image_row['image_media_file'&#93;&#41;.".gif"; 
      
&#125;else &#123; 
        
$thumb_file get_file_path&#40;$image_row['image_thumb_file'&#93;, "thumb", $image_row['cat_id'&#93;, 0, 1&#41;; 
      
&#125; 
      
$thumb_info = @getimagesize&#40;$thumb_file&#41;; 
      
$width $thumb_info[0&#93;; 
      
$height $thumb_info[1&#93;; 
      
$dimension 80
      
$ratio $width $height
      if &
#40;$ratio > 1&#41; &#123; 
        
$new_width $dimension
        
$new_height floor&#40;&#40;$dimension/$width&#41; * $height&#41;; 
      
&#125;else &#123; 
        
$new_width floor&#40;&#40;$dimension/$height&#41; * $width&#41;; 
        
$new_height $dimension
      &
#125; 
$site_template->register_vars&#40;array&#40;   
          
"comment_image_thumb" => &#40;!check_permission&#40;"auth_viewcat", $cat_id&#41; || !check_permission&#40;"auth_viewimage", $cat_id&#41;&#41; ? "<img src=\"".$thumb_file."\" 
  width=\"".$new_width."\" height=\"".$new_height."\" onClick=\"alert&#40;'".$lang['members_only'&#93;."'&#41;;\" border=\"".$config['image_border'&#93;."\">" &#58; "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row[$i&#93;['image_id'&#93;.&#40;&#40;!empty&#40;$mode&#41;&#41; ? "&amp;mode=".$mode &#58; ""&#41;&#41;."\">
  <img src=\"".$thumb_file."\" width=\"".$new_width."\" height=\"".$new_height."\" border=\"".$config['image_border'&#93;."\"></a>", 
        
          
"comment_image_name" => &#40;!check_permission&#40;"auth_viewcat", $cat_id&#41; || !check_permission&#40;"auth_viewimage", $cat_id&#41;&#41; ? $image_row['image_name'&#93; &#58; "<a href=\"".$site_sess->url&#40;ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row[$i&#93;['image_id'&#93;.&#40;&#40;!empty&#40;$mode&#41;&#41; ? "&amp;mode=".$mode &#58; ""&#41;&#41;."\">".$image_row['image_name'&#93;."</a>", 
          
"comment_cat_name" => &#40;!check_permission&#40;"auth_viewcat", $cat_id&#41;&#41; ? $image_row['cat_name'&#93; &#58; "<a href=\"".$site_sess->url&#40;ROOT_PATH."categories.php?".URL_CAT_ID."=".$cat_id&#41;."\">".$image_row['cat_name'&#93;."</a>", 
          
"comment_user_name" => $comment_user_profile_link
          
"comment_user_info" => $comment_user_info
          
"comment_headline" => format_text&#40;$comment_row[$i&#93;['comment_headline'&#93;, 0, $config['wordwrap_comments'&#93;, 0, 0&#41;, 
          
"comment_text" => format_text&#40;$comment_row[$i&#93;['comment_text'&#93;, $config['html_comments'&#93;, $config['wordwrap_comments'&#93;, $config['bb_comments'&#93;, $config['bb_img_comments'&#93;&#41;, 
          
"comment_date" => format_date&#40;$config['date_format'&#93;." ".$config['time_format'&#93;, $comment_row[$i&#93;['comment_date'&#93;&#41;, 
                  
&#41;&#41;; 



        
$comments_short .= $site_template->parse_template&#40;"comment_short_bit"&#41;; 
      
&#125; 
    
&#125; // end while 
  
&#125; //end else 
  
$site_template->register_vars&#40;"comments_short", $comments_short&#41;; 
  
unset&#40;$comments_short&#41;;

//-----------------------------------------------------
//--- Print Out ---------------------------------------
//-----------------------------------------------------
$site_template->register_vars&#40;array&#40;
  
"msg" => $msg,
  
"clickstream" => $clickstream
&#41;&#41;;
$site_template->print_template&#40;$site_template->parse_template&#40;$main_template&#41;&#41;;
include&#40;ROOT_PATH.'includes/page_footer.php'&#41;;
?>



this is my code at the moment but this doesn´t look like very attractive

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
[Mod] Show user's commets from his profile
« Reply #41 on: June 04, 2003, 05:28:29 AM »
It's not pulling the text or the URL for show comments.
Any ideas?

check Step 1. and Step 2.
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 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
[Mod] Show user's commets from his profile
« Reply #42 on: June 20, 2003, 11:19:35 PM »
thx to xwall for pointing in a bug, that would redirect to "lost password" page after changing comments per page using dropdown.
in commentsperpage_dropdown_form.html template use this code:
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>
</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>
and in members.php, find:
Code: [Select]
$site_template->register_vars("commentsperpage_dropdown", $commentsperpage_dropdown); replace with:
Code: [Select]
$site_template->register_vars(array(
    "user_id" => $user_id,
    "action" => $action,
 "commentsperpage_dropdown" => $commentsperpage_dropdown
));
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 The-Rocko

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: [Mod] Show user's commets from his profile
« Reply #43 on: September 11, 2005, 12:41:20 PM »
Hallo zusammen

Das Mod von V@no klappt so weit ganz gut. nur irgendwo ist der Wurm drin  :(

Quote
Step 3.
Open /templates/<yourtemplate>/member_profile.html

Add this tag, whereever u want to display link for comments:
Code: [Select]
<A href="{url_show_user_comments}">&nbsp;&nbsp;{lang_show_user_comments}&nbsp;&nbsp;</a>
Wenn ich diesen Code in die member_profile.html einfüge und ausführe, bekomme ich die " abgegebenen Comments " vom jeweiligen User !!!

Ich würde aber auch gerne die " erhaltenen Comments " von anderen Usern mit anzeigen lassen  :) :)



Was und wo muss ich hier bitte noch ändern  :wink: :P - Bitte helft mir  :P

Liebe Grüße Sabrina  :) :P  :)

Offline The-Rocko

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: [Mod] Show user's commets from his profile
« Reply #44 on: September 11, 2005, 05:34:03 PM »
Weis keiner einen Rat was geändert werden muss  :?

Liebe Grüße Sabrina  :P :)