Changeset 207

Show
Ignore:
Timestamp:
07/04/06 17:12:06 (2 years ago)
Author:
lekeno
Message:

Added a function to determine if Ads should be displayed to avoid invalid clicks on ads by people involved with blogmemes
Removed caching of categories since it will be done by Smarty.
Removed fetching sample data (tags, users) from the database since it will be done by Smarty (caching)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/public_html/akarru.lib/common.php

    r162 r207  
    5454$bm_tags = new folksonomy($bm_db); 
    5555 
    56 $smarty->assign('community_sample', $bm_users->get_random_profile_links(9)); 
    57 $smarty->assign('tags', $bm_tags->fetch_top(21)); 
    5856$smarty->assign('bf_date_posted', 'publicado el %d/%m/%Y a las %R'); 
    5957$smarty->assign('logged_in', $bm_is_logged_in); 
     
    6765$smarty->assign('time', time()); 
    6866$smarty->assign('page', $bm_page); 
    69  
     67/* we don't need this anymore since Smarty will do the caching 
    7068if (isset($_APP['cats'])) { 
    7169  $cats = $_APP['cats']; 
     
    8280} 
    8381$smarty->assign('cats_array', $cats); 
     82*/ 
     83 
     84// This function is used to determine if ads should be displayed for a particular IP 
     85// You can add your fixed IP to avoid clicking on google ads in the blogmemes network 
     86// It would be a bummer to be ban for invalid clicks 
     87// The IPs below are the IP from my lab at the university and home IP 
     88function showGGAds() 
     89{ 
     90$noads = array("221.20.64.61", "130.34.194.50", "130.34.194.51", "130.34.194.52", "130.34.194.53", "130.34.194.54", "130.34.194.55", "130.34.194.56", "130.34.194.57", "130.34.194.58", "130.34.194.59", "130.34.194.60", "130.34.194.61", "130.34.194.62", "130.34.194.63", "130.34.194.64", "130.34.194.65", "130.34.194.66", "130.34.194.67", "130.34.194.68", "130.34.194.69", "130.34.194.70", "130.34.194.49", "130.34.194.48", "130.34.194.47", "130.34.194.46", "130.34.194.45"); 
     91$ip = $_SERVER['REMOTE_ADDR']; 
     92  return (! in_array($ip, $noads)); 
     93} 
     94} 
    8495 
    8596?>