How to insert ads in MediaWiki

Status
Not open for further replies.

Fedlerner

Former Adm & Team Manager
Community Support
Messages
12,934
Reaction score
6
Points
38
Inserting the Ads in MediaWiki is a bit complicated (it took me a long time to figure it out).
You can add before the ad code <div align="center">, and after the code </div> to make it look nicer by centering the ad.

For the Corporate plan:
You'll need to edit two files, and you can edit the file by using an FTP Client, or FileManager (from cPanel).
Go to the MediaWiki folder, and go to the "skins" subfolder. You'll need to edit two files:

-The first file is located in the "/skins/monobook" subfolder. The file you need to edit is the "main.css".
Add the following code:
Code:
#wholebody {
position: absolute;
top: 70px;
}

Right before this code:
Code:
#column-content {
    width: 100%;
    float: right;
    margin: 0 0 .6em -12.2em;
    padding: 0;
}
And save the file.

-The second file is located in the /skins subfolder. The file you need to edit is the "MonoBook.php".

You'll need to add the following code:
Code:
<div id="header">
THE JAVASCRIPT CODE HERE
</div>
<div id="wholebody">

After this code:
Code:
    </head>
<body <?php if($this->data['body_ondblclick']) { ?>ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
<?php if($this->data['body_onload'    ]) { ?>onload="<?php     $this->text('body_onload')     ?>"<?php } ?>
 class="mediawiki <?php $this->text('nsclass') ?> <?php $this->text('dir') ?>">

before this code:
Code:
    <div id="globalWrapper">
        <div id="column-content">
    <div id="content">



Then you'll need to add:
Code:
</div>

Right after this code:
Code:
?>
            </ul>
        </div>
    <?php $this->html('bottomscripts'); /* JS call to runBodyOnloadHook */ ?>
</div>

Before this code:
Code:
<?php $this->html('reporttime') ?>
<?php if ( $this->data['debug'] ): ?>
<!-- Debug output:
<?php $this->text( 'debug' ); ?>

Save the file and that's it. In FireFox you need to delete your cookies to see the changes.


If you still can't insert the Ads, please post in the "Free Hosting" board.
 
Last edited:

Fedlerner

Former Adm & Team Manager
Community Support
Messages
12,934
Reaction score
6
Points
38
For the Advanced plan:

It's easier than the Corporate plan. You just need to edit the "MonoBook.php", and you can edit the file by using an FTP Client, or FileManager (from cPanel). Go to the MediaWiki folder, and go to the "skins" subfolder. You'll need do this:

You just need to add the "JavaScript" code:

After this code:
Code:
		</div><!-- end of the left (by default at least) column -->
			<div class="visualClear"></div>
			<div id="footer">

Before this code:
Code:
<?php
		if($this->data['poweredbyico']) { ?>
				<div id="f-poweredbyico"><?php $this->html('poweredbyico') ?></div>

Save the file and that's it. In FireFox you need to delete your cookies to see the changes.


If you still can't insert the Ads, please post in the "Free Hosting" board.
 
Last edited:
Status
Not open for further replies.
Top