• [MOD] Paging for comments 5 0 5 1
Currently:  

Author Topic: [MOD] Paging for comments  (Read 144694 times)

0 Members and 1 Guest are viewing this topic.

Offline Neo777

  • Newbie
  • *
  • Posts: 10
    • View Profile
Re: [MOD] Paging for comments
« Reply #60 on: January 17, 2007, 11:11:25 PM »
I tried to install this mod, but my details.php has not exactly this code.

My code is:

Code: [Select]
if ($image_allow_comments == 1) {
  $site_template->register_vars(array(
      "has_rss"   => true,
      "rss_title" => "RSS Feed: ".$image_name." (".str_replace(':', '', $lang['comments']).")",
      "rss_url"   => $script_url."/rss.php?action=comments&".URL_IMAGE_ID."=".$image_id
  ));

  $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")."
          FROM ".COMMENTS_TABLE." c
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          WHERE c.image_id = $image_id
          ORDER BY c.comment_date ASC";
  $result = $site_db->query($sql);

Please help me, what shall I do?

greetings

P.S.: Falls ihr mir deutsch antworten könntet wäre es 1.000x besser ;)

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Paging for comments
« Reply #61 on: April 05, 2007, 03:02:21 PM »
hi i have 1.7.3 version. this mod doesnt work . i see the form and the paging but i see all comments in all pages.. i have to install the path for 1.7.1?? and something else?

please help me.. thank you for this great mod

I attached details.php
« Last Edit: April 05, 2007, 03:53:14 PM by ccsakuweb »
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline ccsakuweb

  • Sr. Member
  • ****
  • Posts: 498
  • Patri
    • View Profile
    • My Art
Re: [MOD] Paging for comments
« Reply #62 on: April 07, 2007, 02:11:29 PM »
i found my error. i forgoted to add
   
Code: [Select]
  LIMIT $offset, $commentperpage"; after
Code: [Select]
          ORDER BY c.comment_date DESC
thank you for this great mod ^^
:arrow: 4images Paid Mods: Links, Blog, Albums, Subdomains for users, Diferent templates for user profile, Related picture in details, Last pictures in details.
And the mod that you request me.   Demo: http://www.myart.es

A website dedicated to artist people who loves drawing, design, writing and more

Offline Martin2006-B-2

  • Newbie
  • *
  • Posts: 10
    • View Profile
    • Berlin Fotos und Bilder - fotos-berlin24.de
Re: [MOD] Paging for comments
« Reply #63 on: October 29, 2007, 12:49:26 PM »
@Neo777

For Version 1.7.4 it looks like this:

Code: [Select]
if ($image_allow_comments == 1) {
  $site_template->register_vars(array(
      "has_rss"   => true,
      "rss_title" => "RSS Feed: ".$image_name." (".str_replace(':', '', $lang['comments']).")",
      "rss_url"   => $script_url."/rss.php?action=comments&".URL_IMAGE_ID."=".$image_id
  ));

  $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")."
          FROM ".COMMENTS_TABLE." c
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          WHERE c.image_id = $image_id
          ORDER BY c.comment_date ASC";
  $result = $site_db->query($sql);

You have to replace this part:

Code: [Select]
$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.image_id = $image_id
          ORDER BY c.comment_date ASC
          LIMIT $offset, $commentperpage";
  $result = $site_db->query($sql);

with this part

Code: [Select]
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 <= 15; $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);

  $sql = "SELECT COUNT(image_id) AS comments
      FROM ".COMMENTS_TABLE."
      WHERE image_id = $image_id";
$result = $site_db->query_firstrow($sql);
$site_db->free_result();
$num_comments = $result['comments'];
if ($action == "postcomment") {
$page = ceil($num_comments / $commentperpage);
}
$num_rows_all = (isset($num_comments)) ? $num_comments : 0;
$link_arg = $site_sess->url(ROOT_PATH."details.php?image_id=$image_id");
include(ROOT_PATH.'includes/paging.php');
$getpaging = new Paging($page, $commentperpage, $num_rows_all, $link_arg, $lang['comment_stats'], "comments");
$offset = $getpaging->get_offset();
$site_template->register_vars(array(
  "paging" => $getpaging->get_paging(),
  "paging_stats" => ($num_comments) ? $getpaging->get_paging_stats() : ""
));
  $additional_sql = "";
  if (!empty($additional_user_fields)) {
    $table_fields = $site_db->get_table_fields(USERS_TABLE);
    foreach ($additional_user_fields as $key => $val) {
      if (isset($table_fields[$key])) {
        $additional_sql .= ", u.$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.image_id = $image_id
          ORDER BY c.comment_date DESC
          LIMIT $offset, $commentperpage";
  $result = $site_db->query($sql);


Than it should work!
Berlin Fotos und Bilder - fotos-berlin24.de


Offline Ankney

  • Pre-Newbie
  • Posts: 9
    • View Profile
Re: [MOD] Paging for comments
« Reply #64 on: March 26, 2008, 03:41:52 PM »
hi, the paging for comments is working but pressing the post button will always take me to the last page instead of the first. the modification which v@no describes in this thread isn't working. I'm using the newest version of 4images, 1.76. Can someone help me to solve the problem?

TIA Ankney

Offline Tino23

  • Full Member
  • ***
  • Posts: 191
    • View Profile
    • LMJ - Motorsport
Re: [MOD] Paging for comments
« Reply #65 on: August 02, 2008, 10:53:33 AM »
Benutzt einfach die paging.php Datei aus diesem Mod http://www.4homepages.de/forum/index.php?topic=21960.0. Mach halt bloß die Änderrungen für diese Datei und laßt den Rest des Mods einfach weg. Geht wunderbar auch mit der Ver. 1.7.6 !

Offline RatedRWHC

  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: [MOD] Paging for comments
« Reply #66 on: August 31, 2008, 11:13:08 AM »
cool ill do this in a minute lol:D
i know this is a bit off topic lol but v@no in ur pic is that a bloke with pig tails :L

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] Paging for comments
« Reply #67 on: August 11, 2009, 03:14:02 PM »
Please stop posting code from entire file.
The installation instructions is on first post of this topic.
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
Re: [MOD] Paging for comments
« Reply #68 on: August 12, 2009, 01:33:49 AM »
Well, then you can start by telling what step you have problem with and what is your 4images version.
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 GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: [MOD] Paging for comments
« Reply #69 on: August 12, 2009, 06:35:05 AM »
Sir V@no . im Using 4image 1.7.6 Version :)

In Step 1 .. im not able to find the codes in details.php  :? I Found Some Code Which is closer to the code in step 1..bit thier are more codes thier than the code shown in step 1 .. !
Respecting your Comments i

Thank you ! :roll:
I'm Back :)

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] Paging for comments
« Reply #70 on: August 12, 2009, 07:05:11 AM »
I've updated the step 1, and added step 1.2

P.S.
Thank you for attaching the file this time not posting as text ;)
« Last Edit: August 12, 2009, 07:38:55 AM by V@no »
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 GaYan

  • Sr. Member
  • ****
  • Posts: 301
  • ♫ | G2 | ♫
    • View Profile
    • Ziramagic
Re: [MOD] Paging for comments
« Reply #71 on: August 12, 2009, 08:08:03 AM »
You Are Welcome Sir  :D It looks Neat Now..isnt it ? :) Thanks ...
I'm Back :)

Offline Joss

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • All about digital photography
Re: [MOD] Paging for comments
« Reply #72 on: February 08, 2010, 02:19:14 PM »
I've question about sorting direction (ACS, DESC), some users wants to ASC, some DESC. Is it possible to allow users decide how sorting comments?

http://www.4homepages.de/forum/index.php?topic=5830.msg58693#msg58693

Das ist ein netter Mod! Nur wie kann man folgendes noch dazu einstellen damit immer die letzten Kommentare sichtbar sind? Also die letzte Kommentarseite des ausgewählten Bildes?

...
I think to change the order from ascending to descending is better, so u see the latest comments always on the first site.

Search
Code: [Select]
$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.image_id = $image_id
         ORDER BY c.comment_date ASC
         LIMIT $offset, $commentperpage";

and replace with
Code: [Select]
$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.image_id = $image_id
         ORDER BY c.comment_date DESC
         LIMIT $offset, $commentperpage";

The only change is the changed order from ASC to DESC.
Digital Photo Gallery: http://gallery.imagemaster.ru

Offline d1eter

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: [MOD] Paging for comments
« Reply #73 on: February 17, 2010, 08:06:40 AM »
hello..,
need help...

how do I change the GO button, to match the current template I'm using..
currently it looks like this
I want to change it to be the same style from the template, but I don;t know how...

thank you!

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Paging for comments
« Reply #74 on: February 17, 2010, 11:33:27 AM »
hello d1eter ...

... yes, it doesn't look good ...
... and it is hard to find this small inaccuracy, and I saw it on many 4images websites which use V@no's paging class ...
... but ...
... this mistake comes not from [MOD] Paging for comments ... !
... it is a mistake in V@no's [MOD] Universal Paging Class v1.1 ...
... a mistake with the class="pagingbutton" instead of class="button" and class="paginginput" instead of class="input" ...
... so, in V@no's paging.php find ( in the zip-attachment of the [MOD] Universal Paging Class v1.1 ) ...


$html 
.= "&nbsp;".$lang['gotopage']."&nbsp;<input type=\"text\" size=\"2\" name=\"page\" value=\"\" class=\"paginginput\" />\n<input type=\"submit\" value=\"".$lang['pagebutton']."\" class=\"pagingbutton\" />\n</form>";


... an replace it with the followig ...


$html 
.= "&nbsp;".$lang['gotopage']."&nbsp;<input type=\"text\" size=\"2\" name=\"page\" value=\"\" class=\"input\" />\n<input type=\"submit\" value=\"".$lang['pagebutton']."\" class=\"button\" />\n</form>";


... or you can create new class "pagingbutton" and "paginginput" in your style.css to your needs (e.G. the same as "button" and "input") ...

... that's all ... ;)
... thank V@no for all your perfectly 4images mods ...  :mrgreen:
Your first three "must do" before you ask a question ! ( © by V@no )
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

You are on search for top 4images MOD's ?
- then please search here ... Mawenzi's Top 100+ MOD List (unsorted sorted) ...