From 49ff543541097a514cf8c836b74cd9514df2bf98 Mon Sep 17 00:00:00 2001 From: Starla Insigna Date: Mon, 17 Aug 2009 15:25:11 -0400 Subject: Databasified Affiliates and Website Projects The following database changes must be made ASAP: * Import the links.sql script into the database Closes #114 --- includes/functions.php | 14 ++++++++++++++ includes/header.php | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+) (limited to 'includes') diff --git a/includes/functions.php b/includes/functions.php index b0b28d5..ce7a03e 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -357,4 +357,18 @@ function getPollOfTheWeek($id = -1) return $result; } +function getTagColor($i) +{ + switch ($i % 7) + { + case 0: return 'blue'; + case 1: return 'green'; + case 2: return 'orange'; + case 3: return 'pink'; + case 4: return 'purple'; + case 5: return 'red'; + case 6: return 'yellow'; + } +} + ?> diff --git a/includes/header.php b/includes/header.php index ae39bad..3a8edff 100755 --- a/includes/header.php +++ b/includes/header.php @@ -69,6 +69,26 @@ $headerTemp->add('DATEFINDER', sd_dateFinder()); if ($usingIE) { $headerTemp->add('FLASH', 'It appears you are using Internet Explorer. Four Island is not likely to work properly in IE due to a huge bug in it. There are better browsers out there, why not try one?'); +} + +$getaffs = "SELECT * FROM links WHERE type = \"affiliates\" ORDER BY id ASC"; +$getaffs2 = mysql_query($getaffs); +$i=0; +while ($getaffs3 = mysql_fetch_array($getaffs2)) +{ + $headerTemp->adds_block('AFFILIATES', array( 'COLOR' => getTagColor($i++), + 'TITLE' => $getaffs3['title'], + 'URL' => $getaffs3['url'])); +} + +$getwebps = "SELECT * FROM links WHERE type = \"webprojs\" ORDER BY id ASC"; +$getwebps2 = mysql_query($getwebps); +$i=0; +while ($getwebps3 = mysql_fetch_array($getwebps2)) +{ + $headerTemp->adds_block('WEBPROJS', array( 'COLOR' => getTagColor($i++), + 'TITLE' => $getwebps3['title'], + 'URL' => $getwebps3['url'])); } $headerTemp->display(); -- cgit 1.4.1