Author Topic: Display all voted, commented etc.. images.  (Read 6011 times)

0 Members and 1 Guest are viewing this topic.

Offline uksoreeyes

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.myleeneklass.com
Display all voted, commented etc.. images.
« on: April 27, 2003, 04:06:11 AM »
I was wondering if its possible to have a page like the 'new images' page only that instead of displaying the new images, it will display all the images that have had a vote, or that have had a comment, or that have been downloaded, or display all images in the gallery. depending on what link the user clicks?

If you don't understand tell me and i'll try and explain a bit better

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
Display all voted, commented etc.. images.
« Reply #1 on: April 27, 2003, 04:17:15 AM »
Instead? or new images but sorted by votes/download/so on?
if u want it instead, will it be as "top" images?
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 uksoreeyes

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.myleeneklass.com
Display all voted, commented etc.. images.
« Reply #2 on: April 27, 2003, 04:26:21 AM »
No what I mean is when you click on the 'new images' link you are sent to: search.php?search_new_images=1 where all the new images of the gallery are displayed as thumbnails.

I would like a similar command available where I can add a link next to 'new images' lets say 'voted images' and when clicked you are sent to the search.php where it searches and displayes all the images in the gallery that have had a vote.

understand?  :D

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
Display all voted, commented etc.. images.
« Reply #3 on: April 27, 2003, 04:30:32 AM »
ah, I see now.
that's not a big deal to do as u want, but just to make sure that u know about a mod that let visitors sort images as they want to.
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 uksoreeyes

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.myleeneklass.com
Display all voted, commented etc.. images.
« Reply #4 on: April 27, 2003, 04:40:10 AM »
Yeah I've seen that mod and I was thinking of adding it to my site then decided I didnt really have the space to add it, so I skipped it. Maybe in the future when I get more images in the gallery I might add that.

But the reason I want this mod that displayes all images that have had a vote, or comment, or download is because My gallery has the more statistics mod installed which displays the following:

Quote
13 Total albums
162 Total images
67 Total votes
5659  Total hits
14 Total downloads
3 Total comments


and I thought it would be nice if the 'total votes' 'total downloads' and the 'total comments' when clicked displayed the relevant information. it would also be good for me to track votes and downloads and comments without having to log into the admin section all the time.

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
Display all voted, commented etc.. images.
« Reply #5 on: April 27, 2003, 06:02:48 AM »
ok, here u go :D:
open search.php
Find:
Code: [Select]
$search_id = array();
Add after:
Code: [Select]
if (isset($HTTP_POST_VARS['search_by']) || isset($HTTP_GET_VARS['search_by'])) {
  $search_by = (isset($HTTP_POST_VARS['search_by'])) ? $HTTP_POST_VARS['search_by'] : $HTTP_GET_VARS['search_by'];
  if ($search_by != "") {
 $search_by_check = array("votes", "downloads", "hits", "comments");
 if (in_array($search_by, $search_by_check)){
  $show_result = 1;
 $sql = "SELECT image_id
         FROM ".IMAGES_TABLE."
         WHERE image_".$search_by." > 0";
 $result = $site_db->query($sql);
 if ($result) {
   while ($row = $site_db->fetch_array($result)) {
     $search_id['image_ids'] .= (($search_id['image_ids'] != "") ? ", " : "").$row['image_id'];
   }
   $site_db->free_result($result);
 }
 }else{
  $search_by = "";
 }
  }
}
else {
  $search_by = "";
}


then, there is a little bug (atleast it didnt work right for me).
Find:
Code: [Select]
if (isset($HTTP_POST_VARS['search_new_images']) || isset($HTTP_GET_VARS['search_new_images'])) {
Replace with:
Code: [Select]
if (isset($HTTP_POST_VARS['search_new_images']) || isset($HTTP_GET_VARS['search_new_images']) && ($HTTP_POST_VARS['search_new_images']) != 0 || $HTTP_GET_VARS['search_new_images'] != 0) {
This "bug" was turning on "show new images only" on next page, even thought in the address bar it was set to 0.

next, find:
Code: [Select]
if ($search_new_images && $show_result == 1) {
  $search_id['search_new_images'] = 1;
}

Add after:
Code: [Select]
if ($search_by && $show_result == 1) {
  $search_id['search_by'] = $search_by;
}


Find next:
Code: [Select]
 if (!empty($sql_where_query)) {
Add before:
Code: [Select]
if (!empty($search_id['search_by'])) {
 $sql_where_query .= "AND i.image_".$search_id['search_by']." > 0";
}



now u have this options:
search.php?search_by=votes
search.php?search_by=downloads
search.php?search_by=comments
search.php?search_by=hits
yes, last one is kind of....:roll:

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 uksoreeyes

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.myleeneklass.com
Display all voted, commented etc.. images.
« Reply #6 on: April 28, 2003, 12:56:19 AM »
Thats perfect v@no, thank u very much  :D I wish I could do php as good as u.