Author Topic: Picture of the month  (Read 151603 times)

0 Members and 1 Guest are viewing this topic.

Offline HorrorCrafT

  • Full Member
  • ***
  • Posts: 106
    • View Profile
    • HYPOfun online
Re: Picture of the month
« Reply #105 on: September 06, 2006, 07:29:15 PM »
thanks for this hint V@no!

Loda, dein tipp war auch klasse denn jetzt funktioniert's!!!!! :D :D :D werd jetzt noch schauen ob ich die überschrift (z.b. "bild des monats august") noch ohne hilfe hinbekomme, dann bin ich wunschlos glücklich :D

thanks for great job Loda and V@no!

EDIT: ich bin so schlecht ... Loda, falls du noch einen tipp hast wie ich das datum in die index.php bekomme, dann kannst das gerne posten, ist aber nicht mehr so wichtig - nice to have wie man so schön sagt :D
« Last Edit: September 06, 2006, 08:22:43 PM by HorrorCrafT »

Offline Stoleti

  • Hero Member
  • *****
  • Posts: 574
    • View Profile
Re: Picture of the month
« Reply #106 on: September 06, 2006, 09:51:40 PM »
1) please use BBCode when quote something
2) and on line 216 in index.php is...it should be the obvious first thing one should look at when see any error messages...
3) I dont see anything in the instructions about modifications in index.php

Check step 2 by Loda ;) theres the step to added code at index.php

line 216 is :

Quote
WHERE i.image_active = i.image_potm AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").") AND i.cat_id IN (".implode(", ", $cat_in).")

and also
Quote
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') ORDER BY i.image_potm_date DESC LIMIT 1' at line 4

code:

Quote
        ORDER BY  i.image_potm_date DESC
        LIMIT 1";

 :|

Offline HorrorCrafT

  • Full Member
  • ***
  • Posts: 106
    • View Profile
    • HYPOfun online
Re: Picture of the month
« Reply #107 on: September 06, 2006, 11:38:39 PM »
Stoleti,

replace in index.php code:
Code: [Select]
WHERE i.image_active = i.image_potm AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").") AND i.cat_id IN (".implode(", ", $cat_in).")
with:
Code: [Select]
WHERE i.image_active = i.image_potm
then it works perfect!! (see posts from Loda and V@no)

Offline lemccoy

  • Jr. Member
  • **
  • Posts: 90
    • View Profile
    • DrunkIsland
Re: Picture of the month
« Reply #108 on: September 08, 2006, 02:34:53 PM »
OK I have two questions. 

First, is there anyway to reset the pictures?  I am installing now, and while it works, I didn't have the right settings setup.  I don't want to wait until next month. 

Second, has anyone done a select by random image or hand pick option?

Thanks!

Offline Loda

  • Sr. Member
  • ****
  • Posts: 353
    • View Profile
    • Fotosucht Schweiz
Re: Picture of the month
« Reply #109 on: September 08, 2006, 04:22:56 PM »
Stoleti,

replace in index.php code:
Code: [Select]
WHERE i.image_active = i.image_potm AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").") AND i.cat_id IN (".implode(", ", $cat_in).")
with:
Code: [Select]
WHERE i.image_active = i.image_potm
then it works perfect!! (see posts from Loda and V@no)
i have update my first posting...

Offline HorrorCrafT

  • Full Member
  • ***
  • Posts: 106
    • View Profile
    • HYPOfun online
Re: Picture of the month
« Reply #110 on: September 08, 2006, 04:41:50 PM »

Loda, du könntest diesen script auch gleich noch in dein erstes posting packen weil ich denke die überschrift zum bild des monats dürfte auch für andere noch interessant sein, meinste nicht?

Quote from: Loda

ein tipp mit der überschrift:
in der page_header.php einfach mal unter:
Code: [Select]
"lang_potm_link" => $lang['potm_link'],das einfügen:
Code: [Select]
"lang_potm_home" => $lang['potm_home'],dann in deiner lang/main.php über ?>
Code: [Select]
$lang['potm_home'] = "Foto des Monats";dann in deiner thumbnail_bit_potm dieses:
Code: [Select]
<div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="head2" height="18"> <img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" /> {lang_potm_home}
      <script>
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("So","Mo","Di","Mi","Do","Fr","Sa")
var montharray=new Array("Januar","Februar","M&auml;rz","April","Mai","Juni","July","August","September","Oktober","November","Dezember")
document.write(""+montharray[month-1]+" "+year+"</>")
</script>      </td>
  </tr>
  <tr>
    <td class=""><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
  </tr>
  <tr>
    <td class=""><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td>
  </tr>
</table>
{thumbnail}<br>
  <b>{image_name}</b> {if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new} {if image_is_potm} <sup class="new">{lang_potm}</sup> {endif image_is_potm}</div>


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: Picture of the month
« Reply #111 on: September 09, 2006, 01:37:09 AM »
Stoleti,

replace in index.php code:
Code: [Select]
WHERE i.image_active = i.image_potm AND c.cat_id = i.cat_id AND i.cat_id IN (".get_auth_cat_sql("auth_viewcat").") AND i.cat_id IN (".implode(", ", $cat_in).")
with:
Code: [Select]
WHERE i.image_active = i.image_potm
then it works perfect!! (see posts from Loda and V@no)
I dont think it works perfect...unless you dont use any permissions in the categories...
it could work alright if you remove just AND i.cat_id IN (".implode(", ", $cat_in).") from that line, but replace the way you did only makes more load on the database (it reads everything from categories table) and removes all permission restrictions...
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 HorrorCrafT

  • Full Member
  • ***
  • Posts: 106
    • View Profile
    • HYPOfun online
Re: Picture of the month
« Reply #112 on: September 09, 2006, 12:15:36 PM »
okay i have only removed AND i.cat_id IN (".implode(", ", $cat_in).") and it works also without problems. thx V@no!

Offline HorrorCrafT

  • Full Member
  • ***
  • Posts: 106
    • View Profile
    • HYPOfun online
Re: Picture of the month
« Reply #113 on: October 01, 2006, 08:03:06 PM »
zuerst in deutsch - das kann ich besser:

hab nun die "picture of the month" wahl schon zwei monate am laufen. eingestellt hab ich für die letzte auswahl nach den meisten hits (also 0). bei der ersten auswahl der bilder hat auch alles wunderbar geklappt, bei der zweiten kommen nun die selben bilder nochmal, bis auf jenes das gewonnen hat. das find ich allerdings etwas blöd weil die leute wollen natürlich x neue bilder für die wahl nicht die selben (verlierer) nochmal. gibt es da eine möglichkeit oder ist das halt so? am liebsten wäre mir sowieso wenn ich bilder die zur wahl antreten sollen, irgendwie händisch auswählen könnte. es sind halt meistens nicht die ersten x bilder nach hits, datum oder was auch immer die besten, sondern halt von mir aus auch mal das 50ste in einer kategorie. würd mich echt freuen wenn mir da jemand weiterhelfen kann. vielen dank!

and now in english :oops:
by my last "picture of the month" poll i took the setting 0 (by hits) for picture selection. now, one month later i thought the system needs the next x pictures by most hits but it takes the same pictures only without the winner - thats not very good because people want x new pictures for vote. how can i get the next x pictures by most hits, date or whatever without the looser of the poll before or how can i select pictures for the poll manually? THANKS for help!!

Offline desperate_housewif

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: Picture of the month
« Reply #114 on: October 02, 2006, 11:17:50 AM »
Mein Picture of the month läuft bereits in der Testphase. Nach dem ersten Monatsablauf erscheint nirgends ein Link auf eine Seite zum Gewinner des letzten Monats. Fehlt etwas bei mir oder muß ich per Hand nacharbeiten (das wird schwierig).

Offline HorrorCrafT

  • Full Member
  • ***
  • Posts: 106
    • View Profile
    • HYPOfun online
Re: Picture of the month
« Reply #115 on: October 03, 2006, 11:35:08 PM »
php gurus was ist los? :D gibt es vielleicht eine möglichkeit auch die "verlierer" bilder wie das bild welches die wahl gewonnen hat zu "markieren" damit bei der nächsten wahl wieder komplett neue bilder angezeigt werden und nicht nur das gewinner-bild aussortiert wird? wäre eine idee, hab aber leider zu wenig php kenntnisse um das selber umzusetzen. vielleicht gibt es auch eine andere möglichkeit? ich weiss, freizeit ist ein wertvolles gut, aber vielleicht kann das ja jemand auch für sich nutzen? würd mich über feedback freuen, danke!!

is there a way to mark "looser" pics too, not only the winner pic so that in the next round all pics are new? its an idea but my php knowledge is not so perfect to make it same. thanks for your trouble!!

Offline desperate_housewif

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: Picture of the month
« Reply #116 on: October 18, 2006, 05:16:03 PM »
Haaaallo, ist noch ein Verlierer!

Nochmal, die Bilder werden wahrlos aus meinem Pool herausgegriffen. Die Sortierung sollte aber sein:

1. Einstelldatum des vergangenen Monats
2. Anzahl der Bewertungen
3. Anzahl der Hits.

Offline Darkness2001

  • Full Member
  • ***
  • Posts: 151
    • View Profile
    • photo-galerie-online
Re: Picture of the month
« Reply #117 on: October 23, 2006, 07:23:45 PM »
so, hab mir diesen MOD auch mal angeschaut und eingebaut.

warum neben dem bild nur ":" und kein "Benutzer:" oder "Kategorie:" steht oder warum der {potm_menu_link} link nicht sichtbar ist, ist ein bug der sich durch die gesamte potm.php zieht und zwar folgendermaßen:

ursprünglicher scriptauszug aus der potm.php:

$potm_menu .= "<br>{lang_top_category}: " . "<a href=\"".$site_sess->url(ROOT_PATH. .... usw.

das "<br>{lang_top_category}: " kann so nicht aufgelöst werden und muss umgeschrieben werden auf:

$potm_menu .= "<br>".$lang['top_category'].": " . "<a href=\"".$site_sess->url(ROOT_PATH. .... usw.

nun kann die sprachvariable aus der main.php gezogen und hier angezeigt werden. wenn ihr also auch die linkvariablen so umschreibt, werden sie auch in der 1.7.1er version sichtbar.

eine späte info, ich weiss, aber das hätte eigentlich der programmierer dieses MODs oder einer der großen zampanos hier, korrigieren müssen :wink: :D ansonsten aber ein feiner MOD!!! danke dafür!


Hi,

thanks for this  :lol:

Greez Darkness

Offline desperate_housewif

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: Picture of the month
« Reply #118 on: October 24, 2006, 12:16:55 PM »
Ist mir auch schon als "Anfänger" aufgefallen. Habe das dann gelöscht und mit Freitext versehen. Funktioniert dann aber eben nur in deutsch.
Habe es geändert und funktioniert wunderbar, der gleiche entsteht aber auch bei "Mitglied". Wie ändere ich diesen Bereich? Und hat für meine obigen Fragen noch jemand eine Antwort?
« Last Edit: October 29, 2006, 09:49:36 AM by desperate_housewif »

Offline Darkness2001

  • Full Member
  • ***
  • Posts: 151
    • View Profile
    • photo-galerie-online
Re: Picture of the month
« Reply #119 on: October 29, 2006, 08:09:51 PM »
Hallo,

habe den Mod eingebaut und alles lief...

jetzt bekomme ich auf einmal diese Fehlermeldung, wer weiss RAT ?

DB Error: Bad SQL Query: SELECT i.image_id, i.user_id, i.cat_id, i.image_name, i.image_thumb_file, i.image_media_file, i.image_thumb_file, i.image_rating, i.image_votes, i.image_comments, c.cat_name, u.user_name, i.image_downloads, i.image_hits, i.image_potm, i.image_potm_date, i.image_potm_votes FROM 2_images i, 2_categories c, 2_users u WHERE i.image_active = 1 AND i.cat_id NOT IN (0) AND i.cat_id = c.cat_id AND i.user_id = u.user_id ORDER BY LIMIT
You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT' at line 5


Greez Darkness  :mrgreen: