4images Forum & Community
4images Modifications / Modifikationen => Mods & Plugins (Requests & Discussions) => Topic started by: ruudvroon on October 29, 2005, 07:31:50 PM
-
I have a nice ratingfuncton with smileys, but I don't no how to intergrate it with 4images.
You can see a preview at: http://www.aftertheparty.nl/test.html
Can someone please help me to "intergrate" this function?
-
you need to edit the rate_form.html Template like this:
<!-- start rate_form.html -->
<br />
<table width="100%" border="0" cellspacing="1" cellpadding="3" class="head1">
<tr>
<td valign="top" >{rate}</td>
</tr>
<tr>
<td class="row1"><table border="0" align="center" cellpadding="1" cellspacing="0">
<tr ><form method="post" action="{self}">
<td>
<input type="hidden" name="action" value="rateimage" />
<input type="hidden" name="id" value="{image_id}" />
<input type="hidden" name="rating" value="1" />
<input src="{template_url}/images/smilies_1.gif" type="image" name="Mangelhaft" value="Mangelhaft" alt="Mangelhaft" title="Mangelhaft"/>
</td></form><form method="post" action="{self}">
<td>
<input type="hidden" name="action" value="rateimage" />
<input type="hidden" name="id" value="{image_id}" />
<input type="hidden" name="rating" value="2" />
<input src="{template_url}/images/smilies_2.gif" type="image" name="Ausreichend" value="Ausreichend" alt="Ausreichend" title="Ausreichend"/>
</td></form><form method="post" action="{self}">
<td>
<input type="hidden" name="action" value="rateimage" />
<input type="hidden" name="id" value="{image_id}" />
<input type="hidden" name="rating" value="3" />
<input src="{template_url}/images/smilies_3.gif" type="image" name="Befriedigend" value="Befriedigend" alt="Befriedigend" title="Befriedigend"/>
</td></form><form method="post" action="{self}">
<td>
<input type="hidden" name="action" value="rateimage" />
<input type="hidden" name="id" value="{image_id}" />
<input type="hidden" name="rating" value="4" />
<input src="{template_url}/images/smilies_4.gif" type="image" name="Gut" value="Gut" alt="Gut" title="Gut"/>
</td></form><form method="post" action="{self}">
<td>
<input type="hidden" name="action" value="rateimage" />
<input type="hidden" name="id" value="{image_id}" />
<input type="hidden" name="rating" value="5" />
<input src="{template_url}/images/smilies_5.gif" type="image" name="Sehr gut" value="Sehr gut" alt="Sehr gut" title="Sehr gut"/>
</td></form>
</tr>
</table></td>
</tr>
</table>
<!-- end rate_form.html -->
-
The code I now have is working, but when I intergrate it in the template (I added the javescript in the header) the javascrip doesn't work :S
Example at: www.aftertheparty.nl/test2.html
-
use a name for the form tag (name="form") and use it in the Javascript...
rating_imgo = new Array(6);
for (i=0;i<=5;i++)
{
rating_imgo=new Image;
rating_imgo.src = 'http://www.aftertheparty.nl/templates/test/images/rating/'+i+'.gif'
}
function rating_level(lev)
{
x=lev
y=lev+1
rating_img = new Array(5)
for (i=0;i<=6;i++) rating_img=document.FORM_NAME.getElementById('rating'+i) <--- i think at this line um must use the Name of the Form Tag.
if (lev==6)
for (i=0;i<=x;i++) rating_img.src='http://www.aftertheparty.nl/templates/test/images/rating/'+lev+'.gif'
for (i=y;i<6;i++) rating_img.src='http://www.aftertheparty.nl/templates/test/images/rating/6.gif'
}
-
I don't think it is that
I tried this:
<script type="text/javascript"><!--
rating_imgo = new Array(6);
for (i=0;i<=5;i++)
{
rating_imgo[i]=new Image;
rating_imgo[i].src = 'http://www.aftertheparty.nl/templates/test/images/rating/'+i+'.gif'
}
function rating_level(lev)
{
x=lev
y=lev+1
rating_img = new Array(5)
for (i=0;i<=6;i++) rating_img[i]=document.test.getElementById('rating'+i)
if (lev==6)
for (i=0;i<=x;i++) rating_img[i].src='http://www.aftertheparty.nl/templates/test/images/rating/'+lev+'.gif'
for (i=y;i<6;i++) rating_img[i].src='http://www.aftertheparty.nl/templates/test/images/rating/6.gif'
}
--></script>
with:
<form method="post" name="test" action="img1283.html">
<span class="ratingbox">
<input type="hidden" name="action" value="rateimage" />
<input type="hidden" name="id" value="1283" />
<input type="hidden" name="rating" value="1" />
<input src="http://www.aftertheparty.nl/templates/test/images/rating/6.gif" type="image" class="ratingimg" width="20" height="20" id="rating0" onmouseover="rating_level(0)" onmouseout="rating_level(6)" />
</span>
</form>
And it still doesn't work..
-
sorry i have not enough JS Skills... )o:
-
I would also like this same rating function.
If anyone has somethig simular please let us know.
-
I see test2 works
Could You post here how ?
:twisted:
-
somehow the code in test2.html didn't work when I tried to implend it in the template.