Profile Moods (Wml)

Started on the old forum in July 2009 · view the original in the archive · old links redirect here

2 replies · 327 views · started 17 years ago · 1 min read

2 participants
riderz Lead · 975 posts #1

index.php

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>";
}

genproc.php

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>";
}

core.php

////////////////////////////////////////////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);
}

sql

setmood  varchar(100)  

ive made this code from xhtml to wml but in the profile it dnt set the mood where did i go wrong


Jacques jacques@gw-designs.co.za http://coding.biz.tm Come join and lets make it a place to learn all the noobies how to code


NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

something else Fellow · 2,296 posts #2

$mmsg1 = parsemsg(getsetmood($item[2]), $sid); if(!$mmsg1=="")

on online list is wrong it should be

$mmsg1 = parsemsg(getsetmood($item[3]), $sid); if($mmsg1!="")

something else Fellow · 2,296 posts #3

also on moods this is wrong:

<postfield name="msgtxt" value="$(msgtxt)"/> <postfield name="who" value="$who"/>

should be:

<postfield name="mmsg" value="$(mmsg)"/>

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