Coinbase

Author Topic: Aligning ad blocks  (Read 4866 times)

0 Members and 1 Guest are viewing this topic.

Offline Myself

  • Newbie
  • *
  • Posts: 7
Aligning ad blocks
« 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.

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Aligning ad blocks
« Reply #1 on: November 21, 2006, 07:47:24 pm »
try putting this code around the ad:

Code: [Select]
<div align=center>ad code</div>

Offline Myself

  • Newbie
  • *
  • Posts: 7
Re: Aligning ad blocks
« Reply #2 on: November 21, 2006, 11:04:01 pm »
I did try that before posting here. Didn't work...  :(

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Aligning ad blocks
« Reply #3 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.

Offline Myself

  • Newbie
  • *
  • Posts: 7
Re: Aligning ad blocks
« Reply #4 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.

Offline jerm

  • Support
  • Elite Member
  • *
  • Posts: 726
Re: Aligning ad blocks
« Reply #5 on: November 25, 2006, 11:33:42 am »
try this instead
<div align="center">ad code</div>

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Aligning ad blocks
« Reply #6 on: November 28, 2006, 07:30:39 pm »
Hmm, I never have to use "" at all. I wonder why.

Offline Swoah

  • Newbie
  • *
  • Posts: 5
Re: Aligning ad blocks
« Reply #7 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.
Code: [Select]
//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:
Code: [Select]
//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:
Quote
Parse 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?

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Aligning ad blocks
« Reply #8 on: December 09, 2006, 10:52:31 am »
use:

Code: [Select]
<div align=center>adcode</div>
Around the ad code in the text box in your admin panel. ;)

Offline Swoah

  • Newbie
  • *
  • Posts: 5
Re: Aligning ad blocks
« Reply #9 on: December 09, 2006, 12:41:52 pm »
Ok, thanks. It works fine now.

Offline bigguy

  • Support
  • Elite Member
  • *
  • Posts: 1518
    • SMF Helper
Re: Aligning ad blocks
« Reply #10 on: December 12, 2006, 12:22:05 am »
No problem, glad it's fixed. ;)

SMF Ads Support Forum

Re: Aligning ad blocks
« Reply #10 on: December 12, 2006, 12:22:05 am »
.

 

.