MOD WORKS ONLY ON 1.7.1! - NO SUPPORT FOR NEWER VERSIONS OF 4IMAGES!Info: I've searched the whole forum about any related topic, yes there are, but no working ones (for me), one is in spanish, the other is making errors, so i worked a little bit and (with the help of
V@no) combine some stuff to get a working "Hor or Not" MOD. There were many requests for such a MOD, so here it is.
The MOD:User opens detailed version of an image, instead of the rating button, he sees radio-buttons from 1 to 5 (or more if you change the rating)
above the image. After clicking on a radio-button, the rating is added to the database and he will be automaticly redirected to the next image in the category (folder), if there is one.
Demo:official version:
www.hotornot.com4images:
www.zapomnime.com *user name "test", password "test"*
Required MODshttp://www.4homepages.de/forum/index.php?topic=7493.0Changed files:/templates/rate_form.html
/templates/details.html
/details.php
Tested on 4images 1.7.1 with Firefox & IE
--------------------------------------------------------------------------------------------------------------------------------------------------------
1.open
details.phpfind:
show_image($image_row, $mode, 0, 1);
move below:unset($next_prev_cache);
save file
2.open
details.htmlfind:
{image}
replace with:{if next_image_url}<a href="{next_image_url}">{endif next_image_url}
{if_rate_form} {rate_form} {end_if_rate_form} {image}
{if next_image_url}</a>{endif next_image_url}
{lang_image_rating}: {image_rating} ({image_votes} {lang_votes})<img src="{template_url}/images/{rating_pic}" alt="" />
Add "<img src="{template_url}/images/{rating_pic}" alt="" />"
only if you've installed Nicky's "Star Rating MOD"
http://www.4homepages.de/forum/index.php?topic=923.msg3990#msg3990 If not, delete it.
find:
{if rate_form}
<div align="center">{rate_form}</div>
{endif rate_form}
delete it, or leave it if you want a second rate form
under the image.
save file
3.open
rate_form.htmlfind:
<form method="post" action="{self}">
There are two ways for the next step:a)
if you applyed fix [1.7.1] Conditional tags inside other conditional tags + {ifno ...}{endifno ...} http://www.4homepages.de/forum/index.php?topic=7493.0 replace with:
<FORM action={if next_image_url}{next_image_url}{endif next_image_url}{ifno next_image_url}{self}{endifno next_image_url} method=post target=_top>
b)
If you haven't applied that fixreplace with:
<FORM action={if next_image_url}{next_image_url}&{endif next_image_url}{self} method=post target=_top>
find:
<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="">--</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>
</select>
</td>
<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>
replace with: <TABLE borderColor=#000000 cellSpacing=0 cellPadding=0 width=450>
<TBODY>
<TR vAlign=top>
<TD align=top width="440"> <TABLE borderColor=#000000 cellSpacing=0 cellPadding=1 width="100%" class="head2">
<TBODY>
<TR vAlign=top>
<TD align=middle> <TABLE width=445 border=0>
<TBODY>
<TR>
<TD align=middle colSpan=3 width="445"> <b>Vote!</b></font></TD>
</TR>
<TR>
<TD width="62"></TD>
<TD align=middle width="319"> <table border="0" cellspacing="1" width="100%">
<tr>
<td align="center">1</td>
<td align="center">2</td>
<td align="center">3</td>
<td align="center">4</td>
<td align="center">5</td>
</tr>
<tr>
<td><input onclick=submit() type="radio" value="1" name="rating" ></td>
<td><input onclick=submit() type="radio" value="2" name="rating"></td>
<td><input onclick=submit() type="radio" value="3" name="rating"></td>
<td><input onclick=submit() type="radio" value="4" name="rating"></td>
<td><input onclick=submit() type="radio" value="5" name="rating"></td>
</tr>
</table></TD>
<TD width="29"></TD>
</TR>
<TR>
<TD width="62"><FONT color=#006699 size=2><B>NOT</B></FONT></TD>
<TD align=middle width="319"> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<center><img src="{template_url}/images/hotornotback.gif" border="0" alt="" /></center>
</TBODY>
</TABLE></TD>
<TD width="29"><FONT color=#cc3300 size=2><B>HOT</B></FONT></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE></TD>
</TR>
</TBODY>
</TABLE>
<input type="hidden" name="action" value="rateimage">
<input type="hidden" name="id" value="{image_id}">
Thats just a sample html, you have to change some details if youre using an other template or want (f.e.) a smaller box etc. Also you have to change the words "Vote!", "Hot" and "Not" above to whatever you like. If you want to have more voting options (e.g. 1 - 10) check this topic
http://www.4homepages.de/forum/index.php?topic=6674.0save file
upload the "hotornotback.gif" into your template/.../images folder. You can make one on you own in Photoshop, or just use this (for a 1 - 12 rating system):
Your done! Thanks a lot to
V@no (who wrote the redirect function) and to Lavazza (Yes coffee is important when you code)