Moin Leutz,
folgender Code
if (isset($rating)) { // Ist ein Vote abgegeben worden ? Wenn ja ist $rating gesetzt
$temp = explode("|",$rating);
$index = $temp[0];
$value = $temp[1];
$expires = time() + 60*60*24*365;
if(!isset($GLOBALS["HTTP_COOKIE_VARS"]["bytrain_links"])) { //#### Existiert das Cookie noch nicht ?
//##### Dann setzte es
$done_votes[$index] = $value;
$save = implode("||",$done_votes);
setcookie("bytrain_links", $save, $expires);
mysql(TYPO3_db,"UPDATE tx_btlinks SET rating = (rating + $value), votes = (votes + 1) WHERE uid = $index");
} else {
//##### Das Cookie existiert schon:
$done_votes = explode("||",$GLOBALS["HTTP_COOKIE_VARS"]["bytrain_links"]);
if ($done_votes[$index] == "" ) {
mysql(TYPO3_db,"UPDATE tx_btlinks SET rating = (rating + $value), votes = (votes + 1) WHERE uid = $index");
} else {
// Fehlermeldung ?!
}
$done_votes[$index] = $value;
$save = implode("||",$done_votes);
setcookie("bytrain_links", $save, $expires);
}
}
klappt nicht wie er soll. Ich möchte testen, ob es das Cookie "bytrain_links" schon gibt und entsprechend ein neues Cookie setzten oder auch nicht.
Das ganze ist in einem Plugin verpackt, das es möglich macht Links zu bewerten, leider kann nun jeder so viele Votes abgeben wie er will, zumal das Cookie scheinbar nie gesetzt wird.