 |
|
| View previous topic :: View next topic |
| Author |
Message |
River
Joined: 10 Feb 2007 Posts: 99
|
Posted: Mon Mar 12, 2007 10:57 pm Post subject: Ad color mod |
|
|
There's a mod written by Cyberalien for sebflipper MF that automatically change ad colors so it blend in and looks better at the forums.
| Quote: | Adsense per-template colors
This simple mod automatically modifies adsense colors depending on what template user is using so ads color would match current template color. It can also be quickly adjusted for yahoo ads. |
Well SEBflipper seems like a not so good MF script but there seem to be many cool mods done for it, many by this guy cyberalien.
Anyone here a former sebflipper customer that got access to their mod forums? If so maybe we could see if we can make a version of it for echophp and maybe other interesting mods.
This is the URL for their mod forum but I don't have access to it. I think I remember reading there are some people here from SEB though....: http://forums.sebflipper.com/viewtopic.php?t=1583 |
|
| Back to top |
|
 |
Luke Beale
Joined: 09 Feb 2007 Posts: 17
|
Posted: Tue Mar 13, 2007 2:16 am Post subject: |
|
|
This mod can change adsense colors for muiltiforum ads depending on current template.
How it works: you create file adsense.cfg in some template's directory, put colors in it and script will replace your default colors with custom colors if forum user uses that template.
Installation:
open includes/functions.php, find this: | Code: | $current_template_path = $template_path . $template_name;
@include($phpbb_root_path . $template_path . $template_name . '/' . $template_name . '.cfg');
if ( !defined('TEMPLATE_CONFIG') )
{
message_die(CRITICAL_ERROR, "Could not open $template_name template config file", '', __LINE__, __FILE__);
}
$img_lang = ( file_exists(@phpbb_realpath($phpbb_root_path . $current_template_path . '/images/lang_' . $board_config['default_lang'])) ) ? $board_config['default_lang'] : 'english';
while( list($key, $value) = @each($images) )
{
if ( !is_array($value) )
{
$images[$key] = str_replace('{LANG}', 'lang_' . $img_lang, $value);
}
}
|
or, if you are using eXtreme Styles mod multiforums edition then instead of code above open includes/template.php and find this: | Code: | while( list($key, $value) = @each($images) )
{
if ( !is_array($value) )
{
$images[$key] = str_replace('{LANG}', 'lang_' . $img_lang, $value);
}
}
| and add after it | Code: | $adsense_file = $phpbb_root_path . $template_path . $template_name . '/adsense.cfg';
if(@file_exists($adsense_file))
{
$adsense = array(
'google_color_border' => $row['td_color2'],
'google_color_bg' => $row['td_color2'],
'google_color_link' => $row['body_link'],
'google_color_url' => $row['body_hlink'],
'google_color_text' => $row['body_text'],
);
@include($adsense_file);
if(count($adsense))
{
global $multiforums_setting;
$items = array('advert_top', 'advert_bottom');
$search = array();
$replace = array();
for($i=0; $i<count($items); $i++)
{
if(strpos($multiforums_setting[$items[$i]], 'google_ad_client') > 0)
{
// do replacements
if(!count($search))
{
foreach($adsense as $var => $value)
{
if(strlen($value) == 6)
{
$search[] = '/' . $var . ' = \"([0-9a-fA-F]+)\"/';
$replace[] = $var . ' = "' . $value . '"';
}
}
}
$multiforums_setting[$items[$i]] = preg_replace($search, $replace, $multiforums_setting[$items[$i]]);
}
}
}
}
|
Here are few prebuilt adsense.cfg files for few styles: http://www.trushkin.biz/temp/adsense.zip
That pack includes adsense.cfg for following styles:
- AcidTech (and its color schemes)
- Aeolus
- Artemis
- Athena
- Aphrodite (and Aphrodite Green)
- Classic (and Classic 2.0)
- Christmas
- Counter-Strike
- Eos
- Getaway
- Helius (and HeliusGray)
- Hestia
- Iris
- Jet
- Morpheus
- subSilver
Note: in prebuilt adsense.cfg pack subSilver's adsense.cfg is built in such way so if user changes colors in admin control panel adsense colors will also change to merge with forum.
Sample adsense.cfg that you should put in templates/whatever/adsense.cfg: | Code: | <?php
$adsense = array(
'google_color_border' => '191919',
'google_color_bg' => '191919',
'google_color_link' => '2370B6',
'google_color_url' => 'F0E80A',
'google_color_text' => 'D0D0D0',
);
?> |
_________________
Free phpBB Forum Hosting! No Banners! No Adverts! |
|
| Back to top |
|
 |
River
Joined: 10 Feb 2007 Posts: 99
|
Posted: Tue Mar 13, 2007 11:06 pm Post subject: |
|
|
Nice, seems like a really good mod.  |
|
| Back to top |
|
 |
River
Joined: 10 Feb 2007 Posts: 99
|
Posted: Fri Mar 16, 2007 6:31 pm Post subject: |
|
|
Anyone tried this mod for echophpmf? Echo, if you're reading this, do you think it's compatible? I think the code might be for seb's script.
Anyway, I can not find the code below in my /includes/template.php
| Quote: | or, if you are using eXtreme Styles mod multiforums edition then instead of code above open includes/template.php and find this:Code:
while( list($key, $value) = @each($images) )
{
if ( !is_array($value) )
{
$images[$key] = str_replace('{LANG}', 'lang_' . $img_lang, $value);
}
}
and add after it |
|
|
| Back to top |
|
 |
River
Joined: 10 Feb 2007 Posts: 99
|
Posted: Sat Mar 24, 2007 7:55 pm Post subject: |
|
|
Tried to mess with this again but I could not get it to work.
I think this mod is made for sebflippers and might need some small adjustments to work with echophp mf.
Anyone got any ideas? Echo? |
|
| Back to top |
|
 |
echophp
Joined: 11 Feb 2007 Posts: 345
|
Posted: Mon May 07, 2007 7:08 am Post subject: |
|
|
Hi,
I did it for the version 2, you do not need to put adsense.cfg for each template, you will control it via your echoMF admin.
Thank you. |
|
| Back to top |
|
 |
River
Joined: 10 Feb 2007 Posts: 99
|
Posted: Mon May 07, 2007 8:57 am Post subject: |
|
|
wow, that's great  |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|