User stats Staff

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

    User stats Staff

    This code should be able to allow staff to add a msg in the users profile havnt test it yet just mod the code so anyone up for testing it and let me know if it works

    index.php?action=viewuser
    Code:
     * * * *if(isowner(getuid_sid($sid)))
     * {
     * *echo "<form action=\"index.php?action=userstats&amp;sid=$sid\" method=\"post\">";
    
     * *echo "Text:<input name=\"text\" maxlength=\"100\" value=\"$dmsg\"/><br/>";
    echo "<input type=\"submit\" value=\"Save\"/>";
     * *echo "</form><br/></div>";
     * * *}
     * * * *$userstats = mysql_fetch_array(mysql_query("SELECT userstats FROM ibwf_users WHERE id='".$who."'"));
     *echo "<b>$userstats[0]</b><br/>";
    anywhere u want to add it
    Code:
    //////////////////////////////////////////Update User Stats message
    else if($action=="userstats")
    {
     * *addonline(getuid_sid($sid),"Updating User Stats message","index.php?action=$action");
     * *$text = $_POST["text"];
     * *if(isowner(getuid_sid($sid)))
     * {
    
     * * *echo "<body>";
     * * * * * echo "<div class=\"box_cen\" align=\"center\">";
     *echo "<b>Update User Stats Msg</b>";
     echo "<div class=\"box_sub\" align=\"left\">";
     *echo "<div align=\"center\">";
     *//$uid = getuid_sid($sid);
     *$tex = parsepm($text, $sid);
     *$nos = substr_count($tex,"<img src=");
     *if($nos>1)
    {
     *echo "<img src=\"../images/notok.gif\" alt=\"x\"/><br/>Error <br/>";
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid\">Users Profile</a><br/>";
     *echo "<small>-- -- --</small><br/>";
     *echo "<a href=\"index.php?action=main&amp;sid=$sid\">Main Menu</a><br/>";
     * echo "<a href=\"index.php?action=main&amp;sid=$sid\">© $stitle</a>";
     * * echo "</div>";
     * * echo "</body>";;
     * * *echo "</html>";
     * * *exit();
     * }
     *$res = mysql_query("UPDATE ibwf_users SET userstats='".$text."' WHERE id='".$uid."'");
     *if($res)
     * * * *{
     * * * * * *echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Users Stats message updated successfully<br/>";
     * * * *}else{
     * * * * *echo "<img src=\"../images/notok.gif\" alt=\"x\"/>can't update your Users Stats message<br/>";
     * * * *}
    }
     * * * *echo "<br/>";
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid\">User Profile</a><br/>";
    echo "<small>-- -- --</small><br/>";
     *echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">Main Menu</a><br/>";
     * echo "<a href=\"index.php?action=main&amp;sid=$sid\">© $stitle</a>";
     * * echo "</div>";
    echo "</body>";
    exit();
    }
    SQL
    Code:
    ibwf_users 
    userstats *varchar 255
    ________________
    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
    quick star replacement:
    Originally posted by riderz View Post
    This code should be able to allow staff to add a msg in the users profile havnt test it yet just mod the code so anyone up for testing it and let me know if it works

    index.php?action=viewuser
    Code:
    if(isowner(getuid_sid($sid)))
    {
    echo "<form action=\"index.php?action=userstats&amp;sid=$sid\" method=\"post\">";
    
    echo "Text:<input name=\"text\" maxlength=\"100\" value=\"$dmsg\"/><br/>";
    echo "<input type=\"submit\" value=\"Save\"/>";
    echo "</form><br/></div>";
    }
    $userstats = mysql_fetch_array(mysql_query("SELECT userstats FROM ibwf_users WHERE id='".$who."'"));
    echo "<b>$userstats[0]</b><br/>";
    anywhere u want to add it
    Code:
    //////////////////////////////////////////Update User Stats message
    else if($action=="userstats")
    {
    addonline(getuid_sid($sid),"Updating User Stats message","index.php?action=$action");
    $text = $_POST["text"];
    if(isowner(getuid_sid($sid)))
    {
    
    echo "<body>
    <script type="text/javascript"><!--
    var _gaq = _gaq || [];
    _gaq.push(
    ['_setAccount', 'UA-9744278-3'],
    ['_trackPageview']
    );
    (function() {
    var ga = document.createElement('script');
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    ga.setAttribute('async', 'true');
    document.documentElement.firstChild.appendChild(ga);
    })();
    //-->
    </script>
    ";
    echo "<div class=\"box_cen\" align=\"center\">";
    echo "<b>Update User Stats Msg</b>";
    echo "<div class=\"box_sub\" align=\"left\">";
    echo "<div align=\"center\">";
    //$uid = getuid_sid($sid);
    $tex = parsepm($text, $sid);
    $nos = substr_count($tex,"<img src=");
    if($nos>1)
    {
    echo "<img src=\"../images/notok.gif\" alt=\"x\"/><br/>Error <br/>";
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid\">Users Profile</a><br/>";
    echo "<small>-- -- --</small><br/>";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\">Main Menu</a><br/>";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\">© $stitle</a>";
    echo "</div>";
    echo "</body>";;
    echo "</html>";
    exit();
    }
    $res = mysql_query("UPDATE ibwf_users SET userstats='".$text."' WHERE id='".$uid."'");
    if($res)
    {
    echo "<img src=\"../images/ok.gif\" alt=\"o\"/>Users Stats message updated successfully<br/>";
    }else{
    echo "<img src=\"../images/notok.gif\" alt=\"x\"/>can't update your Users Stats message<br/>";
    }
    }
    echo "<br/>";
    echo "<a href=\"index.php?action=viewuser&amp;sid=$sid\">User Profile</a><br/>";
    echo "<small>-- -- --</small><br/>";
    echo "<br/><a href=\"index.php?action=main&amp;sid=$sid\">Main Menu</a><br/>";
    echo "<a href=\"index.php?action=main&amp;sid=$sid\">© $stitle</a>";
    echo "</div>";
    echo "</body>";
    exit();
    }
    SQL
    Code:
    ibwf_users 
    userstats varchar 255

    Comment


      #3
      i got a prob with this code it dont work 100% when i update the user stats it not update their stats but the use4r who updated the stat
      ________________
      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

      Comment

      Working...
      X