Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Omnirayf

Pages: [1]
1
Mods & Plugins (Releases & Support) / From what I understand....
« on: May 11, 2003, 11:59:37 AM »
...the mod will only bring up pics from categories that are designated public access. Hide your categories by making them private or admin only, and your pics will be hidden from the POTD as well.

If it works differently from that, let us know!

2
Mods & Plugins (Releases & Support) / None...
« on: May 11, 2003, 04:35:35 AM »
It's not based on any stats... The Photo of the Day in my database cold be the worst pic in there, but it would be displayed for 24 hours.

Now if I wanted a pic that was the Top Voted Pic of the database, I would have it that way... which is how the original mod was working for me.

Didn't want that.

3
Mods & Plugins (Releases & Support) / Semantics... OY!
« on: May 10, 2003, 04:43:21 AM »
For my use, Photo of the Day needs to be a randomly chosen pic to be displayed for 24 hours.

If I was going to chose a pic to display as the Top Voted Pic, Top Rated Pic, and the Pic with Most Hits or Downloads, and it not change every 24 hours, then I would keep the mod the way it originally was written.

If I wanted something that restarted every day according to hits, votes, and downloads, then I would make them separate pics, and write if/else functions into the code that would make them visible in that manner, then every 24 hours, they would reset to zero and become active as soon as someone started voting and hitting them. That would drive traffic, but from what I see, it would also encourage cheating because the prog would change pics to suit the one that gains ground. This could happen several times through the day, like a race. I don't need that, but others may be interested in it.

You can see what I have done with it one my site:
www.airbrushonline.com

4
Mods & Plugins (Releases & Support) / Mebbernind!
« on: May 09, 2003, 04:43:29 AM »
Mebbernind!

I think I have it figured out with the help of a couple of friends....

Code: [Select]

<?php

/**************************************************************************
*                                                                        *
*    4images - A Web Based Image Gallery Management System               *
*    ----------------------------------------------------------------    *
*                                                                        *
*             File&#58; potd.php                                           *
*        Copyright&#58; &#40;C&#41; 2002 Jan Sorgalla                                *
*            Email&#58; jan@4homepages.de                                    *
*              Web&#58; http&#58;//www.4homepages.de                             *
*    Scriptversion&#58; 1.0 for 4images 1.7                                *
*                                                                        *
*    Never released without support from&#58; Nicky &#40;http&#58;//www.nicky.net&#41; and SLL &#40;;   *
*                                                                        *
**************************************************************************
*                                                                        *
*    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
*    bedingungen &#40;http&#58;//www.4homepages.de/4images/lizenz.php&#41; für       *
*    weitere Informationen.                                              *
*    ---------------------------------------------------------------     *
*    This script is NOT freeware! Please read the Copyright Notice       *
*    &#40;http&#58;//www.4homepages.de/4images/lizenz_e.php&#41; for further         *
*    information.                                                        *
*                                                                        *
*************************************************************************/
//Based on the Photo of the Day mod by SLL and V@no
//additional tweaking by Omnirayf 9-5-2003

// PATH to your 4images Gallery / PFAD zu Ihrer 4images Gallerie
define&#40;'ROOT_PATH', './4images/'&#41;;
//include&#40;ROOT_PATH.'global.php'&#41;;
include&#40;ROOT_PATH.'config.php'&#41;;
include&#40;ROOT_PATH.'includes/db_mysql.php'&#41;;
include&#40;ROOT_PATH.'includes/constants.php'&#41;;

$site_db = new Db&#40;$db_host, $db_user, $db_password, $db_name&#41;;
function is_remote&#40;$file_name&#41; &#123;
  
return &#40;preg_match&#40;'#^https?\\&#58;\\/\\/[a-z0-9\-&#93;+\.&#40;[a-z0-9\-&#93;+\.&#41;?[a-z&#93;+#i', $file_name&#41;&#41; ? 1 &#58; 0;
&#125;
    
switch &#40;POTD_SELECT_MODE&#41; &#123;
   
case "by_rating"     &#58; $select_mode = "i.image_rating"; $select_mode2 = ", i.image_votes DESC"; break;
   
case "by_votes"      &#58; $select_mode = "i.image_votes"; $select_mode2 = ", i.image_name ASC"; break;
   
case "by_comments"   &#58; $select_mode = "i.image_comments"; $select_mode2 = ", i.image_name ASC"; break;
   
case "by_downloads"  &#58; $select_mode = "i.image_downloads"; $select_mode2 = ", i.image_name ASC"; break;
   
case "by_hits"                &#58; $select_mode = "i.image_hits"; $select_mode2 = ", i.image_name ASC"; break;
   
default                             &#58; $select_mode = "i.image_rating"; $select_mode2 = ", i.image_votes DESC"; break;
&#125;

$sql "SELECT COUNT&#40;*&#41; as total_images
        FROM "
.IMAGES_TABLE." a, ".CATEGORIES_TABLE." b 
        WHERE a.image_date<"
.mktime&#40;0, 0, 0, date&#40;"m"&#41;, date&#40;"d"&#41;, date&#40;"y"&#41;&#41;."
AND a.image_active=
        
AND a.cat_id b.cat_id 
        
AND b.auth_viewcat=".AUTH_ALL." 
        
AND b.auth_viewimage=".AUTH_ALL."
        ";
$row = $site_db->query_firstrow&#40;$sql&#41;;
$total_images = $row['total_images'&#93;;

mt_srand&#40;mktime&#40;0, 0, 0, date&#40;"
m"&#41;, date&#40;"d"&#41;, date&#40;"y"&#41;&#41;&#41;;
$number = &#40;$total_images > 1&#41; ? mt_rand&#40;0, $total_images - 1&#41; &#58; 0;

$sql = "SELECT a.image_ida.cat_ida.image_namea.image_activea.image_thumb_filea.image_comments 
        FROM 
".IMAGES_TABLE." a".CATEGORIES_TABLE." 
        WHERE a
.image_date<".mktime&#40;0, 0, 0, date&#40;"m"&#41;, date&#40;"d"&#41;, date&#40;"y"&#41;&#41;."
AND a.image_active=
        
AND a.cat_id b.cat_id 
        
AND b.auth_viewcat=".AUTH_ALL." 
        
AND b.auth_viewimage=".AUTH_ALL." 
        
LIMIT $number1";
$row = $site_db->query_firstrow&#40;$sql&#41;;
$image_id = $row['image_id'&#93;;
$cat_id = $row['cat_id'&#93;;
$image_name = $row['image_name'&#93;;
$image_comments = $row['image_comments'&#93;;
$thumb_src = &#40;is_remote&#40;$row['image_thumb_file'&#93;&#41;&#41; ? $row['image_thumb_file'&#93; &#58; ROOT_PATH.THUMB_DIR."/".$cat_id."/".$row['image_thumb_file'&#93;;

echo "
<table align=\"center\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td><center><a href=\"".ROOT_PATH."details.php?image_id=$image_id\"><img src=\"".$thumb_src."\" border=\"0\" alt=\"$image_name\"></a><br>\n";
echo 
"<b>$image_name</b><br>\n";
echo 
"Comments&#58; $image_comments</center></td></tr></table>\n";
?>


Copy this code to Notepad or Homesite or UltraEdit, rename to potd.php, toss it in your root directory, and then test it by direct url call. You should get any old pic in your 4images database, regardless of stats. Refresh, and the pic should remain the same. After midnight of the date you implement the mod, the pic should change to another random pic for another 24 hours.

This mod has been optimized for people who are using Postnuke or PhpNuke and want a Photo of the Day block. Just make a new php script block and put this into it:
Code: [Select]
include("http://www.your-own-site.com/potd.php");
?>
It works, believe me, especially if you are using Postnuke. Otherwise, if you are having problems with it, add the opening <?php tag.

Let me know if it works for you, as it works for me. This way I can go and slap my friends for their help. :wink:

5
Mods & Plugins (Releases & Support) / So....
« on: May 09, 2003, 02:44:15 AM »
How can we make a Photo of the Day mod that is essentially a database list of pics that get randomly chosen, displayed for 24 hours, and still display the hit/vote/rank data?

What we are talking about is essentially the Random Image mod, but with a 24 hour display timer on it that also keeps track of when it was last displayed and doesn't get displayed again until it runs through the entire database of pics.

Has this been done already?  Am I just missing something? As it is, the POTD mod will only display the top pic of a given category, and that is not a true POTD. :wink:  :D

Pages: [1]