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

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

0 Members and 1 Guest are viewing this topic.

Offline Joss

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
    • All about digital photography
Re: [MOD] Paging for comments
« Reply #15 on: January 03, 2006, 02:55:05 PM »
Thank you very much, Vano!
I think, may be to move this link to the start of this topic?
Digital Photo Gallery: http://gallery.imagemaster.ru

Offline Aleksey

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [MOD] Paging for comments
« Reply #16 on: January 15, 2006, 02:54:44 AM »
how do then open photo,
automatic open last page comments?

Offline Aleksey

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [MOD] Paging for comments
« Reply #17 on: January 16, 2006, 09:01:54 PM »
up...

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 #18 on: January 17, 2006, 12:53:56 AM »
If you can answer this question...how would you open the first page of comments, if when you open the page without page=xx in the url it will open the last page? (no page=xx in the url is eaqual to page=1)
If you have an idea on how to make it work, then we'll talk ;)
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 #19 on: January 17, 2006, 01:06:35 AM »
Ok, I'll answer it for you ;)
In details.php replace
Code: [Select]
 if ($action == "postcomment") {with this:
Code: [Select]
 if (isset($HTTP_GET_VARS[URL_PAGE]) || isset($HTTP_POST_VARS[URL_PAGE])) {
    $page = (isset($HTTP_POST_VARS[URL_PAGE])) ? intval($HTTP_POST_VARS[URL_PAGE]) : intval($HTTP_GET_VARS[URL_PAGE]);
    if (!$page) {
      $page = 0;
    }
  }
  else {
    $page = 0;
  }
  if (!$page || $action == "postcomment") {

P.S. I like this idea of yours ;)
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 Aleksey

  • Newbie
  • *
  • Posts: 37
    • View Profile
Re: [MOD] Paging for comments
« Reply #20 on: January 18, 2006, 01:09:08 AM »
YES! YES! YES! This work! Thank you very much Vano!  You super coder :mrgreen:
В общем спасибо большое :) Это самое правильное дополнение к этому хаку, иначе людям приходится постоянно жать последнюю страницу чтобы посмотреть нет ли новых сообщений :)

Offline IcEcReaM

  • Hero Member
  • *****
  • Posts: 714
    • View Profile
    • My little Testboard
Re: [MOD] Paging for comments
« Reply #21 on: January 25, 2006, 07:01:19 PM »
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?

Du kannst die Sortierreihenfolge umstellen.

I have made a little change,
so it will not display from oldest to newest.
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.
Coding is a everlasting competition between programmers who tries to write larger, better and idiot-safe programs and the universe producing larger and stupider idiots...
...so far the universe won
bump

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 #22 on: January 26, 2006, 12:21:12 AM »
I have made a little change,
so it will not display from oldest to newest.
I think to change the order from ascending to descending is better,
so u see the latest comments always on the first site.
Yes, you are right, its better that way. Thanks. I've updated the original code too ;)
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 mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] Paging for comments
« Reply #23 on: January 26, 2006, 12:36:53 AM »
Yes, you are right, its better that way. Thanks. I've updated the original code too ;)

... mmm ... but not at the right place (new paging code) ...  :wink:
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) ...

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 #24 on: January 26, 2006, 02:39:46 AM »
ahaha, I'm an idiot :oops:
good save ;) thanks
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 insane

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Gallery
Re: [MOD] Paging for comments
« Reply #25 on: January 29, 2006, 07:35:58 PM »
hi, i've got a big problem, hope anyone is able to help me

first of all i made a test account in my gallery

www.p4ddy-online.de.vu/4images
name: test password: test

so that u can take a look on this problem.
when u click on a thumbnail u won't get the big version of the photo and the comments below - it looks like the page is just refreshing and do not link u to the next page (photo+comments)

how can i fix this problem? (we came to the solution that this problem has come by installing this mod http://www.4homepages.de/forum/index.php?topic=11371.0)

please help, other wise my gallery suxX -.- (anyway)

greetz (again sorry about my english..)

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 #26 on: January 29, 2006, 08:12:23 PM »
Here is a tip:
never install more the one mod at a time. Install only one, test the gallery in every possible ways, make sure it works properly, then continue with another mod. Acording to the problems you've had recently, you are installing everything at once and then test it and if something goes wrong you dont know where to look at, because you dont know what modifications could possible caused it.
So, my advice to you is start over and do it the proper way, with backups for each change you make.
I'm not going even bother to guess what possible could be wrong there.

Good luck.
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 insane

  • Newbie
  • *
  • Posts: 47
    • View Profile
    • Gallery
Re: [MOD] Paging for comments
« Reply #27 on: January 29, 2006, 08:15:47 PM »
ok my nightmare became reality ;P
can i reset everything without deleting my pics and comments?
(just keep the data folder there) does it work?

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 #28 on: January 29, 2006, 08:35:32 PM »
Yes, simply replacing all .php files with fresh ones should not break your gallery, yet, you will loose all the installed mods/changes you've made (obviously), but again, backup the current files before you replace them!

P.S. personaly I hate making backups, but, using UltraEdit and with help of this little trick let me do backups by pressing two keys :)
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 TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD] Paging for comments
« Reply #29 on: January 29, 2006, 08:41:46 PM »
Quote

P.S. personaly I hate making backups, but, using UltraEdit and with help of this little trick let me do backups by pressing two keys


In addition, there's always Winmerge (which is free) so you could compare and make the proper codings replacement without affecting your gallery. ;)