Online list moods

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

    Online list moods

    hey guys who can help me i found this code here i want the genproc and core for this
    Code:
    else if($action=="moods")
    {
    echo "<head>";
    echo "<title>Set OnlineList Mood</title>";
    echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
    
    echo "</head>";
    echo "<body>";
    echo "<p align=\"center\">";
    $mmsg = htmlspecialchars(getsetmood(getuid_sid($sid)));
    $uid = getuid_sid($sid);
    echo "<form action=\"genproc.php?action=upmood&amp;sid=$sid\" method=\"post\">";
    echo "<select name=\"Mood\">";
    echo "<option value=\"01\">Im Sweet</option>";
    echo "<option value=\"black\">Im Sexy</option>";
    echo "<option value=\"red\">Im Angry</option>";
    echo "<option value=\"blue\">Im Happy</option>";
    echo "<option value=\"green\">Im Sad</option>";
    echo "</select>";
    echo "<input type=\"Submit\" name=\"submit\" Value=\"Submit\"></form>";
    
    
    echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"\"/>Home</a>";
    echo "</p>";
    echo "</body>";
    }
    ________________
    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
    something like this in genproc:
    Code:
    else if($action=="moods")
    {
    ?>
    <head>
    <title>Set OnlineList Mood</title>
    <link rel="stylesheet" type="text/css" href="../themes/<?=$theme[0]?>">
    </head>
    <body>
    <p align="center">
    <?
      $mission = mysql_query("UPDATE ibwf_users SET mood='".mysql_escape_string($_POST["mood"])."' WHERE id='".$uid."'");
      if($mission)
            {
    ?>
               <img src="images/ok.gif" alt="o"/>Mood Updated Successfully<br/>
    <?
            }else{
    ?>
             <img src="images/notok.gif" alt="x"/>Whoops there apears to be an error...lol<br/>
    <?
            }
    
    ?>
    <a href="index.php?action=main&amp;sid=<?=$sid?>"><img src="images/home.gif" alt=""/>Home</a>
    </p>
    </body>
    <?
    }
    as for part in core its a function that is waste of time as it is only really going to be called once or maybee twice
    So i would just delete
    $mmsg = htmlspecialchars(getsetmood(getuid_sid($sid)));
    As the string $mmsg isnt even used in the script you posted above.

    So that would then leave 1 place to call the function so its a waste of time as you could just call it with the other online list fields eg: a.mood or b.mood (i cant remember which 1)

    Comment

    Working...
    X