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 --- admin/posts.php | 2 +- includes/functions.php | 14 +++++++++++ includes/header.php | 20 ++++++++++++++++ theme/admin/header.tpl | 6 +++++ theme/header.tpl | 64 +++++++++++--------------------------------------- 5 files changed, 55 insertions(+), 51 deletions(-) diff --git a/admin/posts.php b/admin/posts.php index ac5b612..605db30 100644 --- a/admin/posts.php +++ b/admin/posts.php @@ -8,7 +8,7 @@ 4::::4 4::::4 4::::4 4::::4 Written and maintained by Starla Insigna 4::::444444::::444 -4::::::::::::::::4 admin/pages.php +4::::::::::::::::4 admin/posts.php 4444444444:::::444 4::::4 Please do not use, reproduce or steal the 4::::4 contents of this file without explicit 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(); diff --git a/theme/admin/header.tpl b/theme/admin/header.tpl index bfc1dd4..62beb89 100644 --- a/theme/admin/header.tpl +++ b/theme/admin/header.tpl @@ -24,6 +24,7 @@
  • >POSTS
  • >POLLS
  • >QUOTES
  • +
  • >LINKS
  • FOUR ISLAND
  • @@ -51,6 +52,11 @@
  • >Moderate Quotes
  • >Manage Flagged Quotes
  • + +
  • >Add a new link
  • +
  • >Manage Affiliates
  • +
  • >Manage Website Projects
  • + diff --git a/theme/header.tpl b/theme/header.tpl index 24c9b6b..896ded5 100644 --- a/theme/header.tpl +++ b/theme/header.tpl @@ -63,62 +63,26 @@ -- cgit 1.4.1