4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Releases & Support) => Topic started 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
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)
<img src="{template_url}/images/{rating_pic}" width="55" height="10" alt="" />
// OR / ODER
<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
-
Can you please put this in Englsh
Thanks
Giffy :wink:
-
hi,
sorry ?
look at //
-
thx....habs eingebaut...es funzt...und es gefällt mir :D
Dankeschön! 8)
-
// OPEN / ÖFFNE includes/functions.php:
// ADD AFTER / HINZUFÜGEN DANACH
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
-
Hi,
includes/constants.php:
define('MAX_RATING', 5);
Jan
-
Hi,
includes/constants.php:
define('MAX_RATING', 5);
Jan
:idea: (another aha moment) :wink:
Yep, that works,
thanks a lot, best regards,
Harry
-
// ADD IN TEMPLATE(S) / FÜGE DIES IN DEIN(E) TEMPLATE(S)
<img src="{template_url}/images/{rating_pic}" width="55" height="10" alt="" />
// OR / ODER
<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?
-
well, you can add it where you want,
maybe just into details.html, just look for a good place ;)
-
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.
-
ich sehe dass das problem gelöst worden ist...
sehr schön.
-
// 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
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)
<img src="{template_url}/images/{rating_pic}" width="55" height="10" alt="" />
// OR / ODER
<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:
-
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?
-
ok, erledigt!habs endlich gefunden!
-
anyone have a demo yet???
-
// 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
-
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
-
just wanted to say GREAT MOD!
THANKS!
-
please demo
-
please demo
A demo of the start system (slightly adapted, see posts) can be found on
http://7summits.com/images
Regards,
Harry
-
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
-
// 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:
-
I dont get it... in which file should i insert this? :oops:
into category_bit.html
-
into category_bit.html
Then the code looks like this?
<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> ({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?
-
Sorry, just noticed, that I gave you the wrong answer :oops:
You should insert it under the thumbnail, info 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_lang_image_url}/{rating_pic}" alt="{lang_rating} {image_rating} ({image_votes} {lang_votes})" /><br />
{lightbox_button}
-
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?
-
keine antowort :) :lol:
-
In welchem Template?!?
-
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
-
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: $register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
replace with: $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'].")";
-
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:
$register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
replace with:
$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:$register_array['image_votes_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
replace with:
$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
-
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
-
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:"image_rating" => $image_row['image_rating'],
add after:"image_rating_round" => round($image_row['image_rating']),
then, in templates add this:
<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
-
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?
-
and the problem is....?
-
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
===========================
-
ok, but did u install Photo Of The Day mod?
-
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?
-
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.
-
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?
-
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.
-
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 /_\
-
hmm...seems that u didnt overwrite /includes/page_header.php with new file from the package...
what is on line 152 in it?
-
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);
}
?>
-
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://-----------------------------------------------------
//--- 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 ----------------------------
-
Thanks V@no!
since I had add below
"image_rating_round" => round($image_row['image_rating']),
to includes/functions.php
it works!
Thanks
-
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:
if ($image_row['image_rating'] == '5.00') {
-
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.
-
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!
-
guter mod
mfg
Matthias
-
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?
-
well, you can add it where you want,
maybe just into details.html, just look for a good place ;)
nope does'nt work!
-
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: $register_array['image_rating_number_'.$i] = "<b>".$top_list[$i]['image_rating']."</b> (".$top_list[$i]['image_votes']." ".$lang['votes'].")";
replace with: $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:
{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:
<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?
-
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)
-
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.
-
inserted the new code in functions.php in the wrong place? (please dont post entire code of the file here ;))
-
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:
-
More Stars!!! If any body has the graph modification please post it, like the one that is on the privete message inbox folder
-
and more :lol: :lol: :lol:
-
very nice stars, Ascanio! :D
-
Hallo,
kann mir jemand sagen ich die Stars in das Bewertungs Pull-Down Menue einbinden kann?
-
Das müßte theoretisch gehen, wenn du in deinem template folder rate_form.html entsprechend abänderst
<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.
-
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,
-
cookies live max 5min. in version 1.7.1
when i upload this
where is problem?
-
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
-
Maybe not :/
After this mod, my site work bad with sessions.
I can't search problem, where is mistake..
-
Maybe not :/
After this mod, my site work bad with sessions.
I can't search problem, where is mistake..
then uninstall the mod...
-
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..
-
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 ;)
-
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...
-
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:
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.
-
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
<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
-
you cant use graphics in standart dropdown forms.
-
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
-
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
-
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"> 5 - {lang_top}</option>
<option id="apples_4x" value="4"> 4 - {lang_above_average}</option>
<option id="apples_3x" value="3"> 3 - {lang_average}</option>
<option id="apples_2x" value="2"> 2 - {lang_below_average}</option>
<option id="apples_1x" value="1"> 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:
- Use picture-files of your choice. It's cool to use .gif-pictures with transparent background for this.
- You may change the names used as id (i. e. apples_3x) in both modules to whatever you like. They are not related to the names of the picture-files.
- Insert as many ... as necessary into rate_form.html to move the follow-up text to the right far enough, so that it won't overlap with the picture
- Reduce the height of the pictures you use, so that they will fit the height of the row-entries of the selection dropdown list
- It should be more than easy :wink: to expand this MOD to more than 5 rating-ranks
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
-
@ e-trader_2002
... thanks for this tutorial ... :D
... but it works unfortunately not in all browsers ...
... FF : :thumbup: ... :D
... IE : :thumbdown: ... :cry:
-
Unfortunetly it doesnt work in opera either...
-
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
-
hallo
nur probeweise bei der details.html. auch die bilder ins image verzeichnis kopiert, aber ich sehe keine sternchen. bitte um hilfe
-
can i see a demo pls, for what it's
-
in /includes/functions.php find:
"image_rating_round" => round($image_row['image_rating']),
in templates:
<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
-
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: 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:
$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";
-
this:
$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:
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";
}
-
install the mod from the first page and you should have this.
-
EDIT: Oops, I put this in the wrong topic thread!
-
// 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 ?
-
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 ... ;) ) ...
-
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 ?
-
@ 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 ...
-
@ mawenzi
Your given star rating link is very difficult but this mod is very easy so i ask some modifications for it.
-
... 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 ...
-
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: 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:
$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!
-
@ 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.
-
4ella,
http://www.4homepages.de/forum/index.php?topic=24703.0
-
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
-
Cool mod Nicky. :wink:
-
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.
-
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 ;)
-
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 ((((
-
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?