aboutsummaryrefslogtreecommitdiff
path: root/includes/functions.php
diff options
context:
space:
mode:
authorjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-27 10:44:57 -0500
committerjhunkeler <jhunkeler@c5b2fb0a-d05d-0410-98c8-828840a80ff6>2009-12-27 10:44:57 -0500
commitd526decc4884710ae7fafe7aa5171e7f59b24292 (patch)
tree12c07f3ef6ab9bf5a4f278a7b00720996c41667d /includes/functions.php
parent07253dc75c69cf585ad39a218f3f2cf97b773987 (diff)
downloadbayonetcms-d526decc4884710ae7fafe7aa5171e7f59b24292.tar.gz
MySQL -> MySQLi
Fixed memory leaks after Fetching arrays Removed all while loops that interfaced with $db->Fetch() Rewrote RSS module Fixed syntax error in donations module Fixed link structure for news module Reverting to old page display method git-svn-id: http://svn.3rd-infantry-division.org/testing/branches/Bayonet CMS v2@402 c5b2fb0a-d05d-0410-98c8-828840a80ff6
Diffstat (limited to 'includes/functions.php')
-rw-r--r--includes/functions.php26
1 files changed, 18 insertions, 8 deletions
diff --git a/includes/functions.php b/includes/functions.php
index f0fe60e..bc169ff 100644
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -301,10 +301,10 @@ if(!defined("CALLED_FROM_ADMIN"))
* Begins a Bayonet site table.
* @return
*/
- function OpenTable()
+ function OpenTable($width = "100%")
{
//width="100%" is important. Otherwise all of our tables will be text width.
- echo "<table width=\"100%\" align=\"center\" class=\"cleartable\">\n";
+ echo "<table width=\"{$width}\" align=\"center\" class=\"cleartable\">\n";
}
/**
@@ -314,7 +314,7 @@ if(!defined("CALLED_FROM_ADMIN"))
*/
function CloseTable()
{
- //echo "</table>";
+ echo "</table>";
}
/**
@@ -412,6 +412,19 @@ function ReportHack($message)
CloseTable();
}
+/**
+ * PageRedirect()
+ *
+ * performs an http redirect
+ *
+ * @param $delay
+ * @param $link
+ */
+function PageRedirect($delay, $link)
+{
+ echo "<meta http-equiv=\"Refresh\" content=\"{$delay};url={$link}\">";
+}
+
/**
* array_dump()
@@ -588,11 +601,8 @@ function GetBlocks($position = BLOCK_LEFT)
$result = $db->Query("SELECT * FROM `bayonet_blocks` ORDER BY weight, position");
//$result = mysql_query("SELECT * FROM bayonet_blocks ORDER BY weight, position");
- while(($row = $db->Fetch($result))!==false)
- {
- $blocks[] = $row;
- }
- $db->Free($result);
+ $blocks = $db->Fetch($result);
+ $blocks[] = $row;
foreach($blocks as $block)
{