likendislike.php
profile.php
add two new lines in SQL under USERS
Column: like, Type: int, Length/Values: (100), Default: As defined: 0
Column: dislike, Type: int, Length/Values: (100), Default: As defined: 0
HTML Code:
<?php define('WCS',true); include('./core/main.inc'); //include('./core/functions.inc'); header_type(); cleardata(); if(ipbanned(ip(),browser())){ if(!shield(getuid_sid($sid))){ echo head_tag("Ip Blocked!!!",0,0); echo ipbanned_msg(); echo foot_tag(); exit(); } } if(!islogged($sid)){ echo head_tag("Error!!!",0,0); echo session_expired(); echo foot_tag(); exit(); } if(banned(getuid_sid($sid))){ echo head_tag("Error!!!",1,getnick_sid($sid)); echo banned_msg($sid); echo foot_tag(); exit(); } if($pass!=""){$pw="&pass=$pass";} if($rid!=""){ $rooms=mysql_fetch_array(mysql_query("SELECT id, name FROM chatrooms WHERE id='".$rid."'")); $rname=$rooms[1]; $chatlink="&rid=$rid$pw"; } mysql_query("UPDATE users SET browser='".browser()."', ipaddress='".ip()."', host='".subno()."' WHERE id='".getuid_sid($sid)."'"); /////////////////////////DISLIKE///////////////////////// if($action=="dislikeprof") { $main.="<p align=\"center\">"; $main.="<div class=\"box_cen\" align=\"center\">"; $main.="<b>I dislike this profile</b>"; $main.="<div class=\"box_sub\" align=\"left\">"; $dislikeswho = getuid_sid($sid); setaction($uid, "$dislikeswho being disliked"); $stampiti = mysql_fetch_array(mysql_query("SELECT dislike FROM users WHERE id='$likeswho'")); mysql_query("UPDATE users SET dislike='$stampit' WHERE id='$dislikeswho'"); $dislikeswho = $_REQUEST["who"]; mysql_query("UPDATE users SET dislikes=dislikes+1 WHERE id='$dislikeswho'"); $dislikenick = getnick_sid($sid); $msg = "ahw $dislikenick dont like your profile!!! U better go and improve it....[br/][small]p.s: this is an automated pm[/small]"; autopm($msg, $givewho); print "You have now given your dislikes for this profile!</br>"; $thid = mysql_fetch_array(mysql_query("SELECT themeid FROM users WHERE id='".$uid."'")); $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM iconset WHERE id='".$thid[0]."'")); $unick = getnick_uid($who); include ("footer.php"); $main.="</p></div>"; exit(); } /////////////////////////LIKE///////////////////////// if($action=="likeprof") { $main.="<p align=\"center\">"; $main.="<div class=\"box_cen\" align=\"center\">"; $main.="<b>I like this profile</b>"; $main.="<div class=\"box_sub\" align=\"left\">"; $likeswho = getuid_sid($sid); ///setaction($uid, "$likeswho being liked"); $stampiti = mysql_fetch_array(mysql_query("SELECT likes FROM users WHERE id='$likeswho'")); mysql_query("UPDATE users SET likes='$stampit' WHERE id='$likeswho'"); $likeswho = $_REQUEST["who"]; mysql_query("UPDATE users SET likes=likes+1 WHERE id='$likeswho'"); $likenick = getnick_sid($sid); $msg = "congratulations $likenick has sent you his/her like for your profile today[br/][small]p.s: this is an automated pm[/small]"; autopm($msg, $givewho); print "You have now given your likes for this profile!"; ///$thid = mysql_fetch_array(mysql_query("SELECT themeid FROM users WHERE id='".$uid."'")); ///$themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM iconset WHERE id='".$thid[0]."'")); $unick = getnick_uid($who); ///include ("footer.php"); $main.="<a href=\"./profile.php?who=$who&sid=$sid\">Back</a>"; exit; }
HTML Code:
$main.="<a href=\"likendislike.php?action=likeprof&who=$who&sid=$sid\"><img src=\"./images/like.gif\" alt=\"L\"/></a></br>"; $likes = mysql_fetch_array(mysql_query("SELECT likes FROM users WHERE id='".$who."'")); $main.="<b>$likes[0]</b> / <a href=\"likendislike.php?action=dislikeprof&who=$who&sid=$sid\"><img src=\"../images/dislike.gif\" alt=\"D\"/></a></br>"; $dislikes = mysql_fetch_array(mysql_query("SELECT dislikes FROM users WHERE id='".$who."'")); $main.="<b>$dislikes[0]</b><br/>";
Column: like, Type: int, Length/Values: (100), Default: As defined: 0
Column: dislike, Type: int, Length/Values: (100), Default: As defined: 0
Comment