4images Forum & Community

4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started by: Nicky on July 05, 2002, 12:45:13 PM

Title: [Mod] Star Rating
Post by: Nicky on July 05, 2002, 12:45:13 PM
// OPEN / ÖFFNE includes/functions.php:

// FIND / SUCHE NACH
  if (!check_permission("auth_readcomment", $image_row['cat_id'])) {
    $image_row['image_allow_comments'] = 0;
  }

// ADD AFTER / HINZUFÜGEN DANACH

Code: [Select]

  if ($image_row['image_rating'] == '5.00') {
     $rating_pic = "5.gif";
  } elseif ($image_row['image_rating'] >= '4.00') {
     $rating_pic = "4.gif";
  } elseif ($image_row['image_rating'] >= '3.00') {
     $rating_pic = "3.gif";
  } elseif ($image_row['image_rating'] >= '2.00') {
     $rating_pic = "2.gif";
  } elseif ($image_row['image_rating'] >= '1.00') {
     $rating_pic = "1.gif";
  } else {
     $rating_pic = "0.gif";
  }
  $site_template->register_vars(array(
     "rating_pic" => $rating_pic,
     "lang_rating" => $lang['rating'],
     "lang_votes" => $lang['votes']
  ));



// ADD IN TEMPLATE(S) / FÜGE DIES IN DEIN(E) TEMPLATE(S)
Code: [Select]

<img src="{template_url}/images/{rating_pic}" width="55" height="10" alt="" />

// OR / ODER
Code: [Select]

<img src="{template_url}/images/{rating_pic}" width="55" height="10" alt="{lang_rating} {image_rating} ({image_votes} {lang_votes})" />


// HERE EXAMPLE PICS / HIER DIE BEISPIEL BILDER

standard 4images color on white background / standard 4images farbe auf weissen hintergrund (55x10 px)

(http://www.nicky.net/4images/0.gif)
(http://www.nicky.net/4images/1.gif)
(http://www.nicky.net/4images/2.gif)
(http://www.nicky.net/4images/3.gif)
(http://www.nicky.net/4images/4.gif)
(http://www.nicky.net/4images/5.gif)

// upload pics into your /templates/YOURTEMPLATE/images / uploade die bilder ins /templates/DEINTEMPLATE/images

// DEMO: no more available / nicht mehr verfügbar
Title: [Mod] Star Rating
Post by: giffy007 on July 05, 2002, 02:31:49 PM
Can you please put this in Englsh

Thanks

Giffy :wink:
Title: [Mod] Star Rating
Post by: Nicky on July 05, 2002, 02:41:45 PM
hi,

sorry ?

look at //
Title: [Mod] Star Rating
Post by: [TraXX on July 12, 2002, 05:38:10 PM
thx....habs eingebaut...es funzt...und es gefällt mir :D


Dankeschön!  8)
Title: Re: [Mod] Star Rating
Post by: Harry on July 16, 2002, 12:02:07 PM
Quote from: Nicky
// OPEN / ÖFFNE includes/functions.php:


// ADD AFTER / HINZUFÜGEN DANACH

Code: [Select]

  if ($image_row['image_rating'] == '5.00') {
     $rating_pic = "5.gif";
  } elseif ($image_row['image_rating'] >= '4.00') {
     $rating_pic = "4.gif";
  } elseif ($image_row['image_rating'] >= '3.00') {
     $rating_pic = "3.gif";
  } elseif ($image_row['image_rating'] >= '2.00') {
     $rating_pic = "2.gif";
  } elseif ($image_row['image_rating'] >= '1.00') {
     $rating_pic = "1.gif";
  } else {
     $rating_pic = "0.gif";
  }
  $site_template->register_vars("rating_pic", $rating_pic);




Hi Nicky, this is a cool feature and it works;
only I want to have a rating possible from 1-7, I altered the code above and added extra Gifs. Also changed the rating form, adding option "6" and "7",

but when I try to rate something "6" or "7" I get an "invalid rating" error.

Where is it defined that only 1-5 can be rated?

Thanks for your help,
with best regards,

Harry
Title: [Mod] Star Rating
Post by: Jan on July 16, 2002, 12:03:46 PM
Hi,

includes/constants.php:

Code: [Select]
define('MAX_RATING', 5);

Jan
Title: [Mod] Star Rating
Post by: Harry on July 16, 2002, 12:06:22 PM
Quote from: Jan Sorgalla
Hi,

includes/constants.php:

Code: [Select]
define('MAX_RATING', 5);

Jan


 :idea:  (another aha moment)  :wink:
Yep, that works,

thanks a lot, best regards,

Harry
Title: Re: [Mod] Star Rating
Post by: X-Fan on October 02, 2002, 05:26:08 PM
Quote from: Nicky
// ADD IN TEMPLATE(S) / FÜGE DIES IN DEIN(E) TEMPLATE(S)
Code: [Select]

<img src="{template_url}/images/{rating_pic}" width="55" height="10" alt="" />

// OR / ODER
Code: [Select]

<img src="{template_url}/images/{rating_pic}" width="55" height="10" alt="{lang_rating} {image_rating} ({image_votes} {lang_votes})" />



In which template, and where in that template, is this meant to go?
Title: [Mod] Star Rating
Post by: Nicky on October 02, 2002, 05:46:06 PM
well, you can add it where you want,


maybe just into details.html, just look for a good place ;)
Title: [Mod] Star Rating
Post by: hoelzlmani on October 21, 2002, 02:27:54 PM
ich hab <img src="{template_url}/images/{rating_pic}" width="55" height="10" alt="{lang_rating} {image_rating} ({image_votes} {lang_votes})" />  mal ganz nach unten gestellt, nur probeweise bei der details.html. auch die bilder ins image verzeichnis kopiert, aber ich sehe keine sternchen. bitte um hilfe

nachtrag: es ist eigentlich egal was ich bei der design.html ändere, es ändert sich nichts auf der page.
Title: [Mod] Star Rating
Post by: Nicky on October 22, 2002, 06:35:08 PM
ich sehe dass das problem gelöst worden ist...
sehr schön.
Title: Re: [Mod] Star Rating
Post by: sprokop on November 01, 2002, 04:57:45 AM
Quote from: Nicky
// OPEN / ÖFFNE includes/functions.php:

// FIND / SUCHE NACH
  if (!check_permission("auth_readcomment", $image_row['cat_id'])) {
    $image_row['image_allow_comments'] = 0;
  }

// ADD AFTER / HINZUFÜGEN DANACH

Code: [Select]

  if ($image_row['image_rating'] == '5.00') {
     $rating_pic = "5.gif";
  } elseif ($image_row['image_rating'] >= '4.00') {
     $rating_pic = "4.gif";
  } elseif ($image_row['image_rating'] >= '3.00') {
     $rating_pic = "3.gif";
  } elseif ($image_row['image_rating'] >= '2.00') {
     $rating_pic = "2.gif";
  } elseif ($image_row['image_rating'] >= '1.00') {
     $rating_pic = "1.gif";
  } else {
     $rating_pic = "0.gif";
  }
  $site_template->register_vars(array(
     "rating_pic" => $rating_pic,
     "lang_rating" => $lang['rating'],
     "lang_votes" => $lang['votes']
  ));



// ADD IN TEMPLATE(S) / FÜGE DIES IN DEIN(E) TEMPLATE(S)
Code: [Select]

<img src="{template_url}/images/{rating_pic}" width="55" height="10" alt="" />

// OR / ODER
Code: [Select]

<img src="{template_url}/images/{rating_pic}" width="55" height="10" alt="{lang_rating} {image_rating} ({image_votes} {lang_votes})" />


// HERE EXAMPLE PICS / HIER DIE BEISPIEL BILDER

standard 4images color on white background / standard 4images farbe auf weissen hintergrund (55x10 px)

(http://www.nicky.net/4images/0.gif)
(http://www.nicky.net/4images/1.gif)
(http://www.nicky.net/4images/2.gif)
(http://www.nicky.net/4images/3.gif)
(http://www.nicky.net/4images/4.gif)
(http://www.nicky.net/4images/5.gif)

// upload pics into your /templates/YOURTEMPLATE/images / uploade die bilder ins /templates/DEINTEMPLATE/images

// DEMO: no more available / nicht mehr verfügbar



Thanks for a really simple yet great looking mod. Implementation is easy as 1-2-3! bahm done  :lol:
Title: [Mod] Star Rating
Post by: Der_Nick on November 28, 2002, 07:40:54 PM
Quote from: hoelzlmani
ich hab <img src="{template_url}/images/{rating_pic}" width="55" height="10" alt="{lang_rating} {image_rating} ({image_votes} {lang_votes})" />  mal ganz nach unten gestellt, nur probeweise bei der details.html. auch die bilder ins image verzeichnis kopiert, aber ich sehe keine sternchen. bitte um hilfe

nachtrag: es ist eigentlich egal was ich bei der design.html ändere, es ändert sich nichts auf der page.


bei mir dasselbe!!
ich sehe auch keine sterne??! wo sollten die dann sein?
Title: [Mod] Star Rating
Post by: Der_Nick on November 28, 2002, 10:24:33 PM
ok, erledigt!habs endlich gefunden!
Title: [Mod] Star Rating
Post by: Shap on November 30, 2002, 11:49:17 PM
anyone have a demo yet???
Title: Re: [Mod] Star Rating
Post by: Chris on December 01, 2002, 12:45:42 AM
Quote from: Nicky
// HERE EXAMPLE PICS

standard 4images color on white background (55x10 px)

(http://www.nicky.net/4images/0.gif)
(http://www.nicky.net/4images/1.gif)
(http://www.nicky.net/4images/2.gif)
(http://www.nicky.net/4images/3.gif)
(http://www.nicky.net/4images/4.gif)
(http://www.nicky.net/4images/5.gif)

// DEMO: no more available
Title: Wo im Queltext soll das eingefügt werden?
Post by: adular on December 09, 2002, 03:34:15 PM
Hi,
habe das selbe Problem wie Ihr auch. Ich habe
<img src="{template_url}/images/{rating_pic}" width="55" height="10" alt="" /> schon überall in der design.html eingefügt aber nichts passiert? ;-(

Ich danke Euch
Title: [Mod] Star Rating
Post by: Shap on December 13, 2002, 03:50:56 AM
just wanted to say GREAT MOD!

THANKS!
Title: [Mod] Star Rating
Post by: KSA on January 11, 2003, 11:53:38 AM
please demo
Title: Demo
Post by: Harry on January 11, 2003, 01:46:38 PM
Quote from: KSA
please demo

A demo of the start system (slightly adapted, see posts) can be found on
http://7summits.com/images

Regards,

Harry
Title: [Mod] Star Rating
Post by: SLL on January 12, 2003, 11:26:08 AM
Very nice MOD, thank you!

Standard stars doesn't look very good, but I've found hundreds of rank images at http://www.phpbb.com/styles/downloads/index.php?t=sub_pages&cat=32
Title: [Mod] Star Rating
Post by: Lucifix on February 01, 2003, 02:26:31 PM
Quote
// ADD IN TEMPLATE(S) / FÜGE DIES IN DEIN(E) TEMPLATE(S)
Code:

<img src="{template_url}/images/{rating_pic}" width="55" height="10" alt="" />

I dont get it... in which file should i insert this?  :oops:
Title: [Mod] Star Rating
Post by: SLL on February 01, 2003, 03:43:01 PM
Quote from: Lucifix1
I dont get it... in which file should i insert this?  :oops:

into category_bit.html
Title: [Mod] Star Rating
Post by: Lucifix on February 05, 2003, 10:56:05 AM
Quote
into category_bit.html


Then the code looks like this?
Quote
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td valign="top">
     <img src="{template_url}/images/folder.gif" width="20" height="13" alt="" />
      <!-- {if random_cat_image_file}<a href="{cat_url}"><img src="{random_cat_image_file}" border="1"></a>{endif random_cat_image_file}  -->
    </td>
    <td>
     <a href="{cat_url}" class="maincat">{cat_name}</a>&nbsp;({num_images})
      {if cat_is_new}<sup class="new">{lang_new}</sup>{endif cat_is_new}
   </td>
  </tr>
</table>
{if cat_description}<span class="smalltext">{cat_description}</span><br />{endif cat_description}
{if sub_cats}{sub_cats}{endif sub_cats}
<img src="{template_url}/images/{rating_pic}" width="55" height="10" alt="" />


OR should i insert it somewhere else?
Title: [Mod] Star Rating
Post by: SLL on February 07, 2003, 09:05:29 PM
Sorry, just noticed, that I gave you the wrong answer  :oops:
You should insert it under the thumbnail, info thumbnail_bit.html
Quote
<!-- you wish detail page in a small javascript open window, use {thumbnail_openwindow} -->
{thumbnail}<br />
<b>{image_name}</b> {if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new} ({user_name_link})
<br />
<a href="{cat_url}">{cat_name}</a><br />
{if allow_comments}{lang_comments} {image_comments}{endif allow_comments}<br />
<img src="{template_lang_image_url}/{rating_pic}" alt="{lang_rating} {image_rating} ({image_votes} {lang_votes})" /><br />
{lightbox_button}
Title: rating
Post by: remus on February 09, 2003, 03:45:33 AM
hi

ich habe den code in die function.php eingefügt und in die details.html aber ich sehe kein rating und die pics habe ich auch in den images ordner geladen, könnt ihr mir helfen?
Title: hallo???
Post by: remus on February 09, 2003, 04:59:33 PM
keine antowort :) :lol:
Title: [Mod] Star Rating
Post by: Fuztug on March 22, 2003, 09:31:26 PM
In welchem Template?!?
Title: [Mod] Star Rating
Post by: uksoreeyes on April 24, 2003, 04:17:28 AM
Anyway to add the star rating to the top.php? It would be nice to show the start rating in the top 10s. Ive tried everything but cant get it to work. little help?

Carl
Title: [Mod] Star Rating
Post by: V@no on April 24, 2003, 03:43:57 PM
Quote from: uksoreeyes
Anyway to add the star rating to the top.php? It would be nice to show the start rating in the top 10s. Ive tried everything but cant get it to work. little help?

Carl

from the original MOD find:
Code: [Select]
   $register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
replace with:
Code: [Select]
   $register_array['image_rating_number_'.$i] = "<b><img src=\"".TEMPLATE_PATH."/images/".floor($top_list[$i]['image_rating']).".gif\">"."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
Title: [Mod] Star Rating
Post by: uksoreeyes on April 24, 2003, 10:42:38 PM
Thanks again V@no, made a slight change by adding an alt tag to show the actual rating when a user hovers over the stars. I also removed the <b></b> tags as they don't seem to be getting used. I added the star rating to top 10 images by votes

Open top.php

Top 10 images by rating with alt text.

find:
Code: [Select]
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
replace with:
Code: [Select]
$register_array['image_rating_number_'.$i] = "<img src=\"".TEMPLATE_PATH."/images/".floor($top_list[$i]['image_rating']).".gif\" alt=\"Rating: ".$top_list[$i]['image_rating']." (".$top_list[$i]['image_votes']." ".$lang['votes'].")\"> "."(".$top_list[$i]['image_votes']." ".$lang['votes'].")";
Top 10 images by votes with alt text.

find:
Code: [Select]
$register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
replace with:
Code: [Select]
$register_array['image_votes_number_'.$i] = "<img src=\"".TEMPLATE_PATH."/images/".floor($top_list[$i]['image_rating']).".gif\" alt=\"Rating: ".$top_list[$i]['image_rating']." (".$top_list[$i]['image_votes']." ".$lang['votes'].")\"> "."(".$top_list[$i]['image_votes']." ".$lang['votes'].")";
This is a great Mod if u would like to see my top images with the stars go here: http://www.myleeneklass.com/top.php
Title: [Mod] Star Rating
Post by: andersen on May 12, 2003, 09:17:13 AM
Have anyidea got below error?

Fatal error: Call to undefined function: get_potd_image() in /home/httpd/html/bullroad/gallery/includes/page_header.php on line 152
Title: [Mod] Star Rating
Post by: V@no on May 12, 2003, 11:37:21 AM
this error has nothing to do with this mod (?).
it seems it can not find get_potd_image function ;) that is "Picture Of The Day" MOD
if it happend after u installed "Stars" MOD, then check again the installation, u might missed closing bracket ( } ) or quote, or semicolon.


P.S. this MOD can be done with just two lines of code, and do exactly same thing, plus it wont be restricted to max rating 5 ;) D:

in /includes/functions.php find:
Code: [Select]
"image_rating" => $image_row['image_rating'], add after:
Code: [Select]
"image_rating_round" => round($image_row['image_rating']),
then, in templates add this:
Code: [Select]
<img src="{template_image_url}/{image_rating_round}.gif">
that's it :D. just make sure your images are named as 1.gif, 2.gif ... 5.gif, 6.gif, 10.gif ... 10000.gif whatever number is max u want to show :D
Title: [Mod] Star Rating
Post by: andersen on May 12, 2003, 12:14:09 PM
Thanks for help.

i had do all you mention as above.

BUT still failed on below message

Fatal error: Call to undefined function: get_potd_image() in /home/httpd/html/bullroad/gallery/includes/page_header.php on line 152



below is /includes/functions.php

  $site_template->register_vars(array(
    "image_id" => $image_row['image_id'],
    "user_id" => $image_row['user_id'],
    "user_name" => $user_name,
    "user_name_link" => $user_name_link,
    "image_name" => $image_row['image_name'],
    "image_description" => $description,
    "image_keywords" => $keywords,
    "image_date" => format_date($config['date_format']." ".$config['time_format'],$image_row['image_date']),
    "image_is_new" => $is_new,
    "lang_new" => $lang['new'],
    "image_active" => $image_row['image_active'],
    "cat_id" => $image_row['cat_id'],
    "cat_name" => $image_row['cat_name'],
    "cat_url" => $site_sess->url(ROOT_PATH."categories.php?".URL_CAT_ID."=".$image_row['cat_id']),
    "image_downloads" => $image_row['image_downloads'],
    "image_votes" => $image_row['image_votes'],
    "image_rating" => $image_row['image_rating'],
    "image_rating_round" => round($image_row['image_rating']),
    "image_hits" => $image_row['image_hits'],
    "allow_comments" => $image_row['image_allow_comments'],
    "lang_comments" => $lang['comments'],
    "image_comments" => $num_comments,
    "lightbox_button" => $lightbox_button,
    "postcard_button" => $postcard_button,
    "download_button" => $download_button,
    "download_zip_button" => $download_zip_button,
    "image_download_url" => $image_row['image_download_url'],
    "allow_download" => $allow_download,
    "url_download" => $site_sess->url(ROOT_PATH."download.php?".URL_IMAGE_ID."=".$image_row['image_id']),
    "image_file_size" => $file_size,
    "image" => get_media_code($image_row['image_media_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, $detailed_view),
    "thumbnail" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link),
    "thumbnail_openwindow" => get_thumbnail_code($image_row['image_media_file'], $image_row['image_thumb_file'], $image_row['image_id'], $image_row['cat_id'], $image_row['image_name'], $mode, $show_link, 1),
    "image_file_name" => $image_row['image_media_file'],
    "thumbnail_file_name" => $image_row['image_thumb_file']
  ));



Below is my /templates/4waters/thumbnail_bit.html
==============================

<!-- you wish detail page in a small javascript open window, use {thumbnail_openwindow} -->
{thumbnail}<br />
<b>{image_name}</b> {if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new} ({user_name_link})
<br />
<a href="{cat_url}">{cat_name}</a><br />
{if allow_comments}{lang_comments} {image_comments}{endif allow_comments}<br />
<img src="{template_image_url}/{image_rating_round}.gif">
{lightbox_button}

Below this is my previous test, but fail too.
============================================

<!-- you wish detail page in a small javascript open window, use {thumbnail_openwindow} -->
{thumbnail}<br />
<b>{image_name}</b> {if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new} ({user_name_link})
<br />
<a href="{cat_url}">{cat_name}</a><br />
{if allow_comments}{lang_comments} {image_comments}{endif allow_comments}<br />
<img src="{template_lang_image_url}/{rating_pic}" alt="{lang_rating} {image_rating} ({image_votes} {lang_votes})" /><br />
{lightbox_button}


I am also tried this below on /templates/4waters/potd_image.html when I got above fail.
===============================

<table width="150" border="0" cellspacing="0" cellpadding="0">
  <tr><td class="head2" height="20" align="center"><img src="{template_url}/images/spacer.gif" alt="" width="4" height="4" />{lang_potd_title}</td></tr>
  <tr><td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td></tr>
  <tr><td align="center" class="row1">{thumbnail}<br><b>{image_name}<br>
<img src="{template_image_url}/{image_rating_round}.gif">      </b></td></tr>
  <tr><td align="center" class="row1">{lang_potd_type}</td></tr>
  <tr><td class="tablebgcolor"><img src="{template_url}/images/spacer.gif" alt="" width="1" height="1" /></td></tr>
</table>

Do I done any wrong?
Title: [Mod] Star Rating
Post by: V@no on May 12, 2003, 12:17:41 PM
and the problem is....?
Title: [Mod] Star Rating
Post by: andersen on May 12, 2003, 12:19:10 PM
sorry for miss answer I had edited.  :oops:

===========================
BUT still failed on below message

Fatal error: Call to undefined function: get_potd_image() in /home/httpd/html/bullroad/gallery/includes/page_header.php on line 152
===========================
Title: [Mod] Star Rating
Post by: V@no on May 12, 2003, 12:24:36 PM
ok, but did u install Photo Of The Day  mod?
Title: [Mod] Star Rating
Post by: andersen on May 12, 2003, 12:30:24 PM
Yes I did install the Photo Of the Day mod before I mod this Star Rate mode.

P/s: Photo Of the Day mod work perfectly, no error.

So which 1 I had made a mistake on above scripts?
Title: [Mod] Star Rating
Post by: V@no on May 12, 2003, 12:40:22 PM
Quote from: andersen
P/s: Photo Of the Day mod work perfectly, no error.

So which 1 I had made a mistake on above scripts?

sorry, but I have no clue...hope u have backup of what u changed, try to restore whatever u did when installing this "Stars" MOD, see if the error gone, and try again.
Title: [Mod] Star Rating
Post by: andersen on May 12, 2003, 01:04:18 PM
Actually I had rename the

/includes/functions.php to "functions-backup.php"
/templates/4waters/thumbnail_bit.html  to "thumbnail_bit-backup.html"

before I modify the Star rating mod.

when I rename back to "*-backup.php", everthing back to original.


one more information wish to provide as  /includes/functions.php


if ($image_row['image_rating'] == '5.00') {  
     $rating_pic = "5.gif";  
  } elseif ($image_row['image_rating'] >= '4.00') {  
     $rating_pic = "4.gif";  
  } elseif ($image_row['image_rating'] >= '3.00') {  
     $rating_pic = "3.gif";  
  } elseif ($image_row['image_rating'] >= '2.00') {  
     $rating_pic = "2.gif";  
  } elseif ($image_row['image_rating'] >= '1.00') {  
     $rating_pic = "1.gif";  
  } else {  
     $rating_pic = "0.gif";  
  }  
  $site_template->register_vars(array(
     "rating_pic" => $rating_pic,  
     "lang_rating" => $lang['rating'],
     "lang_votes" => $lang['votes']
  ));

any thing wrong?
Title: [Mod] Star Rating
Post by: V@no on May 12, 2003, 01:14:38 PM
Quote from: andersen
any thing wrong?

looks ok. does it work after restore? please, be more discribing whats goin on when do "this and that", so I dont have to ask this kind of questions, that make the thread less usefull.
Title: [Mod] Star Rating
Post by: andersen on May 13, 2003, 11:09:47 AM
Ok, This thread will made my explain very detail. I had restore back everthing to original. From a 4Image with 100% (for me) fine. Now I am start again for my "star rating mod" as below. (I am doing step by step on real time installation now too..)

I open my includes/functions.php

searching below information:-

else {
    $keywords = REPLACE_EMPTY;
  }

  if (!check_permission("auth_readcomment", $image_row['cat_id'])) {
    $image_row['image_allow_comments'] = 0;
  }

  $num_comments = ($image_row['image_allow_comments'] == 1) ? $image_row['image_comments'] : "";


change to

    $keywords = REPLACE_EMPTY;
  }

  if (!check_permission("auth_readcomment", $image_row['cat_id'])) {
    $image_row['image_allow_comments'] = 0;
  }

if ($image_row['image_rating'] == '5.00') {  
     $rating_pic = "5.gif";  
  } elseif ($image_row['image_rating'] >= '4.00') {  
     $rating_pic = "4.gif";  
  } elseif ($image_row['image_rating'] >= '3.00') {  
     $rating_pic = "3.gif";  
  } elseif ($image_row['image_rating'] >= '2.00') {  
     $rating_pic = "2.gif";  
  } elseif ($image_row['image_rating'] >= '1.00') {  
     $rating_pic = "1.gif";  
  } else {  
     $rating_pic = "0.gif";  
  }  
  $site_template->register_vars(array(
     "rating_pic" => $rating_pic,  
     "lang_rating" => $lang['rating'],
     "lang_votes" => $lang['votes']
  ));

  $num_comments = ($image_row['image_allow_comments'] == 1) ? $image_row['image_comments'] : "";


AND ALSO

"image_votes" => $image_row['image_votes'],
    "image_rating" => $image_row['image_rating'],
    "image_hits" => $image_row['image_hits'],


Change to

"image_votes" => $image_row['image_votes'],
    "image_rating" => $image_row['image_rating'],
    "image_rating_round" => round($image_row['image_rating']),
    "image_hits" => $image_row['image_hits'],


I save it and re-upload to my server in includes/

Then I open this templates/4waters/thumnail_bit.html as below

<!-- you wish detail page in a small javascript open window, use {thumbnail_openwindow} -->
{thumbnail}<br />
<b>{image_name}</b> {if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new} ({user_name_link})
<br />
<a href="{cat_url}">{cat_name}</a><br />
{if allow_comments}{lang_comments} {image_comments}{endif allow_comments}<br />
{lightbox_button}


Then I change it to

<!-- you wish detail page in a small javascript open window, use {thumbnail_openwindow} -->
{thumbnail}<br />
<b>{image_name}</b> {if image_is_new}<sup class="new">{lang_new}</sup>{endif image_is_new} ({user_name_link})
<br />
<a href="{cat_url}">{cat_name}</a><br><img src="{template_image_url}/{image_rating_round}.gif"><br />
{if allow_comments}{lang_comments} {image_comments}{endif allow_comments}<br />
{lightbox_button}


save it to /templates/4waters/

Last, I run on my index.php. the result is......

Fatal error: Call to undefined function: get_potd_image() in /home/httpd/html/bullroad/gallery/includes/page_header.php on line 152


I hope it is detail enough. Do I done wrong anything step?

Please... headache ---> Andersen /_\
Title: [Mod] Star Rating
Post by: V@no on May 13, 2003, 11:18:26 AM
hmm...seems that u didnt overwrite /includes/page_header.php with new file from the package...
what is on line 152 in it?
Title: [Mod] Star Rating
Post by: andersen on May 13, 2003, 12:08:41 PM
Do I missing something at below?

includes/page_header.php


<?php
/**************************************************************************
 *                                                                        *
 *    4images - A Web Based Image Gallery Management System               *
 *    ----------------------------------------------------------------    *
 *                                                                        *
 *             File: page_header.php                                      *
 *        Copyright: (C) 2002 Jan Sorgalla                                *
 *            Email: jan@4homepages.de                                    *
 *              Web: http://www.4homepages.de                             *
 *    Scriptversion: 1.7                                                  *
 *                                                                        *
 *    Never released without support from: Nicky (http://www.nicky.net)   *
 *                                                                        *
 **************************************************************************
 *                                                                        *
 *    Dieses Script ist KEINE Freeware. Bitte lesen Sie die Lizenz-       *
 *    bedingungen (Lizenz.txt) für weitere Informationen.                 *
 *    ---------------------------------------------------------------     *
 *    This script is NOT freeware! Please read the Copyright Notice       *
 *    (Licence.txt) for further information.                              *
 *                                                                        *
 *************************************************************************/
if (!defined('ROOT_PATH')) {
  die("Security violation");
}

// Cache Templates
$template_list = 'header,footer,category_dropdown_form,user_logininfo,user_loginform';
if (isset($templates_used) && $templates_used != "") {
  $template_list = $template_list.",".$templates_used;
}
$site_template->cache_templates($template_list);

//-----------------------------------------------------
//--- Register Global Vars ----------------------------
//-----------------------------------------------------
$total_images = 0;
$total_categories = 0;
$auth_cat_sql['auth_viewcat']['IN'] = 0;
$auth_cat_sql['auth_viewcat']['NOTIN'] = 0;
if (!empty($cat_cache)) {
  foreach ($cat_cache as $key => $val) {
    if (check_permission("auth_viewcat", $key)) {
      $total_categories++;
      if (isset($val['num_images'])) {
        $total_images += $val['num_images'];
      }
      else {
        $cat_cache[$key]['num_images'] = 0;
      }
      $auth_cat_sql['auth_viewcat']['IN'] .= ", ".$key;
    }
    else {
      $auth_cat_sql['auth_viewcat']['NOTIN'] .= ", ".$key;
    }
  }
}

$site_template->register_vars(array(
  "media_url" => MEDIA_PATH,
  "thumb_url" => THUMB_PATH,
  "icon_url" => ICON_PATH,
  "template_url" => TEMPLATE_PATH,
  "template_image_url" => TEMPLATE_PATH."/images",
  "template_lang_image_url" => TEMPLATE_PATH."/images_".$config['language_dir'],
  "site_name" => $config['site_name'],
  "site_email" => $config['site_email'],
  "self" => $site_sess->url($self_url),
  "self_full" => $site_sess->url($script_url."/".$self_url),
  "script_version" => SCRIPT_VERSION,
  "cp_link" => ($user_info['user_level'] != ADMIN) ? "" : "\n<p align=\"center\">[<a href=\"".$site_sess->url(ROOT_PATH."admin/index.php")."\">Control Panel</a>]</p>\n",
  "total_categories" => $total_categories,
  "total_images" => $total_images,
  "url_new_images" => $site_sess->url(ROOT_PATH."search.php?search_new_images=1"),
  "url_top_images" => $site_sess->url(ROOT_PATH."top.php"),
  "url_top_cat_images" => $site_sess->url(ROOT_PATH."top.php".(($cat_id && preg_match("/categories.php/", $self_url)) ? "?".URL_CAT_ID."=".$cat_id : "")),
  "url_register" => (!empty($url_register)) ? $site_sess->url($url_register) : $site_sess->url(ROOT_PATH."register.php"),
  "url_search" => $site_sess->url(ROOT_PATH."search.php"),
  "url_lightbox" => $site_sess->url(ROOT_PATH."lightbox.php"),
  "url_control_panel" => (!empty($url_control_panel)) ? $site_sess->url($url_control_panel) : $site_sess->url(ROOT_PATH."member.php?action=editprofile"),
  "url_categories" => $site_sess->url(ROOT_PATH."categories.php"),
  "url_home" => $site_sess->url(ROOT_PATH."index.php"),
  "url_login" => (!empty($url_login)) ? $site_sess->url($url_login) : $site_sess->url(ROOT_PATH."login.php"),
  "url_logout" => (!empty($url_logout)) ? $site_sess->url($url_logout) : $site_sess->url(ROOT_PATH."logout.php"),
  "url_member" => (!empty($url_member)) ? $site_sess->url($url_member) : $site_sess->url(ROOT_PATH."member.php"),
  "url_upload" => (!empty($url_upload)) ? $site_sess->url($url_upload) : $site_sess->url(ROOT_PATH."member.php?action=uploadform"),
  "url_lost_password" => (!empty($url_lost_password)) ? $site_sess->url($url_lost_password) : $site_sess->url(ROOT_PATH."member.php?action=lostpassword")
));

if (!empty($additional_urls)) {
  $register_array = array();
  foreach ($additional_urls as $key => $val) {
    $register_array[$key] = $site_sess->url($val);
  }
  $site_template->register_vars($register_array);
}

// Replace Globals in $lang
$lang = $site_template->parse_array($lang);

$site_template->register_vars(array(
  "lang_site_stats" => $lang['site_stats'],
  "lang_registered_user" => $lang['registered_user'],
  "lang_random_image" => $lang['random_image'],
  "lang_categories" => $lang['categories'],
  "lang_sub_categories" => $lang['sub_categories'],
  "lang_new_images" => $lang['new_images'],
  "lang_top_images" => $lang['top_images'],
  "lang_search" => $lang['search'],
  "lang_advanced_search" => $lang['advanced_search'],
  "lang_lightbox" => $lang['lightbox'],
  "lang_register" => $lang['register'],
  "lang_control_panel" => $lang['control_panel'],
  "lang_login" => $lang['login'],
  "lang_auto_login" => $lang['lang_auto_login'],
  "lang_logout" => $lang['logout'],
  "lang_lost_password" => $lang['lost_password'],
  "lang_user_name" => $lang['user_name'],
  "lang_password" => $lang['password'],
  "lang_go" => $lang['go'],
  "lang_images_per_page" => $lang['images_per_page'],
  "lang_user_online" => $lang['user_online'],
  "lang_user_online_detail" => $lang['user_online_detail'],
  "charset" => $lang['charset'],
  "direction" => $lang['direction']
));

//-----------------------------------------------------
//--- Category Dropdown -------------------------------
//-----------------------------------------------------
$category_dropdown_selfjump = get_category_dropdown($cat_id, 1);
$site_template->register_vars("category_dropdown_selfjump", $category_dropdown_selfjump);
$category_dropdown_form = $site_template->parse_template("category_dropdown_form");
$site_template->register_vars(array("category_dropdown_form" => $category_dropdown_form));

$site_template->un_register_vars("category_dropdown_selfjump");
unset($category_dropdown_selfjump);
unset($category_dropdown_form);

//-----------------------------------------------------
//--- Random Image ------------------------------------
//-----------------------------------------------------
$random_image = (defined("SHOW_RANDOM_IMAGE") && SHOW_RANDOM_IMAGE == 0) ? "" : get_random_image();
$site_template->register_vars("random_image", $random_image);
unset($random_image);

//-----------------------------------------------------
//--- 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']));
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);

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

//-----------------------------------------------------
//--- Set Paging Vars ---------------------------------
//-----------------------------------------------------
if (isset($HTTP_POST_VARS['setperpage'])) {
  $setperpage = intval($HTTP_POST_VARS['setperpage']);
  if ($setperpage) {
    $site_sess->set_session_var("perpage", $setperpage);
    $session_info['perpage'] = $setperpage;
  }
}

if (isset($session_info['perpage'])) {
  $perpage = $session_info['perpage'];
}
else {
  $perpage = ceil($config['default_image_rows'] * $config['image_cells']);
}

//-----------------------------------------------------
//--- Set Perpage Dropdown ----------------------------
//-----------------------------------------------------
$setperpage_dropdown = "\n<select name=\"setperpage\" class=\"setperpageselect\">\n";
for($i = 1; $i <= $config['custom_row_steps']; $i++) {
  $setvalue = $config['image_cells'] * $i;
  $setperpage_dropdown .= "<option value=\"".$setvalue."\"";
    if ($setvalue == $perpage) {
    $setperpage_dropdown .= " selected=\"selected\"";
  }
  $setperpage_dropdown .= ">";
  $setperpage_dropdown .= $setvalue;
  $setperpage_dropdown .= "</option>\n";
}
$setperpage_dropdown .= "</select>\n";
if ($cat_id != 0) {
  $setperpage_dropdown .= "<input type=\"hidden\" name=\"cat_id\" value=\"".$cat_id."\" />\n";
}
if (isset($show_result) && $show_result == 1) {
  $setperpage_dropdown .= "<input type=\"hidden\" name=\"show_result\" value=\"1\" />\n";
}
$site_template->register_vars("setperpage_dropdown", $setperpage_dropdown);
$setperpage_dropdown_form = $site_template->parse_template("setperpage_dropdown_form");
$site_template->register_vars("setperpage_dropdown_form", $setperpage_dropdown_form);

$site_template->un_register_vars("setperpage_dropdown");
unset($setperpage_dropdown);
unset($setperpage_dropdown_form);

//-----------------------------------------------------
//--- Add & Delete from Lists -------------------------
//-----------------------------------------------------
if ($action == "addtolightbox" && $id) {
  if ($user_info['user_level'] >= USER) {
    $msg = (add_to_lightbox($id)) ? $lang['lightbox_add_success'] : $lang['lightbox_add_error'];
  }
  else {
    $msg = $lang['lightbox_register'];
  }
}
if ($action == "removefromlightbox" && $id) {
  if ($user_info['user_level'] >= USER) {
    $msg = (remove_from_lightbox($id)) ? $lang['lightbox_remove_success'] : $lang['lightbox_remove_error'];
  }
  else {
    $msg = $lang['lightbox_register'];
  }
}
if ($action == "clearlightbox") {
  if ($user_info['user_level'] >= USER) {
    $msg = (clear_lightbox()) ? $lang['lightbox_delete_success'] : $lang['lightbox_delete_error'];
  }
  else {
    $msg = $lang['lightbox_register'];
  }
}

//-----------------------------------------------------
//--- Save Rating -------------------------------------
//-----------------------------------------------------
if ($action == "rateimage" && $id) {
  $rating = intval($HTTP_POST_VARS['rating']);
  $cookie_name = (defined("COOKIE_NAME")) ? COOKIE_NAME : "4images_";
  $cookie_rated = isset($HTTP_COOKIE_VARS[$cookie_name.'rated']) ? unserialize(stripslashes($HTTP_COOKIE_VARS[$cookie_name.'rated'])) : array();
  if ($rating && $rating <= MAX_RATING && $id) {
    if (!isset($session_info['rated_imgs'])) {
      $session_info['rated_imgs'] = $site_sess->get_session_var("rated_imgs");
    }    
    $split_list = array();
    if (!empty($session_info['rated_imgs'])) {
      $split_list = explode(" ", $session_info['rated_imgs']);
    }
    if (!in_array($id, $split_list) && !in_array($id, $cookie_rated)) {
      $session_info['rated_imgs'] .= " ".$id;
      $session_info['rated_imgs'] = trim($session_info['rated_imgs']);
      $site_sess->set_session_var("rated_imgs", $session_info['rated_imgs']);
      $cookie_rated[] = $id;
      $cookie_expire = time() + 60 * 60 * 24 * 4;
      setcookie($cookie_name.'rated', serialize($cookie_rated), $cookie_expire, COOKIE_PATH, COOKIE_DOMAIN, COOKIE_SECURE);
      update_image_rating($id, $rating);
      $msg = $lang['voting_success'];
    }
    else {
      $msg = $lang['already_voted'];
    }
  }
  else {
    $msg = $lang['voting_error'];
  }
}

//-----------------------------------------------------
//--- Parse Header & Footer ---------------------------
//-----------------------------------------------------
if (isset($main_template) && $main_template) {
  $header = $site_template->parse_template("header");
  $footer = $site_template->parse_template("footer");
  $site_template->register_vars(array(
    "header" => $header,
    "footer" => $footer
  ));
  unset($header);
  unset($footer);
}

//-----------------------------------------------------
//--- User Box ----------------------------------------
//-----------------------------------------------------
if ($user_info['user_level'] >= USER) {
  $site_template->register_vars("lang_loggedin_msg", preg_replace("/".$site_template->start."loggedin_user_name".$site_template->end."/siU", $user_info['user_name'], $lang['lang_loggedin_msg']));
  $user_box = $site_template->parse_template("user_logininfo");
  $site_template->register_vars(array(
    "user_box" => $user_box,
    "user_loggedin" => 1,
    "user_loggedout" => 0,
    "is_admin" => ($user_info['user_level'] == ADMIN) ? 1 : 0
  ));  
  $site_template->un_register_vars("user_logininfo");
  unset($user_box);
}
else {
  $user_box = $site_template->parse_template("user_loginform");
  $site_template->register_vars(array(
    "user_box" => $user_box,
    "user_loggedin" => 0,
    "user_loggedout" => 1,
    "is_admin" => 0
  ));
  $site_template->un_register_vars("user_loginform");
  unset($user_box);
}
?>
Title: [Mod] Star Rating
Post by: V@no on May 13, 2003, 10:58:35 PM
Quote from: V@no
what is on line 152 in it?

and your answer is....? :roll:

P.S. Please dont post code from entire file, also next time please use [ code ] ... [ /code ] tags to show PIECE of code.

[EDITED]
this doesnt come with default page_header.php:
Code: [Select]
//-----------------------------------------------------
//--- 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']));
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);

//--- End Photo Of The Day ----------------------------
Title: [Mod] Star Rating
Post by: andersen on May 14, 2003, 06:22:23 AM
Thanks V@no!

since I had add below

"image_rating_round" => round($image_row['image_rating']),

to includes/functions.php

it works!

Thanks
Title: [Mod] Star Rating
Post by: devance on May 15, 2003, 03:05:27 AM
Parse error: parse error, unexpected T_STRING in /www/htdocs/v032550/4u/dev/4images/includes/functions.php on line 195


^^ dieser fehler kommt bei mir nach der installation des "star rating"-mods. was kann ich tun???


in line 195 steht folgendes:

Code: [Select]
if ($image_row['image_rating'] == '5.00') {
Title: [Mod] Star Rating
Post by: drhtm on May 24, 2003, 11:25:00 PM
great mod...wanted to know if it's possible to do two things:

first add the rating system to even the thumbnail section and second can it be set up so when the user rates, it doesn't refresh the page.  I have the 'add lightbox mod' created by V@no where you can add the pictures to your favorites without refreshing the page...anyway of doing this for the rating system...and even better, can it be made so the users just hover over the rating and picks the one they want instead of using a dropdown menu to rate.

I've seen this done at MSN entertainment with music rating.

Any help would be awesome..maybe if this is possible you can create a new Sticky Mod instead of letting this great idea get buried. Thanks.
Title: [Mod] Star Rating
Post by: drhtm on May 29, 2003, 12:07:12 AM
Quote from: drhtm
great mod...wanted to know if it's possible to do two things:

first add the rating system to even the thumbnail section and second can it be set up so when the user rates, it doesn't refresh the page.  I have the 'add lightbox mod' created by V@no where you can add the pictures to your favorites without refreshing the page...anyway of doing this for the rating system...and even better, can it be made so the users just hover over the rating and picks the one they want instead of using a dropdown menu to rate.

I've seen this done at MSN entertainment with music rating.

Any help would be awesome..maybe if this is possible you can create a new Sticky Mod instead of letting this great idea get buried. Thanks.


just wanted to bumb this up!
Title: [Mod] Star Rating
Post by: matthias44 on May 29, 2003, 02:21:43 PM
guter mod


mfg
Matthias
Title: [Mod] Star Rating
Post by: brandkanne on June 13, 2003, 12:36:43 AM
is it possible to configure the rating system so, that every user has to rate a pic by clicking to next or preview pic?

like an imagevote gallery?
Title: [Mod] Star Rating
Post by: Fuztug on June 22, 2003, 06:08:43 PM
Quote from: Nicky
well, you can add it where you want,


maybe just into details.html, just look for a good place ;)
nope does'nt work!
Title: Re: [Mod] Star Rating
Post by: marod0er on March 16, 2005, 11:51:11 PM
Quote from: uksoreeyes
Anyway to add the star rating to the top.php? It would be nice to show the start rating in the top 10s. Ive tried everything but cant get it to work. little help?

Carl
from the original MOD find:
Code: [Select]
   $register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";replace with:
Code: [Select]
   $register_array['image_rating_number_'.$i] = "<b><img src=\"".TEMPLATE_PATH."/images/".floor($top_list[$i]['image_rating']).".gif\">"."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";

This is all well and fine, but it just doesn't work.

What is it exactly you've done here? In my top.html i have:
Code: [Select]
{image_rating_1}

{image_rating_2}

{image_rating_3}

{image_rating_4}

{image_rating_5}

{image_rating_6}

{image_rating_7}

{image_rating_8}

{image_rating_9}

{image_rating_10}

Now, by placing the "star-rating" code next to those "ranking-varibles" how will it know which is which?

Let me demonstrate:

Code: [Select]
<table>
 <tr>
  <td>{image_rating_1}</td>
  <td>img src="templates/site/images/{rating_pic}"></td>
 </tr>
</table>

How can it know whether {rating_pic} refers to {image_rating_1}, {image_rating_2} or any of the others?
Title: Re: [Mod] Star Rating
Post by: ascanio on April 24, 2005, 01:45:12 AM
Here a I post new "stars" with transparent backgorund
I hopeu like them
(http://members.cox.net/jaime/0.gif)
(http://members.cox.net/jaime/1.gif)
(http://members.cox.net/jaime/2.gif)
(http://members.cox.net/jaime/3.gif)
(http://members.cox.net/jaime/4.gif)
(http://members.cox.net/jaime/5.gif)

If u use the 10 rating stars modification here are the other 5 :P

(http://members.cox.net/jaime/1h.gif)
(http://members.cox.net/jaime/2h.gif)
(http://members.cox.net/jaime/3h.gif)
(http://members.cox.net/jaime/4h.gif)
(http://members.cox.net/jaime/5h.gif)
Title: Re: [Mod] Star Rating
Post by: Prashant on April 25, 2005, 02:27:42 PM
OK, this will sound silly to you all but my stars dont appear. I dont know what I did wrong but can somebody please point me to the answer.
the url is http://www.merofoto.com/main there is a picture space there but the starts dont appear.
Title: Re: [Mod] Star Rating
Post by: V@no on April 25, 2005, 02:43:48 PM
inserted the new code in functions.php in the wrong place? (please dont post entire code of the file here ;))
Title: Re: [Mod] Star Rating
Post by: Prashant on April 25, 2005, 03:09:16 PM
V@NO : Ok, I had made myself clear that I was silly  8O yes and I had forgotten to upload the modified functions.php, thank you for the hint. All in a tiring day  :wink:
Title: Re: [Mod] Star Rating
Post by: ascanio on May 03, 2005, 06:42:25 PM
More Stars!!! If any body has the graph modification please post it, like the one that is on the privete message inbox folder
Title: Re: [Mod] Star Rating
Post by: ascanio on May 09, 2005, 03:59:36 AM
and more  :lol: :lol: :lol:
Title: Re: [Mod] Star Rating
Post by: martrix on May 09, 2005, 04:58:32 PM
very nice stars, Ascanio!  :D
Title: Re: [Mod] Star Rating
Post by: DerSchrauber on May 20, 2005, 03:55:51 PM
Hallo,
kann mir jemand sagen ich die Stars in das Bewertungs Pull-Down Menue einbinden kann?
 
Title: Re: [Mod] Star Rating
Post by: max.cady on May 21, 2005, 03:14:22 PM
Das müßte theoretisch gehen, wenn du in deinem template folder rate_form.html entsprechend abänderst

Code: [Select]
       <option value="">--</option>
                <option value="5">5</option>
                <option value="4">4</option>
                <option value="3">3</option>
                <option value="2">2</option>
                <option value="1">1</option>

und da wo die Zahlen stehen den Link zu den entsprechenden Sternen reinmachst.
Title: Re: [Mod] Star Rating
Post by: DerSchrauber on May 21, 2005, 06:58:03 PM
Hallo max.cady,
danke erst mal für den Tip. Ich denke da auch da muss man ansetzen. Ich habe jetzt auch schon etliche Versuche unternommen, es aber nicht hinbekommen (bin ein absoluter html-newbe). Ich habe aber auch schon eine (für mich) bessere alternative gefunden: Text statt Sterne im Pulldown.
Damit kann man auch ins negative bewerten.
trotzdem vielen Dank,
Title: Re: [Mod] Star Rating
Post by: ID25 on August 04, 2005, 11:09:00 PM
cookies live max 5min. in version 1.7.1
when i upload this
where is problem?
Title: Re: [Mod] Star Rating
Post by: V@no on August 05, 2005, 12:46:56 AM
cookies live max 5min. in version 1.7.1
when i upload this
where is problem?
after intalling this mod? 8O
/me find it extremly hard to belive
Title: Re: [Mod] Star Rating
Post by: ID25 on August 08, 2005, 02:37:11 PM
Maybe not :/
After this mod, my site work bad with sessions.
I can't search problem, where is mistake..
Title: Re: [Mod] Star Rating
Post by: V@no on August 09, 2005, 12:32:32 AM
Maybe not :/
After this mod, my site work bad with sessions.
I can't search problem, where is mistake..
then uninstall the mod...
Title: Re: [Mod] Star Rating
Post by: ID25 on August 09, 2005, 08:36:50 PM
I don't know.. after uninstall - not working sessions, users log out after 5sec - 6min.
maybe "globals on" in php.ini not working with 4images..
Title: Re: [Mod] Star Rating
Post by: V@no on August 10, 2005, 02:02:35 AM
I don't know.. after uninstall - not working sessions, users log out after 5sec - 6min.
maybe "globals on" in php.ini not working with 4images..

tell you what, lets start a new topic regarding this issue.
since this has nothing to do with the mod, no point discuss it here ;)
Title: Re: [Mod] Star Rating
Post by: Gulper on August 13, 2005, 03:51:35 PM
Can someone modify this script so, that I don't have to use the dropdown to rate an image but instead can click on the stars itself?... maybe also with a mouse-over event highlighting the star that the user is about to pick? For a rating with 5 stars, this would reuire 5 seperate stars with 3 conditions.... active / not active and highlighted... This way I can combine showing the rating and the rating process itself into one simple line, just showing the 5 stars.... Would be cool...
Title: Re: [Mod] Star Rating
Post by: Maniac on September 05, 2005, 10:25:09 PM
Parse error: parse error, unexpected T_STRING in /www/htdocs/v032550/4u/dev/4images/includes/functions.php on line 195


^^ dieser fehler kommt bei mir nach der installation des "star rating"-mods. was kann ich tun???


in line 195 steht folgendes:

Code: [Select]
if ($image_row['image_rating'] == '5.00') {

Sorry - don't speak German, but I think you were getting the same error I was. I checked the code after I copied and made sure there were no "strange invisible characters" between the lines.

Basically cleaned it up and re-pasted it into functions.php. Now it works.
Title: Re: [Mod] Star Rating
Post by: e-trader_2002 on September 07, 2006, 12:29:39 AM
Hallo,
kann mir jemand sagen ich die Stars in das Bewertungs Pull-Down Menue einbinden kann?
 
(http://www.4homepages.de/forum/index.php?action=dlattach;topic=923.0;id=93;image)
Das müßte theoretisch gehen, wenn du in deinem template folder rate_form.html entsprechend abänderst

Code: [Select]
       <option value="">--</option>
                <option value="5">5</option>
                <option value="4">4</option>
                <option value="3">3</option>
                <option value="2">2</option>
                <option value="1">1</option>

und da wo die Zahlen stehen den Link zu den entsprechenden Sternen reinmachst.

Hello,

can anybody tell me how to modify function show_image in functions.php in order to display the star-image-grafics (http://www.4homepages.de/forum/index.php?action=dlattach;topic=923.0;id=76;image) in the menu in rate_form.html ?

I tried this in functions.php

[qcode]  $rate_form = "";
   $rating_pic_1 = "<img src=\"".TEMPLATE_PATH."/images/apples_1x.gif\" align=\"middle\" width=\"65\" height=\"16\" alt=\"\">";
   $rating_pic_2 = "<img src=\"".TEMPLATE_PATH."/images/apples_2x.gif\" align=\"middle\" width=\"65\" height=\"16\" alt=\"\">";
   $rating_pic_3 = "<img src=\"".TEMPLATE_PATH."/images/apples_3x.gif\" align=\"middle\" width=\"65\" height=\"16\" alt=\"\">";
   $rating_pic_4 = "<img src=\"".TEMPLATE_PATH."/images/apples_4x.gif\" align=\"middle\" width=\"65\" height=\"16\" alt=\"\">";
   $rating_pic_5 = "<img src=\"".TEMPLATE_PATH."/images/apples_5x.gif\" align=\"middle\" width=\"65\" height=\"16\" alt=\"\">";
  if (check_permission("auth_vote", $image_row['cat_id'])) {
    $site_template->register_vars(array(
         "rate" => $lang['rate'],
         "Please_rate" => $lang['Please_rate'],
         "lang_top" => $lang['lang_top'],
         "lang_above_average" => $lang['lang_above_average'],
         "lang_average" => $lang['lang_average'],
         "lang_below_average" => $lang['lang_below_average'],
         "lang_flop" => $lang['lang_flop'],
         "rating_pic_1" => $rating_pic_1,
         "rating_pic_2" => $rating_pic_2,
         "rating_pic_3" => $rating_pic_3,
         "rating_pic_4" => $rating_pic_4,
         "rating_pic_5" => $rating_pic_5
      ));
    $rate_form = $site_template->parse_template("rate_form");
  }
  $site_template->register_vars("rate_form", $rate_form);
[/qcode]

in combination with this in rate_form.html

[qcode]            <td valign="bottom">
              <select name="rating" class="select">
                <option value="">{Please_rate}</option>
                <option value="5">{rating_pic_5} 5 - {lang_top}</option>
                <option value="4">{rating_pic_4} 4 - {lang_above_average}</option>
                <option value="3">{rating_pic_3} 3 - {lang_average}</option>
                <option value="2">{rating_pic_2} 2 - {lang_below_average}</option>
                <option value="1">{rating_pic_1} 1 - {lang_flop}</option>
              </select>
            <td>
[/qcode]

But no grafics show up. Please give me a hint.

Thanks in advance

e-trader_2002
Title: Re: [Mod] Star Rating
Post by: V@no on September 07, 2006, 02:17:14 AM
you cant use graphics in standart dropdown forms.
Title: Re: [Mod] Star Rating
Post by: e-trader_2002 on September 07, 2006, 08:53:45 PM
Hi V@no,

thanks for answering my question. But are you sure about that? :wink: I took it as a challenge and I've found a workaround to have the grafics in my standard dropdown form now. You can see it at the uploaded picture. It's real (not a hoax) and it's very simple to do. Just a few lines in two 4images-modules. If somebody is interested in the code, leave me a message in this thread and I will post the necessary changes.

e-trader_2002
Title: Re: [Mod] Star Rating
Post by: mawenzi on September 07, 2006, 09:24:44 PM
If somebody is interested in the code, leave me a message in this thread and I will post the necessary changes.

I'm interested ...  8O
Title: Re: [Mod] Star Rating
Post by: e-trader_2002 on September 07, 2006, 10:17:05 PM
If somebody is interested in the code, leave me a message in this thread and I will post the necessary changes.

I'm interested ...  8O

Hi mawenzi,

add the red code-fragments to rate_form.html:

[qcode]
<form method="post" action="{self}">
  <table border="0" cellspacing="0" cellpadding="1">
    <tr>
      <td class="head1">
        <table border="0" cellspacing="0" cellpadding="3" class="row1">
          <tr>
            <td valign="bottom">
              <select name="rating" class="select">
                <option value="">{Please_rate}</option>
                <option id="apples_5x" value="5">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5 - {lang_top}</option>
                <option id="apples_4x" value="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4 - {lang_above_average}</option>
                <option id="apples_3x" value="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3 - {lang_average}</option>
                <option id="apples_2x" value="2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2 - {lang_below_average}</option>
                <option id="apples_1x" value="1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1 - {lang_flop}</option>
              </select>
            <td>
              <input type="hidden" name="action" value="rateimage" />
              <input type="hidden" name="id" value="{image_id}" />
              <input type="submit" value="{rate}" class="button" name="submit" />
            </td>
          </tr>
        </table>
      </td>
    </tr>
  </table>
</form>
[/qcode]

At the bottom of style.css add this:

[qcode]
/*--Rating--------------------------------------------------*/
#apples_1x {
   background-image:url(/4images/templates/Fruitsticker/images/apples_1x.gif);
   background-repeat:no-repeat;
}
#apples_2x {
   background-image:url(/4images/templates/Fruitsticker/images/apples_2x.gif);
   background-repeat:no-repeat;
}
#apples_3x {
   background-image:url(/4images/templates/Fruitsticker/images/apples_3x.gif);
   background-repeat:no-repeat;
}
#apples_4x {
   background-image:url(/4images/templates/Fruitsticker/images/apples_4x.gif);
   background-repeat:no-repeat;
}
#apples_5x {
   background-image:url(/4images/templates/Fruitsticker/images/apples_5x.gif);
   background-repeat:no-repeat;
}

[/qcode]

Necessary individual changes:


That's all. And I think that's my first small 4images-MOD.

I hope many users will enjoy this and I would like a PM with a link to the site from everybody, who has implemented this MOD.

e-trader_2002
Title: Re: [Mod] Star Rating
Post by: mawenzi on September 08, 2006, 12:00:46 AM
@ e-trader_2002 

... thanks for this tutorial ...  :D
... but it works unfortunately not in all browsers ...

... FF :  :thumbup: ...  :D
... IE :  :thumbdown: ...  :cry:
Title: Re: [Mod] Star Rating
Post by: V@no on September 08, 2006, 01:27:20 AM
Unfortunetly it doesnt work in opera either...
Title: Re: [Mod] Star Rating
Post by: e-trader_2002 on September 09, 2006, 12:29:59 AM
Hi,

sorry for not having tested with other browers than FF. :oops: But it works with :thumbup: Netscape 7.0x too. Maybe because Netscape uses the same or a very similar engine as FF as far as I know. And it causes no problems with IE; the grafics just aren't displayed.
So everybody can choose to use this little MOD and hope that future versions of IE and other browsers may support this feature.

e-trader_2002
Title: Re: [Mod] Star Rating
Post by: maus on June 09, 2007, 09:19:55 AM
hallo


nur probeweise bei der details.html. auch die bilder ins image verzeichnis kopiert, aber ich sehe keine sternchen. bitte um hilfe
Title: Re: [Mod] Star Rating
Post by: e@agle on July 12, 2007, 04:37:49 PM
can i see a demo pls, for what it's
Title: Re: [Mod] Star Rating
Post by: dMark on November 27, 2008, 11:18:03 AM
in /includes/functions.php find:
Code: [Select]
"image_rating_round" => round($image_row['image_rating']),in templates:
Code: [Select]
<img src="{template_image_url}/{image_rating_round}.gif">
Images: 1.gif, 2.gif, 3.gif, 4.gif, 5.gif
works fine!!!

Default Rating 2.00...2.45=2.gif and 2.50...3.00=3.gif

V@no    how to make Rating 2.20...2.80=2.5.gif ? Where to file 1.5.gif, 2.5.gif, 3.5.gif, 4.5.gif, 5.5.gif
Help me. Sorry for bad English


Title: Re: [Mod] Star Rating
Post by: V@no on November 27, 2008, 07:57:47 PM
Hello and welcome to 4images forum.

First of all, please read our forum rules (link in my signature). This is regarding the PM you've sent.

Second, replace:
Code: [Select]
  if ($image_row['image_rating'] == '5.00') {
     $rating_pic = "5.gif";
  } elseif ($image_row['image_rating'] >= '4.00') {
     $rating_pic = "4.gif";
  } elseif ($image_row['image_rating'] >= '3.00') {
     $rating_pic = "3.gif";
  } elseif ($image_row['image_rating'] >= '2.00') {
     $rating_pic = "2.gif";
  } elseif ($image_row['image_rating'] >= '1.00') {
     $rating_pic = "1.gif";
  } else {
     $rating_pic = "0.gif";
  }

With this:
Code: [Select]
  $ratings = array("0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5");
  foreach ($ratings as $num)
  {
    if ($image_row['image_rating'] >= $num)
    {
      $rating_pic = $num;
    }
  }
  $rating_pic .= ".gif";
Title: Re: [Mod] Star Rating
Post by: dMark on November 28, 2008, 01:19:18 PM
this:
Code: [Select]
  $ratings = array("0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5");
  foreach ($ratings as $num)
  {
    if ($image_row['image_rating'] >= $num)
    {
      $rating_pic = $num;
    }
  }
  $rating_pic .= ".gif";



Has not understood. In what file to change these lines??? :oops:

I do not have this:
Code: [Select]
  if ($image_row['image_rating'] == '5.00') {
     $rating_pic = "5.gif";
  } elseif ($image_row['image_rating'] >= '4.00') {
     $rating_pic = "4.gif";
  } elseif ($image_row['image_rating'] >= '3.00') {
     $rating_pic = "3.gif";
  } elseif ($image_row['image_rating'] >= '2.00') {
     $rating_pic = "2.gif";
  } elseif ($image_row['image_rating'] >= '1.00') {
     $rating_pic = "1.gif";
  } else {
     $rating_pic = "0.gif";
  }
Title: Re: [Mod] Star Rating
Post by: V@no on November 28, 2008, 06:36:51 PM
install the mod from the first page and you should have this.
Title: Re: [Mod] Star Rating
Post by: Anarchology on January 09, 2009, 02:43:16 AM
EDIT: Oops, I put this in the wrong topic thread!
Title: Re: [Mod] Star Rating
Post by: ashfaq on January 09, 2009, 08:19:34 AM

// upload pics into your /templates/YOURTEMPLATE/images / uploade die bilder ins /templates/DEINTEMPLATE/images

// DEMO: no more available / nicht mehr verfügbar

Where are the star rank pictures to download ?
Title: Re: [Mod] Star Rating
Post by: mawenzi on January 09, 2009, 09:15:52 AM
Where are the star rank pictures to download ?

... here (http://www.4homepages.de/forum/index.php?topic=923.msg3990#msg3990) ... at the bottom ...
... there are 6 nice star rank images with white background ( ok ... looks like one image, but there are 6 images ... ;) ) ...
Title: Re: [Mod] Star Rating
Post by: ashfaq on January 09, 2009, 05:22:09 PM
Thanks mawenzi it really works but i need some modifications if you plz help.. i add code at thumbnail_bit.html

1: How enable it to also rate at category.html by hover on stars on thumbnails as now its only show rates given by details page?
2: What to do that registered users or guests also rate from category thumbnails page ? (Two modifications for guest & users)
3: Are there any more beautifull rank images in small sizes like given in topic ?
Title: Re: [Mod] Star Rating
Post by: mawenzi on January 09, 2009, 06:30:31 PM
@ ashfaq

... why you don't use the ajax starrating mod by KurtW ... ?
... http://www.4homepages.de/forum/index.php?topic=17829.0 ...
... this version of image rating will solved all your problems ...
Title: Re: [Mod] Star Rating
Post by: ashfaq on January 10, 2009, 03:24:55 AM
@ mawenzi

Your given star rating link is very difficult but this mod is very easy so i ask some modifications for it.
Title: Re: [Mod] Star Rating
Post by: mawenzi on January 10, 2009, 03:46:08 PM
... mmm ... I think, it is only copy and past by a excelent mod description of KurtW ...
... so it can't be difficult ... ;)
... I do not think that Nicky this modification will continue develop ...
Title: Re: [Mod] Star Rating
Post by: Fere on January 27, 2009, 10:32:02 PM
Hello and welcome to 4images forum.

First of all, please read our forum rules (link in my signature). This is regarding the PM you've sent.

Second, replace:
Code: [Select]
  if ($image_row['image_rating'] == '5.00') {
     $rating_pic = "5.gif";
  } elseif ($image_row['image_rating'] >= '4.00') {
     $rating_pic = "4.gif";
  } elseif ($image_row['image_rating'] >= '3.00') {
     $rating_pic = "3.gif";
  } elseif ($image_row['image_rating'] >= '2.00') {
     $rating_pic = "2.gif";
  } elseif ($image_row['image_rating'] >= '1.00') {
     $rating_pic = "1.gif";
  } else {
     $rating_pic = "0.gif";
  }

With this:
Code: [Select]
  $ratings = array("0", "0.5", "1", "1.5", "2", "2.5", "3", "3.5", "4", "4.5", "5");
  foreach ($ratings as $num)
  {
    if ($image_row['image_rating'] >= $num)
    {
      $rating_pic = $num;
    }
  }
  $rating_pic .= ".gif";

nice mod, thanks!
Title: Re: [Mod] Star Rating
Post by: 4ella on May 14, 2009, 03:08:44 PM
Quote
@ ashfaq  written by Mawenzi  in January 2009
  ... why you don't use the ajax starrating mod by KurtW ... ?
... http://www.4homepages.de/forum/index.php?topic=17829.0 ...
... this version of image rating will solved all your problems ...
Hello I was searching for some AJAX Star Rating but there's no mod at all , what happened with them ? or they are off my limits like the forum info is telling me ?

The topic or board you are looking for appears to be either missing or off limits to you.
Title: Re: [Mod] Star Rating
Post by: Nicky on May 14, 2009, 03:36:24 PM
4ella,
http://www.4homepages.de/forum/index.php?topic=24703.0
Title: Re: [Mod] Star Rating
Post by: 4ella on May 14, 2009, 04:33:27 PM
Ahh ok  :(  ,  It's a pity , I understand him , he did good , some people doesn't respect others works , to put his copyright below is the smallest thing what people who knows nothing about programming and creating Mods like me can do . Nicky thanks for you reply .

so finally I use this Mod when Kurts are not available anymore and I'm satisfied too
 wanting to know 2 things :

1. How can I use this star rating for every category ? My categories serves also like Girls and nightclub profiles so it would be convenient to have this Mod there too .

2, How can I use it below every thumbnail ? in index.php or in categories.php
Title: Re: [Mod] Star Rating
Post by: waynenort on July 31, 2009, 03:25:12 PM
Cool mod Nicky.  :wink:
Title: Re: [Mod] Star Rating
Post by: alekseyn1 on November 24, 2009, 10:53:53 PM
Can someone modify this script so, that I don't have to use the dropdown to rate an image but instead can click on the stars itself?... maybe also with a mouse-over event highlighting the star that the user is about to pick? For a rating with 5 stars, this would reuire 5 seperate stars with 3 conditions.... active / not active and highlighted... This way I can combine showing the rating and the rating process itself into one simple line, just showing the 5 stars.... Would be cool...

Anyone ever tried this?

the only other mode (AJAX rating) rates images in non-rounded figures... most of the users need 1,2,3,4,5... and that's it) therefore this mod would be great if implemented like I quoted above.
Title: Re: [Mod] Star Rating
Post by: Lucifix on November 25, 2009, 07:32:38 AM
Can someone modify this script so, that I don't have to use the dropdown to rate an image but instead can click on the stars itself?... maybe also with a mouse-over event highlighting the star that the user is about to pick? For a rating with 5 stars, this would reuire 5 seperate stars with 3 conditions.... active / not active and highlighted... This way I can combine showing the rating and the rating process itself into one simple line, just showing the 5 stars.... Would be cool...

Anyone ever tried this?

the only other mode (AJAX rating) rates images in non-rounded figures... most of the users need 1,2,3,4,5... and that's it) therefore this mod would be great if implemented like I quoted above.

I presume that you are looking something like this:
http://orkans-tmp.22web.net/star_rating/

I've implented this is my gallery, but if you look at that code (link above) you'll see that this is not so hard to do ;)
Title: Re: [Mod] Star Rating
Post by: alekseyn1 on November 25, 2009, 08:29:47 AM

I presume that you are looking something like this:
http://orkans-tmp.22web.net/star_rating/

I've implented this is my gallery, but if you look at that code (link above) you'll see that this is not so hard to do ;)

Great link! thanks very much..
But I do not have enough knowledge to rework the version i like (demo6) to implement to my site ((((
Title: Re: [Mod] Star Rating
Post by: Sunny C. on April 23, 2010, 10:08:55 AM
Ist es denn eigentlich möglich, dass man in einzelnen Templates extra bewerten kann?
z.B ich lege eine seite an index.php?template=xtra-image
Ist es möglich auch dort zu bewerten?