Mod Name: Google Adsense Theme Colors v1.0

Last modified: 26 November 2007 @ 11:30 (GMT)

Description: This modification will display the google adsense using the colors from the current theme.

Compatibility: XMB v1.9.8 Final SP2

Tested On: XMB 1.9.8 Final SP2

Code Developed By: Adam Clarke (http://www.scriptdesign.co.uk & http://www.xmbgarage.com)

Updated for 1.9.8 by: WormHole @ XMB Garage

License Note: This mod is released under the GPL License.

Note: Backup all affected files, templates & database's.

Affected Files: header.php

Affected Templates: unknown


STEP 1: Edit header.php

Find Code:
---------------------------------------------------------------------------------------------------

// Make theme-vars semi-global
$query = $db->query("SELECT * FROM ".X_PREFIX."themes WHERE themeid='$theme'");
foreach($db->fetch_array($query) as $key=>$val) {
    if ($key != "name") {
        $$key = $val;
    } else {
        $val = stripslashes($val);
    }
    $THEME[$key] = $val;
}
$imgdir = './'.$imgdir;
$db->free_result($query);

---------------------------------------------------------------------------------------------------

Add Below:
---------------------------------------------------------------------------------------------------

// Convert colors for Google Adsense
$google_border = str_replace("#", "", $THEME['bordercolor']);
$google_bg = str_replace("#", "", $THEME['altbg1']);
$google_link = str_replace("#", "", $THEME['headertext']);
$google_url = str_replace("#", "", $THEME['link']);
$google_text = str_replace("#", "", $THEME['text']);

---------------------------------------------------------------------------------------------------


Step 3: Go to Admin Panel --> Templates --> (Template which contains google adsense code)

Find Code: (?????? will not be in template, this is used as the color is unknown)
---------------------------------------------------------------------------------------------------
google_color_border = "??????";
google_color_bg = "??????";
google_color_link = "??????";
google_color_url = "??????";
google_color_text = "??????";
---------------------------------------------------------------------------------------------------

Replace With:
---------------------------------------------------------------------------------------------------
google_color_border = "$google_border";
google_color_bg = "$google_bg";
google_color_link = "$google_link";
google_color_url = "$google_url";
google_color_text = "$google_text";
---------------------------------------------------------------------------------------------------

END OF MOD !