Board index

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
  Print view

Ad color mod
Author Message
PostPosted: Mon Mar 12, 2007 10:57 pm 

Joined: Sat Feb 10, 2007 9:51 pm
Posts: 124
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






Top
 Profile  
 

PostPosted: Tue Mar 13, 2007 2:16 am 

Joined: Fri Feb 09, 2007 1:47 am
Posts: 17
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! :)






Top
 Profile  
 

PostPosted: Tue Mar 13, 2007 11:06 pm 

Joined: Sat Feb 10, 2007 9:51 pm
Posts: 124
Nice, seems like a really good mod. 8)






Top
 Profile  
 

PostPosted: Fri Mar 16, 2007 6:31 pm 

Joined: Sat Feb 10, 2007 9:51 pm
Posts: 124
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






Top
 Profile  
 

PostPosted: Sat Mar 24, 2007 7:55 pm 

Joined: Sat Feb 10, 2007 9:51 pm
Posts: 124
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?






Top
 Profile  
 

PostPosted: Mon May 07, 2007 7:08 am 

Joined: Sun Feb 11, 2007 9:07 am
Posts: 597
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.






Top
 Profile  
 

PostPosted: Mon May 07, 2007 8:57 am 

Joined: Sat Feb 10, 2007 9:51 pm
Posts: 124
wow, that's great :)






Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


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 post attachments in this forum

Search for:
Jump to:  
cron
Style by phpBB3 styles, hemoroidy dieta hemoroidy leczenie przyczyny
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO