lava status update help this code

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

    lava status update help this code

    1. plz anybody solved this delete eror option
    2. do not delete status here



    PHP Code:
    [PHP]<?php
    include("config.php");
    include(
    "core.php");
    header("Content-type: text/vnd.wap.wml");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    echo 
    "<?xml version=\"1.0\"?>";
    echo 
    "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
    ?>
    <wml>
    <?php
    $bcon 
    = connectdb();
    $sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='sitename'"));
    $sitename = $sitename[0];

    if (!
    $bcon)
    {
        echo 
    "<card id=\"main\" title=\"(ERROR!)\">";
        echo 
    "<p align=\"center\">";
        echo 
    "<img src=\"../images/exit.gif\" alt=\"!\"/><br/>";
        echo 
    "<b>Error! Cannot Connect To Database...</b><br/><br/>";
        echo 
    "This error happens usually when backing up the database, please be patient...";
        echo 
    "</p>";
        echo 
    "</card>";
        echo 
    "</wml>";
        exit();
    }

    $brws = explode("/",$HTTP_USER_AGENT);
    $ubr = $brws[0];
    $uip = getip();
    $action = $_GET["action"];
    $sid = $_GET["sid"];
    $page = $_GET["page"];
    $who = $_GET["who"];
    $uid = getuid_sid($sid);
    cleardata();

    if((
    $action != "") && ($action!="view"))
    {
        
    $uid = getuid_sid($sid);
        if((
    islogged($sid)==false)||($uid==0))
        {
            echo 
    "<card id=\"main\" title=\"$sitename\">";
          echo 
    "<p align=\"center\">";
          echo 
    "You are not logged in<br/>";
          echo 
    "Or Your session has been expired<br/><br/>";
          echo 
    "<a href=\"index.php\">Login</a>";
          echo 
    "</p>";
          echo 
    "</card>";
          echo 
    "</wml>";
          exit();
        } 
    }

    $res = mysql_query("UPDATE ibwf_users SET browserm='".$ubr."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'");

    if(
    $action=="view")
    {
      
    //addvisitor();
      
    addonline(getuid_sid($sid),"Status Updates","statusupdates.php?action=$action");

    echo 
    "<card id=\"main\" title=\"Status Updates\">";
    echo 
    "<p align=\"center\">";

    $uid = getuid_sid($sid);
    $unick = getnick_uid($uid);

    ////////////////////////// STATUS UPDATES 
    $pid = mysql_fetch_array(mysql_query("SELECT posts FROM ibwf_users WHERE id='".$uid."'"));
    if(
    $pid[0]<"24")
    {
    echo 
    "You dont have 25 posts in forums. So you can not Make New status update.";
    }else{
      echo 
    "<b>Update Your Status</b><br/>";
      echo 
    "[<a href=\"vprofile.php?action=viewuser&amp;sid=$sid&amp;who=$uid\">".$unick."</a>]<br/>";
      echo 
    "<input type=\"text\" name=\"status\"/><br/>";
      echo 
    "<anchor>Share";
      echo 
    "<go href=\"statusupdates.php?action=update&amp;sid=$sid\" method=\"post\">";
      echo 
    "<postfield name=\"status\" value=\"$(status)\"/>";
      echo 
    "</go>";
      echo 
    "</anchor> I <anchor><refresh><setvar name=\"status\" value=\"\"/></refresh>Clear</anchor><br/>";
      }
      echo 
    '</p><p align="left">';
    echo 
    "--------------<br/>";
    if(
    $page=="" || $page<=0) {$page=1;}
    $count = mysql_fetch_assoc(mysql_query("SELECT COUNT(*) page FROM ibwf_status"));
    $num_items = $count['page']; //changable
    $event_per_page= 6;
    $num_pages = ceil($num_items/$event_per_page);
    if((
    $page>$num_pages)&&$page!=1) {$page= $num_pages;}
    $limit_start = ($page-1)*$event_per_page;

    $res = mysql_query("SELECT * FROM ibwf_status ORDER BY lastupdate DESC LIMIT $limit_start, $event_per_page");
    while (
    $r = mysql_fetch_assoc($res)) {
    $statusid = $r['id'];
    $suid = $r['uid'];
    $sunick = getnick_uid($suid);
    $status = trim($r['status']);
    $stime = $r['time'];
    $tremain = time()-$stime;
    $tmdt = gettimemsg($tremain);

    echo 
    "<a href=\"vprofile.php?action=viewuser&amp;sid=$sid&amp;who=$suid\">".$sunick."</a>: ";
    echo 
    parsepm($status)." @ ".date("h:i:s A",($stime + (6 * 60 * 60)))."<br/>";
    echo 
    "<small>($tmdt ago)</small>";
    if(
    ismod(getuid_sid($sid)))
          {
    echo 
    "<a href=\"modproc.php?action=delsu&amp;sid=$sid&amp;shid=$item[0]\"> [x]</a>";
    }

    $sc = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_scomments WHERE statusid='".$statusid."'"));
    $comm = $sc[0];

    echo 
    "<br/><small><a href=\"scomments.php?action=main&amp;sid=$sid&amp;statusid=$statusid\">$comm Comments</a></small>";
    echo 
    "<br/>--------------<br/>";
    }

    echo 
    "</p><p align=\"center\">";
    if(
    $page>1)
        {
          
    $ppage = $page-1;
          echo 
    "<a href=\"statusupdates.php?action=view&amp;page=$ppage&amp;sid=$sid\">«PREV</a> ";
        }
        if(
    $page<$num_pages)
        {
          
    $npage = $page+1;
          echo 
    "<a href=\"statusupdates.php?action=view&amp;page=$npage&amp;sid=$sid\">NEXT»</a>";
        }
        echo 
    "<br/>$page/$num_pages<br/>";
        if(
    $num_pages>2)
        {
          
    $rets = "Jump to Page: <input name=\"pg\" format=\"*N\" size=\"3\"/>";
            
    $rets .= "<anchor>[GO]";
            
    $rets .= "<go href=\"statusupdates.php\" method=\"get\">";
            
    $rets .= "<postfield name=\"action\" value=\"view\"/>";
            
    $rets .= "<postfield name=\"sid\" value=\"$sid\"/>";
            
    $rets .= "<postfield name=\"page\" value=\"$(pg)\"/>";
            
    $rets .= "</go></anchor>";

            echo 
    $rets;
        }
    }
    else if(
    $action=="update")
    {
      
    //addvisitor();
      
    addonline(getuid_sid($sid),"Update Status","");

    echo 
    "<card id=\"main\" title=\"Update Status\">";
    echo 
    "<p align=\"center\">";
    //$uid = $_GET['who'];
    $pid = mysql_fetch_array(mysql_query("SELECT posts FROM ibwf_users WHERE id='".$uid."'"));
    if(
    $pid[0]<"0")
    {
    echo 
    "";
    }else{
    $status = $_POST['status'];

    $shtime = time();
    $uid = getuid_sid($sid);

    if(
    trim($status)!="" && strlen($status) > "0"){      
    mysql_query("INSERT INTO ibwf_status SET uid='".$uid."', status='".$status."', time='".$shtime."', lastupdate='".$shtime."'");
    echo 
    "<img src=\"images/ok.gif\" alt=\"O\"/>Comment Added Successfully<br/>";
    } else {
    echo 
    "<img src=\"../images/notok.gif\" alt=\"X\"/>Error Adding Comment<br/>";
    }
    }
    }
    echo 
    "</p>";
    echo 
    "<p align=\"center\">";
    echo 
    "<br/><a href=\"djmain.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"*\"/>";
    echo 
    "Home</a><br/><br/>";

    echo 
    "</p>";
    echo 
    "</card>";
    ?>
    </wml>
    [/PHP]
    Last edited by devil_bd; 01.02.11, 04:04.

    #2
    change:
    PHP Code:
    if(trim($status)!="" && strlen($status) > "0"){       
    mysql_query("INSERT INTO ibwf_status SET uid='".$uid."', status='".$status."', time='".$shtime."', lastupdate='".$shtime."'"); 
    echo 
    "<img src=\"images/ok.gif\" alt=\"O\"/>Comment Added Successfully<br/>"; 
    } else { 
    echo 
    "<img src=\"../images/notok.gif\" alt=\"X\"/>Error Adding Comment<br/>"; 
    } 
    to:
    PHP Code:
    $upd = mysql_query("INSERT INTO ibwf_status SET uid='".$uid."', status='".$status."', time='".$shtime."', lastupdate='".$shtime."'"); 
    if(
    $upd){       
    echo 
    "<img src=\"images/ok.gif\" alt=\"O\"/>Comment Added Successfully<br/>"; 
    } else { 
    echo 
    "<img src=\"../images/notok.gif\" alt=\"X\"/>Error Adding Comment<br/>"; 
    } 
    also if your posting your site url in your signature and showing us your scripts you may want to use the search button and look at securing your site .... cos by posting this you have shown me how i could hack into your site easily .... not that im interested in doing so
    Last edited by something else; 01.02.11, 01:25.

    Comment


      #3
      i need delete option.this script do not work status delete option.plz help
      Last edited by devil_bd; 01.02.11, 04:02.

      Comment


        #4
        use like update status=' ' where uid='$uid';

        Comment

        Working...
        X