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

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

0 Members and 1 Guest are viewing this topic.

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] Photo Of The Day
« on: January 11, 2003, 02:13:24 AM »
Quote
Photo Of The Day MOD for 4images - Image Gallery Management System.

Version:      1.2

Author:       Silly Little Lamer <sll@dalnet.ru>

Description:

This Mod shows so called "Photo Of The Day" on the first (and/or any other page) of your gallery. Depending on your settings, the first of the Top Images is selected by rating, number of votes, comments, downloads, hits and its thumbnail is shown as a "Photo Of The Day".

New in v.1.2

•   Random selection mode. (as always, bright idea by V@ano)


Installation Level:    Easy
Installation Time:      10 Minutes

Files To Edit:       4

   /includes/functions.php
   /includes/page_header.php
   /includes/constants.php
   /lang/english/main.php

[EDIT by V@no]
This mod is based on 4images v1.7 some parts of it might not work properly in newer 4images. If mod doesn't work properly for you, try these additional modifications
[/EDIT]

demo: http://faces.dalnet.ru/index.php?l=english
download: http://faces.dalnet.ru/files.php?l=english
« Last Edit: March 19, 2009, 03:59:09 PM by V@no »

Offline KSA

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
[Mod] Photo Of The Day
« Reply #1 on: January 11, 2003, 10:47:26 AM »
Thanks SLL

Offline sorestar

  • Newbie
  • *
  • Posts: 17
    • View Profile
[Mod] Photo Of The Day
« Reply #2 on: January 11, 2003, 05:42:25 PM »
Will this MOD work if there is already an interation between phpBB and 4images?

 :D

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
[Mod] Photo Of The Day
« Reply #3 on: January 11, 2003, 08:58:43 PM »
Quote from: sorestar
Will this MOD work if there is already an integration between phpBB and 4images?


Sorry, I can't check myself... When I've installed 4images, my phpBB database was full already, so I didn't try to integrate (not recommended by developers).

If the database part, related to 4images is not altered during integration (and I believe it's not), then this MOD should work fine. Anyway, it's simple enough, so it's shouldn't be a big deal for you to try  :wink:

Offline wrestlingwiredotnet

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • http://www.wrestlingwire.net
[Mod] Photo Of The Day
« Reply #4 on: January 12, 2003, 05:04:16 AM »
I got this error, does anyone know why?
error:

Parse error: parse error in /home/wwire/public_html/gallery/includes/functions.php on line 128

Fatal error: Call to undefined function: get_php_version() in /home/wwire/public_html/gallery/global.php on line 248


Thanks!!!

~Nate~
visit WWW.WRESTLINGWIRE.NET if your a wrestling fan!!!

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 #5 on: January 12, 2003, 06:42:59 AM »
When u edited /includes/functions.php file, u probably forgot put } at the end of script u added.
Quote
function get_potd_image($show_link = 1) {
    global $site_db, $site_template;

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;
}

$cat_id_sql = get_auth_cat_sql("auth_viewcat", "NOTIN");

    $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".get_user_table_field(", u.", "user_name")."
            FROM ".IMAGES_TABLE." i,  ".CATEGORIES_TABLE." c
            LEFT JOIN ".USERS_TABLE." u ON (".get_user_table_field("u.", "user_id")." = i.user_id)
            WHERE i.image_active = 1 AND i.cat_id NOT IN ($cat_id_sql) AND c.cat_id = i.cat_id
            ORDER BY $select_mode DESC
            LIMIT 1";

   $potd_image = $site_db->query_firstrow($sql);
   $site_db->free_result();
   $template = 'potd_image';
   show_image($potd_image, "", $show_link);
   $potd_image = $site_template->parse_template($template);
   return $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 SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
Re: nope
« Reply #6 on: January 12, 2003, 10:46:49 AM »
Quote from: wrestlingwiredotnet
I had that, I didnt forget it... anything else it could be?


It seems, you were posting the whole functions.php here? If so, then have a look at the very end of the file and compare it to the original -  approximately 130 lines are missing. The part of this file, related to the MOD looks OK, I can see no errors...

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
Re: hm...
« Reply #7 on: January 12, 2003, 04:51:44 PM »
Quote from: wrestlingwiredotnet
I dont know why, must of been my mistake but it didnt post the entire code, well here it is:


hmm... your functions.php doesn't work on my system also, but i can't find out why  :?

it's slightly different inside, than mine. drop me a privat msg here with your email, and i will send you my functions.php by return, probaly this will help

Offline wrestlingwiredotnet

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • http://www.wrestlingwire.net
Hey
« Reply #8 on: January 12, 2003, 06:09:27 PM »
I sent you a Private Message, did u get it???

If not, my email is Nate_Wheeler@MSN.com
visit WWW.WRESTLINGWIRE.NET if your a wrestling fan!!!

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 #9 on: January 12, 2003, 10:55:51 PM »
make sure u dont have ANYTHING (spaces, returnsigns...so on) after " ?> " at the end of php files.
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 Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Re: what the heck...
« Reply #10 on: January 13, 2003, 04:46:51 AM »
Quote from: wrestlingwiredotnet
now I get this big long list of errors (with the admin login under it):


Warning: Cannot add header information - headers already sent by (output started at /home/wwire/public_html/gallery/lang/english/main.php:392) in /home/wwire/public_html/gallery/includes/sessions.php on line 79

This is covered in the FAQ forum

Offline wrestlingwiredotnet

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • http://www.wrestlingwire.net
AHHHHHHHHHHH
« Reply #11 on: January 13, 2003, 04:59:41 AM »
OK I tried what you and v@no said, I deleted everything AFTER and any spaces return lines or anything before it also, and it didnt work.

Im going out of my mind, why isnt it working?!?!? PLease HELP!
visit WWW.WRESTLINGWIRE.NET if your a wrestling fan!!!

Offline SLL

  • Hero Member
  • *****
  • Posts: 585
    • View Profile
Re: AHHHHHHHHHHH
« Reply #12 on: January 13, 2003, 09:50:12 AM »
Quote from: wrestlingwiredotnet
Im going out of my mind, why isnt it working?!?!? PLease HELP!


Sorry, Nate, I can't see from here what's going on at your system. I hardly believe this small MOD destroyed you gallery, if you followed installation instructions, of course.

I'd suggest you download the 4images from this site once again, drop the database and make the fresh installation. When you see the gallery running without any error message, the apply this MOD again.

I hope this will help...

Offline wrestlingwiredotnet

  • Newbie
  • *
  • Posts: 22
    • View Profile
    • http://www.wrestlingwire.net
Hey
« Reply #13 on: January 15, 2003, 12:42:28 AM »
Just wanted to let you know I got it working, and I was wondering how I would make it on every page? Would I put it on each html template I want it on? Thanks!


~Nate~
visit WWW.WRESTLINGWIRE.NET if your a wrestling fan!!!

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 #14 on: January 15, 2003, 03:31:04 AM »
Yes, because its only displays when add {potd_image} in the template.
so, u'll need edit each "MAIN" template like categories.html, home.html, details.html, lightbox.html and so on.
it's easy determ witch template is "main" - it has {header} tag on the top.
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)