Website Babble Webmaster Forums  


Go Back   Website Babble Webmaster Forums > Creating a Website > Forums, Communities & Social Networking Sites

Your WB Notifications

Reply
 
LinkBack Thread Tools Display Modes
  #16 (permalink)  
Old 09-11-2009, 11:23 AM
hypetype's Avatar
Master Babbler
 
Join Date: Aug 2009
Location: Jamaica
Posts: 289
hypetype has no reputation at Website Babble yet.
Default

thanks thanks thanks it works. thanks man

the part that i went wrong was i didnt edit it before i uploaded it. thanks again
Reply With Quote
  #17 (permalink)  
Old 09-11-2009, 11:39 AM
hypetype's Avatar
Master Babbler
 
Join Date: Aug 2009
Location: Jamaica
Posts: 289
hypetype has no reputation at Website Babble yet.
Default

ok so once i have placed my publisher number thats it and i am good to go
PHP Code:
<?php
/**
* Konu Þeklinde Google Reklamlarý - Adsense Ads. on Forumdisplay
* Copyright 2008 -  LowBattery - www.lowbattery.info
*/

if(!defined("IN_MYBB"))
{
    die(
"Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
}

$plugins->add_hook("forumdisplay_start", "gadsp_index_start");

function
gadsp_info()
{    
    return array(
        
"name" => "Adsense Ads. on Forumdisplay",
        
"description" => "Show your adsense ads. on forumdisplay.",
        
"website" => "http://www.mybbturkiye.com",
        
"author" => "LowBattery",
        
"authorsite" => "http://www.lowbattery.info",
        
"version" => "1.0",
        
"compatibility" => "14*",
    );
}

function
gadsp_install()
{
    global
$settings, $mybb, $db;
    
if(
$db->field_exists("gadsenses", "users"))
    {
    
$db->write_query("ALTER TABLE ".TABLE_PREFIX."users DROP gadsenses");
    }
    
    
$settings_group = array(
        
'gid'          => 'NULL',
        
'name'         => 'gadsa',
        
'title'        => 'Jamaican Pitbulls Forum Ads',
        
'description'  => 'Adsense Ads. on Forumdisplay Settings.',
        
'disporder'    => '2',
        
'isdefault'    => 'no'
    
);
    
$db->insert_query('settinggroups', $settings_group);
    
$gid = $db->insert_id();
    
    
$setting = array(
        
'sid'          => 'NULL',
        
'name'         => 'pub',
        
'title'        => '2660057795490422',
        
'description'  => '2660057795490422',
        
'optionscode'  => 'textarea',
        
'value'        => '2660057795490422',
        
'disporder'    => '1',
        
'gid'          => intval( $gid )
    );
    
$db->insert_query( 'settings', $setting );        
        
    
$db->write_query("ALTER TABLE ".TABLE_PREFIX."users ADD gadsenses int NOT NULL default 0");

    
rebuild_settings();
    
    
$insertarray = array(
        
"title" => "gadsense",
        
"template" => "<td class=\"trow1\" align=\"center\" width=\"2%\"><img src=\"images/dot_hotfolder.gif\" alt=\"Contains posts by you. No new posts.Hot posts.\" title=\"Contains posts by you. No new posts.Hot posts.\"></td>
    <td class=\"trow2\" align=\"center\" width=\"2%\"><img src=\"images/icons/information.gif\" alt=\"Google Ads.\"></td>
    <td class=\"trow1\">
        <center>
<script type=\"text/javascript\"><!--
google_ad_client = \"pub-{\$mybb->settings[\'pub\']}\";
google_ad_width = 468;
google_ad_height = 60;
google_ad_format = \"468x60_as\";
google_ad_type = \"text_image\";
google_ad_channel = \"jamaican pitbulls\";
google_color_border = \"000000\";
google_color_bg = \"ffffff\";
google_color_link = \"0000ff\";
google_color_text = \"000000\";
google_color_url = \"000033\";
//--></script>
<script type=\"text/javascript\"
  src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
</script></center>
    </td>
    <td class=\"trow2\" align=\"center\">-</a></td>
    <td class=\"trow1\" align=\"center\">-</td>
    <td class=\"trow2\" align=\"center\"><img src=\"images/star.gif\"><img src=\"images/star.gif\"><img src=\"images/star.gif\"><img src=\"images/star.gif\"><img src=\"images/star.gif\"></td>
    <!-- start: forumdisplay_thread_rating -->
<td class=\"trow2\" align=\"center\">Google Bot</td>
        "
,
        
"sid" => -1,
        
"dateline" => TIME_NOW
    
);
    
    
$db->insert_query("templates", $insertarray);
}

function
gadsp_is_installed()
{
    global
$db;
    
    if(
$db->field_exists("gadsenses", "users"))
    {
        return
true;
    }
    
    return
false;
}

function
gadsp_activate()
{
    global
$db;
    
    include
MYBB_ROOT."/inc/adminfunctions_templates.php";
    
    
find_replace_templatesets("forumdisplay_threadlist", "#".preg_quote("{\$announcementlist}")."#i", "{\$announcementlist}\r\n{\$gadsense}");
}

function
gadsp_deactivate()
{
    global
$db;
    
    include
MYBB_ROOT."/inc/adminfunctions_templates.php";
    
    
find_replace_templatesets("forumdisplay_threadlist", "#".preg_quote("\r\n{\$gadsense}")."#i", "", 0);
}

function
gadsp_uninstall()
{
    global
$db;
    
    if(
$db->field_exists("gadsenses", "users"))
    {
        
$db->write_query("ALTER TABLE ".TABLE_PREFIX."users DROP gadsenses");
    }
    
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='gadsa'");
    
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='pub'");
    
    
rebuild_settings();
    
    
$db->delete_query("templates", "title = 'gadsense'");
}

function
gadsp_index_start()
{
    global
$db, $mybb, $templates, $gadsense;
    
    eval(
"\$gadsense = \"".$templates->get("gadsense")."\";");
}
?>
wat about this section of the code?
PHP Code:
google_ad_client = "pub-{\$mybb->settings[\'pub\']}\";
Reply With Quote
  #18 (permalink)  
Old 09-11-2009, 12:27 PM
Master Babbler
 
Join Date: Sep 2009
Posts: 145
Coder is a reputable WB member and has over 100 reputation pointsCoder is a reputable WB member and has over 100 reputation points
Default

Quote:
Originally Posted by hypetype View Post
wat about this section of the code?
PHP Code:
google_ad_client = "pub-{\$mybb->settings[\'pub\']}\";
When you enter your publisher ID in the admin control panel, this is where that variable is placed in the snippet before it is stored in the database. If you like, you can simply enter your publisher id here like so:

PHP Code:
google_ad_client = "pub-123456\";
Note: There should be a backslash before each " but for some reason the first one doesn't show in the PHP blocks.

Hope this helps
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -6. The time now is 09:46 PM.


 Subscribe to RSS

WB Sponsors

flash chat

Home Jobs Online

Search Engine Marketing

Paid Surveys

Web Design Newcastle

Bookmarking Demon 5



 Subscribe to the Website Babble Feeds

2 Create a Website Homepage | 2 Create a Website Blog


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0