View previous topic :: View next topic |
Author |
Message |
bestbuildpc Site Admin
Joined: Jun 30, 2012 Posts: 213 Location: NL
|
Posted: Wed Dec 12, 2012 15:32 Post subject: DBI layer Conversion |
|
|
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 |
|
|
bestbuildpc Site Admin
Joined: Jun 30, 2012 Posts: 213 Location: NL
|
Posted: Tue Jan 15, 2013 3:24 Post subject: |
|
|
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 |
|
|
bestbuildpc Site Admin
Joined: Jun 30, 2012 Posts: 213 Location: NL
|
Posted: Thu Jan 31, 2013 12:50 Post subject: |
|
|
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 |
|
|
bestbuildpc Site Admin
Joined: Jun 30, 2012 Posts: 213 Location: NL
|
Posted: Tue Feb 12, 2013 14:42 Post subject: |
|
|
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 |
|
|
|