PDA

View Full Version : How do I add Ads on the 2nd News Article?


sammyman
10-05-2007, 02:49 PM
on my homepage? I would like to ad a small advertisement after the first news article on the homepage... Maybe after the 4th article too. Is this hard to do?

Brian
10-06-2007, 02:35 PM
http://www.vbadvanced.com/forum/showthread.php?t=24508&highlight=ads+news+after

Our Sponsors
 

sammyman
10-07-2007, 02:23 PM
http://www.vbadvanced.com/forum/showthread.php?t=24508&highlight=ads+news+after

This works great, but if I try to put a simple td around the ad to make it look a little nicer, and to center it, it combines with the 2nd news article. Any way to put a simple box around the ad with a background color, and to center the ad? Thanks!

sammyman
10-09-2007, 06:44 PM
bump... It can't be too difficult to get a simple table around the ad... Thanks!

Our Sponsors
 

Brian
10-10-2007, 01:37 PM
Sorry I missed your previous reply. Can you post the code you're using in your 'adv_portal_newsbits' template?

sammyman
10-11-2007, 02:41 PM
Sorry I missed your previous reply. Can you post the code you're using in your 'adv_portal_newsbits' template?


<if condition="$newscount == 2">
<script type="text/javascript"><!--
google_ad_client = "pub-7237447290663668";
google_ad_width = 250;
google_ad_height = 250;
google_ad_format = "250x250_as";
google_ad_type = "text_image";
google_ad_channel = "";
google_color_border = "E0E0F0";
google_color_bg = "E1E1E2";
google_color_link = "000000";
google_color_text = "FFFFFF";
google_color_url = "5C7099";
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<br>
<br>
</if>

<if condition="!$mod_options['portal_news_legacy']">

<tr>

<td class="thead"><if condition="$mod_options['portal_news_showicon']">$vba_style[portal_blockbullet]</if> <a href="$vboptions[bburl]/showthread.php?$session[sessionurl]t=$news[threadid]">$news[title]</a></td>
</tr>
</if>



<tr>

<td class="<if condition="$mod_options['portal_news_legacy']">thead<else />alt2</if>">
<if condition="($mod_options['portal_news_showrating'] AND $news['rating']) OR ($news['subscribed'] AND $mod_options['portal_news_showsubscribed'])">
<span style="float:$stylevar[right]">
<if condition="$mod_options['portal_news_showrating'] AND $news['rating']">
<img alt="" src="$stylevar[imgdir_rating]/rating_$news[rating].gif" title="<phrase 1="$news[votenum]" 2="$news[voteavg]">$vbphrase[thread_rating_x_votes_y_average]</phrase>" />
</if>

<if condition="$news['subscribed'] AND $mod_options['portal_news_showsubscribed']">
<img alt="" class="inlineimg" src="$stylevar[imgdir_misc]/subscribed.gif" title="$vbphrase[you_are_subscribed_to_this_thread]" />
</if>
</span>
</if>
$news[dateposted] - <phrase 1="$vboptions[bburl]/member.php?$session[sessionurl]u=$news[postuserid]" 2="$news[postusername]">$vbphrase[by_x]</phrase>
</td>
</tr>
<tr>
<td align="$stylevar[left]" class="alt1" valign="top">
<if condition="$show['paperclip']">
<span style="float:$stylevar[right]">
<img class="inlineimg" src="$stylevar[imgdir_misc]/paperclip.gif" title="<phrase 1="$news[attach]">$vbphrase[x_attachments]</phrase>" alt="" />
</span>
</if>
<if condition="$news['avatarpath']">
<img align="$stylevar[left]" style="padding:6px" alt="" border="0" src="$news[avatarpath]" title="$news[postusername]'s $vbphrase[avatar]" />
</if>
$news[message]

<if condition="$show['signature']">
<div>__________________<br />
$news[signature]</div>
</if>

</td>
</tr>

<if condition="$news['attachment']">
<tr class="alt1">
<td>
<fieldset class="fieldset">
<legend>Attached Files</legend>
<div style="padding:$stylevar[formspacer]px">
$news[attachment]
</div>
</fieldset>
</td>
</tr>
</if>

<tr class="alt2" valign="middle">
<td valign="middle">
<span style="float:right">
<if condition="$show['editbutton']">
<a href="$vboptions[bburl]/editpost.php?$session[sessionurl]do=editpost&amp;p=$news[postid]"><img alt="$vbphrase[edit_this_post]" border="0" src="$stylevar[imgdir_button]/edit.gif" /></a>
</if>

<if condition="$show['replybutton']">
<a href="$vboptions[bburl]/newreply.php?$session[sessionurl]do=newreply&amp;t=$news[threadid]"><img alt="$vbphrase[reply_to_this_post]" border="0" src="$stylevar[imgdir_button]/reply_small.gif" /></a>
</if>

<if condition="$mod_options['portal_news_showsendfriend']">
<a href="$vboptions[bburl]/sendmessage.php?$session[sessionurl]do=sendtofriend&amp;t=$news[threadid]"><img alt="" border="0" src="$stylevar[imgdir_button]/sendtofriend.gif" title="$vbphrase[send_to_friend]" /></a>
</if>

<if condition="$mod_options['portal_news_showprintable']">
<a href="$vboptions[bburl]/printthread.php?$session[sessionurl]t=$news[threadid]"><img alt="" border="0" src="$stylevar[imgdir_button]/printer.gif" title="$vbphrase[show_printable_version]" /></a>
</if>
</span>
[ <a href="$vboptions[bburl]/showthread.php?$session[sessionurl]t=$news[threadid]"> $news[replycount] Comments</a> ] [ <a href=http://digg.com/submit?phase=2&url=$vboptions[bburl]/showthread.php?$session[sessionurl]t=$news[threadid]>digg</a> ]
<span class="smallfont">
<if condition="$mod_options['portal_news_allowreplies']">$news[replycount] <if condition="$news['reply_noformat'] == 1">$vbphrase[reply]<else />$vbphrase[replies]</if></if><if condition="$mod_options['portal_news_showviews'] AND $mod_options['portal_news_allowreplies']"> | </if><if condition="$mod_options['portal_news_showviews']">$news[views] $vbphrase[views]</if></span>
</td>

</tr>

Brian
10-12-2007, 11:00 AM
The wrapper template is going to form the table around the news posts, so you may be better off adding the code with your banner to the beginning of your 'adv_portal_module_wrapper' template with a slightly different <if condition> wrapped around it.

<if condition="$newscount == 2 AND $mods['identifier'] == 'news'">

Ad code here

</if>

sammyman
10-12-2007, 11:55 AM
That worked! Thanks!