index.php
genproc.php
core.php
sql
ive made this code from xhtml to wml but in the profile it dnt set the mood where did i go wrong
Code:
else if($action=="mood")
{
echo "<card id=\"main\" title=\"$stitle\">";
echo "<p align=\"center\">";
$mmsg = htmlspecialchars(getsetmood(getuid_sid($sid)));
$uid = getuid_sid($sid);
echo "SET MOOD TO:<input name=\"mmsg\" maxlength=\"30\"/><br/>";
echo "<anchor>Add";
echo "
<go href=\"genproc.php?action=upmood&sid=$sid\" method=\"post\">
<postfield name=\"msgtxt\" value=\"$(msgtxt)\"/>
<postfield name=\"who\" value=\"$who\"/>
</go>
";
echo "</anchor>";
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
else if($action=="online")
{
$showavatar = mysql_fetch_array(mysql_query("SELECT showavatar FROM ibwf_users WHERE id='".$uid."'"));
$mmsg = htmlspecialchars(getsetmood(getuid_sid($sid)));
addonline(getuid_sid($sid),"Online List","");
echo "<card id=\"main\" title=\"ONLINE\">";
//////ALL LISTS SCRIPT <<
if($page=="" || $page<=0)$page=1;
$num_items = getnumonline(); //changable
$items_per_page= 10;
$num_pages = ceil($num_items/$items_per_page);
if($page>$num_pages)$page= $num_pages;
$limit_start = ($page-1)*$items_per_page;
//changable sql
$sql = "SELECT
a.name,a.perm, b.place, b.userid FROM ibwf_users a
INNER JOIN ibwf_online b ON a.id = b.userid
GROUP BY 1,2
LIMIT $limit_start, $items_per_page";
$mols = mysql_fetch_array(mysql_query("SELECT name, value FROM ibwf_settings WHERE id='2'"));
print "Most online: <b>$mols[1]</b><br/>";
$mols = mysql_fetch_array(mysql_query("SELECT ppl, dtm FROM ibwf_mpot WHERE ddt='".date("d m y")."'"));
print "Most online today only: <b>$mols[0]</b><br/>";
$items = mysql_query($sql);
echo mysql_error();
while ($item = mysql_fetch_array($items))
{
if($item[1]=='0')
{
$tit = "";
}if($item[1]=='1')
{
$tit = "³";
}if($item[1]=='2')
{
$tit = "²";
} if($item[1]=='3')
{
$tit = "¹";
} if($item[1]=='4')
{
$tit = "º";
}
$sex = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE name='$item[0]'"));
if($sex[0]=="M"){$usersex = "<img src=\"images/male.gif\" alt=\"(M)\"/>";}
if($sex[0]=="F"){$usersex = "<img src=\"images/female.gif\" alt=\"(F)\"/>";}
if($sex[0]==""){$usersex = "";}
if($item[1]>'0')
{
$lnk = "$usersex<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$tit$item[0]</a>";
}else{
$lnk = "$usersex<a href=\"index.php?action=viewuser&who=$item[3]&sid=$sid\">$tit$item[0]</a>";
}
////////////////////online avatar
if($showavatar[0]=="1")
{
$avlink = getavatar($item[3]);
if ($avlink!=""){
echo "<img src=\"$avlink\" height=\"25\" width=\"25\" alt=\"avatar\"/>";
}else{
echo "<img src=\"/images/nopic.jpg\" height=\"25\" width=\"25\" alt=\"avatar\"/>";
}
}
echo "$lnk - $item[2] <br/>";
}
$mmsg1 = parsemsg(getsetmood($item[2]), $sid);
if(!$mmsg1=="")
{
echo "($mmsg1) - $item[1] ";
}else{
echo " $item[1]<br/>";
}
//echo "</p>";
//echo "<p align=\"center\">";
if($page>1)
{
$ppage = $page-1;
echo "<a href=\"index.php?action=online&page=$ppage&sid=$sid\">Prev</a> ";
}
if($page<$num_pages)
{
$npage = $page+1;
echo "<a href=\"index.php?action=online&page=$npage&sid=$sid\">Next</a>";
}
echo "<br/>$page/$num_pages";
if($num_pages>2)
{
echo getjumper($action, $sid,"index");
}
////// UNTILL HERE >>
echo "<p align=\"center\">";
echo "<a href=\"index.php?action=mood&sid=$sid\">Update Mood</a><br/>";
echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
Code:
else if($action=="upmood")
{
addonline(getuid_sid($sid),"Updating My Mood","");
$mmsg = $_POST["mmsg"];
echo "<card id=\"main\" title=\"Update Mood\">";
echo "<p align=\"center\">";
$res = mysql_query("UPDATE ibwf_users SET setmood='".$mmsg."' WHERE id='".$uid."'");
if($res)
{
echo "<img src=\"images/ok.gif\" alt=\"o\"/>Mood updated successfully<br/>";
}else{
echo "<img src=\"images/notok.gif\" alt=\"x\"/>Can't update your Mood<br/>";
}
echo "<br/><br/><a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
echo "</p>";
echo "</card>";
}
Code:
////////////////////////////////////////////Get Mood
function getsetmood($uid)
{
$getdata = mysql_fetch_array(mysql_query("SELECT setmood FROM ibwf_users WHERE id='".$uid."'"));
return $getdata[0];
$text = getsmilies($text);
$text = parsepm($mmsg[0], $sid);
}
Code:
setmood varchar(100)
Comment