Author |
Message |
jjmusicpro
Involved
![Involved Involved](modules/Forums/images/ranks/4stars.gif)
![](modules/Forums/images/avatars/computerguy.gif)
Joined: Jul 12, 2005
Posts: 283
|
Posted:
Thu Dec 28, 2006 6:19 pm |
|
I was looking all over, but i was unable to find out hot to add google adsense to the forums last 5 block on the main page.
I can get it to run, but it wont display anything.
I tried adding all the adsense code, with the $content tag in front of it but it didnt work, ive read the forums here and nothing helps.
Code:<?php
########################################################################
# PHP-Nuke Block: iCGstation Center Forum Block v.3 #
# Made for PHP-Nuke 6.5 and up #
# #
# Made by mikem http://www.nukemods.com #
# This block is made only to match the iCGstation Theme pack #
########################################################################
# This program is free software. You can redistribute it and/or modify #
# it under the terms of the GNU General Public License as published by #
# the Free Software Foundation; either version 2 of the License. #
# If you modify this, let me know for fun. =) #
########################################################################
if (eregi("block-iCGstation-Forum.php",$PHP_SELF)) {
Header("Location: index.php");
die();
}
global $prefix, $sitename, $admin, $db;
$HideViewReadOnly = 1;
$Last_New_Topics = 8;
$show = " <tr>
<td height=\"15\" colspan=\"6\" align=\"center\" background=\"themes/iCGstation/forums/images/tb2_m.gif\"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>";
$Count_Topics = 0;
$Topic_Buffer = "";
$result = $db->sql_query( "SELECT t.topic_id, f.forum_name, f.forum_id, t.topic_last_post_id, t.topic_title, t.topic_poster, t.topic_views, t.topic_replies, t.topic_moved_id FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f where t.forum_id=f.forum_id ORDER BY topic_last_post_id DESC" );
while( list( $topic_id, $forum_name, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = $db->sql_fetchrow( $result ) )
{
$skip_display = 0;
if( $HideViewReadOnly == 1 )
{
$result1 = $db->sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'" );
list( $auth_view, $auth_read ) = $db->sql_fetchrow( $result1 );
if( ( $auth_view != 0 ) or ( $auth_read != 0 ) ) { $skip_display = 1; }
}
if( $topic_moved_id != 0 )
{
// Shadow Topic !!
$skip_display = 1;
}
if( $skip_display == 0 )
{
$Count_Topics += 1;
$result2 = $db->sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$topic_poster'");
list($username, $user_id)=$db->sql_fetchrow($result2);
$avtor=$username;
$sifra=$user_id;
$result3 = $db->sql_query("SELECT poster_id, FROM_UNIXTIME(post_time,'%m/%d/%Y at %h:%i%p') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'");
list($poster_id, $post_time)=$db->sql_fetchrow($result3);
$result4 = $db->sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'");
list($username, $user_id)=$db->sql_fetchrow($result4);
$viewlast .=" <tr>
<td height=\"34\" nowrap class=\"row1\"><img src=\"themes/iCGstation/forums/images/folder_new.gif\" border=\"0\" /></td>
<td width=\"100%\" class=\"row1\"> <b>$forum_name</b><br> <a href=\"forums.html?file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\">$topic_title</a></td>
<td align=\"center\" class=\"row2\">$topic_replies</td>
<td align=\"center\" class=\"row1\"><a href=\"profile-.html$sifra\">$avtor</a></td>
<td align=\"center\" class=\"row2\">$topic_views</td>
<td align=\"center\" nowrap class=\"row1\"><font size=\"-2\"><i> $post_time </i></font><br>
<a href=\"profile-.html$user_id\">$username</a> <a href=\"forums.html?file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\"><img src=\"themes/iCGstation/forums/images/icon_minipost_new.gif\" border=\"0\" alt=\"Last Post\"></a></td>
</tr>";
}
if( $Last_New_Topics == $Count_Topics ) { break 1; }
}
$content .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">
<tr>
<td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td bgcolor=\"#000000\"><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\">
<tr>
<th height=\"25\" colspan=\"2\" align=\"center\" nowrap><font color=\"#28313C\"><strong>Forum/Topic</strong></font></th>
<th height=\"25\" width=\"50\" align=\"center\" nowrap><font color=\"#28313C\"><strong> Replies </strong></font></th>
<th height=\"25\" width=\"100\" align=\"center\" nowrap><font color=\"#28313C\"><strong> Author </strong></font></th>
<th height=\"25\" width=\"50\" align=\"center\" nowrap><font color=\"#28313C\"><strong> Views </strong></font></th>
<th height=\"25\" align=\"center\" nowrap><font color=\"#28313C\"><strong> Last Post </strong></font></th>
</tr>";
$content .= "$viewlast";
$content .= "$show";
?>
|
|
_________________ - JJMUSICPRO
Myspacetoolbelt.com || RankBook.com || GamerBomb.com || MyspaceJar.com |
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hitwalker
Sells PC To Pay For Divorce
![](modules/Forums/images/avatars/gallery/blank.gif)
Joined:
Posts: 5661
|
Posted:
Fri Dec 29, 2006 1:58 am |
|
tested and works to.....
Code:
<?php
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
global $prefix, $sitename, $admin, $db;
$HideViewReadOnly = 1;
$Last_New_Topics = 8;
$show = " <tr>
<td height=\"15\" colspan=\"6\" align=\"center\" background=\"\"> </td>
</tr></table><scr~ipt type=\"text/javascr~ipt\"><!--
google_ad_client = 'pub-';
google_ad_width = '100%';
google_ad_height = ;
google_ad_format = ' ';
google_ad_type = 'text';
google_ad_channel ='';
google_color_border = '000000';
google_color_bg = 'ffffff';
google_color_link = '0000ff';
google_color_url = '00ff00';
google_color_text = '000000';
//--></scr~ipt>
<scr~ipt type=\"text/javascr~ipt\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"></scr~ipt></td></tr></table></td></tr></table>";
$Count_Topics = 0;
$Topic_Buffer = "";
$result = $db->sql_query( "SELECT t.topic_id, f.forum_name, f.forum_id, t.topic_last_post_id, t.topic_title, t.topic_poster, t.topic_views, t.topic_replies, t.topic_moved_id FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f where t.forum_id=f.forum_id ORDER BY topic_last_post_id DESC" );
while( list( $topic_id, $forum_name, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = $db->sql_fetchrow( $result ) )
{
$skip_display = 0;
if( $HideViewReadOnly == 1 )
{
$result1 = $db->sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'" );
list( $auth_view, $auth_read ) = $db->sql_fetchrow( $result1 );
if( ( $auth_view != 0 ) or ( $auth_read != 0 ) ) { $skip_display = 1; }
}
if( $topic_moved_id != 0 )
{
// Shadow Topic !!
$skip_display = 1;
}
if( $skip_display == 0 )
{
$Count_Topics += 1;
$result2 = $db->sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$topic_poster'");
list($username, $user_id)=$db->sql_fetchrow($result2);
$avtor=$username;
$sifra=$user_id;
$result3 = $db->sql_query("SELECT poster_id, FROM_UNIXTIME(post_time,'%m/%d/%Y at %h:%i%p') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'");
list($poster_id, $post_time)=$db->sql_fetchrow($result3);
$result4 = $db->sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'");
list($username, $user_id)=$db->sql_fetchrow($result4);
$viewlast .=" <tr>
<td height=\"34\" nowrap class=\"row1\"><img src=\"\" border=\"0\" /></td>
<td width=\"100%\" class=\"row1\"> <b>$forum_name</b><br> <a href=\"forums.html?file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\">$topic_title</a></td>
<td align=\"center\" class=\"row2\">$topic_replies</td>
<td align=\"center\" class=\"row1\"><a href=\"profile-.html$sifra\">$avtor</a></td>
<td align=\"center\" class=\"row2\">$topic_views</td>
<td align=\"center\" nowrap class=\"row1\"><font size=\"-2\"><i> $post_time </i></font><br>
<a href=\"profile-.html$user_id\">$username</a> <a href=\"forums.html?file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\"><img src=\"\" border=\"0\" alt=\"Last Post\"></a></td>
</tr>";
}
if( $Last_New_Topics == $Count_Topics ) { break 1; }
}
$content .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">
<tr><td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td bgcolor=\"#000000\"><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\">
<tr>
<th height=\"25\" colspan=\"2\" align=\"center\" nowrap><font color=\"#28313C\"><strong>Forum/Topic</strong></font></th>
<th height=\"25\" width=\"50\" align=\"center\" nowrap><font color=\"#28313C\"><strong> Replies </strong></font></th>
<th height=\"25\" width=\"100\" align=\"center\" nowrap><font color=\"#28313C\"><strong> Author </strong></font></th>
<th height=\"25\" width=\"50\" align=\"center\" nowrap><font color=\"#28313C\"><strong> Views </strong></font></th>
<th height=\"25\" align=\"center\" nowrap><font color=\"#28313C\"><strong> Last Post </strong></font></th>
</tr>";
$content .= "$viewlast";
$content .= "$show";
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jjmusicpro
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 8:30 am |
|
Hitwalker....
Ok, I tried your code, however it dosent display anything....
It just acts like there is no data to display. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hitwalker
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 8:42 am |
|
well i did say i checked it....and i did..
dont forget to enter all the info in the adsense areas..and that you do that the correct way...
other possibility is that some java whatever breaks the code somehow,or you use to many adsense on your site....
a few options .... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jjmusicpro
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 8:44 am |
|
I am running php 5 if that matters...
I dont have any adsenses on my site other then this one.
I have no other "adsense" like tools on my site.
But it still dosent work....
Code:
<?php
if ( !defined('BLOCK_FILE') ) {
Header("Location: ../index.php");
die();
}
global $prefix, $sitename, $admin, $db;
$HideViewReadOnly = 1;
$Last_New_Topics = 8;
$show = " <tr>
<td height=\"15\" colspan=\"6\" align=\"center\" background=\"\"> </td>
</tr></table><sc~ript type=\"text/javascr~ipt\"><!--
google_ad_client = 'pub-xxxxxxxxxxxxxxxx';
google_ad_width = '468';
google_ad_height = '60';
google_ad_format = '468x60_as ';
google_ad_type = 'text';
google_ad_channel ='';
google_color_border = '000000';
google_color_bg = 'ffffff';
google_color_link = '0000ff';
google_color_url = '00ff00';
google_color_text = '000000';
//--></scri~pt>
<scr~ipt type=\"text/javas~cript\" src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\"></scr~ipt></td></tr></table></td></tr></table>";
$Count_Topics = 0;
$Topic_Buffer = "";
$result = $db->sql_query( "SELECT t.topic_id, f.forum_name, f.forum_id, t.topic_last_post_id, t.topic_title, t.topic_poster, t.topic_views, t.topic_replies, t.topic_moved_id FROM ".$prefix."_bbtopics t, ".$prefix."_bbforums f where t.forum_id=f.forum_id ORDER BY topic_last_post_id DESC" );
while( list( $topic_id, $forum_name, $forum_id, $topic_last_post_id, $topic_title, $topic_poster, $topic_views, $topic_replies, $topic_moved_id ) = $db->sql_fetchrow( $result ) )
{
$skip_display = 0;
if( $HideViewReadOnly == 1 )
{
$result1 = $db->sql_query( "SELECT auth_view, auth_read FROM ".$prefix."_bbforums where forum_id = '$forum_id'" );
list( $auth_view, $auth_read ) = $db->sql_fetchrow( $result1 );
if( ( $auth_view != 0 ) or ( $auth_read != 0 ) ) { $skip_display = 1; }
}
if( $topic_moved_id != 0 )
{
// Shadow Topic !!
$skip_display = 1;
}
if( $skip_display == 0 )
{
$Count_Topics += 1;
$result2 = $db->sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$topic_poster'");
list($username, $user_id)=$db->sql_fetchrow($result2);
$avtor=$username;
$sifra=$user_id;
$result3 = $db->sql_query("SELECT poster_id, FROM_UNIXTIME(post_time,'%m/%d/%Y at %h:%i%p') as post_time FROM ".$prefix."_bbposts where post_id='$topic_last_post_id'");
list($poster_id, $post_time)=$db->sql_fetchrow($result3);
$result4 = $db->sql_query("SELECT username, user_id FROM ".$prefix."_users where user_id='$poster_id'");
list($username, $user_id)=$db->sql_fetchrow($result4);
$viewlast .=" <tr>
<td height=\"34\" nowrap class=\"row1\"><img src=\"\" border=\"0\" /></td>
<td width=\"100%\" class=\"row1\"> <b>$forum_name</b><br> <a href=\"forums.html?file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\">$topic_title</a></td>
<td align=\"center\" class=\"row2\">$topic_replies</td>
<td align=\"center\" class=\"row1\"><a href=\"profile-.html$sifra\">$avtor</a></td>
<td align=\"center\" class=\"row2\">$topic_views</td>
<td align=\"center\" nowrap class=\"row1\"><font size=\"-2\"><i> $post_time </i></font><br>
<a href=\"profile-.html$user_id\">$username</a> <a href=\"forums.html?file=viewtopic&p=$topic_last_post_id#$topic_last_post_id\"><img src=\"\" border=\"0\" alt=\"Last Post\"></a></td>
</tr>";
}
if( $Last_New_Topics == $Count_Topics ) { break 1; }
}
$content .= "<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"1\">
<tr><td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
<tr>
<td bgcolor=\"#000000\"><table width=\"100%\" border=\"0\" cellpadding=\"1\" cellspacing=\"1\">
<tr>
<th height=\"25\" colspan=\"2\" align=\"center\" nowrap><font color=\"#28313C\"><strong>Forum/Topic</strong></font></th>
<th height=\"25\" width=\"50\" align=\"center\" nowrap><font color=\"#28313C\"><strong> Replies </strong></font></th>
<th height=\"25\" width=\"100\" align=\"center\" nowrap><font color=\"#28313C\"><strong> Author </strong></font></th>
<th height=\"25\" width=\"50\" align=\"center\" nowrap><font color=\"#28313C\"><strong> Views </strong></font></th>
<th height=\"25\" align=\"center\" nowrap><font color=\"#28313C\"><strong> Last Post </strong></font></th>
</tr>";
$content .= "$viewlast";
$content .= "$show";
?>
|
![Image Image](http://www.imagesticky.com/userimages/4796AFDAFDE.JPG) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hitwalker
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 8:51 am |
|
huh...
and where does that page cannot be found comes from ? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jjmusicpro
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 9:00 am |
|
Thats whats shows up when i put your code in, here is what it looks like with my code without adsense:
![Image Image](http://www.imagesticky.com/userimages/9468asd.JPG) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hitwalker
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 9:29 am |
|
but thats impossible....
when adsense doesnt work ,..it doesnt show a page cannot be found... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jjmusicpro
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 9:33 am |
|
I copy pasted your code above you put, and all i did was put in my pub id, and change these below:
google_ad_client = 'pub-xxxxxxxxxxxxxxxx';
google_ad_width = '468';
google_ad_height = '60';
google_ad_format = '468x60_as '; |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hitwalker
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 9:56 am |
|
well i have no idea whats wrong or from your side...
speaks for itself that i created this for you,tested it with google and when done i gave it to you....
theres nothing more i can say...
you DID fixed the BROKEN java crap ? |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jjmusicpro
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 9:59 am |
|
What broken java crap? lol |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hitwalker
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 10:16 am |
|
Well we cannot post full java scripts here remember?
So the script > tags are posted broken like scr~ipt>
check that...lol |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jjmusicpro
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 10:21 am |
|
yes, i fixed those.....when i installed it ![Smile](modules/Forums/images/smiles/icon_smile.gif) |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hitwalker
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 10:24 am |
|
well then im lost to...
i cannot see the situation so helping you further is hard... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jjmusicpro
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 10:28 am |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jjmusicpro
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 12:00 pm |
|
I even tried to make a center block all alone with google adsense, and it still dosent work.....
Code:
<?php
if (eregi("block-Sample_Block.php",$_SERVER['PHP_SELF'])) {
Header("Location: index.php");
die();
}
$content = "<s cript language='Javas cript'>
<!--
google_ad_client = 'pub-xxxxxxxxxxxxxx';
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = '468x60_as';
google_ad_type = 'text_image';
google_color_border = 'E3E6EA';
google_color_bg = '000000';
google_color_link = '0000CC';
google_color_text = 'FFFFCC';
google_color_url = '008000';
</scr ipt>
<center><s cript language='Javas cript'
src='http://pagead2.googlesyndication.com/pagead/show_ads.js'>
</s cript></center>";
?>
|
|
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hitwalker
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 3:48 pm |
|
well that proves a bit what i was telling / thinking huh... |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
jjmusicpro
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 4:08 pm |
|
I did a download online and found a preset google adsense block, i tried it and it worked, as a stand alone block, however, i still cant get them into above or below in the forums last 5 posts. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
hitwalker
![](modules/Forums/images/avatars/gallery/blank.gif)
|
Posted:
Fri Dec 29, 2006 4:12 pm |
|
well i dont know what the reason is....
my testsite is ravennuke latest..,so why its different for you i dont know. |
|
|
|
![](themes/RavenIce/forums/images/spacer.gif) |
|