- OpenX Community Forums
![]() ![]() |
Mar 10 2010, 06:24 PM
Post
#1
|
|
|
Member ![]() ![]() Group: Members Posts: 11 Joined: 30-July 09 From: NorCal, USA Member No.: 29,612 |
Have had really good results using the WP plug-in, but there seems to be little customization available in the widget.
I maybe overlooking this, but have not been able to find a way to add some padding around the ads so the banners don't land right on top of each other when running multiple banners in the widget in the sidebar. (see attached - and don't say anything about the banner designs...those were submitted by the advertisers, m'kay. I would really prefer to not have to place multiple widgets on top of each other just to keep them spaced apart, but I cannot find a simple/neat way for me to add some padding around my banners when they land. I don't need much, even 1-2 px would be fine, or even a <br> tag. I just need them to not look like one stacked banner. any suggestions? Also would be nice to add some options in the control panel for the plug-in to control some of this as a default action when setting up the plug-in.
Attached File(s)
|
|
|
|
Mar 10 2010, 08:07 PM
Post
#2
|
|
|
Member ![]() ![]() Group: Members Posts: 11 Joined: 30-July 09 From: NorCal, USA Member No.: 29,612 |
so, i've looked at the code to see if I can see where the call is for the landing of banners and I found this starting at line 557 (lines 557-567):
CODE <?php for ($n = 0; $n < 10; $n++) { $showhide = (intval($zonecount) > $n) ? 'inline' : 'none'; $n1 = $n+1; echo "<div id='widget-openxwpwidget-div-zoneid$n-$number' name='widget-openxwpwidget-div-zoneid$n-$number' style='display:$showhide;'>\n"; echo "<label for='widget_openxwpwidget-zoneid-$number'>ZoneID for Banner $n1:<br />\n"; echo "<input type='text' id='widget-openxwpwidget-zoneid$n-$number' name='widget-widget_openxwpwidget[$number][zoneid$n]' value='$zoneID[$n]' />\n"; echo "</label>\n"; echo "<br /></div>\n"; } ?> is this the correct php call for the widget when more than one banner is selected in the widget options? if so, where would I put in an extra line break in to separate the banners just enough? looks as thought there is already a <br /> tag at the end before the closing </div> tag...could I just add another? or, if not, where would it go? I know just enough php to normally identify actions, but not 100% sure on the context or proper code needed to manipulate it confidently. |
|
|
|
Mar 11 2010, 08:17 AM
Post
#3
|
|
|
Mentor ![]() Group: OpenX Translators Posts: 3,168 Joined: 18-November 06 From: Germany/Sauensiek Member No.: 13,921 |
Hi AR,
I'll think about an option how to solve your wish - in the meantime you can change the following in the plugins code (please see "// added for AR": CODE // loop over there ... $bannercode = ''; for ($n = 0; $n < intval($zoneCount); $n++) { $zoneID = empty($values['zoneid'.$n]) ? '' : $values['zoneid'.$n]; $bannercode .= _openxwpwidget_get_invocation($location, $zoneID, $params); // added for AR $bannercode .= '<br />'; } // done, most of the echo's are framework echo $before_widget; echo $before_title; echo $title; echo $after_title; if ($align !== false) { echo "<DIV align='{$align}'>"; } echo $bannercode; if ($align !== false) { echo "</DIV>"; } echo $after_widget; This adds a <br> after each banner in the sidebar. To avoid a <br> after the last banner change the added line to if ($n+1 < intval($zoneCount)) { $bannercode .= '<br />'; } Heiko |
|
|
|
Mar 11 2010, 05:23 PM
Post
#4
|
|
|
Member ![]() ![]() Group: Members Posts: 11 Joined: 30-July 09 From: NorCal, USA Member No.: 29,612 |
Hi AR, I'll think about an option how to solve your wish - in the meantime you can change the following in the plugins code (please see "// added for AR": CODE // loop over there ... $bannercode = ''; for ($n = 0; $n < intval($zoneCount); $n++) { $zoneID = empty($values['zoneid'.$n]) ? '' : $values['zoneid'.$n]; $bannercode .= _openxwpwidget_get_invocation($location, $zoneID, $params); // added for AR $bannercode .= '<br />'; } // done, most of the echo's are framework echo $before_widget; echo $before_title; echo $title; echo $after_title; if ($align !== false) { echo "<DIV align='{$align}'>"; } echo $bannercode; if ($align !== false) { echo "</DIV>"; } echo $after_widget; This adds a <br> after each banner in the sidebar. To avoid a <br> after the last banner change the added line to if ($n+1 < intval($zoneCount)) { $bannercode .= '<br />'; } Heiko Thanks Heiko! I used the variable version, since not all our widgets in the sidebar have the same banner count and it keeps things a bit tighter. i had to add an additional break in there to get them to keep them from touching: CODE if ($n+1 < intval($zoneCount)) { $bannercode .= '<br /><br />'; } but it works perfect!! (see screen capture attached) if you look into adding some functionality to this widget I would think adding the option to throw a border around the banner and specify the color would really make this widget a world better! I haven't ran into it on this particular site, but depending on the color scheme, it is sometimes nice to throw a thin border around all banners to keep them contained if the background of the banner and the site backgrounds are similar or the same. I know it is as simple as adding a thin 1px border to the banner before loading it to OpX, but if it could save that step, that would be nice. other than that, I do think you would want to add the above line of code to the next build of the openxwpplugin widget, since I don't think anyone wants banners touching/resting on top of each other. thanks again! I have a happy blogger again! (and happy advertisers!)
Attached File(s)
|
|
|
|
![]() ![]() |