SMF Ads Support Forum

Support => General Support => Topic started by: Myself on November 20, 2006, 05:42:38 AM

Title: Aligning ad blocks
Post by: Myself on November 20, 2006, 05:42:38 AM
I have installed the mod, no problems, but I am stuck on how to align the various ad blocks. Example, I want to have the ads at the bottom of the page appear centered, but at the moment they are defaulting to be aligned left.
Title: Re: Aligning ad blocks
Post by: bigguy on November 21, 2006, 07:47:24 PM
try putting this code around the ad:

<div align=center>ad code</div>
Title: Re: Aligning ad blocks
Post by: Myself on November 21, 2006, 11:04:01 PM
I did try that before posting here. Didn't work...  :(
Title: Re: Aligning ad blocks
Post by: bigguy on November 22, 2006, 05:04:38 PM
That should have worked no problems. There is another way to do it but I can't think right now. Let's see what Jerm has to say.
Title: Re: Aligning ad blocks
Post by: Myself on November 25, 2006, 11:25:25 AM
Apologies - I tried it again and it worked this time. I must have screwed up the code first time out.
Title: Re: Aligning ad blocks
Post by: jerm on November 25, 2006, 11:33:42 AM
try this instead
<div align="center">ad code</div>
Title: Re: Aligning ad blocks
Post by: bigguy on November 28, 2006, 07:30:39 PM
Hmm, I never have to use "" at all. I wonder why.
Title: Re: Aligning ad blocks
Post by: Swoah on December 09, 2006, 10:42:36 AM
If I use the code as above it doesn't seem to work.

This is the code I wan't to align, only the bold, the rest is extra.

//Display ads on the top of the page
$ads = show_topofpageAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);[/b]


I've changed it like this:

//Display ads on the top of the page
<div align="center">
$ads = show_topofpageAds();
if(!empty($ads))
if($ads['type']==0)
echo $ads['content'];
else
eval($ads['content']);
unset($ads);
</div>


But when I open the index page it gives this error:
QuoteParse error: parse error, unexpected '<' in .../Themes/safgreen/index.template.php on line 171

162:
163:             document.getElementById("upshrinkHeaderIC").style.display = mode ? "none" : "";
164:
165:             current_header_ic = mode;
166:          }
167:       // ]]></script>
168: </head>
169: <body>';
170: //Display ads on the top of the page

171: <div align="center">

172:    $ads = show_topofpageAds();   
173:    if(!empty($ads))
174:       if($ads['type']==0)
175:          echo $ads['content'];

Line 171 seems to be wrong, but I don't know what is wrong. Can U help me?
Title: Re: Aligning ad blocks
Post by: bigguy on December 09, 2006, 10:52:31 AM
use:

<div align=center>adcode</div>

Around the ad code in the text box in your admin panel. ;)
Title: Re: Aligning ad blocks
Post by: Swoah on December 09, 2006, 12:41:52 PM
Ok, thanks. It works fine now.
Title: Re: Aligning ad blocks
Post by: bigguy on December 12, 2006, 12:22:05 AM
No problem, glad it's fixed. ;)