• [MOD] All Comments (Alle Kommentare) V.1.6 5 0 5 1
Currently:  

Author Topic: [MOD] All Comments (Alle Kommentare) V.1.6  (Read 336938 times)

0 Members and 1 Guest are viewing this topic.

Offline zoolmann

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • www.fotoseznam.cz
Re: [MOD] All Comments (Alle Kommentare) V.1.0
« Reply #45 on: January 20, 2006, 10:34:15 PM »
It's not functional (it is no go)  :cry:
Sorry for my bad English :-)
----------------------------------

- Today's visit rate

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] All Comments (Alle Kommentare) V.1.0
« Reply #46 on: January 21, 2006, 01:53:17 AM »
In comments_all.php find:
Code: [Select]
      $sql = "SELECT i.image_id, i.cat_id, i.image_name, c.cat_name, i.image_media_file, i.image_thumb_fileReplace it with:
Code: [Select]
      $sql = "SELECT i.image_id, i.cat_id, i.image_name, c.cat_name, i.image_media_file, i.image_thumb_file".get_user_table_field(", u.", "user_id").get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name")."
Then find:
Code: [Select]
        "admin_links" => $admin_links,Insert above:
Code: [Select]
        "image_user_name" => ($image_row[$user_table_fields['user_level']] != GUEST) ? "<a href=\"".$site_sess->url(ROOT_PATH."member.php?action=showprofile&amp;user_id=".$image_row[$user_table_fields['user_id']])."\">".htmlspecialchars($image_row[$user_table_fields['user_name']])."</a>" : $lang['userlevel_guest'],Then in template you can use {image_user_name}
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] All Comments (Alle Kommentare) V.1.0
« Reply #47 on: January 21, 2006, 03:01:53 AM »
@ V@no

... thanks for this nice additive ...  :D
... I will integrate it into the MOD ...

... little mistake ... this ..
Quote
... $user_table_fields['user_id']]."\">".htmlspecialchars($image_row[ ...
should be
Quote
... $user_table_fields['user_id']])."\">".htmlspecialchars($image_row[ ...

mawenzi
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 TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD] All Comments (Alle Kommentare) V.1.0
« Reply #48 on: January 21, 2006, 03:13:36 AM »
In the mean time, I believe I know why this string $user_table_fields is being used now. ;)

However, I wonder if this one can be applied over user additional fields or only on user core fields ...

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] All Comments (Alle Kommentare) V.1.1
« Reply #49 on: January 21, 2006, 04:32:04 AM »
... I will integrate it into the MOD ...
Oh, ok :)
And while you at it, I have a suggestion, not really important, but in this query:
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_date".get_user_table_field(", u.", "user_level").get_user_table_field(", u.", "user_name").get_user_table_field(", u.", "user_lastaction").get_user_table_field(", u.", "user_comments").$additional_sql."
          FROM ".COMMENTS_TABLE." c
          LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = c.user_id)
          LEFT JOIN ".IMAGES_TABLE." i ON (i.image_id = c.image_id) ".$add_where."
          ORDER BY c.comment_date DESC
          LIMIT $offset, $commentperpage";
actualy don't need include USERS_TABLE table, because later on you are using
Code: [Select]
$user_row_comment = get_user_info($comment_user_id);which fetch all needed information about the user of the comment ;)
so, this query should do just fine:
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_date
          FROM ".COMMENTS_TABLE." c
          LEFT JOIN ".IMAGES_TABLE." i ON (i.image_id = c.image_id) ".$add_where."
          ORDER BY c.comment_date DESC
          LIMIT $offset, $commentperpage";

Also, since no USER_TABLE included in the query this block of code is no needed:
Code: [Select]
    $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]))."'";
        }
      }


And now a little bug fix ;)
this code
Code: [Select]
  if (isset($HTTP_GET_VARS['user_id']) and $HTTP_GET_VARS['user_id'] != ""){
    $add_where = "WHERE c.user_id IN (".$user_id.") AND i.cat_id NOT IN ($cat_id_sql)";
  }else{
    $add_where = "WHERE i.cat_id NOT IN ($cat_id_sql)";
  }
should be placed below
Code: [Select]
  $cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN").", ".get_auth_cat_sql("auth_readcomment", "NOTIN").", ".get_auth_cat_sql("auth_viewimage", "NOTIN");Otherwise when you open comments page for a specific user, you will get wrong total comments number and pages count ;)
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 zoolmann

  • Newbie
  • *
  • Posts: 14
    • View Profile
    • www.fotoseznam.cz
Re: [MOD] All Comments (Alle Kommentare) V.1.1
« Reply #50 on: January 21, 2006, 09:34:46 AM »
S . U . P . E . R .

Thanks, its very nice MOD  :D

Sorry for my bad English :-)
----------------------------------

- Today's visit rate

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] All Comments (Alle Kommentare) V.1.1
« Reply #51 on: January 21, 2006, 01:55:46 PM »
@ V@no

... thanks for your additional input for tuning of this MOD ...
... I have updated the MOD description ... now it is Version 1.1 ...  :wink:

mawenzi
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 tradenet

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: [MOD] All Comments (Alle Kommentare) V.1.1
« Reply #52 on: January 22, 2006, 06:03:40 PM »
I've set this MOD up with 4images v1.7
However, I'm getting a:
Quote
Warning: Division by zero in /home/4images/comments_all.php on line 146

Warning: Division by zero in /home/4images/comments_all.php on line 151

When I access the page. Any ideas?

Nice MOD BTW.
Thanks

Offline TheOracle

  • Hero Member
  • *****
  • Posts: 875
    • View Profile
Re: [MOD] All Comments (Alle Kommentare) V.1.1
« Reply #53 on: January 22, 2006, 06:24:55 PM »
@tradenet:

Try this :

Quote

$ratio = $width / $height;
      if ($ratio > 1) {
        $new_width = $dimension;
        $new_height = floor(($dimension/$width) * $height);
      }else {
        $new_width = floor(($dimension/$height) * $width);
        $new_height = $dimension;
      }


replace with :

Code: [Select]

$ratio = $width / $height;
      if ($ratio > 1) {
        $new_width = $dimension;
        $new_height = floor(($dimension/$width) * $height);
      }else {
        $new_width = floor(($dimension/$height) * $width);
        $new_height = $dimension;
        $ratio = 0;
      }


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] All Comments (Alle Kommentare) V.1.1
« Reply #54 on: January 22, 2006, 06:53:25 PM »
Warning: Division by zero in /home/4images/comments_all.php on line 146

Warning: Division by zero in /home/4images/comments_all.php on line 151
Replace
Code: [Select]
      $width = $thumb_info[0];
      $height = $thumb_info[1];
With:
Code: [Select]
      $width = ($thumb_info[0]) ? $thumb_info[0] : 400;
      $height = ($thumb_info[1]) ? $thumb_info[1] : 400;


Code: [Select]

$ratio = $width / $height;
 if ($ratio > 1) {
 $new_width = $dimension;
 $new_height = floor(($dimension/$width) * $height);
 }else {
 $new_width = floor(($dimension/$height) * $width);
 $new_height = $dimension;
 $ratio = 0;
 }

HUH? Would you be so kind an explain what the hell that supposed to change? Jeez...Stop embarrassing yourself...
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 tradenet

  • Jr. Member
  • **
  • Posts: 53
    • View Profile
Re: [MOD] All Comments (Alle Kommentare) V.1.1
« Reply #55 on: January 22, 2006, 07:13:40 PM »
 :lol: TheOracle  :P

Thanks V@no. That worked.

Offline JensF

  • Addicted member
  • ******
  • Posts: 1.028
    • View Profile
    • http://www.terraristik-galerie.de
Re: [MOD] All Comments (Alle Kommentare) V.1.1
« Reply #56 on: January 26, 2006, 06:08:19 PM »
Hi Detlef,

habe folgendes kleines Problem festgestellt :)

Wenn man als Admin nen Kommentar schreibt erscheint man in der Liste als Member.....Ist mir gerade so aufgefallen.
Mit freundlichem Gruß
Jens Funk



-> Sorry for my bad English <-

Offline Eschy5

  • Newbie
  • *
  • Posts: 36
    • View Profile
    • Eschys Homepage
Re: [MOD] All Comments (Alle Kommentare) V.1.1
« Reply #57 on: January 27, 2006, 10:51:01 PM »
Ich habe den Hack bei www.verkehrsgigant.info auch eingebaut. Mir gefällt er ganz ganz, aber am Style habert´s noch etwas. Wie bekomme ich das richtig hin?

http://www.verkehrsgigant.info/comments_all.php

Offline mawenzi

  • Moderator
  • 4images Guru
  • *****
  • Posts: 4.500
    • View Profile
Re: [MOD] All Comments (Alle Kommentare) V.1.1
« Reply #58 on: January 27, 2006, 11:04:52 PM »
hallo Eschy5,
... das ist dann eigentlich "nur" html-coding ...
... hast du die comments_all.html entsprechend 2.Schritt aus deiner error.html erstellt ... ?
... ansonsten ... probier es nochmals ... ggf. hast etwas zu viel von den Tabellen weggelöscht ...
... sei vorsichtig mit den Table-Tags ... <table><tr><td> ... </td></tr></table> ...
... die Schriftfarbe von "head2" in style.css solltest du noch ändern ...

mawenzi
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 Eschy5

  • Newbie
  • *
  • Posts: 36
    • View Profile
    • Eschys Homepage
Re: [MOD] All Comments (Alle Kommentare) V.1.1
« Reply #59 on: January 27, 2006, 11:18:42 PM »
Ich hab´s nochmal probiert, war anscheinend mein Fehler.  :oops:
Aber der Tabellenkopf müsste eigentlich, wenn es den gleichen Style benutzt, hellblau sein. Ist er aber nicht, er ist dunkelblau.