Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once(dirname(__FILE__) . '/../../../_standards/bootstrap.php');
- require_once(dirname(__FILE__) . '/../../../db/cdbmember.php');
- require_once(dirname(__FILE__) . '/../../../classes/cusersecurity.php');
- $DBMember = new CDBMember();
- $UserSecurity = new CUserSecurity();
- $sBody = '';
- $sTemplateDir = get_bloginfo('template_url');
- $sTemplateName = get_post_meta($post->ID, '_wp_page_template', true);
- $bIsChamber = ($sTemplateName == 'chamber.php');
- $bIsHomePage = ($sTemplateName == 'home_template.php');
- $bIsSearch = is_search();
- $bIs404 = is_404();
- $sLogoID = 'logo';
- if ($bIsChamber)
- {
- $sLogoID = 'chamber_logo';
- }
- if ($bIsHomePage)
- {
- $sBody = 'home';
- }
- $bIsBlogPage = false;
- if (((is_home() || is_front_page()) && !$bIsHomePage) || is_archive() || is_single())
- {
- $bIsBlogPage = true;
- }
- if (($post->ID == 515) || ($post->ID == 620) || $bIsSearch)
- {
- $sBody = 'interactive_body';
- }
- /////////////////////////////
- // Inputs
- /////////////////////////////
- if (isset($_POST['Login']))
- {
- $sUserName = isset($_POST['UserName']) ? strtolower(trim($_POST['UserName'])) : '';
- $sPassword = isset($_POST['Pwd']) ? trim($_POST['Pwd']) : '';
- $aRow = $DBMember->VerifyLogin($sUserName, $sPassword);
- if ($aRow)
- {
- $UserSecurity->Login($aRow[0]['MemberID'], 'ChamberMember');
- $iUserID = $UserSecurity->UserID();
- $iMenuID = $iChamberMenuID;
- $bIsLoggedIn = true;
- }
- else
- {
- $UserSecurity->Logout();
- $iUserID = -1;
- $sUserType = '';
- $bIsLoggedIn = false;
- $sLoginMsg = 'Your login could not be verified. Please try again.';
- }
- }
- if (isset($_GET['logout']))
- {
- $UserSecurity->Logout();
- $iUserID = -1;
- $sUserType = '';
- $bIsLoggedIn = false;
- $sLoginMsg = 'You have been logged out.';
- }
- //////////////////////////////
- // User Info
- //////////////////////////////
- $iUserID = $UserSecurity->UserID();
- $bIsLoggedIn = $UserSecurity->IsValid();
- $sMemberName = '';
- if ($bIsLoggedIn)
- {
- $aRow = $DBMember->GetForMemberID($iUserID);
- if ($aRow)
- {
- $sMemberName = $aRow[0]['OwnerName'];
- }
- }
- elseif ($post->ID == 616)
- {
- ?>
- <script type="text/javascript">
- location.href="<?php echo get_permalink(255); ?>";
- </script>
- <?php
- }
- /////////////////////////////
- // Display
- /////////////////////////////
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html <?php language_attributes(); ?>>
- <head>
- <meta charset="<?php bloginfo( 'charset' ); ?>" />
- <title>
- <?php
- /*
- * Print the <title> tag based on what is being viewed.
- */
- global $page, $paged;
- wp_title( '|', true, 'right' );
- // Add the blog name.
- bloginfo( 'name' );
- // Add the blog description for the home/front page.
- $site_description = get_bloginfo( 'description', 'display' );
- if ( $site_description && ( is_home() || is_front_page() ) )
- echo " | $site_description";
- // Add a page number if necessary:
- if ( $paged >= 2 || $page >= 2 )
- echo ' | ' . sprintf( __( 'Page %s', 'twentyten' ), max( $paged, $page ) );
- ?></title>
- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
- <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.21/jquery-ui.min.js" type="text/javascript"></script>
- <script src="<?php echo $sTemplateDir; ?>/js/superfish.js" type="text/javascript"></script>
- <script src="<?php echo $sTemplateDir; ?>/js/jquery.cycle.js" type="text/javascript"></script>
- <script src="<?php echo $sTemplateDir; ?>/js/jquery.qtip-1.0.0-rc3.min.js" type="text/javascript"></script>
- <script src="<?php echo $sTemplateDir; ?>/js/formValidator2.5/jquery.validationEngine.js" type="text/javascript"></script>
- <script src="<?php echo $sTemplateDir; ?>/js/formValidator2.5/languages/jquery.validationEngine-en.js" type="text/javascript"></script>
- <link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo( 'stylesheet_url' ); ?>" />
- <link rel="stylesheet" type="text/css" media="all" href="<?php echo $sTemplateDir; ?>/css/jquery-ui-1.8.6.custom.css" />
- <link rel="stylesheet" href="<?php echo $sTemplateDir; ?>/css/validationEngine.jquery.css" type="text/css" media="all" />
- <link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
- <?php
- if ( is_singular() && get_option( 'thread_comments' ) )
- wp_enqueue_script( 'comment-reply' );
- wp_head();
- ?>
- <script type="text/javascript">
- $(document).ready(function() {
- <?php
- if ($bIsHomePage)
- {
- ?>
- $('.gallery').cycle({
- fx: 'fade',
- timeout: 6000
- });
- <?php
- }
- elseif ($bIsChamber)
- {
- ?>
- iHeightLeft = $('#chamber_left').height();
- iHeightRight = $('#chamber_right').height();
- if (iHeightLeft < iHeightRight)
- {
- $('#chamber_left').height(iHeightRight);
- }
- <?php
- }
- elseif ($post->post_parent == 48)
- {
- ?>
- $('#secondary_right').css({'position': 'relative', 'top': '140px'});
- $('#tertiary_nav .page-item-57').prepend('<img src="<?php echo $sTemplateDir; ?>/images/green_dot_mtn.png"> ');
- $('#tertiary_nav .page-item-60').prepend('<img src="<?php echo $sTemplateDir; ?>/images/blue_dot_valley.png"> ');
- $('#tertiary_nav .page-item-63').prepend('<img src="<?php echo $sTemplateDir; ?>/images/orange_dot_underground.png"> ');
- <?php
- }
- elseif ($post->ID == 620)
- {
- ?>
- if ($('#secondary_right aside').length == 0)
- {
- sContentCheck = $.trim($('#secondary_right').text());
- }
- else
- {
- sContentCheck = $.trim($('#secondary_right aside').text());
- }
- if (sContentCheck == '')
- {
- $('#secondary_right').hide();
- $('#secondary_left').css({'width' : '840px'});
- }
- <?php
- }
- ?>
- $('#top_nav ul ul li').hover(
- function () {
- $(this).parent().parent().addClass('hover');
- },
- function () {
- $(this).parent().parent().removeClass('hover');
- }
- );
- $.fn.qtip.styles.tipstyle = { // Last part is the name of the style
- width: 490,
- background: '#ffffff',
- color: '#000000',
- border: {
- width: 0,
- radius: 2,
- color: '#000000'
- },
- title: {
- background: '#004990',
- color: '#ffffff'
- },
- padding: 5,
- margin: 0,
- tip: false,
- name: 'dark' // Inherit the rest of the attributes from the preset style
- };
- });
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', 'UA-32603220-1']);
- _gaq.push(['_trackPageview']);
- (function() {
- var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
- ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
- var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
- })();
- </script>
- <?php
- if ($post->ID == 620)
- {
- ?>
- <script type="text/javascript">
- var __htmlcontainer_domain = "issuu.com";
- </script>
- <script src='http://static.issuu.com/static/1594/w/viewer/v2/standalone/index.js' type='text/javascript'></script>
- <!--[if IE]>
- <script type="text/javascript">
- function fixOutOfMemoryError() { //Fix IE memory leak from using External Interface
- __flash_unloadHandler = function() {};
- __flash_savedUnloadHandler = function() {};
- }
- window.attachEvent("onbeforeunload", fixOutOfMemoryError);
- </script>
- <![endif]-->
- <script type="text/javascript">
- //=== SERVER SIDE OVERRIDES
- //---Carrier protocol
- var __protocol = "http://";
- /*
- //domain
- var __domain = "issuu.com";
- */
- //---Specifies the minimum required version of flash for this page to show
- var __req_flash = "9.0.0";
- // Document ID
- var documentId = "110920163545-9aa14c5e01ec4328ab58791850f201ea";
- //=== REDIRECT TO AJAX VIEWER IF FLASH VERSION IS BELOW REQUIRED VERSION
- if (!swfobject.hasFlashPlayerVersion(__req_flash)) {
- var breakdown = window.location.href.split('?')
- var ajv_url = breakdown[0] + "?mode=a_p";
- window.location.href= ajv_url;
- }
- //=== Insert flash
- var bl_swfUrl = "http://static.issuu.com/webembed/viewers/style1/v2/IssuuReader.swf";
- var bl_domId = "flashcontent";
- var bl_width = "100%";
- var bl_height = "100%";
- var bl_flashver = __req_flash; //flex publishing version
- var bl_flashvars = {
- mode:"window",documentId: "110920163545-9aa14c5e01ec4328ab58791850f201ea",
- pageNumber: 1,
- bl_domain: "issuu.com",
- bl_resource: "http://issuu.com/lpccc/docs/2012_getaway_guide",
- bl_query: "mode=window",
- bl_referrer: "",
- bl_viewuser: "",
- userAgent: "Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.5; en-US; rv:1.9.2.28) Gecko/20120306 Firefox/3.6.28"
- };
- var bl_params = {
- allowfullscreen: "true",
- menu: "false",
- salign: "tl",
- scale: "noscale",
- wmode: 'transparent',
- allowscriptaccess: "always"
- };
- var bl_attr = {
- id: bl_domId,
- name: bl_domId
- };
- swfobject.embedSWF(bl_swfUrl, bl_domId, bl_width, bl_height, bl_flashver, {}, bl_flashvars, bl_params, bl_attr);
- </script>
- <?php
- }
- ?>
- </head>
- <body id="<?php echo $sBody; ?>">
- <div id="container_wrapper">
- <div id="container">
- <?php
- if ($bIsHomePage)
- {
- ?>
- <div class="gallery-holder">
- <ul class="gallery">
- <?php
- $aChildren = get_children('post_parent=69&post_type=page&orderby=menu_order&order=ASC', ARRAY_A);
- foreach ($aChildren as $iIndex => $aOneChild)
- {
- echo '<li>' . strip_tags($aOneChild['post_content'], '<img>') . '</li>' . "\n";
- }
- wp_reset_query();
- ?>
- </ul>
- </div>
- <?php
- }
- ?>
- <div id="header">
- <div id="transparent_banner"></div>
- <div class="clear"></div>
- <div id="banner">
- <div id="banner_col1">
- <form id="searchform" method="get" action="<?php bloginfo('siteurl'); ?>">
- <input id="s" class="field" type="text" placeholder="Search" name="s">
- <input id="searchsubmit" class="submit" type="submit" value="Search" name="submit">
- </form>
- </div>
- <div id="banner_col2">
- <!-- AddThis Button BEGIN -->
- <a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&pubid=inprint"><img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/></a>
- <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=inprint"></script>
- <!-- AddThis Button END -->
- </div>
- <div id="banner_col3">
- <?php
- $iPageID = 974;
- $aPage = get_page($iPageID, ARRAY_A);
- if ($aPage)
- {
- $aPage['post_content'] = str_replace(array('<p>', '</p>'), '', $aPage['post_content']);
- echo $aPage['post_content'];
- }
- ?>
- </div>
- </div>
- <?php
- wp_nav_menu(array('container_id' => 'top_nav', 'menu' => 'Main', 'container' => 'div'));
- ?>
- <a id="<?php echo $sLogoID; ?>" href="<?php bloginfo('siteurl'); ?>" alt="Luray & Page County" title="Luray & Page County"><?php bloginfo('name'); ?></a>
- <?php
- if (!$bIsChamber)
- {
- ?>
- <div id="choose_nav">
- <ul>
- <li><a href="#"><img src="<?php echo $sTemplateDir; ?>/images/level_graphic.png" alt="Choose Your Level" title="Choose Your Level" /></a>
- <?php
- wp_nav_menu(array('menu' => 'Level', 'container' => 'div'));
- ?>
- </li>
- </ul>
- </div>
- <?php
- }
- ?>
- </div>
- <?php
- $bHasHeaderImage = false;
- if (!$bIsHomePage && !$bIsSearch && !$bIs404)
- {
- $sStyle = '';
- if ($bIsBlogPage)
- {
- $iMainBlogID = get_option('page_for_posts');
- $bHasHeaderImage = true;
- $sImage = wp_get_attachment_image(get_post_thumbnail_id($iMainBlogID), 'full');
- echo '<div id="header_image">' . "\n";
- echo $sImage . "\n";
- echo '</div>' . "\n";
- }
- elseif (has_post_thumbnail())
- {
- $bHasHeaderImage = true;
- $sImage = wp_get_attachment_image(get_post_thumbnail_id($post->ID), 'full');
- echo '<div id="header_image">' . "\n";
- echo $sImage . "\n";
- echo '</div>' . "\n";
- }
- if (!$bIsChamber)
- {
- if ($post->post_parent)
- {
- $aPage = get_page($post->post_parent, ARRAY_A);
- $sTertiaryMenuClass = $aPage['post_name'];
- $sMenuTitle = $aPage['post_title'];
- }
- else
- {
- $sTertiaryMenuClass = $post->post_name;
- $sMenuTitle = $post->post_title;
- }
- if ($post->post_parent)
- {
- $aArgs = array('child_of' => $post->post_parent,
- 'depth' => 1,
- 'sort_column' => 'menu_order',
- 'echo' => 0,
- 'title_li' => '');
- }
- else
- {
- $aArgs = array('child_of' => $post->ID,
- 'depth' => 1,
- 'sort_column' => 'menu_order',
- 'echo' => 0,
- 'title_li' => '');
- }
- $sTertiaryMenu = wp_list_pages($aArgs);
- if ($sTertiaryMenu != '')
- {
- ?>
- <div id="tertiary_nav" class="<?php echo $sTertiaryMenuClass; ?>">
- <span id="tertiary_nav_title"><?php echo $sMenuTitle; ?> ></span>
- <ul>
- <?php echo $sTertiaryMenu; ?>
- </ul>
- </div>
- <?php
- }
- }
- }
- ?>
- <div id="content"<?php echo (($sBody == 'interactive_body') && $bHasHeaderImage) ? ' style="padding-top: 0;"' : ''; ?>>
- <?php
- if ($bIsChamber && !$bIsSearch && !$bIs404)
- {
- ?>
- <div id="chamber_left">
- <h3 class="chamber_title">Chamber<br />of Commerce</h3>
- <?php
- $sMenu = wp_nav_menu(array('container_id' => 'chamber_nav', 'menu' => 'Main', 'container' => 'div', 'echo' => false));
- $iStartPos1 = strpos($sMenu, 'menu-item-283');
- $iStartPos2 = strpos($sMenu, '<ul', $iStartPos1);
- $sTmpMenu = substr($sMenu, $iStartPos2);
- $sTmpMenu = str_replace(' class="sub-menu"', '', $sTmpMenu);
- echo '<div id="chamber_nav">' . "\n";
- echo $sTmpMenu;
- if (($post->ID == 255) || ($post->ID == 616))
- {
- // Member directory page. Display login area.
- if (!$bIsLoggedIn)
- {
- if ($sLoginMsg != '')
- {
- echo '<p><b>' . $sLoginMsg . '</b></p>';
- }
- ?>
- <div class="login_form">
- <form name="LoginForm" method="post" action="<?php echo get_permalink(255); ?>">
- <h3 class="chamber_title">Member Login</h3>
- <div class="section_row">
- <input class="default_text" type="text" name="UserName" size="15" maxlength="80" value="" title="Email" />
- </div>
- <div class="section_row">
- <input class="default_text" type="password" name="Pwd" size="15" maxlength="20" value="" title="Password" />
- </div>
- <div class="section_row">
- <input type="submit" name="Login" value="Login" />
- </div>
- <div class="section_row">
- <a href="<?php echo get_permalink(618); ?>">Forgot password?</a>
- </div>
- </form>
- </div>
- <?php
- }
- else
- {
- ?>
- <p class="member_welcome">Welcome, <?php echo $sMemberName; ?></p>
- <div id="member_nav">
- <ul>
- <li><a href="<?php echo get_permalink(616); ?>">Edit Your Profile</a></li>
- <li><a href="<?php echo get_permalink(255); ?>?logout=1">Logout</a></li>
- </ul>
- </div>
- <?php
- }
- }
- ?>
- <div id="chamber_left_shim"></div>
- </div>
- <?php
- }
- elseif (!$bIsHomePage && !$bIsSearch && !$bIs404)
- {
- $sStyle = '';
- if ($bIsBlogPage)
- {
- $sStyle = ' style="float: left; padding-left: 20px;"';
- }
- ?>
- <div id="secondary_right"<?php echo $sStyle; ?>>
- <?php
- if ($bIsBlogPage)
- {
- $oCategories = get_the_category();
- $sCategory = '';
- $iCategoryID = -1;
- if ($oCategories)
- {
- $sCategory = $oCategories[0]->cat_name;
- $iCategoryID = $oCategories[0]->term_id;
- }
- // Display all posts for this category
- $sQuery = 'cat=' . $iCategoryID . '&post_status=publish';
- $Query = new WP_Query($sQuery);
- while ($Query->have_posts() ) : $Query->the_post();
- echo '<p><a href="';
- the_permalink();
- echo '">';
- the_title();
- echo '</a> - ';
- the_time('n/d/y');
- echo '</p>' . "\n";
- endwhile;
- }
- else
- {
- if (!dynamic_sidebar()) :
- endif;
- }
- ?>
- </div>
- <?php
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement