• [Mod] Star Rating 5 0 5 1
Currently:  

Author Topic: [Mod] Star Rating  (Read 131963 times)

0 Members and 1 Guest are viewing this topic.

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
[Mod] Star Rating
« 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)








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

// DEMO: no more available / nicht mehr verfügbar
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline giffy007

  • Full Member
  • ***
  • Posts: 119
    • View Profile
[Mod] Star Rating
« Reply #1 on: July 05, 2002, 02:31:49 PM »
Can you please put this in Englsh

Thanks

Giffy :wink:

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
[Mod] Star Rating
« Reply #2 on: July 05, 2002, 02:41:45 PM »
hi,

sorry ?

look at //
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline [TraXX

  • Newbie
  • *
  • Posts: 26
    • View Profile
[Mod] Star Rating
« Reply #3 on: July 12, 2002, 05:38:10 PM »
thx....habs eingebaut...es funzt...und es gefällt mir :D


Dankeschön!  8)
-= Seize the Day=-

Offline Harry

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • http://7summits.com
Re: [Mod] Star Rating
« Reply #4 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
Trips & Expeditions to the 7 summits: the highest mountains on the seven continents. Kilimanjaro, Aconcagua and more!
Check out http://7summits.com

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
[Mod] Star Rating
« Reply #5 on: July 16, 2002, 12:03:46 PM »
Hi,

includes/constants.php:

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

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline Harry

  • Newbie
  • *
  • Posts: 33
    • View Profile
    • http://7summits.com
[Mod] Star Rating
« Reply #6 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
Trips & Expeditions to the 7 summits: the highest mountains on the seven continents. Kilimanjaro, Aconcagua and more!
Check out http://7summits.com

Offline X-Fan

  • Full Member
  • ***
  • Posts: 117
    • View Profile
    • http://www.comixfan.com/xfan/
Re: [Mod] Star Rating
« Reply #7 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?
Eric J. Moreels
ComiX-Fan Editor-in-Chief
e-mail: webmaster@comixfan.cjb.net
Web: http://www.comixfan.com/xfan
AIM: XFan2k

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
[Mod] Star Rating
« Reply #8 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 ;)
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline hoelzlmani

  • Newbie
  • *
  • Posts: 24
    • View Profile
    • http://www.smssprueche.net
[Mod] Star Rating
« Reply #9 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.

Offline Nicky

  • Administrator
  • 4images Guru
  • *****
  • Posts: 3.195
    • View Profile
[Mod] Star Rating
« Reply #10 on: October 22, 2002, 06:35:08 PM »
ich sehe dass das problem gelöst worden ist...
sehr schön.
cheers
Nicky
Your first three "must do" before you ask a question ! (© by V@no)
- please read the Forum Rules ...
- please study the FAQ ...
- please try to Search for your answer ...

nicky.net 4 4images
Signature stolen from mawenzi

Offline sprokop

  • Newbie
  • *
  • Posts: 25
    • View Profile
Re: [Mod] Star Rating
« Reply #11 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)








// 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:
--
   __O
 _-\<,_     Why drive when you can bike?
(_)/ (_)

Offline Der_Nick

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • http://www.fetteseite.com
[Mod] Star Rating
« Reply #12 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?

Offline Der_Nick

  • Newbie
  • *
  • Posts: 46
    • View Profile
    • http://www.fetteseite.com
[Mod] Star Rating
« Reply #13 on: November 28, 2002, 10:24:33 PM »
ok, erledigt!habs endlich gefunden!

Offline Shap

  • Full Member
  • ***
  • Posts: 114
    • View Profile
[Mod] Star Rating
« Reply #14 on: November 30, 2002, 11:49:17 PM »
anyone have a demo yet???