SEO-Board: Free, Fast and Search Engine Optimization Friendly Forum Script
»User: »Password:   Remember Me? 
Posted:  24 Sep 2005 10:15
I have added a adsense "post" , its great to increase CTR: 

example: http://www.teenagewriters.com/article480.htm
Posted:  24 Sep 2005 10:20
That's a clever one and I guess it's not against the TOS. I'll experiment with it. Thanks for sharing it.
Posted:  24 Sep 2005 17:24
How do I implement it like you did?
Posted:  24 Sep 2005 17:46
I use this code in vtopic.php. Insert it just below the loop that shows posts (it ends with $enable_delete = 1; } 
Code:

  $posted_by = '<form action="#" method=post class=formstyle style="max-width:20px;"><input type=submit name=submit value="AdSense" class=memberbutton></form>';
  $author_num_posts = $lang['posts'].': &nbsp; 120';
  $author_reg_date = $lang['joined'].': '.format_shortdate(time());
  $author_online = '<br>'.$lang['user_online'];
  $user_type = $lang['member'];
  $posted_on = $lang['posted'].': &nbsp;'.format_datetime(time(), $user_timezone);
  $user_ip = null; 
  $post_actions = null;
  $edited_by = null;
  $post_message = $adsense2;
  array_push($posts_html, eval($template_post));

and somewhere at the top initialize the $adsense2 variable with your AdSense code
Posted:  25 Sep 2005 19:22
Thank you very much.
Posted:  14 Nov 2005 20:45
So, where do you place the "$adsense2" variable specifically, and where would you place Yahoo! PN ads if you wanted to use them? I see your'e using Chitika ads on your site.
Posted:  14 Nov 2005 21:27
Quote:
So, where do you place the "$adsense2" variable specifically
Somewhere at the top of vtopic.php
Posted:  15 Nov 2005 03:02
I added it to the very top of the file, right after the "<php ", and it doesn't work. I have no idea where to place it.
Posted:  15 Nov 2005 04:34
Could you post your vtopic.php file, Hristo?
Posted:  15 Nov 2005 10:10
I've made too many mods in it.
What do you mean "it does not work"? Post an URL to your site and snippets of your vtopic.php where you've changed the code.
Posted:  15 Nov 2005 19:09
I placed "$adsense2" on the line after "<?php ", and nothing happened. I changed what the post says to my Yahoo Publisher code, and it said had an error on line 3.
Posted:  15 Nov 2005 19:11
Post the snippet of code around $adsense2. I guess you have a syntax error.
Posted:  27 Nov 2005 06:40
if ($p > 1)
  $enable_delete = 1;
  $posted_by = '<form action="#" method=post class=formstyle style="max-width:20px;"><input type=submit name=submit value="Sponsored Advertisements" class=memberbutton></form>';
  $author_num_posts = $lang['posts'].': &nbsp; 120';
  $author_reg_date = $lang['joined'].': '.format_shortdate(time());
  $author_online = '<br>'.$lang['user_online'];
  $user_type = $lang['member'];
  $posted_on = $lang['posted'].': &nbsp;'.format_datetime(time(), $user_timezone);
  $user_ip = null;
  $post_actions = null;
  $edited_by = null;
  $post_message = $adsense;
  array_push($posts_html, eval($template_post));

I have this but now i need to do

$adsense =

You got the correct syntax anyone ?
Posted:  27 Nov 2005 10:27
1 The $adsense variable must be above that snippet of code you've pasted.
2. Syntax is:
Code:

$adsense = <<<ADS
<script type="text/javascript"><!--
... code provided by google
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
ADS;
Posted:  27 Nov 2005 11:13
thanks let me try it
Posted:  27 Nov 2005 11:38
I get an error

Notice: Undefined variable: template_post in /home/httpd/vhosts/my/httpdocs/vtopic.php on line 50

Warning: array_push(): First argument should be an array in /home/httpd/vhosts/my/httpdocs/vtopic.php on line 50

using this

$adsense = <<<ADS
<script type="text/javascript"><!--
google_ad_client = "pub-*************";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_type = "text_image";
google_ad_channel ="";
google_color_border = "3366CC";
google_color_bg = "3366CC";
google_color_link = "FFFFFF";
google_color_url = "FFFFFF";
google_color_text = "FFFFFF";
//--></script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
ADS;

if ($p > 1)
  $enable_delete = 1;
  $posted_by = '<form action="#" method=post class=formstyle style="max-width:20px;"><input type=submit name=submit value="Sponsored Advertisements" class=memberbutton></form>';
  $author_num_posts = $lang['posts'].': &nbsp; 120';
  $author_reg_date = $lang['joined'].': '.format_shortdate(time());
  $author_online = '<br>'.$lang['user_online'];
  $user_type = $lang['member'];
  $posted_on = $lang['posted'].': &nbsp;'.format_datetime(time(), $user_timezone);
  $user_ip = null;
  $post_actions = null;
  $edited_by = null;
  $post_message = $adsense;
  array_push($posts_html, eval($template_post));
Posted:  27 Nov 2005 11:40
then i comment out the array_push line it gives no errors but it doesnt do the ads either ?

Any ideas?
Posted:  27 Nov 2005 15:19
You haven't placed the snippet of code at the right place. It is placed after these lines
Code:

    $cell_iterator = 1 - $cell_iterator;
    $enable_delete = 1;
  }


The code will look like:
Code:

    $cell_iterator = 1 - $cell_iterator;
    $enable_delete = 1;
  }

  $posted_by = '<form action="#" method=post class=formstyle style="max-width:20px;"><input type=submit name=submit value="AdSense" class=memberbutton></form>';
  $author_num_posts = $lang['posts'].': &nbsp; 120';
  $author_reg_date = $lang['joined'].': '.format_shortdate(time());
  $author_online = '<br>'.$lang['user_online'];
  $user_type = $lang['member'];
  $posted_on = $lang['posted'].': &nbsp;'.format_datetime(time(), $user_timezone);
  $user_ip = null; 
  $post_actions = null;
  $edited_by = null;
  $post_message = $adsense2;
  array_push($posts_html, eval($template_post));


The $adsense initialization is kept at the top of vtopic.php.
Posted:  27 Nov 2005 20:23
works now i had it in the wrong place it always posts on the last one, anyway i can have this on the second post ? everytime
Posted:  27 Nov 2005 23:34
Sure, you can modify the script further to do that but.. I think inserting an ad post as the 2nd post in every topic is too annoying. Plus, users will condition to filter out the 2nd post in a while.
Posted:  20 Apr 2006 17:06
I dont get how this works, could you give me the full code for vtopic that is needed?
Posted:  20 Apr 2006 18:12
Quote:
dont get how this works, could you give me the full code for vtopic that is needed?
I am sorry. I deleted the code, because I don't use it at the moment. Just follow the exact instructions.
Posted:  20 Apr 2006 19:24
Did that already, not getting it anyway
Could someone give me a original file with this added in it?
Posted:  22 Jan 2007 14:11
yes, anyone ?

this sample is useless i guess for newbies