Originally Posted by .Track
[php]<?php
// ## EGO! Switchgear - Hab-World - Functions
// ## header function
// ## description: prints the page header with custom variables set
function print_system_header($page_title,$css=FALSE,$js=FAL SE,$int_css=FALSE,$int_js=FALSE)
{
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n";
echo "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">\n\n";
echo "<!-- EGO! Switchgear - Designed and Coded by the EGO! boyz -->\n";
echo "<!-- Don't steal it or i'll set my hyena's on you -->\n\n";
echo " <head>\n";
echo " <meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\">\n";
echo " <title>EGO! Switchgear - $page_title</title>\n\n";
echo " <!-- externals -->\n";
echo " <link rel=\"stylesheet\" href=\"includes/template.css\" type=\"text/css\"/>\n";
echo " <script language=\"javascript\" src=\"includes/template.js\"></script>\n\n";
if($css)
{
echo " <link rel=\"stylesheet\" href=\"$css\" type=\"text/css\"/>\n";
}
if($js)
{
echo " <script language=\"javascript\" src=\"$js\"></script>\n\n";
}
if($int_css)
{
echo " <!-- css -->\n";
echo " $int_css\n\n";
}
if($int_js)
{
echo " <!-- javascript -->\n";
echo " $int_js\n\n";
}
echo " </head>\n\n";
echo "<body>\n\n";
}
// ## footer function
// ## description: prints the page footer
function print_system_footer()
{
echo "\n</body>\n";
echo "</html>";
}
// ## nav category
// ## prints a nav category
function print_nav_category($divid,$spanid,$btnid,$title)
{
*REMOVED*
function print_no_access($where)
{
echo "<p align=\"center\"><b>Sorry, you do not have permission to view the $where!!</b></p>";
}
function bbcode($string)
{
$string = nl2br(htmlspecialchars($string));
$patterns = array
(
'`\[b\](.+?)\[/b\]`is',
'`\[i\](.+?)\[/i\]`is',
'`\[u\](.+?)\[/u\]`is',
'`\[strike\](.+?)\[/strike\]`is',
'`\[color=#([0-9]{6})\](.+?)\[/color\]`is',
'`\[img\](.+?)\[/img\]`is',
'`\[url=([a-z0-9]+://)([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*?)?)\](.*?)\[/url\]`si',
'`\[url\]([a-z0-9]+?://){1}([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)\[/url\]`si',
'`\[url\]((www|ftp)\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*?)?)\[/url\]`si',
'`\
As i said there coding's explained well in some areas soits easy to edit for newbs. :rolleyes: