bestbuildpc: Forums
 

 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DBI layer Conversion
 
 
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> General and Questions
View previous topic :: View next topic  
Author Message
bestbuildpc
Site Admin
Site Admin


Joined: Jun 30, 2012
Posts: 213
Location: NL

PostPosted: Wed Dec 12, 2012 15:32    Post subject: DBI layer Conversion Reply with quote

OLD

Code:
global $prefix, $dbi;


NEW

Code:
global $prefix, $db;


OLD

Code:
$result = sql_query("select lid, title, hits, url from ".$prefix."_links_links order by linkratingsummary DESC limit 0,$mainlinkstoshow", $dbi)


NEW

Code:
$result = $db->sql_query("select lid, title, hits, url from ".$prefix."_links_links order by linkratingsummary DESC limit 0,$mainlinkstoshow") 


Follow the Table

Code:
OLD:

sql_query($sql, $dbi)
sql_num_rows($sql, $dbi)
sql_fetch_row($sql, $dbi)
sql_fetch_array($sql, $dbi)
sql_fetch_object($sql, $dbi)
sql_free_result($sql, $dbi)

NEW:
$db->sql_query($sql)
$db->sql_numrows($sql)
$db->sql_fetchrow($sql)
$db->sql_fetchrow($sql)
$db->sql_fetchrow($sql)
$db->sql_freeresult($sql)


OLD

Code:
if (eregi("block-Shout_Box.php",$_SERVER['PHP_SELF'])) {

    Header("Location: index.php");
    die();
}


NEW

Code:
if ( !defined('BLOCK_FILE') ) {

   Header('Location: ../index.php');
   die();
}


OLD

Code:
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {

    die ("You can't access this file directly...");
}


NEW

Code:
if (!defined('MODULE_FILE')) die('You can\'t access this file directly...');



OLD

Code:
include("header.php");


NEW
Code:


include_once('header.php');


There are more stuff to add.. It will continue
  
Back to top
View user's profile Send private message Visit poster's website
bestbuildpc
Site Admin
Site Admin


Joined: Jun 30, 2012
Posts: 213
Location: NL

PostPosted: Tue Jan 15, 2013 3:24    Post subject: Reply with quote

If you see this line

Code:
if (!eregi("modules.php", $_SERVER['PHP_SELF'])) {


Replace it with

Code:
if (!defined('MODULE_FILE')) {

    Header("Location: ../../modules.php?name=$module_name");
}
  
Back to top
View user's profile Send private message Visit poster's website
bestbuildpc
Site Admin
Site Admin


Joined: Jun 30, 2012
Posts: 213
Location: NL

PostPosted: Thu Jan 31, 2013 12:50    Post subject: Reply with quote

OLD

Code:
   if(eregi('http\:\/\/', $name)) { die('Hi and Bye'); }

   if(eregi('http\:\/\/', $file)) { die('Hi and Bye'); }


New

Code:
   if(stristr($name, 'http://')) { die('Hi and Bye'); }

   if(stristr($file, 'http://')) { die('Hi and Bye'); }


OLD

Code:
if(ereg("\.\.",$name) || ereg("\.\.",$file) || ereg("\.\.",$mop)) {


New

Code:
      if(preg_match('/\.\./', $name) || preg_match('/\.\./', $file)) {


OLD

Code:
if (eregi("block-youtube-video-random.php",$PHP_SELF)) {

    Header("Location: index.php");
    die();
}


   $res=mysql_query("SELECT tt_vids_videos.id, tt_vids_videos.url,
                     tt_vids_videos.title   
                     FROM tt_vids_videos
                     WHERE tt_vids_videos.active='1' AND tt_vids_videos.video_type='youtube' order by RAND() Limit 1") or die(mysql_error());

   $myrow=mysql_fetch_array($res);


New

Code:
if ( !defined('BLOCK_FILE') ) {

   Header('Location: ../index.php');
   die();
}

global $db;
   $res=$db->sql_query("SELECT tt_vids_videos.id, tt_vids_videos.url,
                     tt_vids_videos.title   
                     FROM tt_vids_videos
                     WHERE tt_vids_videos.active='1' AND tt_vids_videos.video_type='youtube' order by RAND() Limit 1") or die($db->sql_error());

   $myrow=$db->sql_fetchrow($res);
  
Back to top
View user's profile Send private message Visit poster's website
bestbuildpc
Site Admin
Site Admin


Joined: Jun 30, 2012
Posts: 213
Location: NL

PostPosted: Tue Feb 12, 2013 14:42    Post subject: Reply with quote

OLD

Code:
if (eregi($spider, $_SERVER['HTTP_USER_AGENT']))


New

Code:
if (preg_match('/' . preg_quote($spider, '/') . '/i', $_SERVER['HTTP_USER_AGENT'])) { 
  
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:       
Post new topic   Reply to topic    bestbuildpc Forum Index -> RavenNuke -> General and Questions All times are GMT + 2 Hours
 
 Page 1 of 1

 

Jump to:   
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Powered by phpBB © 2001-2008 phpBB Group
 
Forums ©