Hallo Andy,
kann ich das auch für den (MOD Like me) verwenden?
Variante sagt nur "Dieses Bild mag ich nicht".
Mein Problem ist, dass wenn ein User "like_me" oder "like_me2" klickt, der andere Button noch da ist.
Ich möchte dass beide Buttons verschwinden, egal wofür sich der User entscheidet.
Habe das probiert, geht aber nicht. {if likeme2_button} {likeme_button} {endif likeme2_button} {if likeme_button} {likeme2_button} {endif likeme_button}
Gruss Lailash
//####################### Start Mod Like me 2 #########################################
if ($likeme2){
$likeme2_array = explode(",",$likeme2);
$likeme2_count = count($likeme2_array);
$sql = "SELECT user_id, user_name
FROM ".USERS_TABLE."
WHERE user_name IN ('".implode("','",$likeme2_array)."')
";
$result = $site_db->query($sql);
while ($img_row = $site_db->fetch_array($result)) {
$likeme2_cache[$img_row['user_name']] = $img_row['user_id'];
}
$likeme2_user ="";
foreach($likeme2_array as $likeme2_user_name){
$likeme2_user .= "<a href=\"".ROOT_PATH."/member.php?action=showprofile&user_id=$likeme2_cache[$likeme2_user_name]\">".$likeme2_user_name."</a>";
$likeme2_user .=", ";
}
$site_template->register_vars(array(
"lang_likeme2_header" =>str_replace('{likeme2_count}',$likeme2_count, $lang['likeme2_header']),
"likeme2_user" => $likeme2_user,
));
}
$site_template->register_vars("likeme2",$likeme2);
if($likeme2){
$already_voted = (in_array($user_info['user_name'], $likeme2_array)) ? 1:0;
}
else{
$already_voted = 0;
}
if(!$likeme2_image_owner && !$already_voted && $user_info['user_level'] != GUEST){
$likeme2_button = "<form method=\"post\" action=\"".$site_sess->url($self_url)."\">\n";
$likeme2_button .= "<input type=\"hidden\" name=\"action\" value=\"likeme2\" >\n";
$likeme2_button .= "<input type=\"submit\" value= \"".$lang['like_me2']."\" class=\"button\" name=\"submit\" >\n";
$likeme2_button .= "</form>\n";
$site_template->register_vars("likeme2_button",$likeme2_button);
}
if($action == "likeme2" && !$likeme2_image_owner && $user_info['user_level'] != GUEST){
if($already_voted) {
$msg = $lang['already_voted'];
}
else{
$sql = "UPDATE ".IMAGES_TABLE."
SET image_likeme2 = '".$likeme2.(($likeme2)?",":"").$user_info['user_name']."'
WHERE image_id = $image_id";
$site_db->query($sql);
}
redirect($site_sess->url($self_url));
}
//####################### End Mod Like me 2 #########################################