PDA

View Full Version : How to: Add a advertisement after first post?


ryancooper
05-16-2004, 07:43 PM
How can I do this:

http://www.techimo.com/forum/t108340.html

See the google ad after the first post?

Thanks!

Even better if it could be set to onyl show for certain usergroups. . .

Zachery
05-16-2004, 08:46 PM
ITs more than possible with just simple template mods :)

Owen
05-16-2004, 08:46 PM
that wouldnt be good, that would be GREAT! I am guessing something with <if>'s

Xenon
05-16-2004, 09:00 PM
well you have to edit your postbittemplate

and at the very end you have to add something like:

<if condition="$thread[firstpostid] == $post[postid]">code of your advertisments here</if>

Owen
05-16-2004, 09:06 PM
since I have my google ads in the header, what would the <if> code be not to display it on the showthread page? (You are not allowed to show two google ads on one page).

Xenon
05-16-2004, 09:08 PM
<if condition="THIS_SCRIPT != 'showthread'">google add here</if>

P.Jackson
05-17-2004, 03:30 PM
how could you do it only for unregistered or certain usersgroups? i.e show it to Registered,unreg,users awaing etc ad not showing it for admins,mods and a custom usergroup

Xenon
05-17-2004, 04:24 PM
then you have to combine the conditions:

<if condition="THIS_SCRIPT != 'showthread' AND $bbuserinfo['usergroupid'] != 6">google add here</if>

ryancooper
05-17-2004, 06:51 PM
then you have to combine the conditions:

<if condition="THIS_SCRIPT != 'showthread' AND $bbuserinfo['usergroupid'] != 6">google add here</if>


I am a little confused. I trued to add

<if condition="$thread[firstpostid] == $post[postid]" AND $bbuserinfo['usergroupid'] != 2">code of your advertisments here</if>

and got:

The following error occurred when attempting to evaluate this template:

Parse error: parse error in /home/talkdis/public_html/forums/includes/adminfunctions_template.php(3037) : eval()'d code on line 209

Also how can I show it to more than one usergroup: ['usergroupid'] != 2,3,4,5"

??

or ['usergroupid'] != 2 AND 3"

Xenon
05-17-2004, 07:54 PM
there is a " in the middle of your condition, which shouldn'T be there :p

as for several usergroups you have to use something like this:
in_array($bbuserinfo['usergroupid'], array(2, 3, 4))

dethfire
02-08-2005, 04:28 AM
I tried this and it doesn't work, nothing renders