Make Sharewatch your Homepage

$value"; break; case "==": $inclusive[] = "bannerID = $value"; break; } } } $where_exclusive = !empty($exclusive) ? implode(" AND ", $exclusive): ""; $where_inclusive = !empty($inclusive) ? implode(" OR ", $inclusive): ""; $where = sprintf("$where_inclusive %s $where_exclusive", (!empty($where_inclusive) && !empty($where_exclusive)) ? "AND": ""); $where = trim($where); if(!empty($where)) { $where .= " AND "; } $select = "SELECT bannerID, banner, format, width, height, alt, bannertext, url FROM $phpAds_tbl_banners WHERE $where active = 'true' "; if($clientID != 0) { $select .= " AND clientID = $clientID "; } if(is_string($what) && !ereg("[0-9]x[0-9]", $what)) { switch($what) { // Get all HTML banners case "html": $select .= " AND format = 'html' "; break; //Not any of the special words (i.e. 'html'), So, must be a keyword default: $select .= " AND ("; $what_array = explode(",",$what); for($k=0; $k */ $select .= "keyword = 'global') "; } //switch($what) } elseif(is_int($what)) { $select .= " AND bannerID = $what "; } else { list($width, $height) = explode("x", $what); // Get all banners with the specified width/height $select .= " AND width = $width AND height = $height "; } // print($select); $res = @mysql_db_query($phpAds_db, $select); if(!$res) return(false); $rows = array(); while ($tmprow = @mysql_fetch_array($res)) { $rows[] = $tmprow; } $date = getdate(time()); $request = array('remote_host' => $REMOTE_ADDR, 'user_agent' => $HTTP_USER_AGENT, 'weekday' => $date['wday']); srand((double)microtime()*1000000); shuffle($rows); for ($i = 0; $i < count($rows); $i++) { if (acl_check($request, $rows[$i])) { $row = $rows[$i]; break; } } return($row); } // Log an adview for the banner with $bannerID function log_adview($bannerID) { global $phpAds_log_adviews, $phpAds_ignore_hosts, $phpAds_reverse_lookup, $phpAds_insert_delayed; global $row, $phpAds_tbl_adviews; global $REMOTE_HOST, $REMOTE_ADDR; if(!$phpAds_log_adviews) { return(false); } if($phpAds_reverse_lookup) { $host = isset($REMOTE_HOST) ? $REMOTE_HOST : @gethostbyaddr($REMOTE_ADDR); } else { $host = $REMOTE_ADDR; } // Check if host is on list of hosts to ignore $found = 0; while(($found == 0) && (list($key, $ignore_host)=each($phpAds_ignore_hosts))) { if(eregi($ignore_host, $host)) // host found in ignore list { $found = 1; } } if($found == 0) { $res = @mysql_db_query($GLOBALS["phpAds_db"], sprintf(" INSERT %s INTO $phpAds_tbl_adviews VALUES ( '$bannerID', null, '$host' ) ", $phpAds_insert_delayed ? "DELAYED": "")); } } // view a banner function view($what, $clientID=0, $target = "", $withtext=0, $context=0) { global $phpAds_db, $REMOTE_HOST; if(!is_int($clientID)) { $target = $clientID; $clientID = 0; } @mysql_pconnect($GLOBALS["phpAds_hostname"], $GLOBALS["phpAds_mysqluser"], $GLOBALS["phpAds_mysqlpassword"]); $row = get_banner($what, $clientID, $context); if(!empty($row["bannerID"])) { if(!empty($target)) { $target = " target=\"$target\""; } if($row["format"] == "html") { if(!empty($row["url"])) { echo ""; } echo $row["banner"]; if(!empty($row["url"])) { echo ""; } } else { echo "\"$row[alt]\""; if($withtext && !empty($row["bannertext"])) { echo "
\n".$row["bannertext"].""; } } } log_adview($row["bannerID"]); return($row["bannerID"]); } function view_t($what, $target = "") { view ($what, $target, 1); } ?>
Sharewatch Market Research. Market research for US, UK European stocks and shares.

Sharewatch Ltd is regulated by the Central Bank of Ireland. All Equity Share Trading will be executed, cleared and administered by ODL Securities Ltd which is a member of the London Stock Exchange and is authorised and regulated by the Financial Services Authority. All CFD's & Spread Betting are Provided by CMC Markets UK Plc and CMC Spreadbet Plc who are both authorised and regulated by the UK Financial Services Authority. Sharewatch Ltd is registered in Dublin, Ireland No 286532. Registered Office NSC Campus, Mahon, Cork, Ireland. Website Service TermsPrivacy Policy © Copyright 1996-2012 Sharewatch Limited.