Author Topic: Can't vote images with 0 rating and 0 votes  (Read 8498 times)

0 Members and 1 Guest are viewing this topic.

Offline davy_74

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Can't vote images with 0 rating and 0 votes
« on: December 26, 2007, 10:55:49 PM »
Hi guys

I'm having a weird trouble. Some images that shows 0 points in rating and 0 votes,  show me the message Sorry, you've already rated for this image once recently. How is this possible if they have 0 votes and 0 rating. In fact, 0 is not a valid value for voting, so if you vote once, you could't get 0 rating.

Weird eh?

Some ideas? My code of rating_form.html is as follow:

<table  border="0">
  <tr>
    <td><form method="post" action="{parent}">
  <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=""> -- Select and Vote -- </option>

                <option value="10">10</option>
                <option value="9">9</option>
                <option value="8">8</option>
                <option value="7">7</option>
                <option value="6">6</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>
</form>
</td>
    <td width="50"></td>
    <td>

<FORM>
                        <div align="center">
                          <INPUT name="Submit" type="submit" class="button" value="Return" action="index.php">
                        </div>
                      </FORM>  </td>
  </tr>
</table>


Cheers

David


Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Can't vote images with 0 rating and 0 votes
« Reply #1 on: December 26, 2007, 11:26:08 PM »
Very good. You find bug. ;)

In includes/page_header.php file,

find:

Code: [Select]
if ($rating && $rating <= MAX_RATING && $id) {

replace:

Code: [Select]
if (isset($rating) && $rating > 0 && $rating <= MAX_RATING && isset($id) && !empty($id)) {

;)
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline davy_74

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: Can't vote images with 0 rating and 0 votes
« Reply #2 on: December 27, 2007, 04:13:38 PM »
Thanks thunderstrike

Offline davy_74

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: Can't vote images with 0 rating and 0 votes
« Reply #3 on: December 27, 2007, 04:47:40 PM »
Hi Thunderstrike

I already made the correction and it stills the same. I notice that for certain pictures 4images doesn't update image hits too. But for other pictures is ok. I really need some help.

David

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Can't vote images with 0 rating and 0 votes
« Reply #4 on: December 27, 2007, 04:55:35 PM »
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline davy_74

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: Can't vote images with 0 rating and 0 votes
« Reply #5 on: December 27, 2007, 05:52:45 PM »
I already use that MOD with version A

In fact I posed an error in http://www.4homepages.de/forum/index.php?topic=6123.msg107744#msg107744

I don't know why I can't vote some pictures, if they have o votes and o rating. And they doesn't update hits too.

I really need help.

Cheers

David

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Can't vote images with 0 rating and 0 votes
« Reply #6 on: December 27, 2007, 05:56:04 PM »
Please no create new topic if use publish MOD :!:
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline davy_74

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: Can't vote images with 0 rating and 0 votes
« Reply #7 on: December 27, 2007, 06:05:07 PM »
Thunderstrike, I'm not talking about that MOD. My problems is that some images doesn't update the hits in Image_table and doesn't allow me vote because I already votes, but votes and rating are 0 in image_table.

I need some help. I don't know what is going on. Sometimes work and some others don't. I already restored my files whicj I backed up before installin that MOD, and stills get the same result. I still have problems with some pictures. But when I will more images How do I know if will work or not?

I really need some help

Cheers

David

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Can't vote images with 0 rating and 0 votes
« Reply #8 on: December 27, 2007, 06:08:26 PM »
Quote
I need some help. I don't know what is going on. Sometimes work and some others don't. I already restored my files whicj I backed up before installin that MOD, and stills get the same result. I still have problems with some pictures. But when I will more images How do I know if will work or not?

If so - is nothing do with vote if restore file and see problem. How MODs you install ?
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline davy_74

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: Can't vote images with 0 rating and 0 votes
« Reply #9 on: December 27, 2007, 06:38:10 PM »
Just that one, and I already removed it restoring my files.

I don't know why the problem is random.

Offline thunderstrike

  • 4images Guru
  • *******
  • Posts: 2.327
    • View Profile
Re: Can't vote images with 0 rating and 0 votes
« Reply #10 on: December 27, 2007, 06:40:09 PM »
If is just this one, you reverse all step of Votes DB MOD ?
If reverse all, I no get how you see random result. Please report to Votes DB topic if problem with MOD.
8 steps need when ask question -

- PHP version (ACP - > phpinfo())
- mySQL version (ACP - > phpinfo())
- 4images version
- Post screenshot / URL
- Post code in BB Code (no need full file for code) or post attach file
- It doesn't work. What is say - what is do for no work
- Install MOD ? If so - please say (troubleshooting)
- Read FAQ ? Install Bug fixes ?

Offline davy_74

  • Jr. Member
  • **
  • Posts: 69
    • View Profile
Re: Can't vote images with 0 rating and 0 votes
« Reply #11 on: December 27, 2007, 06:58:33 PM »
ok thanks any way