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

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

0 Members and 1 Guest are viewing this topic.

Offline justintjacob

  • Pre-Newbie
  • Posts: 5
    • View Profile
Re: [Mod] Photo Of The Day
« Reply #225 on: May 27, 2010, 02:31:31 PM »
after installing picture of the day i got error

DB Error: Bad SQL Query: 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 4images_images i, 4images_categories c LEFT JOIN 4images_users u ON (u.user_id = i.user_id) WHERE i.image_active = 1 AND i.cat_id NOT IN (0) AND c.cat_id = i.cat_id ORDER BY i.image_votes DESC LIMIT 1
Unknown column 'i.user_id' in 'on clause'

and a "File not found"error message t the point of the image

Please Help Me

Offline diehard

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: [Mod] Photo Of The Day
« Reply #226 on: July 29, 2010, 10:43:57 AM »
Hi all.
This is my sql query in a "photo of the day" by  postcards  sended since beginning of the day




Code: [Select]
$timestamp = strtotime(date("d-m-Y"));
$sql = "SELECT c.image_id, COUNT(c.image_id ) AS NumOccurrences, c.postcard_date, 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, d.cat_name
FROM (".POSTCARDS_TABLE." AS c)
LEFT JOIN (".IMAGES_TABLE." AS i, ".CATEGORIES_TABLE." d) ON ( c.image_id = i.image_id )
WHERE (c.postcard_date > ".$timestamp.")
GROUP BY c.image_id
HAVING (COUNT( c.image_id ) >1)
ORDER BY NumOccurrences DESC
LIMIT 1";


Offline zakaria666

  • Full Member
  • ***
  • Posts: 211
    • View Profile
Re: [Mod] Photo Of The Day
« Reply #227 on: August 13, 2010, 06:05:17 PM »
Hello,

This mod is great but i have noticed that when i refresh the page it will say "selected by votes' then if i rrefresh again it will say 'select by comment' or votes or hits, but some of them i have no done, so for example i have not put any comments on an comment but it will say selected by comments which this is not true, is there a way to tweak this so that correct information is shown for why the photo of the day is actually the photo of the day..

Thank u to anyone who help  me.

Offline milanNN

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • http://www.planesphotos.net
Re: [Mod] Photo Of The Day
« Reply #228 on: January 09, 2011, 04:19:38 PM »
Hi!
..
How to show TOP 3 images by 'rating'?

Code: [Select]
$sql = "SELECT DISTINCT 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 i.image_votes DESC
           LIMIT 3

mfg Andi
I've chaneged this code but i've got error:
Parse error: syntax error, unexpected '"' in C:\planesphotos.local\www\includes\functions.php on line 711


Rembrandt

  • Guest
Re: [Mod] Photo Of The Day
« Reply #229 on: January 09, 2011, 04:54:54 PM »
....I've chaneged this code but i've got error:
.
I think they have deleted  ";
replace:
LIMIT 3 ";
 

Offline milanNN

  • Newbie
  • *
  • Posts: 40
    • View Profile
    • http://www.planesphotos.net
Re: [Mod] Photo Of The Day
« Reply #230 on: January 09, 2011, 05:54:58 PM »
....I've chaneged this code but i've got error:
.
I think they have deleted  ";
replace:
LIMIT 3 ";
 
Thanks but i see one image only.
And i don't want to show photos selected by downloads.
How to do it?
« Last Edit: January 09, 2011, 08:33:05 PM by milanNN »

Offline SweD

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: [Mod] Photo Of The Day
« Reply #231 on: October 18, 2011, 01:52:33 PM »
Hi.
update my file.
Don't work site
Empty index page

Version 1.7.10


WORK!
« Last Edit: October 18, 2011, 02:49:51 PM by SweD »

Offline whwsammler

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
    • Winterhilfswerk und andere Fotogalerien
Re: [Mod] Photo Of The Day
« Reply #232 on: December 16, 2011, 01:34:58 PM »
Ich habe den MOD nach einigen keinen Schwierigkeiten eingebaut bekommen.
Mir fehlt nur noch eine Info zu meinem Glück. Welche Änderung muss ich vornehmen, damit die Überschrift "Bild des Tages" an der markierten Stelle des Anhangs erscheint?
Vielen Dank im Voraus

Gruß
Mathias
Anonymous Sympathisant

Rembrandt

  • Guest
Re: [Mod] Photo Of The Day
« Reply #233 on: December 16, 2011, 03:31:25 PM »
Hi!
wenn du den code in der "includes/page_header.php" und "lang/main.php" eingebaut hast, sollte das funktionieren.

mfg Andi

Offline whwsammler

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
    • Winterhilfswerk und andere Fotogalerien
Re: [Mod] Photo Of The Day
« Reply #234 on: December 16, 2011, 06:38:44 PM »
Sorry ich bin da ein absoluter noob. Welchen Code soll ich denn einbauen?
Anonymous Sympathisant

Rembrandt

  • Guest
Re: [Mod] Photo Of The Day
« Reply #235 on: December 16, 2011, 06:40:57 PM »
.. Welchen Code soll ich denn einbauen?

na den aus den mod hier, eben ob du die änderungen in der "includes/page_header.php" und "lang/main.php" vorgenommen hast.

Offline whwsammler

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
    • Winterhilfswerk und andere Fotogalerien
Re: [Mod] Photo Of The Day
« Reply #236 on: December 16, 2011, 07:09:54 PM »
Habe alles noch mal kontrolliert. Code ist gem. Installationsanweisung eingebaut. Scheint ja auch funktionieren, bis auf die fehlende Überschrift "Foto des Tages"
Anonymous Sympathisant

Rembrandt

  • Guest
Re: [Mod] Photo Of The Day
« Reply #237 on: December 16, 2011, 07:15:07 PM »
hm.. gibts eigentlich nicht mit
Code: [Select]
{lang_potd_title}sollte dir der Titel in der html Datei angezeigt werden

Offline whwsammler

  • Jr. Member
  • **
  • Posts: 57
    • View Profile
    • Winterhilfswerk und andere Fotogalerien
Re: [Mod] Photo Of The Day
« Reply #238 on: December 16, 2011, 08:18:46 PM »
Hmmmm never mind my previous suggestion...

The mod was built on 4images v1.7 since then the template engine was changed, and now the registering template tags must be done before parsing the template - and that what causing the problem.

What you need to do is replace in includes/page_header.php:
//-----------------------------------------------------
//--- Photo Of The Day --------------------------------
//-----------------------------------------------------

$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']));
$site_template->register_vars(array("lang_potd_type" => $lang['potd_type_'.ereg_replace ("i.image_"""$select_mode)]));
unset(
$potd_image);

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


With this:
//-----------------------------------------------------
//--- Photo Of The Day --------------------------------
//-----------------------------------------------------

$site_template->register_vars("potd_image", (defined("SHOW_POTD_IMAGE") && SHOW_POTD_IMAGE == 0) ? "" get_potd_image());

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



Then in includes/functions.php replace
//-----------------------------------------------------
//--- Photo Of The Day --------------------------------
//-----------------------------------------------------

function get_potd_image() {
    global 
$site_db$site_template$select_mode;

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

switch (
POTD_SELECT_MODE) {
	
case 
"rating"
	
	
:
	
$select_mode "i.image_rating"; break;
	
case 
"votes"
	
	
:
	
$select_mode "i.image_votes"; break;
	
case 
"comments"
	
:
	
$select_mode "i.image_comments"; break;
	
case 
"downloads"
	
:
	
$select_mode "i.image_downloads"; break;
	
case 
"hits"
	
	
:
	
$select_mode "i.image_hits"; break;
	
case 
"random"
	
	
:
	
$selection = array('rating''votes''hits''comments''downloads');
	
	
	
	
	
	
	
mt_srand((double) microtime() * 1000000);
	
	
	
	
	
	
	
$select_mode 'i.image_'.$selection[mt_rand(0, (count($selection)-1))];
	
	
	
	
	
	
	
break;
}

    
$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""1);
	
$potd_image $site_template->parse_template($template);
	
return 
$potd_image;
}

//-----------------------------------------------------


With this:
//-----------------------------------------------------
//--- Photo Of The Day --------------------------------
//-----------------------------------------------------

function get_potd_image($selection false)
{
  global 
$site_db$site_template$lang;

  if (
$selection === false)
    
$selection POTD_SELECT_MODE;

  
$selection strtolower($selection);
  
$selection_array = array('rating''votes''hits''comments''downloads');
  if (
$selection != "random" && !in_array($selection$selection_array))
    
$selection "rating";

  switch (
$selection)
  {
    default       : 
$select_mode "i.image_".$selection; break;
    case 
"random" mt_srand((double) microtime() * 1000000);
                    
$selection $selection_array[mt_rand(0, (count($selection_array)-1))];
                    
$select_mode 'i.image_'.$selection;
             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";
  if (!(
$potd_image $site_db->query_firstrow($sql)))
    return;

  
show_image($potd_image""1);
  
$site_template->register_vars(array(
    
"lang_potd_title" => $lang['potd_title'],
    
"lang_potd_type" => $lang['potd_type_'.$selection],
  ));
  
$potd_image $site_template->parse_template('potd_image');
  return 
$potd_image;
}

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



Wer lesen kann ist klar im Vorteil. Habe den verkehrten Code eingebaut. Habe es nun gem. o. a Eintrag geändert und was soll ich sagen es funzt
Nun ist der Text Bild des Tages allerdings in der Mitte. Wäre schöner wenn der Text aber rechtsbündig stehen würde. Was ist denn nun zu ändern?
Anonymous Sympathisant

Rembrandt

  • Guest
Re: [Mod] Photo Of The Day
« Reply #239 on: December 16, 2011, 09:04:59 PM »
suche in der podt_image.html, "center" und ersetze es mit "left".

mfg Andi