me create profile like feature but id logout plzzz help me my all code here
sql
profile code
genproc
sql
PHP Code:
-- Table structure for table `plike`
--
CREATE TABLE IF NOT EXISTS `plike` (
`id` int(200) NOT NULL AUTO_INCREMENT,
`pid` int(200) NOT NULL,
`uid` int(200) NOT NULL,
`ld` int(1) NOT NULL,
`time` text COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1 ;
profile code
PHP Code:
$like=mysql_fetch_array(mysql_query("select count(*) from plike where ld='1' and pid='$post[0]'"));
$dlike=mysql_fetch_array(mysql_query("select count(*) from plike437 where ld='0' and pid='$post[0]'"));
echo "<img src=\"../images/like.png\" alt=\"+\"> <a href=\"genproc.php?action=plike&sid=$siid&id=$post[0]\">Like</a> |
<img src=\"../images/dislike.png\" alt=\"-\"> <a href=\"genproc.php?action=pdislike&sid=$siid&id=$post[0]\">Dislike</a><br/><img src=\"../images/like.png\" alt=\"+\"> <b>$like[0]</b> People like | <img src=\"../images/dislike.png\" alt=\"-\"> <b>$dlike[0]</b> People Dislike";
genproc
PHP Code:
else if($action=="plike"){head_tag("Liking a Profile",$theme);addonline($ud,$time,"Liking a Profile");
$id=$_GET['id'];checkvalue($id);
$tp=mysql_fetch_array(mysql_query("select id from users where id='$id'"));
$tname=gettname($tp[1]);$n=getnick($tp[0]);
$al=mysql_fetch_array(mysql_query("select count(*) from plike where uid='$ud' and pid='$id'"));
if($al[0]==0){$dt=date("G:i D jS M y");
$res=mysql_query("insert into like values('','$id','$ud','1','$dt')");
$msg='The User Has Liked Your Post[br/]'.$tp[2].'[br/]in topic [topic='.$tp[1].']'.$tname.'[/topic]';
if($tp[0]!=$ud)
mysql_query("insert into inbox437 values('','1','$msg','$ud','$tp[0]','0','1','$time','0','0','$dt')");
$sub=mysql_query("select uid from subs437 where tid='$tp[1]' and uid!='$ud' and uid!='$tp[0]'");
$msg='The User Has Liked The Post[br/]'.$tp[2].'[br/]Posted By '.$n.'[br/]in topic [topic='.$tp[1].']'.$tname.'[/topic]';
while($i=mysql_fetch_array($sub)){
mysql_query("insert into inbox437 values('','1','$msg','$ud','$i[0]','0','1','$time','0','0','$dt')");}
if($res)
echo "<center><img src=\"../images/ok.gif\">You Liked The Profile<br/></center>";
else
echo "<center><img src=\"../images/error.gif\">System Error Occured<br/></center>";
}
else
echo "<center><img src=\"../images/error.gif\">You Have Already Liked/Disliked This Profile<br/></center>";
}
else if($action=="pdislike"){head_tag("Disliking a Profile",$theme);addonline($ud,$time,"Disliking a Profile");
$id=$_GET['id'];checkvalue($id);
$tp=mysql_fetch_array(mysql_query("select uid from users where id='$id'"));
$tname=gettname($tp[1]);$n=getnick($tp[0]);
$al=mysql_fetch_array(mysql_query("select count(*) from like437 where uid='$ud' and pid='$id'"));
if($al[0]==0){$dt=date("G:i D jS M y");
$res=mysql_query("insert into plike values('','$id','$ud','0','$dt')");
$msg='The User Has Disiked Your Post[br/]'.$tp[2].'[br/]in topic [topic='.$tp[1].']'.$tname.'[/topic]';
if($tp[0]!=$ud)
mysql_query("insert into inbox437 values('','1','$msg','$ud','$tp[0]','0','1','$time','0','0','$dt')");
$sub=mysql_query("select uid from subs437 where tid='$tp[1]' and uid!='$ud' and uid!='$tp[0]'");
$msg='The User Has Disiked The Post[br/]'.$tp[2].'[br/]Posted By '.$n.'[br/]in topic [topic='.$tp[1].']'.$tname.'[/topic]';
while($i=mysql_fetch_array($sub)){
mysql_query("insert into inbox437 values('','1','$msg','$ud','$i[0]','0','1','$time','0','0','$dt')");}
if($res)
echo "<center><img src=\"../images/ok.gif\">You Disliked The Profile<br/></center>";
else
echo "<center><img src=\"../images/error.gif\">System Error Occured<br/></center>";
}
else
echo "<center><img src=\"../images/error.gif\">You Have Already Liked/Disliked This Profile<br/></center>";
}
Comment