Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,14 +527,18 @@ class="dt">&#148;</span>
$rating = explode(" ", $photos[$p]);
$hits = $rating[0];
$hits++;
$rate = 0;
$raters = substr(strrchr($rating[1], '/'), 1);
if ($raters != "0")
@eval("@\$rate =".$rating[1].";");
$rate = round($rate, 2);
$photos[$p] = sprintf("%d %s %s", $hits, $rating[1], date("Y/m/d-G:i:s", GetTimeWithDiffer()));
save_container('photos', 'Photo', './data/photos.xml');
@eval("@\$rate =".$rating[1].";");
if (($rate < 1) || ($rate > 5))
$rating[1] = "0/0";
$rating[1] = "0";
if (isset($rating[2]))
$curLastVisit = $rating;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure why these two ifs are removed.

The second (which sets $curLastVisit) is weird. But the first one has been there to correct any incorrect rating.

Is there any special reason that they are removed?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reversed them.


$photos[$p] = sprintf("%d %s %s", $hits, $rating[1], date("Y/m/d-G:i:s", GetTimeWithDiffer()));
save_container('photos', 'Photo', './data/photos.xml');
}
$hr = "<center><div class=\"hr\"></div></center>";
$dd = "<span class=\"darkdot\">&#149;</span>";
Expand Down