Author Topic: last commented image listing  (Read 88642 times)

0 Members and 1 Guest are viewing this topic.

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
last commented image listing
« Reply #15 on: February 14, 2003, 12:19:17 PM »
no, u add my code, above the code u showed  :roll:  :wink:
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 widgit1981

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
last commented image listing
« Reply #16 on: February 14, 2003, 12:21:03 PM »
What add "another" print out section ?

Thanks

Steve

Offline widgit1981

  • Jr. Member
  • **
  • Posts: 98
    • View Profile
last commented image listing
« Reply #17 on: February 14, 2003, 12:24:10 PM »
I tried that and it works YAY! Thank you now I have to implement it somehow into the site without it looking out of place  :P

Thanks

Steve
HighRez.com

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
last commented image listing
« Reply #18 on: February 17, 2003, 05:59:03 PM »
Quote from: widgit1981
That above code is already in my index.php.

what about your code in index.php?
just add the code I posted... :roll:
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 Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
last commented image listing
« Reply #19 on: February 21, 2003, 04:31:36 AM »
is it possible to show, when logged in, the last comments made to our images?

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
last commented image listing
« Reply #20 on: February 21, 2003, 05:01:53 AM »
Quote from: Bomba
is it possible to show, when logged in, the last comments made to our images?

do u mean, "last comments" for images logged in user uploaded?
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 Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
last commented image listing
« Reply #21 on: February 21, 2003, 06:00:40 PM »
i want the user to be warned when someone comments his images. this warning would appear when the user logs in and should disappear after he reads them.

is it possible?

Offline bag53

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
last commented image listing
« Reply #22 on: February 24, 2003, 04:52:39 AM »
Great Mod.

This should get moved to the Mods & Plugins (Publishing & Support) forum, and made sticky.

It might be a little easier to find  :wink: .

drhtm

  • Guest
last commented image listing
« Reply #23 on: February 24, 2003, 06:21:43 AM »
is there a way to add a small 40x40 thumbnail next to the comment list? just to give our users an idea what was commented on...

i'm sure its a minor modification , right?

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
last commented image listing
« Reply #24 on: February 24, 2003, 07:16:58 AM »
Quote from: drhtm
is there a way to add a small 40x40 thumbnail next to the comment list? just to give our users an idea what was commented on...

i'm sure its a minor modification , right?

yeah, good idea!  :D
here u go:
1. in the code, change:
Code: [Select]
$sql = "SELECT i.image_id, i.cat_id, i.image_name, c.cat_nameto this:
Code: [Select]
$sql = "SELECT i.image_id, i.cat_id, i.image_name, c.cat_name, i.image_media_file, i.image_thumb_file

2. this:
Code: [Select]
     $site_template->register_vars(array(
        "comment_image_name" => (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id)) ? $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>",

to this:
Code: [Select]
     if (!get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 0)) {
        $thumb_file = ICON_PATH."/".get_file_extension($image_row['image_media_file']).".gif";
      }else {
        $thumb_file = get_file_path($image_row['image_thumb_file'], "thumb", $image_row['cat_id'], 0, 1);
      }
      $thumb_info = @getimagesize($thumb_file);
      $width = $thumb_info[0];
      $height = $thumb_info[1];
      $dimension = 40;
      $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;
      }
      $site_template->register_vars(array(
      "comment_image_thumb" => (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id)) ? "<img src=\"".$thumb_file."\" width=\"".$new_width."\" height=\"".$new_height."\" onClick=\"alert('".$lang['members_only']."');\" border=\"".$config['image_border']."\">" : "<a href=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$comment_row[$i]['image_id'].((!empty($mode)) ? "&amp;mode=".$mode : ""))."\"><img src=\"".$thumb_file."\" width=\"".$new_width."\" height=\"".$new_height."\" border=\"".$config['image_border']."\"></a>",
        "comment_image_name" => (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id)) ? $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>",

now u can use in template this: {comment_image_thumb}



[EDITED]
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)

drhtm

  • Guest
last commented image listing
« Reply #25 on: February 24, 2003, 07:18:26 AM »
oh thanks... :oops:  :oops:

i have many more ideas...


i can share them if you like ;)

drhtm

  • Guest
last commented image listing
« Reply #26 on: February 24, 2003, 07:21:08 AM »
hmmm....

the 2nd step
Code: [Select]
$site_template->register_vars(array(

is found in seven different places on the orginal code.

can you be a little more specific...thanks

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
last commented image listing
« Reply #27 on: February 24, 2003, 07:28:09 AM »
ah, well, I was talking about my code only....
but here is more specific:
Code: [Select]
     $site_template->register_vars(array(
        "comment_image_name" => (!check_permission("auth_viewcat", $cat_id) || !check_permission("auth_viewimage", $cat_id)) ? $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>",
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 bag53

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
last commented image listing
« Reply #28 on: February 24, 2003, 09:41:44 AM »
Ok, I got everything working correctly. I am using this to display the latest comments in the left sidebar (underneath the random picture) and I got my comment_short_bit.html looking decent.

Here is the code if anyone's interested:
Code: [Select]
<table valign="top" width="140" border="0" cellspacing="0" cellpadding="1">
<td class="head1">
<table width="138" border="0" cellspacing="0" cellpadding="1">
<tr><td width="45%" align="center" class="row3">{comment_image_thumb}</td><td width="55%" align="center" class="row3">{comment_image_name}</td></tr>
<tr><td colspan="2" align="center" class="row3">{comment_cat_name}<P></td></tr>
<tr><td colspan="2" align="center" class="row3"><strong>{comment_headline}</strong></td></tr>
<tr><td colspan="2" align="center" class="row3">{comment_text}<p></td></tr>
<tr><td colspan="2" align="center" class="row3">Posted By: {comment_user_name}</td></tr>
<tr><td colspan="2" align="center" class="row3">User Rank: {comment_user_info}</td></tr>
<tr><td colspan="2" align="center" class="row3">Date: {comment_date}</td></tr>
</table>
</td>
<br>
</table>


I set the thumbnail to 60 pixels (instead of 40) and put this into home.html underneath the random picture table:
Code: [Select]
<table width="150" border="0" cellspacing="0" cellpadding="0">
  <tr><td class="head2" height="20" align="left"><img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />Latest Comments</td></tr>
  <tr><td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td></tr>
  <tr><td align="center" class="row1"><br />{comments_short}<br /><br>
  <tr><td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td></tr>
</table>

Offline mantra

  • Sr. Member
  • ****
  • Posts: 358
    • View Profile
    • DREAM WITH MANTRA
paging
« Reply #29 on: February 27, 2003, 01:22:42 AM »
What code to add if I want make paging after the limit comment is over.