Author Topic: rating with smileys  (Read 8860 times)

0 Members and 1 Guest are viewing this topic.

Offline ruudvroon

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AFTERTHEPARTY.NL
rating with smileys
« 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?

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: rating with smileys
« Reply #1 on: October 29, 2005, 07:42:30 PM »
you need to edit the rate_form.html Template like this:

Code: [Select]
<!-- 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 -->

Offline ruudvroon

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AFTERTHEPARTY.NL
Re: rating with smileys
« Reply #2 on: October 29, 2005, 09:15:18 PM »
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

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: rating with smileys
« Reply #3 on: October 29, 2005, 09:33:10 PM »
use a name for the form tag (name="form") and use it in the Javascript...

Quote

 
  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'
    
  }
 
 

Offline ruudvroon

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AFTERTHEPARTY.NL
Re: rating with smileys
« Reply #4 on: October 29, 2005, 09:45:45 PM »
I don't think it is that

I tried this:
Code: [Select]
<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:

Code: [Select]
<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..

Offline Acidgod

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 2.421
  • It's me?
    • View Profile
    • Flash-Webdesign
Re: rating with smileys
« Reply #5 on: October 30, 2005, 02:49:39 PM »
sorry i have not enough JS Skills... )o:

Offline impss

  • Sr. Member
  • ****
  • Posts: 382
    • View Profile
    • Cusstom.net
Re: rating with smileys
« Reply #6 on: November 14, 2005, 02:21:31 AM »
I would also like this same rating function.
If anyone has somethig simular please let us know.


Offline Zyga

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: rating with smileys
« Reply #7 on: January 04, 2006, 06:47:45 PM »
I see test2 works
Could You post here how ?

:twisted:

Offline ruudvroon

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AFTERTHEPARTY.NL
Re: rating with smileys
« Reply #8 on: January 14, 2006, 04:35:19 PM »
somehow the code in test2.html didn't work when I tried to implend it in the template.