Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Comments per page

Asked Modified Viewed 3,468 times
M
Maailmameister
M
  • Junior Member, joined since
  • Contributed 39 posts on the community forums.
  • Started 12 threads in the forums
  • Started this discussions
asked
Junior Member

Hi there,
I'm new there. I tried to ask on our Czech PHPFusion Support but no one knew how to help me.

I'm sure my request is not impossible. I just want to know how change the number of comments per page (in news.. If it will change number of comments per page in articles it will be better, but it is not important by now)
- 10 comments is too few.

I have already read something about changing number(s) 10 to whatever in includes/comments_include.php on line +/- 112
if ($c_rows > 10) { 
echo "<div style='text-align:center;margin-top:5px;'>".makecommentnav($_GET['c_start'],
10, $c_rows, 3, $clink."&amp;")."</div>\n";
}


But this does not working for me :) Thx for help.
0 replies

7 posts

S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
answered
Veteran Member

Hi there.

Just search after the number 10 in the code. The number is several places in the code. Then change the number to another number you wish.

Here's one that allows 20 comments pr. page:
[syntaxhighlighter brush=php,first-line=1,highlight=0,collapse=false,html-script=false]<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2010 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: comments_include.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION"wink) { die("Access Denied"wink; }

include LOCALE.LOCALESET."comments.php";

function showcomments($ctype, $cdb, $ccol, $cid, $clink) {

global $settings, $locale, $userdata, $aidlink;

$link = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : ""wink;
$link = preg_replace("^(&amp;|\?)c_action=(edit|delete)&amp;comment_id=\d*^", "", $link);

if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "delete"wink && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
if ((iADMIN && checkrights("C"wink) || (iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='".$_GET['comment_id']."' AND comment_name='".$userdata['user_id']."'"wink)) {
$result = dbquery("DELETE FROM ".DB_COMMENTS." WHERE comment_id='".$_GET['comment_id']."'".(iADMIN ? "" : " AND comment_name='".$userdata['user_id']."'"wink);
}
redirect($clink);
}

if ($settings['comments_enabled'] == "1"wink {
if ((iMEMBER || $settings['guestposts'] == "1"wink && isset($_POST['post_comment'])) {

if (iMEMBER) {
$comment_name = $userdata['user_id'];
} elseif ($settings['guestposts'] == "1"wink {
$comment_name = trim(stripinput($_POST['comment_name']));
$comment_name = preg_replace("(^[0-9\s]*)", "", $comment_name);
if (isnum($comment_name)) { $comment_name = ""; }
include_once INCLUDES."securimage/securimage.php";
$securimage = new Securimage();
if (!isset($_POST['com_captcha_code']) || $securimage->check($_POST['com_captcha_code']) == false) { redirect($link); }
}

$comment_message = trim(stripinput(censorwords($_POST['comment_message'])));

if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit"wink && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
$comment_updated = false;
if ((iADMIN && checkrights("C"wink) || (iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='".$_GET['comment_id']."' AND comment_item_id='".$cid."' AND comment_type='".$ctype."' AND comment_name='".$userdata['user_id']."' AND comment_hidden='0'"wink)) {
if ($comment_message) {
$result = dbquery("UPDATE ".DB_COMMENTS." SET comment_message='$comment_message' WHERE comment_id='".$_GET['comment_id']."'".(iADMIN ? "" : " AND comment_name='".$userdata['user_id']."'"wink);
$comment_updated = true;
}
}
if ($comment_updated) {
$c_start = (ceil(dbcount("(comment_id)", DB_COMMENTS, "comment_id<='".$_GET['comment_id']."' AND comment_item_id='".$cid."' AND comment_type='".$ctype."'"wink / 20) - 1) * 20;
}
redirect($clink."&amp;c_start=".(isset($c_start) && isnum($c_start) ? $c_start : ""wink);
} else {
if (!dbcount("(".$ccol."wink", $cdb, $ccol."='".$cid."'"wink) { redirect(BASEDIR."index.php"wink; }
if ($comment_name && $comment_message) {
require_once INCLUDES."flood_include.php";
if (!flood_control("comment_datestamp", DB_COMMENTS, "comment_ip='".USER_IP."'"wink) {
$result = dbquery("INSERT INTO ".DB_COMMENTS." (comment_item_id, comment_type, comment_name, comment_message, comment_datestamp, comment_ip, comment_hidden) VALUES ('$cid', '$ctype', '$comment_name', '$comment_message', '".time()."', '".USER_IP."', '0'wink"wink;
}
}
$c_start = (ceil(dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='".$cid."' AND comment_type='".$ctype."'"wink / 20) - 1) * 20;
redirect($clink."&amp;c_start=".$c_start);
}
}

opentable($locale['c100']);
echo "<a id='comments' name='comments'></a>";
$c_rows = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='$cid' AND comment_type='$ctype' AND comment_hidden='0'"wink;
if (!isset($_GET['c_start']) && $c_rows > 20) {$_GET['c_start'] = (ceil($c_rows / 20) - 1) * 20;}
if (!isset($_GET['c_start']) || !isnum($_GET['c_start'])){ $_GET['c_start'] = 0; }
$result = dbquery(
"SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcm.comment_datestamp, tcu.user_name, tcu.user_status
FROM ".DB_COMMENTS." tcm
LEFT JOIN ".DB_USERS." tcu ON tcm.comment_name=tcu.user_id
WHERE comment_item_id='$cid' AND comment_type='$ctype' AND comment_hidden='0'
ORDER BY comment_datestamp ASC LIMIT ".$_GET['c_start'].",20"
);
if (dbrows($result)) {
$i = $_GET['c_start']+1;
if ($c_rows > 20) {
echo "<div style='text-align:center;margin-bottom:5px;'>".makecommentnav($_GET['c_start'], 20, $c_rows, 3, $clink."&amp;"wink."</div>\n";
}
while ($data = dbarray($result)) {
echo "<div class='tbl2'>\n";
if ((iADMIN && checkrights("C"wink) || (iMEMBER && $data['comment_name'] == $userdata['user_id'] && isset($data['user_name']))) {
echo "<div style='float:right' class='comment_actions'><!--comment_actions-->\n<a href='".FUSION_REQUEST."&amp;c_action=edit&amp;comment_id=".$data['comment_id']."#edit_comment'>".$locale['c108']."</a> |\n";
echo "<a href='".FUSION_REQUEST."&amp;c_action=delete&amp;comment_id=".$data['comment_id']."'>".$locale['c109']."</a>\n</div>\n";
}
echo "<a href='".FUSION_REQUEST."#c".$data['comment_id']."' id='c".$data['comment_id']."' name='c".$data['comment_id']."'>#".$i."</a> | ";
if ($data['user_name']) {
echo "<span class='comment-name'>".profile_link($data['comment_name'], $data['user_name'], $data['user_status'])."</span>\n";
} else {
echo "<span class='comment-name'>".$data['comment_name']."</span>\n";
}
echo "<span class='small'>".$locale['global_071'].showdate("longdate", $data['comment_datestamp'])."</span>\n";
echo "</div>\n<div class='tbl1 comment_message'><!--comment_message-->".nl2br(parseubb(parsesmileys($data['comment_message'])))."</div>\n";
$i++;
}
if (iADMIN && checkrights("C"wink) {
echo "<div align='right' class='tbl2'><a href='".ADMIN."comments.php".$aidlink."&amp;ctype=$ctype&amp;cid=$cid'>".$locale['c106']."</a></div>\n";
}
if ($c_rows > 20) {
echo "<div style='text-align:center;margin-top:5px;'>".makecommentnav($_GET['c_start'], 20, $c_rows, 3, $clink."&amp;"wink."</div>\n";
}
} else {
echo $locale['c101']."\n";
}
closetable();

opentable($locale['c102']);
if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit"wink && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
$eresult = dbquery(
"SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcu.user_name FROM ".DB_COMMENTS." tcm
LEFT JOIN ".DB_USERS." tcu ON tcm.comment_name=tcu.user_id
WHERE comment_id='".$_GET['comment_id']."' AND comment_item_id='".$cid."' AND comment_type='".$ctype."' AND comment_hidden='0'"
);
if (dbrows($eresult)) {
$edata = dbarray($eresult);
if ((iADMIN && checkrights("C"wink) || (iMEMBER && $edata['comment_name'] == $userdata['user_id'] && isset($edata['user_name']))) {
$clink .= "&amp;c_action=edit&amp;comment_id=".$edata['comment_id'];
$comment_message = $edata['comment_message'];
}
} else {
$comment_message = "";
}
} else {
$comment_message = "";
}
if (iMEMBER || $settings['guestposts'] == "1"wink {
require_once INCLUDES."bbcode_include.php";
echo "<a id='edit_comment' name='edit_comment'></a>\n";
echo "<form name='inputform' method='post' action='".$clink."'>\n";
if (iGUEST) {
echo "<div align='center' class='tbl'>\n".$locale['c104']."<br />\n";
echo "<input type='text' name='comment_name' maxlength='30' class='textbox' style='width:360px' />\n";
echo "</div>\n";
}
echo "<div align='center' class='tbl'>\n";
echo "<textarea name='comment_message' cols='70' rows='6' class='textbox' style='width:360px'>".$comment_message."</textarea><br />\n";
echo display_bbcodes("360px", "comment_message"wink;
if (iGUEST) {
echo $locale['global_158']."<br />\n";
echo "<img id='com_captcha' src='".INCLUDES."securimage/securimage_show.php' alt='' /><br />\n";
echo "<a href='".INCLUDES."securimage/securimage_play.php'><img src='".INCLUDES."securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
echo "<a href='#' onclick=\"document.getElementById('com_captcha'wink.src = '".INCLUDES."securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='".INCLUDES."securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n";
echo $locale['global_159']."<br />\n<input type='text' name='com_captcha_code' class='textbox' style='width:100px' />\n";
}
echo "<br />\n<input type='submit' name='post_comment' value='".($comment_message ? $locale['c103'] : $locale['c102'])."' class='button' />\n";
echo "</div>\n</form>\n";
} else {
echo $locale['c105']."\n";
}
closetable();
}
}

function makecommentnav($start, $count, $total, $range = 0, $link) {

global $locale;

$pg_cnt = ceil($total / $count);
if ($pg_cnt <= 1) { return ""; }

$idx_back = $start - $count;
$idx_next = $start + $count;
$cur_page = ceil(($start + 1) / $count);

$res = $locale['global_092']." ".$cur_page.$locale['global_093'].$pg_cnt.": ";
if ($idx_back >= 0) {
if ($cur_page > ($range + 1)) {
$res .= "<a href='".$link."c_start=0'>1</a>";
if ($cur_page != ($range + 2)) {
$res .= "...";
}
}
}
$idx_fst = max($cur_page - $range, 1);
$idx_lst = min($cur_page + $range, $pg_cnt);
if ($range == 0) {
$idx_fst = 1;
$idx_lst = $pg_cnt;
}
for ($i = $idx_fst; $i <= $idx_lst; $i++) {
$offset_page = ($i - 1) * $count;
if ($i == $cur_page) {
$res .= "<span><strong>".$i."</strong></span>";
} else {
$res .= "<a href='".$link."c_start=".$offset_page."'>".$i."</a>";
}
}
if ($idx_next < $total) {
if ($cur_page < ($pg_cnt - $range)) {
if ($cur_page != ($pg_cnt - $range - 1)) {
$res .= "...";
}
$res .= "<a href='".$link."c_start=".($pg_cnt - 1) * $count."'>".$pg_cnt."</a>\n";
}
}

return "<div class='pagenav'>\n".$res."</div>\n";
}
?>[/syntaxhighlighter]
Edited by smokeman on 19-01-2011 18:11,
0 replies
M
Maailmameister
M
  • Junior Member, joined since
  • Contributed 39 posts on the community forums.
  • Started 12 threads in the forums
  • Started this discussions
answered
Junior Member

Thanks for reply, but could you please send me that line only? I have already changed that comment_include.php file when I've added avatars in comments.

/because I cannot find it.. but i totally changed 4 numbers (10 to 100) and nothing happened)/
Edited by Maailmameister on 19-01-2011 18:24,
0 replies
S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
answered
Veteran Member

It's not only one line. The number 10 you should change several places in the code - like I said before.

Open the file with eg; notepad and use the search-funktion and search after the number 10. All these places you see that number - you just change them to another number, eg; 50.

Just try it m8 - Im sure you can do that. Or else you never learning this.

This is a very easy new-beginner-project. If you just do as i told you.

If something goes wrong - then just upload a new fresh file - nothing damage will happen.


Edit: There are twelve (12) of these "number 10" you should change.
Edited by smokeman on 19-01-2011 18:51,
0 replies
M
Maailmameister
M
  • Junior Member, joined since
  • Contributed 39 posts on the community forums.
  • Started 12 threads in the forums
  • Started this discussions
answered
Junior Member

include this numbers of 10? grin
$c_start = (ceil(dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='".$cid."'
AND comment_type='".$ctype."'"wink / 10) - 1) * 10;
redirect($clink."&amp;rstart=".$c_start);

i could not put this into bb code :/ the red tens would not appear
Edited by Maailmameister on 19-01-2011 19:07,
0 replies
S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
answered
Veteran Member

Yes you are right - the code-BBcode is nothing worth when using colours in the code :(

Here you have the hole code (@admins: it's on purpose that I don't use BBcode - else I can't show him with red-marked in the code)

<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright (C) 2002 - 2010 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: comments_include.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) { die("Access Denied"); }

include LOCALE.LOCALESET."comments.php";

function showcomments($ctype, $cdb, $ccol, $cid, $clink) {

   global $settings, $locale, $userdata, $aidlink;

   $link = FUSION_SELF.(FUSION_QUERY ? "?".FUSION_QUERY : "");
   $link = preg_replace("^(&amp;|\?)c_action=(edit|delete)&amp;comment_id=\d*^", "", $link);

   if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "delete") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
      if ((iADMIN && checkrights("C")) || (iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='".$_GET['comment_id']."' AND comment_name='".$userdata['user_id']."'"))) {
         $result = dbquery("DELETE FROM ".DB_COMMENTS." WHERE comment_id='".$_GET['comment_id']."'".(iADMIN ? "" : " AND comment_name='".$userdata['user_id']."'"));
      }
      redirect($clink);
   }

   if ($settings['comments_enabled'] == "1") {
      if ((iMEMBER || $settings['guestposts'] == "1") && isset($_POST['post_comment'])) {

         if (iMEMBER) {
            $comment_name = $userdata['user_id'];
         } elseif ($settings['guestposts'] == "1") {
            $comment_name = trim(stripinput($_POST['comment_name']));
            $comment_name = preg_replace("(^[0-9\s]*)", "", $comment_name);
            if (isnum($comment_name)) { $comment_name = ""; }
            include_once INCLUDES."securimage/securimage.php";
            $securimage = new Securimage();
            if (!isset($_POST['com_captcha_code']) || $securimage->check($_POST['com_captcha_code']) == false) { redirect($link); }
         }

         $comment_message = trim(stripinput(censorwords($_POST['comment_message'])));

         if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
            $comment_updated = false;
            if ((iADMIN && checkrights("C")) || (iMEMBER && dbcount("(comment_id)", DB_COMMENTS, "comment_id='".$_GET['comment_id']."' AND comment_item_id='".$cid."' AND comment_type='".$ctype."' AND comment_name='".$userdata['user_id']."' AND comment_hidden='0'"))) {
               if ($comment_message) {
                  $result = dbquery("UPDATE ".DB_COMMENTS." SET comment_message='$comment_message' WHERE comment_id='".$_GET['comment_id']."'".(iADMIN ? "" : " AND comment_name='".$userdata['user_id']."'"));
                  $comment_updated = true;
               }
            }
            if ($comment_updated) {
               $c_start = (ceil(dbcount("(comment_id)", DB_COMMENTS, "comment_id<='".$_GET['comment_id']."' AND comment_item_id='".$cid."' AND comment_type='".$ctype."'") / [color=#ff0000][b]10[/b][/color]) - 1) * [color=#ff0000][b]10[/b][/color];
            }
            redirect($clink."&amp;c_start=".(isset($c_start) && isnum($c_start) ? $c_start : ""));
         } else {
            if (!dbcount("(".$ccol.")", $cdb, $ccol."='".$cid."'")) { redirect(BASEDIR."index.php"); }
            if ($comment_name && $comment_message) {
               require_once INCLUDES."flood_include.php";
               if (!flood_control("comment_datestamp", DB_COMMENTS, "comment_ip='".USER_IP."'")) {
                  $result = dbquery("INSERT INTO ".DB_COMMENTS." (comment_item_id, comment_type, comment_name, comment_message, comment_datestamp, comment_ip, comment_hidden) VALUES ('$cid', '$ctype', '$comment_name', '$comment_message', '".time()."', '".USER_IP."', '0')");
               }
            }
            $c_start = (ceil(dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='".$cid."' AND comment_type='".$ctype."'") / [color=#ff0000][b]10[/b][/color]) - 1) * [color=#ff0000][b]10[/b][/color];
            redirect($clink."&amp;c_start=".$c_start);
         }
      }

      opentable($locale['c100']);
      echo "<a id='comments' name='comments'></a>";
      $c_rows = dbcount("(comment_id)", DB_COMMENTS, "comment_item_id='$cid' AND comment_type='$ctype' AND comment_hidden='0'");
      if (!isset($_GET['c_start']) && $c_rows > [color=#ff0000][b]10[/b][/color]) {$_GET['c_start'] = (ceil($c_rows / [color=#ff0000][b]10[/b][/color]) - 1) * [color=#ff0000][b]10[/b][/color];}
      if (!isset($_GET['c_start']) || !isnum($_GET['c_start'])){ $_GET['c_start'] = 0; }
      $result = dbquery(
         "SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcm.comment_datestamp, tcu.user_name, tcu.user_status
         FROM ".DB_COMMENTS." tcm
         LEFT JOIN ".DB_USERS." tcu ON tcm.comment_name=tcu.user_id
         WHERE comment_item_id='$cid' AND comment_type='$ctype' AND comment_hidden='0'
         ORDER BY comment_datestamp ASC LIMIT ".$_GET['c_start'].",[color=#ff0000][b]10[/b][/color]"
      );
      if (dbrows($result)) {
         $i = $_GET['c_start']+1;
         if ($c_rows > [color=#ff0000][b]10[/b][/color]) {
            echo "<div style='text-align:center;margin-bottom:5px;'>".makecommentnav($_GET['c_start'], [color=#ff0000][b]10[/b][/color], $c_rows, 3, $clink."&amp;")."</div>\n";
         }
         while ($data = dbarray($result)) {
            echo "<div class='tbl2'>\n";
            if ((iADMIN && checkrights("C")) || (iMEMBER && $data['comment_name'] == $userdata['user_id'] && isset($data['user_name']))) {
               echo "<div style='float:right' class='comment_actions'><!--comment_actions-->\n<a href='".FUSION_REQUEST."&amp;c_action=edit&amp;comment_id=".$data['comment_id']."#edit_comment'>".$locale['c108']."</a> |\n";
               echo "<a href='".FUSION_REQUEST."&amp;c_action=delete&amp;comment_id=".$data['comment_id']."'>".$locale['c109']."</a>\n</div>\n";
            }
            echo "<a href='".FUSION_REQUEST."#c".$data['comment_id']."' id='c".$data['comment_id']."' name='c".$data['comment_id']."'>#".$i."</a> | ";
            if ($data['user_name']) {
               echo "<span class='comment-name'>".profile_link($data['comment_name'], $data['user_name'], $data['user_status'])."</span>\n";
            } else {
               echo "<span class='comment-name'>".$data['comment_name']."</span>\n";
            }
            echo "<span class='small'>".$locale['global_071'].showdate("longdate", $data['comment_datestamp'])."</span>\n";
            echo "</div>\n<div class='tbl1 comment_message'><!--comment_message-->".nl2br(parseubb(parsesmileys($data['comment_message'])))."</div>\n";
            $i++;
         }
         if (iADMIN && checkrights("C")) {
            echo "<div align='right' class='tbl2'><a href='".ADMIN."comments.php".$aidlink."&amp;ctype=$ctype&amp;cid=$cid'>".$locale['c106']."</a></div>\n";
         }
         if ($c_rows > [color=#ff0000][b]10[/b][/color]) {
            echo "<div style='text-align:center;margin-top:5px;'>".makecommentnav($_GET['c_start'], [color=#ff0000][b]10[/b][/color], $c_rows, 3, $clink."&amp;")."</div>\n";
         }
      } else {
         echo $locale['c101']."\n";
      }
      closetable();

      opentable($locale['c102']);
      if (iMEMBER && (isset($_GET['c_action']) && $_GET['c_action'] == "edit") && (isset($_GET['comment_id']) && isnum($_GET['comment_id']))) {
         $eresult = dbquery(
            "SELECT tcm.comment_id, tcm.comment_name, tcm.comment_message, tcu.user_name FROM ".DB_COMMENTS." tcm
            LEFT JOIN ".DB_USERS." tcu ON tcm.comment_name=tcu.user_id
            WHERE comment_id='".$_GET['comment_id']."' AND comment_item_id='".$cid."' AND comment_type='".$ctype."' AND comment_hidden='0'"
         );
         if (dbrows($eresult)) {
            $edata = dbarray($eresult);
            if ((iADMIN && checkrights("C")) || (iMEMBER && $edata['comment_name'] == $userdata['user_id'] && isset($edata['user_name']))) {
               $clink .= "&amp;c_action=edit&amp;comment_id=".$edata['comment_id'];
               $comment_message = $edata['comment_message'];
            }
         } else {
            $comment_message = "";
         }
      } else {
         $comment_message = "";
      }
      if (iMEMBER || $settings['guestposts'] == "1") {
         require_once INCLUDES."bbcode_include.php";
         echo "<a id='edit_comment' name='edit_comment'></a>\n";
         echo "<form name='inputform' method='post' action='".$clink."'>\n";
         if (iGUEST) {
            echo "<div align='center' class='tbl'>\n".$locale['c104']."<br />\n";
            echo "<input type='text' name='comment_name' maxlength='30' class='textbox' style='width:360px' />\n";
            echo "</div>\n";
         }
         echo "<div align='center' class='tbl'>\n";
         echo "<textarea name='comment_message' cols='70' rows='6' class='textbox' style='width:360px'>".$comment_message."</textarea><br />\n";
         echo display_bbcodes("360px", "comment_message");
         if (iGUEST) {
            echo $locale['global_158']."<br />\n";
            echo "<img id='com_captcha' src='".INCLUDES."securimage/securimage_show.php' alt='' /><br />\n";
            echo "<a href='".INCLUDES."securimage/securimage_play.php'><img src='".INCLUDES."securimage/images/audio_icon.gif' alt='' class='tbl-border' style='margin-bottom:1px' /></a>\n";
            echo "<a href='#' onclick=\"document.getElementById('com_captcha').src = '".INCLUDES."securimage/securimage_show.php?sid=' + Math.random(); return false\"><img src='".INCLUDES."securimage/images/refresh.gif' alt='' class='tbl-border' /></a><br />\n";
            echo $locale['global_159']."<br />\n<input type='text' name='com_captcha_code' class='textbox' style='width:100px' />\n";
         }
         echo "<br />\n<input type='submit' name='post_comment' value='".($comment_message ? $locale['c103'] : $locale['c102'])."' class='button' />\n";
         echo "</div>\n</form>\n";
      } else {
         echo $locale['c105']."\n";
      }
      closetable();
   }
}

function makecommentnav($start, $count, $total, $range = 0, $link) {

   global $locale;

   $pg_cnt = ceil($total / $count);
   if ($pg_cnt <= 1) { return ""; }

   $idx_back = $start - $count;
   $idx_next = $start + $count;
   $cur_page = ceil(($start + 1) / $count);

   $res = $locale['global_092']." ".$cur_page.$locale['global_093'].$pg_cnt.": ";
   if ($idx_back >= 0) {
      if ($cur_page > ($range + 1)) {
         $res .= "<a href='".$link."c_start=0'>1</a>";
         if ($cur_page != ($range + 2)) {
            $res .= "...";
         }
      }
   }
   $idx_fst = max($cur_page - $range, 1);
   $idx_lst = min($cur_page + $range, $pg_cnt);
   if ($range == 0) {
      $idx_fst = 1;
      $idx_lst = $pg_cnt;
   }
   for ($i = $idx_fst; $i <= $idx_lst; $i++) {
      $offset_page = ($i - 1) * $count;
      if ($i == $cur_page) {
         $res .= "<span><strong>".$i."</strong></span>";
      } else {
         $res .= "<a href='".$link."c_start=".$offset_page."'>".$i."</a>";
      }
   }
   if ($idx_next < $total) {
      if ($cur_page < ($pg_cnt - $range)) {
         if ($cur_page != ($pg_cnt - $range - 1)) {
            $res .= "...";
         }
         $res .= "<a href='".$link."c_start=".($pg_cnt - 1) * $count."'>".$pg_cnt."</a>\n";
      }
   }

   return "<div class='pagenav'>\n".$res."</div>\n";
}
?>




Like I said: The number 10 should you change twelve (12) places. These are now marked with red.
Edited by starefossen on 03-02-2011 10:44,
0 replies
M
Maailmameister
M
  • Junior Member, joined since
  • Contributed 39 posts on the community forums.
  • Started 12 threads in the forums
  • Started this discussions
answered
Junior Member

Uh.. it works dude ;) How can I thank you? :D (and I did now changed all 12 number, just 5 - that two echos and this LIMIT ".$_GET['c_start'].",20"

but thanks anyway. i would be lost without help :)
Edited by Maailmameister on 19-01-2011 19:36,
0 replies
S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
answered
Veteran Member

No problem. Im glad I could help.
0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 7 posts
  • Votes 0 votes
  • Topic users 2 members

2 participants

S
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
M
M
  • Junior Member, joined since
  • Contributed 39 posts on the community forums.
  • Started 12 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet