How to add adsense code in vbulletin archive tutorial

Discussion in 'HTML & Website Design' started by genetrix, Oct 24, 2008.

  1. #1
    Hi, here is a tutorial for all dp members interested .
    To add adsense code to vbulletin archive you should open file index.php located in /archive directory and find this lines of code, in all vbulletin versions these code segment is the same :

    
    $output .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
    <html dir=\"$stylevar[textdirection]\" lang=\"$stylevar[languagecode]\">
    <head>
        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=$stylevar[charset]\" />
        $metatags
        <title>$title</title>
        <link rel=\"stylesheet\" type=\"text/css\" href=\"" . $vbulletin->options['bburl'] . "/archive/archive.css\" />
    </head>
    <body>
    <div class=\"pagebody\">;
    // ********************************************************************************************
    // display board
    
    if ($do == 'index')
    {
        $output .= print_archive_navigation(array());
    
        $output .= "<p class=\"largefont\">$vbphrase[view_full_version]: <a href=\"" . $vbulletin->options['bburl'] . '/' . $vbulletin->options['forumhome'] . '.php">' . $vbulletin->options['bbtitle'] . "</a></p>\n";
    
        $output .= "<div id=\"content\">\n";
        $output .= print_archive_forum_list();
        $output .= "</div>\n";
    
    }
    
    if ($Coventry = fetch_coventry('string'))
    {
        $globalignore = "AND " . iif($do == 'forum', 'thread.post', 'post.') . "userid NOT IN ($Coventry) ";
    }
    else
    {
        $globalignore = '';
    }
    
    // ********************************************************************************************
    // display forum
    PHP:
    add your adsense code as shown below, adsense code marked bold :

    
    $output .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
    <html dir=\"$stylevar[textdirection]\" lang=\"$stylevar[languagecode]\">
    <head>
        <meta http-equiv=\"Content-Type\" content=\"text/html; charset=$stylevar[charset]\" />
        $metatags
        <title>$title</title>
        <link rel=\"stylesheet\" type=\"text/css\" href=\"" . $vbulletin->options['bburl'] . "/archive/archive.css\" />
    </head>
    <body>
    <div class=\"pagebody\">
    <script type=\"text/javascript\"><!--
    google_ad_client = \"pub-8328165345698274\";
    
    google_ad_slot = \"6659140808\";
    google_ad_width = 728;
    google_ad_height = 90;
    //-->
    </script>
    <script type=\"text/javascript\"
    src=\"http://pagead2.googlesyndication.com/pagead/show_ads.js\">
    </script>
    
    ";
    
    ($hook = vBulletinHook::fetch_hook('archive_postheader')) ? eval($hook) : false;
    
    // ********************************************************************************************
    // display board
    
    
    PHP:


    Good luck .
     
    genetrix, Oct 24, 2008 IP