lostwages/ bin/ad images/bannerads/cw-ad01.gif ...
Jeremy Newman
jnewman at wine.codeweavers.com
Wed Sep 13 16:45:55 CDT 2006
ChangeSet ID: 28056
CVSROOT: /opt/cvs-commit
Module name: lostwages
Changes by: jnewman at winehq.org 2006/09/13 16:45:55
Modified files:
bin : ad
Removed files:
images/bannerads: cw-ad01.gif cw-ad01.xml cw-ad02.gif
cw-ad02.xml cw-ad03.gif cw-ad03.xml
cw-ad04.gif cw-ad04.xml cw-ad05.gif
cw-ad05.xml
Log message:
updated banner ads
Patch: http://cvs.winehq.org/patch.py?id=28056
Old revision New revision Changes Path
1.2 1.3 +5 -71 lostwages/bin/ad
1.1 Removed +0 -0 lostwages/images/bannerads/cw-ad01.gif
1.4 Removed +0 -0 lostwages/images/bannerads/cw-ad01.xml
1.4 Removed +0 -0 lostwages/images/bannerads/cw-ad02.gif
1.4 Removed +0 -0 lostwages/images/bannerads/cw-ad02.xml
1.1 Removed +0 -0 lostwages/images/bannerads/cw-ad03.gif
1.1 Removed +0 -0 lostwages/images/bannerads/cw-ad03.xml
1.1 Removed +0 -0 lostwages/images/bannerads/cw-ad04.gif
1.3 Removed +0 -0 lostwages/images/bannerads/cw-ad04.xml
1.1 Removed +0 -0 lostwages/images/bannerads/cw-ad05.gif
1.1 Removed +0 -0 lostwages/images/bannerads/cw-ad05.xml
Index: lostwages/bin/ad
diff -u -p lostwages/bin/ad:1.2 lostwages/bin/ad:1.3
--- lostwages/bin/ad:1.2 13 Sep 2006 21:45:55 -0000
+++ lostwages/bin/ad 13 Sep 2006 21:45:55 -0000
@@ -3,74 +3,8 @@
/* Banner Ad Code */
/* For WineHQ */
-// path for banner ad
-$bannerads_path = '../images/bannerads/';
-
-// base filename of the static ad
-$fixed_ad = 'cw-ad02';
-
-// max count until we fix on static ad
-$max_ads = 50;
-
-// open file and display contents of selected tag (very simple)
-function get_xml_tags ($file, $tags = null)
-{
- if (is_array($tags) and file_exists($file))
- {
- $content = array();
- $fp = @fopen($file, "r");
- $data = fread($fp, filesize($file));
- @fclose($fp);
- foreach ($tags as $tag)
- {
- if (eregi("<" . $tag . ">(.*)</" . $tag . ">", $data, $out))
- {
- array_push($content, $out[1]);
- }
- }
- return $content;
- }
- else
- {
- return null;
- }
-}
-// end get_xml_tags()
-
-// check cookie for ad counter
-$whqac = 1;
-if (isset($_COOKIE['whqac']))
- $whqac = $_COOKIE['whqac'];
-unset($_COOKIE["whqac"]);
-$whqac++;
-
-// randomly select a banner and display it
-if ($whqac >= $max_ads)
-{
- // display fixed ad
- $whqac = $max_ads;
- $img = $fixed_ad;
-}
-else
-{
- // display random ad
- $ads = array();
- $d = opendir($bannerads_path);
- while($entry = readdir($d))
- {
- if(!ereg("(.+)\\.gif$", $entry, $arr))
- continue;
- array_push($ads, $arr[1]);
- }
- closedir($d);
- sort($ads);
- $img = $ads[(rand(1,count($ads))-1)];
-}
-list($url, $alt) = get_xml_tags($bannerads_path.$img.'.xml', array('url', 'alt'));
-
// da banner
-setcookie("whqac", $whqac, time()+60*60*24*365);
-header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
+header("Expires: Mon, 1 Jan 2006 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
@@ -79,9 +13,9 @@ header("Pragma: no-cache");
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
- <title><?=$alt?></title>
+ <title>Banner Ad</title>
</head>
-<body bgcolor="#000000" text="#FFFFFF" marginwidth="0" marginheight="0" style="margin:0px;"><a href="<?=$url?>"
-target="_top"><img src="../images/bannerads/<?=$img?>.gif"
-width="468" height="60" border="0" alt="<?=$alt?>" /></a> <?=$whqac?></body>
+<body bgcolor="#FFFFFF" text="#000000" marginwidth="0" marginheight="0" style="margin:0px;"><a href="http://www.codeweavers.com/"
+target="_top"><img src="../images/bannerads/cw-ad06.png"
+width="468" height="60" border="0" alt="cw-ad06.png" /></a></body>
</html>
Index: lostwages/images/bannerads/cw-ad01.xml
diff -u -p lostwages/images/bannerads/cw-ad01.xml:1.4 /dev/null
--- lostwages/images/bannerads/cw-ad01.xml 13 Sep 2006 21:45:55 -0000
+++ /dev/null 13 Sep 2006 21:45:55 -0000
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE bannerAd>
-<ad>
- <id>cw-ad04</id>
- <url>http://www.codeweavers.com/products/cxoffice/?ad=5</url>
- <alt>QuickTime for Linux!</alt>
-</ad>
Index: lostwages/images/bannerads/cw-ad02.xml
diff -u -p lostwages/images/bannerads/cw-ad02.xml:1.4 /dev/null
--- lostwages/images/bannerads/cw-ad02.xml 13 Sep 2006 21:45:55 -0000
+++ /dev/null 13 Sep 2006 21:45:55 -0000
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE bannerAd>
-<ad>
- <id>cw-ad04</id>
- <url>http://www.codeweavers.com/products/support_wine/?ad=21</url>
- <alt>Support the Wine Project!</alt>
-</ad>
Index: lostwages/images/bannerads/cw-ad03.xml
diff -u -p lostwages/images/bannerads/cw-ad03.xml:1.1 /dev/null
--- lostwages/images/bannerads/cw-ad03.xml 13 Sep 2006 21:45:55 -0000
+++ /dev/null 13 Sep 2006 21:45:55 -0000
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE bannerAd>
-<ad>
- <id>cw-ad03</id>
- <url>http://www.codeweavers.com/services/?ad=16</url>
- <alt>CodeWeavers can port your Windows application with Wine</alt>
-</ad>
Index: lostwages/images/bannerads/cw-ad04.xml
diff -u -p lostwages/images/bannerads/cw-ad04.xml:1.3 /dev/null
--- lostwages/images/bannerads/cw-ad04.xml 13 Sep 2006 21:45:55 -0000
+++ /dev/null 13 Sep 2006 21:45:55 -0000
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE bannerAd>
-<ad>
- <id>cw-ad04</id>
- <url>http://www.codeweavers.com/products/cxoffice/?ad=5</url>
- <alt>Microsoft Office On Linux!</alt>
-</ad>
Index: lostwages/images/bannerads/cw-ad05.xml
diff -u -p lostwages/images/bannerads/cw-ad05.xml:1.1 /dev/null
--- lostwages/images/bannerads/cw-ad05.xml 13 Sep 2006 21:45:55 -0000
+++ /dev/null 13 Sep 2006 21:45:55 -0000
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE bannerAd>
-<ad>
- <id>cw-ad05</id>
- <url>http://www.codeweavers.com/about/?ad=18</url>
- <alt>Professional Support for Wine!</alt>
-</ad>
More information about the wine-cvs
mailing list