Lavalair Mods...

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Comment


      works perfect tested aswell:
      Originally posted by something else View Post
      Total online time and hourly reward of 50 plusses
      PHP Code:
      //////////////////////////////////////////////////////////////////// addonline 

      function addonline($uid,$place,$plclink){ 
      $tm time(); 
      $timeout $tm 300//time out = 5 minutes 
      mysql_query("DELETE FROM ibwf_online WHERE actvtime <'".$timeout."'"); 

      $lttime mysql_fetch_array(mysql_query("SELECT lastact, plustime FROM ibwf_users WHERE id='".$uid."'")); 

      $limit $tm $lttime[0]; 
      if(
      $limit<60){  //limit to 60 seconds away 
      $newtime $lttime[1] + $limit
      if(
      $newtime>3600){ //1 hour 
      mysql_query("UPDATE ibwf_users SET plustime='0', totaltime=toaltime+$newtime, plusses=plusses+50 WHERE id='".$uid."'"); 

      $msg "Congratulation! You are Have Been Online For 1 Hour. You Have Recieved 50 plusses [br/][small]Note: This is an automated PM[/small]";  
                              
      autopm($msg$uid); 
      }else{ 
      mysql_query("UPDATE ibwf_users SET  totaltime=toaltime+$newtime, plustime='".$newtime."' WHERE id='".$uid."'"); 





      mysql_query("UPDATE ibwf_users SET lastact='".$tm."' WHERE id='".$uid."'");  
      $res mysql_query("INSERT INTO ibwf_online SET userid='".$uid."', actvtime='".$tm."', place='".$place."', placedet='".$plclink."'"); 

      if(!
      $res){ 
      $res mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$place."', placedet='".$plclink."', hide='".$hide."' WHERE userid='".$uid."'"); 


      $maxmem mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE id='2'")); 
      $result mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online")); 
      if(
      $result[0]>=$maxmem[0]){ 

      mysql_query("UPDATE ibwf_settings set name='".date("D d M Y - H:i")."', value='".$result[0]."' WHERE id='2'"); 


      $maxtoday mysql_fetch_array(mysql_query("SELECT ppl FROM ibwf_mpot WHERE ddt='".date("d m y")."'")); 
      if(
      $maxtoday[0]==0||$maxtoday==""){ 
      mysql_query("INSERT INTO ibwf_mpot SET ddt='".date("d m y")."', ppl='1', dtm='".date("H:i:s")."'"); 
      $maxtoday[0]=1


      if(
      $result[0]>=$maxtoday[0]){ 
      mysql_query("UPDATE ibwf_mpot SET ppl='".$result[0]."', dtm='".date("H:i:s")."' WHERE ddt='".date("d m y")."'"); 



      PHP Code:
      ALTER TABLE `ibwf_usersADD `totaltimeINT(100NOT NULL DEFAULT '0';
      ALTER TABLE `ibwf_usersADD `plustimeINTNOT NULL DEFAULT '0'
      Added after 2 minutes:

      to call:
      PHP Code:
      $ttime mysql_fetch_array(mysql_query("SELECT totaltime FROM ibwf_users WHERE id='".$uid."'"));
      echo 
      "Total Online Time: $ttime[0]"

      Comment


        PHP Code:
        //////////////////////////////////////////////////////////////////// addonline  

        function addonline($uid,$place,$plclink){  
        $tm time();  
        $timeout $tm 300//time out = 5 minutes  
        mysql_query("DELETE FROM ibwf_online WHERE actvtime <'".$timeout."'");  

        $lttime mysql_fetch_array(mysql_query("SELECT lastact, plustime FROM ibwf_users WHERE id='".$uid."'"));  

        $limit $tm $lttime[0];  
        if(
        $limit<60){  //limit to 60 seconds away  
        $newtime $lttime[1] + $limit;  
        if(
        $newtime>3600){ //1 hour  
        mysql_query("UPDATE ibwf_users SET plustime='0', totaltime=toaltime+$newtime, plusses=plusses+50 WHERE id='".$uid."'");  

        $msg "Congratulation! You are Have Been Online For 1 Hour. You Have Recieved 50 plusses [br/][small]Note: This is an automated PM[/small]";   
                                
        autopm($msg$uid);  
        }else{  
        mysql_query("UPDATE ibwf_users SET  totaltime=toaltime+$newtime, plustime='".$newtime."' WHERE id='".$uid."'");  
        }  
        }  



        mysql_query("UPDATE ibwf_users SET lastact='".$tm."' WHERE id='".$uid."'");   
        $res mysql_query("INSERT INTO ibwf_online SET userid='".$uid."', actvtime='".$tm."', place='".$place."', placedet='".$plclink."'");  

        if(!
        $res){  
        $res mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$place."', placedet='".$plclink."', hide='".$hide."' WHERE userid='".$uid."'");  
        }  

        $maxmem mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE id='2'"));  
        $result mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online"));  
        if(
        $result[0]>=$maxmem[0]){  

        mysql_query("UPDATE ibwf_settings set name='".date("D d M Y - H:i")."', value='".$result[0]."' WHERE id='2'");  
        }  

        $maxtoday mysql_fetch_array(mysql_query("SELECT ppl FROM ibwf_mpot WHERE ddt='".date("d m y")."'"));  
        if(
        $maxtoday[0]==0||$maxtoday==""){  
        mysql_query("INSERT INTO ibwf_mpot SET ddt='".date("d m y")."', ppl='1', dtm='".date("H:i:s")."'");  
        $maxtoday[0]=1;  
        }  

        if(
        $result[0]>=$maxtoday[0]){  
        mysql_query("UPDATE ibwf_mpot SET ppl='".$result[0]."', dtm='".date("H:i:s")."' WHERE ddt='".date("d m y")."'");  
        }  


        Where do I have to add this as I've tried adding it to core.php but it wont work.

        Comment


          ok, well if you added it but didn't overwrite the previous version of function, i'm guessing if your errors on, it says:

          cannot redeclare addonline (already declared in core.php on line ***...)

          go to that line n check if it's the modified one, if so remove the double copy of function that isn't the one you modified...
          C3 Themes: http://c3themes.wen.ru/index.html
          Find Files: http://mystarter.tk/?goto=X-search

          Comment


            Originally posted by pmbguy View Post
            ok, well if you added it but didn't overwrite the previous version of function, i'm guessing if your errors on, it says:

            cannot redeclare addonline (already declared in core.php on line ***...)

            go to that line n check if it's the modified one, if so remove the double copy of function that isn't the one you modified...
            No not getting any error message, the "time online" is just showing up as 0

            Comment


              have you altered the sql?
              PHP Code:
              ALTER TABLE `ibwf_usersADD `totaltimeINT(100NOT NULL DEFAULT '0'
              ALTER TABLE `ibwf_usersADD `plustimeINTNOT NULL DEFAULT '0'

              Comment


                Originally posted by something else View Post
                have you altered the sql?
                PHP Code:
                ALTER TABLE `ibwf_usersADD `totaltimeINT(100NOT NULL DEFAULT '0'
                ALTER TABLE `ibwf_usersADD `plustimeINTNOT NULL DEFAULT '0'
                yeah i copied everything you posted a few messages up.

                Yet it still shows up as "Total Online Time: 0".

                Originally posted by something else View Post
                have you altered the sql?
                PHP Code:
                ALTER TABLE `ibwf_usersADD `totaltimeINT(100NOT NULL DEFAULT '0'
                ALTER TABLE `ibwf_usersADD `plustimeINTNOT NULL DEFAULT '0'
                yeah i copied everything you posted a few messages up.

                Yet it still shows up as "Total Online Time: 0".

                Comment


                  oops there is a typo:
                  mysql_query("UPDATE ibwf_users SET plustime='0', totaltime=toaltime+$newtime, plusses=plusses+50 WHERE id='".$uid."'");
                  toaltime should be totaltime

                  Comment


                    Originally posted by something else View Post
                    oops there is a typo:
                    mysql_query("UPDATE ibwf_users SET plustime='0', totaltime=toaltime+$newtime, plusses=plusses+50 WHERE id='".$uid."'");
                    toaltime should be totaltime
                    PHP Code:
                    function addonline($uid,$place,$plclink)
                    {  
                    $tm time();  
                    $timeout $tm 300//time out = 5 minutes  
                    mysql_query("DELETE FROM ibwf_online WHERE actvtime <'".$timeout."'");  

                    $lttime mysql_fetch_array(mysql_query("SELECT lastact, plustime FROM ibwf_users WHERE id='".$uid."'"));  

                    $limit $tm $lttime[0];  
                    if(
                    $limit<60){  //limit to 60 seconds away  
                    $newtime $lttime[1] + $limit;  
                    if(
                    $newtime>3600){ //1 hour  
                    mysql_query("UPDATE ibwf_users SET plustime='0', totaltime=totaltime+$newtime, plusses=plusses+50 WHERE id='".$uid."'");

                    $msg "Congratulation! You are Have Been Online For 1 Hour. You Have Recieved 50 plusses [br/][small]Note: This is an automated PM[/small]";   
                                            
                    autopm($msg$uid);  
                    }else{  
                    mysql_query("UPDATE ibwf_users SET  totaltime=totaltime+$newtime, plustime='".$newtime."' WHERE id='".$uid."'");  
                    }  
                    }  



                    mysql_query("UPDATE ibwf_users SET lastact='".$tm."' WHERE id='".$uid."'");   
                    $res mysql_query("INSERT INTO ibwf_online SET userid='".$uid."', actvtime='".$tm."', place='".$place."', placedet='".$plclink."'");  

                    if(!
                    $res){  
                    $res mysql_query("UPDATE ibwf_online SET actvtime='".$tm."', place='".$place."', placedet='".$plclink."', hide='".$hide."' WHERE userid='".$uid."'");  
                    }  

                    $maxmem mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE id='2'"));  
                    $result mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online"));  
                    if(
                    $result[0]>=$maxmem[0]){  

                    mysql_query("UPDATE ibwf_settings set name='".date("D d M Y - H:i")."', value='".$result[0]."' WHERE id='2'");  
                    }  

                    $maxtoday mysql_fetch_array(mysql_query("SELECT ppl FROM ibwf_mpot WHERE ddt='".date("d m y")."'"));  
                    if(
                    $maxtoday[0]==0||$maxtoday==""){  
                    mysql_query("INSERT INTO ibwf_mpot SET ddt='".date("d m y")."', ppl='1', dtm='".date("H:i:s")."'");  
                    $maxtoday[0]=1;  
                    }  

                    if(
                    $result[0]>=$maxtoday[0]){  
                    mysql_query("UPDATE ibwf_mpot SET ppl='".$result[0]."', dtm='".date("H:i:s")."' WHERE ddt='".date("d m y")."'");  


                    Thats what I have in the core.php & its giving me a blank page, counted the {} & () and there seems to be 2 more ) than ( is this right ?

                    Comment


                      How to create THANKS script on post forum.. Any 1 know? Help plz..

                      Comment


                        yeah... it's not that hard...

                        create new table called thanks or whatever...

                        must have 3 fields, or well up to as many as you want depending how much info you plan to log...

                        1. id
                        2. postid
                        3. thankzfrm
                        4. timethanked (optional)
                        5. thankzfrmip (really bored, lol)

                        ok, then by each post you make it get count from thanks where post id = $postid...

                        in genproc, code a thanks action that inserts into thanks, postid= $postid, thankzfrm = $uid kinda thing...

                        if you going the whole way n adding a list of thankers too, you can add the timethanked bit so you got something to order it by when getting list...

                        hope this helps...

                        I would post the code up, but not coded it yet, lol...
                        C3 Themes: http://c3themes.wen.ru/index.html
                        Find Files: http://mystarter.tk/?goto=X-search

                        Comment


                          If you put a quote ' after yo $who variable, you'll get an SQL error

                          i.e.

                          web/ownercp.php?action=user&sid=616064d42404f02dc07c8d 614cbe2456&who=2'
                          You'll get Sql error which shows the $who is vuln to SQLi.

                          Quick fix,

                          Add this to core.php

                          function clean_url($text)
                          {
                          #### FUNCTION BY Webune - Webune - Web Site Design Development Dedicated Hosting Domains Business Company AND WALLPAPERAMA.COM
                          ## PLEASE DO NOT REMOVE THIS.. THANK YOU

                          $text=strtolower($text);
                          $code_entities_match = array( '&quot;' ,'!' ,'@' ,'#' ,'$' ,'%' ,'^' ,'&' ,'*' ,'(' ,')' ,'+' ,'{' ,'}' ,'|' ,':' ,'"' ,'<' ,'>' ,'?' ,'[' ,']' ,'' ,';' ,"'" ,',' ,'.' ,'_' ,'/' ,'*' ,'+' ,'~' ,'`' ,'=' ,' ' ,'---' ,'--','--');
                          $code_entities_replace = array('' ,'-' ,'-' ,'' ,'' ,'' ,'-' ,'-' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'-' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'' ,'-' ,'' ,'-' ,'-' ,'' ,'' ,'' ,'' ,'' ,'-' ,'-' ,'-','-');
                          $text = str_replace($code_entities_match, $code_entities_replace, $text);
                          return $text;
                          }
                          and also

                          change

                          $who = $_GET['who'];
                          to
                          $who = (int) $_GET['who'];
                          in all pages

                          and finally in .htaccess,

                          Turn register globals off

                          Comment


                            Originally posted by something else View Post
                            yeah you could just add:
                            PHP Code:
                            if(isset($_GET)){foreach($_GET as $key=>$value){$_GET[$key]=addslashes(htmlspecialchars($value));}} 
                            if(isset(
                            $_POST)){foreach($_POST as $key=>$value){$_POST[$key]=addslashes(htmlspecialchars($value));}}    
                            if(isset(
                            $_SERVER)){foreach($_SERVER as $key=>$value){$_SERVER[$key]=addslashes(htmlspecialchars($value));}}  
                            if(isset(
                            $_SESSION)){foreach($_SESSION as $key=>$value){$_SESSION[$key]=addslashes(htmlspecialchars($value));}} 
                            to your config.php
                            i got Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/musicraj/public_html/forum/config.php on line 8 problem, how to solve it? i just put the code on config.php , sud i put something at core.php?

                            Comment


                              Originally posted by zubaer9 View Post
                              i got Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/musicraj/public_html/forum/config.php on line 8 problem, how to solve it? i just put the code on config.php , sud i put something at core.php?
                              PHP Code:
                              function ewanz($txt){
                              $txt htmlentities($txtENT_QUOTES'UTF-8');
                              return 
                              $txt;}
                              if(isset(
                              $_POST)){foreach($_POST as $key=>$value){$_POST[$key]=ewanz($value);}}
                              if(isset(
                              $_GET)){foreach($_GET as $key=>$value){$_GET[$key]=ewanz($value);}}
                              if(isset(
                              $_REQUEST)){foreach($_REQUEST as $key=>$value){$_REQUEST[$key]=ewanz($value);}} 
                              thats mine... u also can add for $_SESSION / $_SERVER or other globals.. =)
                              our lfe is simple words....
                              http://mygenkz.net
                              ewanz06@yahoo.com
                              PHP Code:
                              $output="i am NOoob....";
                              $newfile="ewanz.txt";
                              $file fopen ($newfile"w");
                              fwrite($file$output);
                              fclose ($file); 

                              Comment


                                HELP To speedup this!

                                SOMEONE HELP to speed up "View category" func?it very slow to open this...this is code what I using now

                                else if($action=="viewcat")
                                {
                                $cid = $_GET["cid"];
                                addonline(getuid_sid($sid),"Gleda kategorije","");
                                $cinfo = mysql_fetch_array(mysql_query("SELECT name from iwbf_fcats WHERE id='".$cid."'"));

                                echo "<p align=\"center\">";
                                echo getshoutbox($sid);
                                echo "</p>";
                                echo "<p>";
                                $forums = mysql_query("SELECT id, name FROM iwbf_forums WHERE cid='".$cid."' AND clubid='0' ORDER BY position, id, name");
                                echo "";
                                while($forum = mysql_fetch_array($forums))
                                {
                                if(canaccess(getuid_sid($sid), $forum[0]))
                                {
                                $notp = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM iwbf_topics WHERE fid='".$forum[0]."'"));
                                $nops = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM iwbf_posts a INNER JOIN iwbf_topics b ON a.tid = b.id WHERE b.fid='".$forum[0]."'"));
                                $iml = "<img src=\"images/1.gif\" alt=\"*\"/>";
                                echo "<a href=\"index.php?action=viewfrm&amp;sid=$sid&amp;f id=$forum[0]\">$iml$forum[1]($notp[0]/$nops[0])</a><br/>";
                                $lpt = mysql_fetch_array(mysql_query("SELECT id, name FROM iwbf_topics WHERE fid='".$forum[0]."' ORDER BY lastpost DESC LIMIT 0,1"));
                                $nops = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM iwbf_posts WHERE tid='".$lpt[0]."'"));
                                if($nops[0]==0)
                                {
                                $pinfo = mysql_fetch_array(mysql_query("SELECT authorid FROM iwbf_topics WHERE id='".$lpt[0]."'"));
                                $tluid = $pinfo[0];

                                }else{
                                $pinfo = mysql_fetch_array(mysql_query("SELECT uid FROM iwbf_posts WHERE tid='".$lpt[0]."' ORDER BY dtpost DESC LIMIT 0, 1"));

                                $tluid = $pinfo[0];
                                }
                                $tlnm = htmlspecialchars($lpt[1]);
                                $tlnick = getnick_uid($tluid);
                                $tpclnk = "<a href=\"index.php?action=viewtpc&amp;sid=$sid&amp;t id=$lpt[0]&amp;go=last\">$tlnm</a>";
                                $vulnk = "<a href=\"index.php?action=viewuser&amp;sid=$sid&amp; who=$tluid\">$tlnick</a>";
                                echo "Zadnji post u temi: $tpclnk, od: $vulnk<br/><br/>";
                                }
                                }
                                echo "";
                                echo "</p>";
                                echo "<p align=\"center\">";
                                $tmsg = getpmcount(getuid_sid($sid));
                                $umsg = getunreadpm(getuid_sid($sid));
                                if($umsg>0)
                                {
                                echo "<a href=\"inbox.php?action=main&amp;sid=$sid\">Inbox( $umsg/$tmsg)</a><br/>";
                                }
                                echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
                                echo "Home</a>";
                                echo "</p>";

                                }

                                Comment

                                Working...
                                X