Profile Moods (Wml)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Profile Moods (Wml)

    index.php
    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&amp;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&amp;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 = "&#179;";
            }if($item[1]=='2')
            {
              $tit = "&#178;";
            } if($item[1]=='3')
            {
              $tit = "&#185;";
            } if($item[1]=='4')
            {
              $tit = "&#186;";
            }
    
    $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&amp;who=$item[3]&amp;sid=$sid\">$tit$item[0]</a>";
      }else{
      $lnk = "$usersex<a href=\"index.php?action=viewuser&amp;who=$item[3]&amp;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&amp;page=$ppage&amp;sid=$sid\">Prev</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"index.php?action=online&amp;page=$npage&amp;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&amp;sid=$sid\">Update Mood</a><br/>";
      echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
      echo "</card>";
    }
    genproc.php
    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&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
      echo "</card>";
    }
    core.php
    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);
    }
    sql
    Code:
    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

    #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!="")
    Last edited by something else; 24.07.09, 22:59.

    Comment


      #3
      also on moods this is wrong:

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

      should be:

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

      Comment

      Working...
      X