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 ??

eZ debug

Timing: Jan 18 2025 05:00:21
Script start
Timing: Jan 18 2025 05:00:21
Module start 'content'
Timing: Jan 18 2025 05:00:22
Module end 'content'
Timing: Jan 18 2025 05:00:22
Script end

Main resources:

Total runtime1.1557 sec
Peak memory usage4,096.0000 KB
Database Queries267

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 587.8359180.8203
Module start 'content' 0.00650.9752 768.6563804.2813
Module end 'content' 0.98170.1740 1,572.9375366.5625
Script end 1.1556  1,939.5000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00460.3948210.0002
Check MTime0.00170.1500210.0001
Mysql Total
Database connection0.00080.067110.0008
Mysqli_queries0.982184.97922670.0037
Looping result0.00300.25882650.0000
Template Total1.122597.120.5613
Template load0.00180.156720.0009
Template processing1.120796.968220.5603
Template load and register function0.00020.020110.0002
states
state_id_array0.00180.156410.0018
state_identifier_array0.00110.094820.0005
Override
Cache load0.00200.17411530.0000
Sytem overhead
Fetch class attribute can translate value0.00160.141950.0003
Fetch class attribute name0.00150.1260220.0001
XML
Image XML parsing0.00800.695950.0016
class_abstraction
Instantiating content class attribute0.00010.0074370.0000
General
dbfile0.01951.6839330.0006
String conversion0.00000.000530.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
17content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
20content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
35content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
8content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
10content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 92
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs