ads script in xoops

Status
Not open for further replies.

plinkous

New Member
Messages
17
Reaction score
0
Points
0
i need some help getting the ad script placed on to my site ..

i am running xoops and need some help with placing it so as it will show up in the right place ....

if anyone can help me out i would be most greatfull...

thanks in advance
 

omnirom

New Member
Messages
182
Reaction score
0
Points
0
Edit header.php, and copy and paste this
The ad code itself is in red:

Code:
<?php
// $Id: header.php 558 2006-06-20 06:35:23Z skalpa $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <http://www.xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //
defined("XOOPS_ROOT_PATH") or die( 'XOOPS root path not defined' );

include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';

//global $xoopsLogger;

if ( !isset( $xoopsLogger ) ) {        $xoopsLogger =& $GLOBALS['xoopsLogger'];    }

$xoopsLogger->stopTime( 'Module init' );
$xoopsLogger->startTime( 'XOOPS output init' );


if ($xoopsConfig['theme_set'] != 'default' && file_exists(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/theme.php')) {
    require_once XOOPS_ROOT_PATH . '/include/xoops13_header.php';
} else {
    global $xoopsOption, $xoopsConfig, $xoopsModule;
    
    $xoopsOption['theme_use_smarty'] = 1;
    
    if ( $xoopsConfig['gzip_compression'] == 1 && extension_loaded( 'zlib' ) ) {
        if ( @ini_get( 'zlib.compression_level' ) < 0 ) {
            ini_set( 'zlib.compression_level', 6 );
        }
        ob_start( 'ob_gzhandler' );
    }

    // include Smarty template engine and initialize it
    require_once XOOPS_ROOT_PATH . '/class/template.php';
    require_once XOOPS_ROOT_PATH . '/class/theme.php';
    require_once XOOPS_ROOT_PATH . '/class/theme_blocks.php';

    if ( @$xoopsOption['template_main'] ) {
        if ( false === strpos( $xoopsOption['template_main'], ':' ) ) {
            $xoopsOption['template_main'] = 'db:' . $xoopsOption['template_main'];
        }
    }
    $xoopsThemeFactory =& new xos_opal_ThemeFactory();
    $xoopsThemeFactory->allowedThemes = $xoopsConfig['theme_set_allowed'];
    $xoopsThemeFactory->defaultTheme = $xoopsConfig['theme_set'];
   
    /**
     * @var xos_opal_Theme
     */
    $xoTheme =& $xoopsThemeFactory->createInstance( array(
        'contentTemplate' => @$xoopsOption['template_main'],
    ) );
    $xoopsTpl =& $xoTheme->template;
    
    $xoTheme->addScript( '/include/xoops.js', array( 'type' => 'text/javascript' ) );

    // Weird, but need extra <script> tags for 2.0.x themes
    //$xoopsTpl->assign('xoops_js', '//--></script><script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script><script type="text/javascript"><!--');

    if ( @is_object( $xoTheme->plugins['xos_logos_PageBuilder'] ) ) {
        $aggreg =& $xoTheme->plugins['xos_logos_PageBuilder'];
    
        $xoopsTpl->assign_by_ref( 'xoBlocks', $aggreg->blocks );
        
        // Backward compatibility code for pre 2.0.14 themes
        $xoopsTpl->assign_by_ref( 'xoops_lblocks', $aggreg->blocks['canvas_left'] );
        $xoopsTpl->assign_by_ref( 'xoops_rblocks', $aggreg->blocks['canvas_right'] );
        $xoopsTpl->assign_by_ref( 'xoops_ccblocks', $aggreg->blocks['page_topcenter'] );
        $xoopsTpl->assign_by_ref( 'xoops_clblocks', $aggreg->blocks['page_topleft'] );
        $xoopsTpl->assign_by_ref( 'xoops_crblocks', $aggreg->blocks['page_topright'] );
    
        $xoopsTpl->assign( 'xoops_showlblock', !empty($aggreg->blocks['canvas_left']) );
        $xoopsTpl->assign( 'xoops_showrblock', !empty($aggreg->blocks['canvas_right']) );
        $xoopsTpl->assign( 'xoops_showcblock', !empty($aggreg->blocks['page_topcenter']) || !empty($aggreg->blocks['page_topleft']) || !empty($aggreg->blocks['page_topright']) );
    }

    if ( $xoopsModule ) {
        $xoTheme->contentCacheLifetime = $xoopsConfig['module_cache'][ $xoopsModule->getVar('mid', 'n') ];
    }
    if ( $xoTheme->checkCache() ) {
        exit();
    }

    if ( !isset($xoopsOption['template_main']) && $xoopsModule ) {
        // new themes using Smarty does not have old functions that are required in old modules, so include them now
        include XOOPS_ROOT_PATH.'/include/old_theme_functions.php';
        // need this also
        $xoopsTheme['thename'] = $xoopsConfig['theme_set'];
        ob_start();
    }

$xoopsLogger->stopTime( 'XOOPS output init' );
$xoopsLogger->startTime( 'Module display' );
[COLOR=#000000][COLOR=red]<script language='JavaScript' type='text/javascript' src='http://x10hosting.com/advert/adx.js'></script>[/COLOR][/COLOR][COLOR=#000000][COLOR=red]
<script language='JavaScript' type='text/javascript'>
<!--
if (!document.phpAds_used) document.phpAds_used = ',';
phpAds_random = new String (Math.random()); phpAds_random = phpAds_random.substring(2,11);
 
document.write ("<" + "script language='JavaScript' type='text/javascript' src='");
document.write ("[/COLOR][URL="http://x10hosting.com/advert/adjs.php?n"][COLOR=red]http://x10hosting.com/advert/adjs.php?n[/COLOR][/URL][COLOR=red]=" + phpAds_random);[/COLOR][COLOR=red]
document.write ("&amp;what=zone:1&amp;target=_blank");
document.write ("&amp;exclude=" + document.phpAds_used);
if (document.referrer)
 document.write ("&amp;referer=" + escape(document.referrer));
document.write ("'><" + "/script>");
//-->
</script><noscript><a href='http://x10hosting.com/advert/adclick.php?n=a7fb3e9d' target='_blank'><img src='http://x10hosting.com/advert/adview.php?what=zone:1&amp;n=a7fb3e9d' border='0' alt=''></a></noscript>[/COLOR] [/COLOR]

}

?>
 

plinkous

New Member
Messages
17
Reaction score
0
Points
0
have changed to SMF and need to be able to find the header.php file have looked all over for it with the file manager but no luck...

any help would be great

thanks in advance
 

Chris Z

Active Member
Messages
5,603
Reaction score
0
Points
36
ummm, i believe there's already an ad script mod on SMF, correct me if i'm wrong, i don't know if you have to download it or not, but i know there's a mod for it
 

omnirom

New Member
Messages
182
Reaction score
0
Points
0
There are a lot of threads about ads in smf, so you should try to look around. In fact, theres one called "Ads in Smf" on the front page, about 3 threads down from this one currently.. ;)

The mod billybob is talking about is in that thread. Here's the mod:

http://mods.simplemachines.org/index.php?mod=255

edit: nevermind, I see you have posted in the other thread and couldn't find the mod apparently

Contact me on aim/msn (omnirom) and maybe I can help you there.
 
Last edited:
Status
Not open for further replies.
Top