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

Author Topic: [Mod] Photo Of The Day  (Read 269610 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
Re: new choice?
« Reply #30 on: February 09, 2003, 04:39:04 PM »
Quote from: John_Doe
Hello!
Thank you for this mod!

Is there a way to include the choice "by hits", so the picture with the most hits will appear?

Thanks!

yes, its.
in the code u added in /includes/functions.php add this chose:
Code: [Select]
 case "by_hits" : $select_mode = "i.image_hits"; $select_mode2 = ", i.image_name ASC"; break;

and in /includes/constants.php change to this:
Code: [Select]
define('POTD_SELECT_MODE', 'by_hits');


P.S. just a thought.
in this case u probably will have same picture be showed all the time, because visitors will give more "credit" to that picture, u know what I mean? ;)
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 John_Doe

  • Pre-Newbie
  • Posts: 2
    • View Profile
[Mod] Photo Of The Day
« Reply #31 on: February 09, 2003, 04:42:14 PM »
Thanks for this fast answer  8O

Offline bag53

  • Jr. Member
  • **
  • Posts: 62
    • View Profile
[Mod] Photo Of The Day
« Reply #32 on: February 16, 2003, 09:18:44 AM »
How do I keep the "404 File Not Found" icon from appearing when I am logged off?

I have 4images set to not allow guests viewing rights at all. Only registered users can view pictures. When I am at the site as a guest, I get the "404 File Not Found" icon in the spot where the POTD is supposed to be.

I would rather it be like the Random Image, and not show anything to when I am not logged in.

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 #33 on: February 16, 2003, 03:41:24 PM »
Quote from: bag53
How do I keep the "404 File Not Found" icon from appearing when I am logged off?

I have 4images set to not allow guests viewing rights at all. Only registered users can view pictures. When I am at the site as a guest, I get the "404 File Not Found" icon in the spot where the POTD is supposed to be.

I would rather it be like the Random Image, and not show anything to when I am not logged in.


In the code that u inserted in /includes/page_header.php at the very top add this:
Code: [Select]
if ($user_info['user_level'] != GUEST) {And at the end of the code add }
So, it would looks like this:
Quote
if ($user_info['user_level'] != GUEST) {
$potd_image = (defined("SHOW_POTD_IMAGE") && SHOW_POTD_IMAGE == 0) ? "" : get_potd_image();
$site_template->register_vars("potd_image", $potd_image);
$site_template->register_vars(array("lang_potd_title" => $lang['potd_title']));
switch (POTD_SELECT_MODE) {
   case "by_rating"   : $site_template->register_vars(array("lang_potd_type" => $lang['potd_type_rating'])); break;
   case "by_votes"      : $site_template->register_vars(array("lang_potd_type" => $lang['potd_type_votes'])); break;
   case "by_comments"   : $site_template->register_vars(array("lang_potd_type" => $lang['potd_type_comments'])); break;
   case "by_downloads"   : $site_template->register_vars(array("lang_potd_type" => $lang['potd_type_downloads'])); break;
   case "by_hits"   : $site_template->register_vars(array("lang_potd_type" => $lang['potd_type_hits'])); break;
}
unset($potd_image);
}
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
[Mod] Photo Of The Day
« Reply #34 on: February 17, 2003, 06:56:21 AM »
Thanks! Great mod!

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
lightbox on the choices
« Reply #35 on: February 20, 2003, 12:08:53 AM »
is it possible to make the photo of the day first choice the number of favorites (lightbox) ?

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
Re: lightbox on the choices
« Reply #36 on: February 20, 2003, 09:01:54 AM »
Quote from: Bomba
is it possible to make the photo of the day first choice the number of favorites (lightbox) ?

nope. how do you know, who added particular photo to their favorites?

Offline Bomba

  • Full Member
  • ***
  • Posts: 202
    • View Profile
time limit
« Reply #37 on: February 20, 2003, 02:54:41 PM »
hmmm ok i just thought that was the best choice to mark favs
but ok

now i wanna ask something else, i've chosen the option "by_rating" but can i make the photo of the day selected appear only when she's marked as new. so i won't take the risk of featuring always the same pic.
or is there a way that in case of a similar rating between pics the 2nd choice going to "by_votes" ?

thanks

Offline Jasondavis

  • Full Member
  • ***
  • Posts: 157
    • View Profile
help
« Reply #38 on: February 22, 2003, 12:23:36 AM »
I dont think what i want is possible but I'll ask, Would there be a way to have it be by top hits of the day? like so it really would be the Pic of the day, otherwise In my galery, it will probably be Pic of the Daya EVERYDAY!

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] Photo Of The Day
« Reply #39 on: February 22, 2003, 01:08:59 AM »
yeah... why not?
Code: [Select]
switch (POTD_SELECT_MODE) {
case "by_rating" : $select_mode = "i.image_rating"; break;
case "by_votes" : $select_mode = "i.image_votes"; break;
case "by_comments" : $select_mode = "i.image_comments"; break;
case "by_downloads" : $select_mode = "i.image_downloads"; break;
case "by_hits" : $select_mode = "i.image_hits"; break;
}

don't forget to add lang strings...

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: help
« Reply #40 on: February 22, 2003, 01:27:10 AM »
Quote from: Jasondavis
I dont think what i want is possible but I'll ask, Would there be a way to have it be by top hits of the day? like so it really would be the Pic of the day, otherwise In my galery, it will probably be Pic of the Daya EVERYDAY!

yes, u are right, it will be EVERYDAY hits.
4images doesnt log time of each hit, it just add to the total of the image hits.
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
[Mod] Photo Of The Day
« Reply #41 on: February 22, 2003, 04:00:16 AM »
and beside hits, is there any way that only shows the pic of the day for one day or as long as she's marked as "new"

that would be great
thanks

Offline Lord Nite

  • Newbie
  • *
  • Posts: 43
    • View Profile
[Mod] Photo Of The Day
« Reply #42 on: February 22, 2003, 04:22:06 AM »
Quote from: SLL
yeah... why not?
Code: [Select]
switch (POTD_SELECT_MODE) {
case "by_rating" : $select_mode = "i.image_rating"; break;
case "by_votes" : $select_mode = "i.image_votes"; break;
case "by_comments" : $select_mode = "i.image_comments"; break;
case "by_downloads" : $select_mode = "i.image_downloads"; break;
case "by_hits" : $select_mode = "i.image_hits"; break;
}

don't forget to add lang strings...


Don't forget to add the
Code: [Select]
case "by_hits"      : $site_template->register_vars(array("lang_potd_type" => $lang['potd_type_hits'])); break; to the includes/page_header.php in order for it to actually show the "selected by hits" under the pic.

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 #43 on: February 22, 2003, 04:31:37 AM »
Quote from: Bomba
and beside hits, is there any way that only shows the pic of the day for one day or as long as she's marked as "new"

that would be great
thanks

as I already said, 4images doesnt log time of each hit/rating/vote/ and so on, it just add to the total of the image hit/rating/vote/ and so on.
and if u make it show only new POTD, then after "new" status is "expired" (picture become old) u'll get "404" icon - picture not found.
if u still want it his way, then try replace:
Code: [Select]
           WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_idwith this:
Code: [Select]
           WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id AND i.image_date >= ".(time() - 60 * 60 * 24 * $config['new_cutoff'])."
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 Lord Nite

  • Newbie
  • *
  • Posts: 43
    • View Profile
[Mod] Photo Of The Day
« Reply #44 on: February 22, 2003, 04:55:17 AM »
I've tried and tried, but can't figure out how to make the POTD appear on the main category and not just the subcategories.

Any help?

I've added the {potd_image} after the {endif random_cat_image} and it will only show up on the categories under the main category.

http://gallery.nitetek.com/categories.php?cat_id=6 <-main category
http://gallery.nitetek.com/categories.php?cat_id=7 <-sub category