ShellBanner
System:Linux MiraNet 3.0.0-14-generic-pae #23-Ubuntu SMP Mon Nov 21 22:07:10 UTC 2011 i686
Software:Apache. PHP/5.3.6-13ubuntu3.10
ID:uid=65534(nobody) gid=65534(nogroup) groups=65534(nogroup)
Safe Mode:OFF
Open_Basedir:OFF
Freespace:27.2 GB of 70.42 GB (38.63%)
MySQL: ON MSSQL: OFF Oracle: OFF PostgreSQL: OFF Curl: OFF Sockets: ON Fetch: OFF Wget: ON Perl: ON
Disabled Functions: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,

/ http/ smf/ Sources/ - drwxrwxrwx

Directory:
Viewing file:     LoadAds.php (8.23 KB)      -r--r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/******************************************************************************
* SMF: Simple Machines Forum - Ad Management Mod                              *
*                                                                             *
* =========================================================================== *
* Software Version:           Ad mod: 2.3                                     *
* Software by:                smfhacks.com                                    *
* Copyright 2010 by:          smfhacks.com                                    *
* Support site:               www.smfads.com                                  *
*******************************************************************************
* This mod is free software; you may not redistribute or provide a modified   *
* version to redistribute.  This mod is distributed in the hope that it is    *
* and will be useful, but WITHOUT ANY WARRANTIES; without even any implied    *
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.            *
******************************************************************************/
if (!defined('SMF'))
    die(
'Hacking attempt...');
    
function 
loadads()
{
    global 
$db_prefix;    
    global 
$adverts;
        
    
$query db_query("
        SELECT *
        FROM 
{$db_prefix}ads"__FILE____LINE__);
    while (
$row mysql_fetch_assoc($query))
    {
        
$adverts[] = array(
            
'id' => $row['ADS_ID'],
            
'name' => $row['NAME'],
            
'content' => $row['CONTENT'],
            
'boards' => $row['BOARDS'],
            
'posts' => $row['POSTS'],
            
'category' => $row['CATEGORY'],
            
'hits' => $row['HITS'],
            
'type' => $row['TYPE'],
            
'show_index' => $row['show_index'],
            
'show_board' => $row['show_board'],
            
'show_threadindex' => $row['show_threadindex'],
            
'show_lastpost' => $row['show_lastpost'],
            
'show_thread' => $row['show_thread'],
            
'show_bottom' => $row['show_bottom'],
            
'show_welcome' => $row['show_welcome'],
            
'show_topofpage' => $row['show_topofpage'],
            
'show_towerright' => $row['show_towerright'],
            
'show_towerleft' => $row['show_towerleft'],
            
'show_underchildren' => $row['show_underchildren'],
        );
    }
    
    
mysql_free_result($query);
    
$adverts stripslashes__recursive($adverts);
        
            
}    

function 
show_threadindexAds()
{
    return 
showAds('show_threadindex');
}

function 
show_boardAds()
{
    return 
showAds('show_board');
}

function 
show_threadAds()
{
    return 
showAds('show_thread');
}

function 
show_bottomAds()
{
    return 
showAds('show_bottom');
}

function 
show_indexAds()
{
    return 
showAds('show_index');
}

function 
show_towerleftAds()
{
    return 
showAds('show_towerleft');
}

function 
show_towerrightAds()
{
    return 
showAds('show_towerright');    
}

function 
show_topofpageAds()
{
    return 
showAds('show_topofpage');
}

function 
show_welcomeAds()
{
    return 
showAds('show_welcome');
}

function 
show_lastpostAds()
{
    return 
showAds('show_lastpost');
}

function 
show_underchildren()
{
    return 
showAds('show_underchildren');
}


function 
show_posts($postcount)
{
    global 
$board$adverts$modSettings;
    
    
//Quickly check the settings to display ads for Admins
    
if(!empty($modSettings['ads_displayAdsAdmin']) && $modSettings['ads_displayAdsAdmin'] == && allowedTo('admin'))
        return ;
        
    
//Quickly check if all ads should be disabled
    
if(!empty($modSettings['ads_quickDisable']) && $modSettings['ads_quickDisable'] == 1)
        return ;
    
    
//Only want to go in here if there are ads!
    
if(!empty($adverts) && allowedTo('ad_manageperm'))
    {
        
$displayAds = array();
        
$displayBoardAds = array();
        
//Find which ads should display in this area.        
        
for ($i=0;$i<count($adverts);$i++)
        {
            if((
$adverts[$i]['posts']!="" && in_array($postcountexplode(','$adverts[$i]['posts']))) && ($adverts[$i]['boards']!="" && in_array($boardexplode(','$adverts[$i]['boards']))))
                
$displayBoardAds[] = $adverts[$i];
            elseif(
$adverts[$i]['posts']!="" && in_array($postcountexplode(','$adverts[$i]['posts'])) && $adverts[$i]['boards']=="")
                
$displayAds[] = $adverts[$i];
        }
                
//Did we find any ads?
        
if(!empty($displayAds) || !empty($displayBoardAds))
        {

            
//If the board specific ads array is empty, then display normal ads
            
if(empty($displayBoardAds))
            {            
                
$adtemp array_rand($displayAds);
                
                
//Update the hit counter for this ad
                
if(empty($modSettings['ads_updateReports']))
                    
updateAddHits($displayAds[$adtemp]['id']);
                
//Return all information about the post
                
return $displayAds[$adtemp];

            }
            
//else this is a board specific ads, therefor only display ads for that certain board
            
else
            {        
                
$adtemp array_rand($displayBoardAds);
                
                
//Update the hit counter for this ad
                
if(empty($modSettings['ads_updateReports']))
                    
updateAddHits($displayBoardAds[$adtemp]['id']);
                
//Return all information about the post
                
return $displayBoardAds[$adtemp];
            }            
        }
    }        
        
}

function 
showAds($type)
{
    global 
$board$adverts$modSettings;

    
//For security reasons, we don't want to display ads if the action is "admin" or "admod"
    
if(isset($_REQUEST['action']) && ($_REQUEST['action'] == 'admod' || $_REQUEST['action'] == 'admin'))
        return ;
    
    
//Quickly check the settings to display ads for Admins
    
if(!empty($modSettings['ads_displayAdsAdmin']) && $modSettings['ads_displayAdsAdmin'] == && allowedTo('admin'))
        return ;
        
    
//Quickly check if all ads should be disabled
    
if(!empty($modSettings['ads_quickDisable']) && $modSettings['ads_quickDisable'] == 1)
        return ;
        
    
//Only want to go in here if there are ads!
    
if(!empty($adverts) && allowedTo('ad_manageperm'))
    {
        
$displayAds = array();
        
$displayBoardAds = array();
        
//Find which ads should display in this area.        
        
for ($i=0;$i<count($adverts);$i++)
        {
            
//This is where all the board specific ads go
            
if($adverts[$i][$type]==&& $adverts[$i]['boards']!="" && in_array($boardexplode(','$adverts[$i]['boards'])))
                
$displayBoardAds[] = $adverts[$i];
            
//This is where the non board specific ads go
            
elseif($adverts[$i][$type]==&& $adverts[$i]['boards']=="")
                
$displayAds[] = $adverts[$i];

        }    

        
//Did we find any ads?
        
if(!empty($displayAds) || !empty($displayBoardAds))
        {

            
//If the board specific ads array is empty, then display normal ads
            
if(empty($displayBoardAds))
            {            
                
$adtemp array_rand($displayAds);
                
//Only update if we have reports enabled
                
if(empty($modSettings['ads_updateReports']))
                    
updateAddHits($displayAds[$adtemp]['id']);
                
//Return all information about the post
                
return $displayAds[$adtemp];
            }
            
//else this is a board specific ads, therefor only display ads for that certain board
            
else
            {        
                
$adtemp array_rand($displayBoardAds);
                
//Only update if we have reports enabled
                
if(empty($modSettings['ads_updateReports']))
                    
updateAddHits($displayBoardAds[$adtemp]['id']);
                
//Return all information about the post
                
return $displayBoardAds[$adtemp];
            }
            
        }
    }
}

function 
show_category($cat)
{
    global 
$board$adverts$modSettings;
    
    
//Quickly check the settings to display ads for Admins
    
if(!empty($modSettings['ads_displayAdsAdmin']) && $modSettings['ads_displayAdsAdmin'] == && allowedTo('admin'))
        return ;
        
    
//Quickly check if all ads should be disabled
    
if(!empty($modSettings['ads_quickDisable']) && $modSettings['ads_quickDisable'] == 1)
        return ;
    
    
//Only want to go in here if there are ads!
    
if(!empty($adverts) && allowedTo('ad_manageperm'))
    {
        
$displayAds = array();
        
//Find which ads should display in this area.        
        
for ($i=0;$i<count($adverts);$i++)
        {
            if(
in_array($catexplode(','$adverts[$i]['category'])))
                
$displayAds[] = $adverts[$i];
        }
                
//Did we find any ads?
        
if(!empty($displayAds))
        {        
                
$adtemp array_rand($displayAds);
                
                
//Update the hit counter for this ad
                
if(empty($modSettings['ads_updateReports']))
                    
updateAddHits($displayAds[$adtemp]['id']);
                
//Return all information about the post
                
return $displayAds[$adtemp];
                        
        }
    }
}

function 
updateAddHits($id)
{
    global 
$db_prefix;
    
$request db_query("
        UPDATE 
{$db_prefix}ads
            SET hits = hits+1
        WHERE ADS_ID = 
$id"__FILE____LINE__);    
    
}    
    
?>
Command:
Quick Commands:
Upload:
[OK] Max size: 100MB
PHP Filesystem: <@ Ú
Search File:
regexp
Create File:
Overwrite [OK]
View File:
Mass Defacement:
[+] Main Directory: [+] Defacement Url:
LmfaoX Shell - Private Build [BETA] - v0.1 -; Generated: 2.5959 seconds