Home arrow Help & Tips arrow Joomla Help & Tips arrow Joomla and phpAdsNew Integration

Joomla and phpAdsNew Integration

Print E-mail
User Rating: / 22
PoorBest 
Written by Editor (cowboy)   
Wednesday, 26 July 2006
phpAdsNewWhat is phpAdsNew? phpAdsNew is an open-source ad server, with an integrated banner management interface and tracking system for gathering statistics. With phpAdsNew you can easily rotate advertisements. You can even integrate banners from third party advertising companies. phpAdsNew is very useful for those who run multiple websites. This means you only have to manage your ads from one location.

Here is a quick tip on how to integrate phpAdsNew to Joomla.

Step 1: Understand phpAdsNew.

The first step is to know how to use phpAdsNew. phpAdsNew will be confusing for those who don't understand advertising terminologies. You need to know what is a "campaign", "zone", "advertiser", "publisher", etc. Once you understand all of these, you'll find this application really useful. Please refer to phpAdsNew documentations here.

Step 2. Download and install phpAdsNew. (currently version 2.0.8)

Download phpAdsNew here. phpAdsNew is also packaged in Fantastico from your CPANEL. But I prefer direct download from their site to get the latest version. Just take note that you have to install phpAdsNew on the same server as your websites. I know phpAdsNew can do remote invocation but i'm not sure if it works with Joomla integration. Installation is just like installing Joomla. I suggest using a sub-domain for phpAdsNew installation. For example adserver.yoursite.com.

Step 3. Setup ads in phpAdsNew.

I am not going to cover this process but you can refer to phpAdsNew documentations here.

Step 4. Download and install "KL evalPHP" module and "Imbed PHP" mambot by John Long.

Download "KL evalPHP" Joomla module here. You can also use the "Imbed PHP" mambot so you can embed your ads on Joomla contents. Download Imbed PHP here.

Step 5. Configure the KL evalPHP module.

For those still at lost with Joomla module concept, you can create copies of this module and assign it to different module sections such as "advert1", "advert2", "banner", etc. After you complete this one module, just copy the module and configure the copy and assign it on a different module section with different invocation code.

But first, lets configure one module. You have to generate invocation code from your phpAdsNew publisher zone. From phpAdsNew administration, go to:

INVENTORY >> PUBLISHERS & ZONES >> (click one publisher) >> ZONE OVERVIEW >>  (click one zone)  >> INVOCATIONCODE

phpAdsNew Admin
phpAdsNew Admin
 
  • You need to choose "LOCAL MODE" for banner invocation.
  • Copy the invocation code and put it in your module PHP Script parameter.
  • Remove the PHP opening and close tag.
  • If phpAdsNew is hosted from a different domain, you need to hard code the "phpadsnew.inc.php" path reference.
KL evalPHP module
KL evalPHP module


Original Invocation Code:


<?php
    if (@include(getenv('DOCUMENT_ROOT').'/phpadsnew.inc.php')) {
        if (!isset($phpAds_context)) $phpAds_context = array();
        $phpAds_raw = view_raw ('zone:16', 0, '', '', '0', $phpAds_context);
        echo $phpAds_raw['html'];
    }
?>

Edited Invocation Code for Joomla module:

if (@include(getenv('DOCUMENT_ROOT').'/phpadsnew.inc.php')) {
        if (!isset($phpAds_context)) $phpAds_context = array();
        $phpAds_raw = view_raw ('zone:16', 0, '', '', '0', $phpAds_context);
        echo $phpAds_raw['html'];
}

If phpAdsNew is hosted on a different domain:

if (@include('/home/yoursite/phpAdsNew/phpadsnew.inc.php')) {
        if (!isset($phpAds_context)) $phpAds_context = array();
        $phpAds_raw = view_raw ('zone:16', 0, '', '', '0', $phpAds_context);
        echo $phpAds_raw['html'];
}

That's it. This is just a quick tip. I know those new to Joomla might not get it. Please use this forum thread if you need some assistance.

 








Comments (10)add feed
thanks... : Nicky
Thank! i've been looking for this!
July 27, 2006
i like it! : johnny
thanks for this article. i just tried it. Setting up ads though is a bit confusing at first. But i got it now.
July 28, 2006
i didnt sort it out. all the time i have this error
Parse error: parse error, unexpected '
July 29, 2006
Working with Max Media Manager : gorrisai : http://www.yourout.nl
Hi, I have an dedicated server for the use with max media manager. I would like to use this module/mambot to display banners in the site, what should i do when the control panel of my adserver is reachable on a different domain via http://www.media-portal.nl/adserver? />
Hopefully someone has some ideas.

Thanks,

Ivo
August 16, 2006
Hardcoded path : xincana
Ivo, you should be able to use Javascript (disable WYSIWYG) or I-Frames.
I have the same problem, changing the hardcode path doesn't help as it is looking for banners from the wrong URL.
Please contact me if you need more info, I am Dutch too.
September 3, 2006
Contents : atb80
May I show the banners in contents?
December 15, 2006
... : mollet
I tried the installation like described in the article but I only get the following error message:

Parse error: syntax error, unexpected '{' in /usr/httpd_data/pro/www.isurf.ch/www/cms/modules/mod_phpadsnew_468x60.php(27) : eval()'d code on line 1

What's the matter with this { ?
January 2, 2007
Does not work! : cbriere
Can't make it work.
images/grin.gifoes anyone knows of decent tutorial out there to make this thing work?

Getting parse errors as follows:
Parse error: syntax error, unexpected ')' in /home/mesonesg/public_html/modules/mod_kl_evalphp.php(27) : eval()'d code on line 1

I have PhpAdsnew installed in
www.multipleweb.com/ads /> My Joomla site is installed in www.MesonesGastronomicos.com />
Both sites are in the same server. They share the same directory structure.

Home directory for
www.multipleweb.com is:
/home/multiple/public_html/

Home directory for www.MesonesGastronomicos.com is:
/home/mesonesg/public_html/

The invocation code generated by PhpAdsNew is as follows:



And of course I deleted the php opening/closing tags.
The modified invocation code is as follows:

if
(@include('/home/multiple/public_html').'/ads/phpadsnew.inc.php')) {
if (!isset($phpAds_context))
$phpAds_context = array();
$phpAds_raw = view_raw
('zone:2', 0, '', '', '0', $phpAds_context);
echo $phpAds_raw['html'];
}


Any clues of why it doesn't work.
Thanks,
January 8, 2007
imbed PHP not working ? : Pixelate
This tutorial seems to miss how to use the imbed PHP mambot. The evalPHP works, but the imbed PHP doesn't seem to work. I keep reading about people getting the same errors when adding the

{kl_php} if (@include(getenv(''DOCUMENT_ROOT'').''/adserver/phpadsnew.inc.php''))
{ if (!isset($phpAds_context)) $phpAds_context = array(); $phpAds_raw = view_raw (''bannerid:24'', 33, '''', '''', ''0'', $phpAds_context); echo $phpAds_raw[''html'']; } {/kl_php}
February 23, 2007
Really Nice : okello : http://www.okello.info
For months I've been looking for something like this. I'm trying it out just right now.
November 30, 2007
Write comment

You must be logged in to post a comment. Please register if you do not have an account yet.

 
< Prev   Next >



 
Joomla Hacks is a Joomla Components, Joomla Modules, Joomla Templates, & Joomla Mambots resource portal.
None of the text or images in this public website may be copied without the expressed written consent of the authors.
Copyright 2005 by JoomlaHacks.com. Powered by Joomla. All rights reserved.
Terms of Use