Forums / Install & configuration / openAds 2.3 custom tag discussion

openAds 2.3 custom tag discussion

Author Message

Pascal Specht

Wednesday 20 June 2007 2:27:53 am

Please use this forum for troubleshooting and assistance for the openAds (Max Media Manager) extension.

Lukasz Piech

Saturday 23 June 2007 12:58:57 am

Hi,

Can you use OpenAds to "rotate" banners on the Frontpage?

How would you approach that?

Thanks

Lukasz

Pascal Specht

Saturday 23 June 2007 1:24:33 am

Hi Lukasz,

Yes of course. That's definitively what openAds is meant for.

There are two ways: either your banner is part of the header area, in this case, you would use the template operator directly inside your pagelayout template, or if the banner is inside the content area, I would use the custom tag inside the XML block of the center column, for example.

From the openAds point of view, it resumes to creating a new campaign, and add let's say 4 new images with URLs into this campaign. All the fine tuning (showing the click url or not, rotating randomly etc have to be setup also in openAds.

If your campaign_id is 1, the code would become something like:

<custom name="openads" zone_id="0" campaign_id="1" banner_id="0" html_target="_self"></custom>

Lukasz Piech

Saturday 23 June 2007 1:40:08 am

OK thanks

I meant the main banner in class Frontpage so i will have to tweak the billboard.tpl i think

I will try this today and will share my feedback if this is ok with you/

Lukasz

laurent le cadet

Thursday 06 September 2007 5:07:14 am

(sorry, but first reported on contribution page)

Hi,

I dowloaded and install the 2.3.39 beta Openads release and I have the following error:


Fatal error: Call to undefined function: view_local() in /home/zoneindustrie/public_html/extension/openads/lib/openads_operators.php on line 112

Fatal error: eZ publish did not finish its request

The execution of eZ publish was abruptly ended, the debug output is present below.

Is it a known bug I can fix or ist due to that release ?

Regards.

Laurent

Pascal Specht

Thursday 06 September 2007 5:19:51 am

Bonjour Laurent,

It looks like the template did'nt include the openAds files... view_local is the function I'm calling in openAds.

Did you check that you adjusted the path to openAds in content.ini.append.php ?
The template code gets the library path from there:

$defaultOpenAdsServer = $ini->variable( 'openads', 'DefaultOpenAdsServer' );
$defaultOpenAdsServerScript = $ini->variable( 'openads', 'DefaultOpenAdsServerScript' );

and then includes openAds this way:

define('MAX_PATH', $defaultOpenAdsServer);
@include_once(MAX_PATH.$defaultOpenAdsServerScript);

I hope this helps. I still have 2.3.35b, if you need to compare files, feel free to ask me.

Happy advertising,
Pascal

Pascal Specht

Thursday 06 September 2007 5:25:32 am

Hello Laurent,

also one thing that may happen: if you're using virtual hosts, make sure you're allowed to execute openads!

RewriteRule ^/openads - [L]

Check if you're getting some logs in /home/logs/httpd or /site/var/log ?!

Hope this helps,
Pascal

laurent le cadet

Thursday 06 September 2007 5:33:18 am

Pascal,

Much much better.
My content.ini was:

DefaultOpenAdsServer=/home/zoneindustrie/www/openads

But the directory isn't named "www" but "public_html" (haha!)

Now I can start playing with eZ and Openads.
It seems to be really powerfull and your extension should be include in the eZ regular release (my opinion).

Maybe I'll be back soon here for more ;)

Merci beaucoup.

Laurent

laurent le cadet

Thursday 06 September 2007 9:16:22 am

Me again ;)

I have a error in the generated url :

<a href='http://zoneindustrie.alfanwt.net/openads/www/delivery/ck.php?oaparams=2__bannerid=7__zoneid=0__cb=1dd9cb19c8__maxdest=http://www.lestudiot.com' target=''_blank'' onmouseover="self.status='Sky1'; return true;" onmouseout="self.status=''; return true;"><img src='http://zoneindustrie.alfanwt.net/openads/www/delivery/ai.php?filename=sky_1.gif&contenttype=gif' width='120' height='600' alt='Sky1' title='Sky1' border='0' /></a><div id='beacon_7' style='position: absolute; left: 0px; top: 0px; visibility: hidden;'><img src='http://zoneindustrie.alfanwt.net/openads/www/delivery/lg.php?bannerid=7&amp;campaignid=3&amp;zoneid=0&amp;loc=http%3A%2F%2Fzoneindustrie.alfanwt.net%2F&amp;cb=1dd9cb19c8' width='0' height='0' alt='' style='width: 0px; height: 0px;' /></div>

The target destination is warpped with 2 quotes:

target=''_blank''

It should be a double quote instead?

I'm not sure if due to the extension code or Openads appz...

Let me know.

Laurent

Pascal Specht

Thursday 06 September 2007 9:33:47 am

Hey Laurent,

how do you call openAds? Through an xml tag or through the template operator?

If you use the XML tag, all fields have to be filled in with plain values without any quotes or double quotes, in other words the dialog shows 1 2 3 and _self in the four form fields, for example.

If you use the template directly, I think i anways add the single quotes around the last argument, so maybe you should pass _self instead of '_self' as the argument ? I maybe did something wrong, I didn't use it from within a .tpl yet. the function openads_html may have to be written without adding quotes.

Let me know, and I'm going to correct that.

Pascal

laurent le cadet

Thursday 06 September 2007 9:45:03 am

Pascal,

This is in a include.tpl in the pagelayout:

{openads_html(0, 3, 0, _blank)}

{openads_html(0, 3, 0, '_blank')}

I tryed both of them but amazingly it's still the same result:

target=''_blank''

Pascal Specht

Friday 07 September 2007 12:54:37 am

Hi Laurent,

yes, I believe the function does always add the single quotes to the output text, even if the quote was there before...
I added one line with a trim instruction.
Maybe you can give the following code a try and tell me if it corrects the problem. I would then update the library and post it again.
The code is placed in the lib folder:

 

   function openads_html( $zone_id, $campaign_id, $banner_id, $html_target )
   {

	if (!isset($phpAds_context)) {
		$phpAds_context = array();
	}
//-------------------------------------------------------------------------
	$html_target = trim( $html_target, "\ \"\'" );
//-------------------------------------------------------------------------
	$phpAds_raw = view_local('', $zone_id, $campaign_id , $banner_id, "'".$html_target."'", '', '0', $phpAds_context);
	return $phpAds_raw['html'];
   }

        

Let me know if this is a workaround.

Pascal

laurent le cadet

Friday 07 September 2007 3:07:50 am

Hi Pascal,

I added the new line, clear all caches, but quotes are still here.

Sorry.

Laurent

Pascal Specht

Friday 07 September 2007 5:03:10 am

Hi Laurent,

that's strange, because this is the place where the code gets generated. If you add nonsense characters there or a syntax error, do you see the consequence on your generated files?

Pascal

laurent le cadet

Friday 07 September 2007 5:22:15 am

Yes, that's here the problem is.
With a brutal hack of line 112 (openads_operators.php), I'va got a eZ publish fatal error.

Pascal Specht

Friday 07 September 2007 5:41:46 am

Hi Laurent,

and if you would replace the
return $phpAds_raw['html'];
by
return "<b>hello</b>";

does your output reflect that change then? I mean if this is the case, I can't see how the redundant quotes still would remain, since we removed them just in this function.
Since I'm heavilly taken in another project right now, I can't find the time to look into your issue further for now, but I think this is the place to look at for sure.

Pascal

laurent le cadet

Friday 07 September 2007 7:07:07 am

Pascal,

return "hello";

Return stricly : hello

No quotes.

Laurent

Ps : tanks for your valuable time

Pascal Specht

Friday 07 September 2007 7:24:34 am

of course! that's how PHP should work when returning a literal string!

Start from here:

	$html_target = trim( $html_target, "\ \"\'" );
	$phpAds_raw = view_local('', $zone_id, $campaign_id , $banner_id, "€".$html_target."€", '', '0', $phpAds_context);
	return $phpAds_raw['html'];

See what it generates, and according to that, add or replace the euro symbol with what's needed!

Pascal

laurent le cadet

Friday 07 September 2007 7:41:22 am

"".$html_target.""

Is the winner :)

Thanks Pascal

Laurent

Rhino Vincent

Thursday 27 September 2007 5:02:41 am

Hi
I trie to use openads whit ezp,
Where can i find the rotate option in open ads ??