This is what im work on for like n dislike for V2 profiles

Started on the old forum in January 2012 · view the original in the archive · old links redirect here

8 replies · 541 views · started 14 years ago · 1 min read

3 participants
carebear Developer · 68 posts #1
<?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>";

/////////////////////////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!";

  $L1="$sixkey<a $key6 href=\"../profile.php?who=$who&sid=$sid\">Back</a>"; 
$L2="$sixkey<a $key6 href=\"../inbox/inbox.php?sid=$sid\">Inbox</a>"; 
$L3="$sevenkey<a $key7 href=\"../buds/buds.php?sid=$sid\">BuddyList</a>"; 
$L4="$eightkey<a $key8 href=\"../chat/public.php?sid=$sid\">Chat</a>"; 
$L5="$ninekey<a $key9 href=\"../forums/forums.php?sid=$sid\">Forums</a>"; 
$L6="$zerokey<a $key0 href=\"../main.php?sid=$sid\"><img src=\"./images/home.gif\" alt=\"\"/>Main Menu</a>";
?> 

I am getting this Parse error: syntax error, unexpected $end in /home/teddywap/public_html/likendislike.php on line 86 its the very last line so may anyone plz help once i got it working I will share the code.. I got it from Riderz post but his is for lava so im editing so it works on V2 as well.. Thanks..

arnage Lead · 811 posts #2

Try to change this $main.= with echo and all of this make just html tags, don't place those in vars:

  $L1="$sixkey<a $key6 href=\"../profile.php?who=$who&sid=$sid\">Back</a>"; 
$L2="$sixkey<a $key6 href=\"../inbox/inbox.php?sid=$sid\">Inbox</a>"; 
$L3="$sevenkey<a $key7 href=\"../buds/buds.php?sid=$sid\">BuddyList</a>"; 
$L4="$eightkey<a $key8 href=\"../chat/public.php?sid=$sid\">Chat</a>"; 
$L5="$ninekey<a $key9 href=\"../forums/forums.php?sid=$sid\">Forums</a>"; 
$L6="$zerokey<a $key0 href=\"../main.php?sid=$sid\"><img src=\"./images/home.gif\" alt=\"\"/>Main Menu</a>";

If i catching it right these are big differences between those scripts.

Here stampiti and stampit...

$stampiti = mysql_fetch_array(mysql_query("SELECT dislike FROM users WHERE id='$likeswho'"));

mysql_query("UPDATE users SET dislike='$stampit' WHERE id='$dislikeswho'");
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
carebear Developer · 68 posts #3
<?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/////////////////////////
else 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/////////////////////////
else 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.="</p></div>";

  $L1="$sixkey<a $key6 href=\"./profile.php?who=$who&sid=$sid\">Back</a>"; 
$L2="$sixkey<a $key6 href=\"./inbox/inbox.php?sid=$sid\">Inbox</a>"; 
$L3="$sevenkey<a $key7 href=\"./buds/buds.php?sid=$sid\">BuddyList</a>"; 
$L4="$eightkey<a $key8 href=\"./chat/public.php?sid=$sid\">Chat</a>"; 
$L5="$ninekey<a $key9 href=\"./forums/forums.php?sid=$sid\">Forums</a>"; 
$L6="$zerokey<a $key0 href=\"./main.php?sid=$sid\"><img src=\"./images/home.gif\" alt=\"\"/>Main Menu</a>";
 echo xhtml($sid,$title,1,$L1,$L2,$L3,$L4,$L5,$L6,0,0,$main); 
echo foot_tag(); 
exit; 
}

Do u main this

arnage Lead · 811 posts #4

Nope. 🙂 Where ever you see this: $main.= change it with this: echo istead this:

$L1="$sixkey<a $key6 href=\"../profile.php?who=$who&sid=$sid\">Back</a>"; 

write every line like this:

echo "<a href=\"../profile.php?who=$who&sid=$sid\">Back</a>"; 

and $stampiti var at the next line missing letter i.

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
carebear Developer · 68 posts #5

$main is the only one that will work with WapD v2...

ozziemale31 Lead · 861 posts #6

parse syntex error usually means your missing a closed } every tag u have open in code u must have a close statement

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!";     $L1="$sixkey<a $key6 href=\"../profile.php?who=$who&sid=$sid\">Back</a>";  $L2="$sixkey<a $key6 href=\"../inbox/inbox.php?sid=$sid\">Inbox</a>";  $L3="$sevenkey<a $key7 href=\"../buds/buds.php?sid=$sid\">BuddyList</a>";  $L4="$eightkey<a $key8 href=\"../chat/public.php?sid=$sid\">Chat</a>";  $L5="$ninekey<a $key9 href=\"../forums/forums.php?sid=$sid\">Forums</a>";  $L6="$zerokey<a $key0 href=\"../main.php?sid=$sid\"><img src=\"./images/home.gif\" alt=\"\"/>Main Menu</a>"; } // u are missing closed function here
?>

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer.. Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free ***

carebear Developer · 68 posts #7

Thanks Andy but tryed it with the closed } n still got an error on last line..

ozziemale31 Lead · 861 posts #8

ok try this

<?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="&amp;pass=$pass";} if($rid!=""){ $rooms=mysql_fetch_array(mysql_query("SELECT id, name FROM chatrooms WHERE id='".$rid."'")); $rname=$rooms[1]; $chatlink="&amp;rid=$rid$pw"; } mysql_query("UPDATE users SET browser='".browser()."', ipaddress='".ip()."', host='".subno()."' WHERE id='".getuid_sid($sid)."'"); /////////////////////////DISLIKE///////////////////////// else if($action=="dislikeprof") { $main.=" "; $main.=""; $main.="**I dislike this profile**"; $main.=""; $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.=" "; exit(); } /////////////////////////LIKE///////////////////////// else if($action=="likeprof") { $main.=" "; $main.=""; $main.="**I like this profile**"; $main.=""; $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.=" "; $L1="$sixkey<a $key6 href=\"./profile.php?who=$who&amp;sid=$sid\">Back</a>"; $L2="$sixkey<a $key6 href=\"./inbox/inbox.php?sid=$sid\">Inbox</a>"; $L3="$sevenkey<a $key7 href=\"./buds/buds.php?sid=$sid\">BuddyList</a>"; $L4="$eightkey<a $key8 href=\"./chat/public.php?sid=$sid\">Chat</a>"; $L5="$ninekey<a $key9 href=\"./forums/forums.php?sid=$sid\">Forums</a>"; $L6="$zerokey<a $key0 href=\"./main.php?sid=$sid\"><img src=\"./images/home.gif\" alt=\"\"/>Main Menu</a>"; echo xhtml($sid,$title,1,$L1,$L2,$L3,$L4,$L5,$L6,0,0,$main); echo foot_tag(); exit; }} just tested it with my php editor and it gives the green light

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer.. Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free ***

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close