In this forum you'll find the threads about Gary´s Cookbook 3.0 and above with extensions. English or german possible.
<
>

In diesem Forum geht´s um die Version 3.0 von Gary´s Cookbook oder neuer mit Erweiterungen. Englisch oder deutsch ist möglich.

Bewertung funktioniert nicht....

  • Jannik
  • Topic Author
  • Visitor
  • Visitor
13 years 8 months ago - 13 years 8 months ago #4247 by Jannik
Bewertung funktioniert nicht.... was created by Jannik
Hallo an alle!

ich habe gerade gemerkt, das die Bewertung auf meiner Seite nicht richtig funktioniert und zwar wird immer nur die letzte Bewertung gespeichert und die vorherige verworfen.

War also ein Rezept mit drei Sternen bewertet und der zweite bewertet mit 5 Sternen, dann steht da:

1 Bewertung 5 Sterne anstelle von: 2 Bewertungen 4 Sterne

Hinzu kommt eine Fehlermeldung siehe Bild.



Die entsprechende Stelle in der vote.php ist diese:

if (!gkbvote::userVoted($id, 3)) {
$dbGKB = &JFactory::getDBO();
$imgvote = JRequest::getCmd('imgvote');
$dbGKB->setQuery("SELECT imgvotes, imgvotesum FROM #__garyscookbook WHERE id = '$id'");
$result1 = $dbGKB->query();
list($imgvotes, $imgvotesum) = mysql_fetch_row($result1); // Zeile 132
// echo "<script> alert('imgvotes".$imgvotes."'); </script>\n";
// Recalculate with the new vote
$user = &JFactory::getUser();
GKBVote::addVote($id, $user->get('id'));
$imgvotes++;
$imgvotesum = $imgvotesum + $imgvote;
// Save new values
$dbGKB->setQuery("UPDATE #__garyscookbook SET imgvotes='$imgvotes', imgvotesum='$imgvotesum' WHERE id=$id");
$dbGKB->query();
echo "<script> alert('" . JText::_('Your vote is saved:') . "'); </script>\n";
}
Wäre wie immer sehr dankbar, wenn jemand von euch einen hilfreichen Tipp parat hätte :)!

PS ich nutze momentan noch die 3.0.15 version!
Last edit: 13 years 8 months ago by Jannik.

Please Log in to join the conversation.

  • Jannik
  • Topic Author
  • Visitor
  • Visitor
13 years 8 months ago - 13 years 8 months ago #4248 by Jannik
Replied by Jannik on topic Aw: Bewertung funktioniert nicht....
Attachments:
Last edit: 13 years 8 months ago by Jannik.

Please Log in to join the conversation.

Time to create page: 0.145 seconds