\n";
return $content;
}
// -----------------------------------------------------------------------------
function display_page($content) {
global $config;
if ($file = fopen($config['header'], "r")) {
fpassthru($file);
fclose($file);
}
print <<
function basicPopup(url) {
popupWindow = window.open(url,'popUpWindow','height=500,width=500,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no, status=yes');
}
HTML;
echo $content;
if ($file = @fopen($config['footer'], "r")) {
@fpassthru($file);
@fclose($file);
}
}
function display_page_old($content="") {
global $config, $mainlink;
displayHeader("Pethobbyist.com - Building the world's largest pet community", $config['banner_region'], $config['splashtext_market']);
// start main outside table
echo "
\n";
// display the left_column_include
echo "
\n";
if ($file = @fopen($config[left_column_include],"r")) {
@fpassthru($file);
@fclose($file);
}
// start middle content with description and featured video
print <<
Videos These are videos submitted by staff, volunteers, and users of all the PetHobbyist pet communities. Currently our system supports videos hosted on YouTube, but other video hosts will be added soon. PLEASE NOTE - All videos are reviewed before listing and videos that contain commerical advertising, copyrighted materials, profanity, or are not on topic will not be listed. Submitting a video does not guarantee listing. To have a video listed click here.
HTML;
// Get recommended Video
if (!$mainlink) { dbConnect(); }
get_recommended_video($config[default_market]);
print <<
$content
HTML;
// show the right_column_include
echo "\n";
if ($file = @fopen($config[right_column_include],"r")) {
@fpassthru($file);
@fclose($file);
}
// close the main table
print <<
HTML;
displayFooter();
exit;
}
function displayHeader($title="", $banner_rotation="", $splashtext_market="kingsnake") {
global $config;
if ($banner_rotation=="" || $banner_rotation==" ") { $banner_rotation = $config[banner_region]; }
if (!$title) {
$title = strip_tags($config[title]);
}
// Capture the header template
if ($file = @fopen($config[header_template],"r")) {
ob_start();
@fpassthru($file);
$page = ob_get_contents();
ob_end_clean();
@fclose($file);
}
//$page = implode("",(@file('/mnt/shared/headers/top_king_tmpl.html')));
//$page = implode("",(@file('/web/forums/kingsnake/top_king_tmpl.html')));
if ( (!$page) or (empty($page)) ) {
die("Sorry, there was a problem building the page.");
}
// Capture the banner
if ($file = @fopen("http://gallery.pethobbyist.com/ssi/get_banner.php?region=$banner_rotation","r")) {
ob_start();
@fpassthru($file);
$banner = ob_get_contents();
ob_end_clean();
@fclose($file);
}
// Capture the splashtext
if ($file = @fopen("http://www.pethobbyist.com/splashtext/splashtext.php?market=$splashtext_market","r")) {
ob_start();
@fpassthru($file);
$splash = ob_get_contents();
ob_end_clean();
@fclose($file);
}
$css = <<
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}
HTML;
$page = ereg_replace("{title}", strip_tags($title), $page);
$page = ereg_replace("{css}", $css, $page);
$page = ereg_replace("{banner}", $banner, $page);
$page = ereg_replace("{splash}", $splash, $page);
echo $page;
return true;
}
function displayFooter() {
global $config;
echo "
\n";
if ($myfile = @fopen($config[footer],'r')) {
@fpassthru($myfile);
}
exit;
}
function dbConnect() {
global $mainlink, $config;
$mainlink = @mysql_connect( $config[dbHost], $config[dbUser], $config[dbPasswd] )
or error( "Unable to connect to the database. Please try again later." );
@mysql_select_db( $config[dbName], $mainlink )
or error("Unable to select the database table ($config[dbName]). Please try again later.");
}
function dbConnectAuth () {
global $authlink, $config;
$authlink = @mysql_connect( $config[dbAuthHost], $config[dbAuthUser], $config[dbAuthPasswd] )
or error("Unable to connect to the database. Please try again later.", "C3 - Can't connect to Auth database " . mysql_error() );
@mysql_select_db( $config[dbAuthName], $authlink )
or error("Unable to connect to $config[dbAuthName]. Please try again later.", "C4 - Auth database not selected, " . mysql_error() );
}
function verifyUser() {
global $config;
if ( isset($_SESSION["usernamein"]) && isset($_SESSION["userpasswd"]) ) {
if ( $_SESSION[pgm_id]==$config[pgm_id] ) {
return true;
}
}
return false;
}
function logit( $details ) {
global $config;
$mydate = date("Y-m-d H:i:s") . ": ";
error_log ("$mydate $error $details\n", 3, $config[logfile]);
}
function error( $error, $details="" ) {
global $config;
$content = <<