• [Mod] Photo Of The Day 4 0 5 1
Currently:  

Author Topic: [Mod] Photo Of The Day  (Read 269819 times)

0 Members and 1 Guest are viewing this topic.

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] Photo Of The Day
« Reply #60 on: March 10, 2003, 10:27:40 PM »
Quote from: Amosnet
I need to know how i can show the POTD in an external php page.


you can combine it with "radom image" mod for this
http://www.4homepages.de/forum/viewtopic.php?t=1020

Offline Amosnet

  • Full Member
  • ***
  • Posts: 104
    • View Profile
    • Bilder verkaufen
[Mod] Photo Of The Day
« Reply #61 on: March 10, 2003, 10:29:14 PM »
and how can i combine it SLL?
I love 4images! http://www.fotos-verkaufen.de Fotos verkaufen online Tips und Tricks und http://www.fotoskaufen.de

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] Photo Of The Day
« Reply #62 on: March 10, 2003, 10:39:57 PM »
Well.. just use database queries from POTD in Random Images MOD.... or wait untill V@no post this MOD here  :wink:

Usualy it takes him 15 minutes - from MOD's request to his post here  :lol:

Offline Amosnet

  • Full Member
  • ***
  • Posts: 104
    • View Profile
    • Bilder verkaufen
[Mod] Photo Of The Day
« Reply #63 on: March 10, 2003, 10:43:53 PM »
V@no this is a MOD Request!
I love 4images! http://www.fotos-verkaufen.de Fotos verkaufen online Tips und Tricks und http://www.fotoskaufen.de

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
[Mod] Photo Of The Day
« Reply #64 on: March 11, 2003, 01:18:42 AM »
Quote from: SLL
you can combine it with "radom image" mod for this
http://www.4homepages.de/forum/viewtopic.php?t=1020

exactly!

Quote from: SLL
or wait untill V@no post this MOD here  :wink:

Usualy it takes him 15 minutes - from MOD's request to his post here  :lol:

o boy! 8O

so, try this code:
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.                                                        *
 *                                                                        *
 *************************************************************************/

// 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 i.image_id, i.cat_id, i.user_id, i.image_name, i.image_description, i.image_keywords, i.image_date, i.image_active, i.image_media_file, i.image_thumb_file, i.image_download_url, i.image_allow_comments, i.image_comments, i.image_downloads, i.image_votes, i.image_rating, i.image_hits, c.cat_name, u.user_name
        FROM "
.IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
        LEFT JOIN "
.USERS_TABLE." u ON &#40;u.user_id = i.user_id&#41;
        WHERE i.image_active=1
    AND i.cat_id = c.cat_id
      AND c.auth_viewcat="
.AUTH_ALL."
     AND c.auth_viewimage="
.AUTH_ALL."
        ORDER BY 
$select_mode DESC $select_mode2
         LIMIT 1"
;
$row $site_db->query_firstrow&#40;$sql&#41;;
$site_db->free_result&#40;&#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 "<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<br>\n";
?>


aslo, I'd suggest change from SLL original script switch (POTD_SELECT_MODE) { ... }to this:
Code: [Select]
switch (POTD_SELECT_MODE) {
   case "by_rating"     : $select_mode = "i.image_rating"; $select_mode2 = ", i.image_votes DESC"; break;
   case "by_votes"      : $select_mode = "i.image_votes"; $select_mode2 = ", i.image_name ASC"; break;
   case "by_comments"   : $select_mode = "i.image_comments"; $select_mode2 = ", i.image_name ASC"; break;
   case "by_downloads"  : $select_mode = "i.image_downloads"; $select_mode2 = ", i.image_name ASC"; break;
   case "by_hits" : $select_mode = "i.image_hits"; $select_mode2 = ", i.image_name ASC"; break;
   default : $select_mode = "i.image_rating"; $select_mode2 = ", i.image_votes DESC"; break;
}

and then,
Code: [Select]
       ORDER BY $select_mode DESC
to this:
Code: [Select]
       ORDER BY $select_mode DESC $select_mode2
this will solve little problem, when two images ( aaaa.jpg and bbbb.jpg ) have same rating (4.5), but bbbb.jpg has 10 votes, and aaaa.jpg has only 2 votes. so, with original script it will show aaaa.jpg instead of bbbb.jpg
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 SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] Photo Of The Day
« Reply #65 on: March 11, 2003, 08:29:47 AM »
Quote from: V@no
aslo, I'd suggest change from SLL original script...


Fixed... Thanks!  :wink:

Offline hiuyu23

  • Newbie
  • *
  • Posts: 18
    • View Profile
english vision?
« Reply #66 on: April 15, 2003, 04:46:48 PM »
Quote from: SLL
Additional languages for above mode:

Code: [Select]
#
#-----[ OPEN ]----------------------------------------
#

/lang/deutsch/main.php

#
#-----[ ADD ]------------------------------------------
#

//-----------------------------------------------------
//--- Photo Of The Day --------------------------------
//-----------------------------------------------------

$lang['potd_title'] = "Foto des Tages";
$lang['potd_type_rating'] = "nach Bewertung";
$lang['potd_type_votes'] = "nach Stimmen";
$lang['potd_type_comments'] = "nach Kommentar";
$lang['potd_type_downloads'] = "nach Downloads";

#
#-----[ OPEN ]----------------------------------------
#

/lang/russian/main.php

#
#-----[ ADD ]------------------------------------------
#

//-----------------------------------------------------
//--- Photo Of The Day --------------------------------
//-----------------------------------------------------

$lang['potd_title'] = "&#1060;&#1086;&#1090;&#1086;&#1075;&#1088;&#1072;&#1092;&#1080;&#1103; &#1076;&#1085;&#1103;";
$lang['potd_type_rating'] = "&#1042;&#1099;&#1073;&#1088;&#1072;&#1085;&#1086; &#1087;&#1086; &#1088;&#1077;&#1081;&#1090;&#1080;&#1085;&#1075;&#1091;";
$lang['potd_type_votes'] = "&#1042;&#1099;&#1073;&#1088;&#1072;&#1085;&#1086; &#1087;&#1086; &#1075;&#1086;&#1083;&#1086;&#1089;&#1086;&#1074;&#1072;&#1085;&#1080;&#1103;&#1084;";
$lang['potd_type_comments'] = "&#1042;&#1099;&#1073;&#1088;&#1072;&#1085;&#1086; &#1087;&#1086; &#1082;&#1086;&#1084;&#1084;&#1077;&#1085;&#1090;&#1072;&#1088;&#1080;&#1103;&#1084;";
$lang['potd_type_downloads'] = "&#1042;&#1099;&#1073;&#1088;&#1072;&#1085;&#1086; &#1087;&#1086; &#1079;&#1072;&#1075;&#1088;&#1091;&#1079;&#1082;&#1072;&#1084;";



Can you change to english?

Offline hiuyu23

  • Newbie
  • *
  • Posts: 18
    • View Profile
how to change the photo in the center?
« Reply #67 on: April 15, 2003, 05:32:58 PM »
how to change the photo in the center?

i mean "phopt of the day".

http://utenti.lycos.it/kueou/4images/index.php

Offline lakeside

  • Full Member
  • ***
  • Posts: 123
    • View Profile
[Mod] Photo Of The Day
« Reply #68 on: April 15, 2003, 08:21:18 PM »
Another Great Mod

Thanks, this is a great addition to 4images.  It worked without a hitch, other than I needed to fix the potd template so that the POTD name came below the image rather than start next to it.  But this is small and probably was only affected on my site.

Thanks much.

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
[Mod] Photo Of The Day
« Reply #69 on: April 15, 2003, 11:11:00 PM »
how can i add additional field to image details page,
but this field wouldn't show on the user_uploadform. Only admin would be available to edit this field at the admin panel.

This way administrators can write a little description saying why was that pic choosen as "photo of the day", and that text would appear on the details.html of that image, in a way that "photo of the day" become a serious award to the best works and users.

This field when edited would be permanently showed, and not just as long as that pic is selected as "photo of the day". Remembering all "photo of the day" is my idea.


sorry if this is confuse to understand
thanks in advance

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
Re: english vision?
« Reply #70 on: April 16, 2003, 08:19:15 AM »
Quote from: hiuyu23
Can you change to english?


no, i can't...  i don't speak english  :cry:

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] Photo Of The Day
« Reply #71 on: April 16, 2003, 08:26:10 AM »
Quote from: Bomba
Remembering all "photo of the day" is my idea.

well, well... even the name "photo of the day" shows you, that this is dynamic thing... from my point of view it doesn't make any sense to make it fixed. i'd suggest you to make separate category and move winners there manually.

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
[Mod] Photo Of The Day
« Reply #72 on: April 17, 2003, 03:11:59 PM »
but is this additional field hard to make?

i don't want to change pic's category because that would kill the identity that user has chosen to that pic. if user chooses a category to his pic, that should be the category where the pic should stay.

having that little "photo of the day note" on the choosen pics would be discretly and eficient, from my point of view.

thanks
hope that this could be done :)

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] Photo Of The Day
« Reply #73 on: April 17, 2003, 11:21:23 PM »
Quote from: Bomba
but is this additional field hard to make?

hard enough... this requires db modification, but i'd like to keep this mod simple

Offline batz

  • Newbie
  • *
  • Posts: 14
    • View Profile
POTD reset everyday
« Reply #74 on: May 08, 2003, 01:30:51 PM »
Hi,

This is really a great MOD.

There is any chance of a POTD reset to make it a really POTD?
My settings are by_votes but if an image in 2 days had more votes than an one day photo the first image is the POTD. Can you fix this SSL?

This is very important for me. I have run through the forum but i don't figure how to do this.

Thanks
Paulo