I installed the Flex template (Joomla) in xampp and when I open the site, some errors are appearing:
Notice: Undefined variable: boxed_layout_width in C:\xampp\htdocs\flex\templates\flex\index.php on line 164
class="body-innerwrapper">
Here's my index.php:
<?php
/**
* Flex #package Helix3 Framework
* Template Name - Flex
* #author Aplikko http://www.aplikko.com
* #copyright Copyright (c) 2016 Aplikko
* #license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or later
*/
//no direct access
defined ('_JEXEC') or die ('restricted access');
$doc = JFactory::getDocument();
JHtml::_('jquery.framework');
JHtml::_('bootstrap.framework'); //Force load Bootstrap
unset($doc->_scripts[$this->baseurl . '/media/jui/js/bootstrap.min.js']); // Remove joomla core bootstrap
//Load Helix
$helix3_path = JPATH_PLUGINS.'/system/helix3/core/helix3.php';
if (file_exists($helix3_path)) {
require_once($helix3_path);
$this->helix3 = helix3::getInstance();
} else {
die('Please install and activate helix plugin');
}
//Coming Soon
if($this->helix3->getParam('comingsoon_mode')) header("Location: ".$this->baseUrl."?tmpl=comingsoon");
//Class Classes
$body_classes = '';
if($this->helix3->getParam('sticky_header')) {
$body_classes .= ' sticky-header';
}
$body_classes .= ($this->helix3->getParam('boxed_layout', 0)) ? ' layout-boxed' : ' layout-fluid';
//Body Background Image
if($bg_image = $this->helix3->getParam('body_bg_image')) {
$body_style = 'background-image: url(' . JURI::base(true ) . '/' . $bg_image . ');';
$body_style .= 'background-repeat: '. $this->helix3->getParam('body_bg_repeat') .';';
$body_style .= 'background-size: '. $this->helix3->getParam('body_bg_size') .';';
$body_style .= 'background-attachment: '. $this->helix3->getParam('body_bg_attachment') .';';
$body_style .= 'background-position: '. $this->helix3->getParam('body_bg_position') .';';
$body_style = 'body.site {' . $body_style . '}';
$doc->addStyledeclaration( $body_style );
}
//Boxed Layout Width
$this->params->get('boxed_layout') == 1 ? $boxed_layout_width = ' style="max-width:'.$this->helix3->getParam('boxed_layout_width').'"' : '';
//Body Font
$webfonts = array();
if( $this->params->get('enable_body_font') ) {
$webfonts['body'] = $this->params->get('body_font');
}
//Heading1 Font
if( $this->params->get('enable_h1_font') ) {
$webfonts['h1'] = $this->params->get('h1_font');
}
//Heading2 Font
if( $this->params->get('enable_h2_font') ) {
$webfonts['h2'] = $this->params->get('h2_font');
}
//Heading3 Font
if( $this->params->get('enable_h3_font') ) {
$webfonts['h3'] = $this->params->get('h3_font');
}
//Heading4 Font
if( $this->params->get('enable_h4_font') ) {
$webfonts['h4'] = $this->params->get('h4_font');
}
//Heading5 Font
if( $this->params->get('enable_h5_font') ) {
$webfonts['h5'] = $this->params->get('h5_font');
}
//Heading6 Font
if( $this->params->get('enable_h6_font') ) {
$webfonts['h6'] = $this->params->get('h6_font');
}
//Navigation Font
if( $this->params->get('enable_navigation_font') ) {
$webfonts['.sp-megamenu-parent'] = $this->params->get('navigation_font');
}
//Custom Font
if( $this->params->get('enable_custom_font') && $this->params->get('custom_font_selectors') ) {
$webfonts[ $this->params->get('custom_font_selectors') ] = $this->params->get('custom_font');
}
$this->helix3->addGoogleFont($webfonts);
//Custom CSS
if($custom_css = $this->helix3->getParam('custom_css')) {
$doc->addStyledeclaration( $custom_css );
}
//Custom JS
if($custom_js = $this->helix3->getParam('custom_js')) {
$doc->addScriptdeclaration( $custom_js );
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php
if($favicon = $this->helix3->getParam('favicon')) {
$doc->addFavicon( JURI::base(true) . '/' . $favicon);
} else {
$doc->addFavicon( $this->helix3->getTemplateUri() . '/images/favicon.ico' );
}
?>
<jdoc:include type="head" />
<?php
$this->helix3->addCSS('bootstrap.min.css, font-awesome.min.css') // CSS Files
->addJS('bootstrap.min.js, jquery.sticky.js, modernizr.js, SmoothScroll.js, matchheight.js, jquery.easing.min.js, scrolling-nav.js, jquery.nav.js, vm-cart.js, main.js') // JS Files
->lessInit()->setLessVariables(array(
'preset'=>$this->helix3->Preset(),
'bg_color'=> $this->helix3->PresetParam('_bg'),
'text_color'=> $this->helix3->PresetParam('_text'),
'major_color'=> $this->helix3->PresetParam('_major')
))
->addLess('legacy/bootstrap', 'legacy')
->addLess('master', 'template');
//RTL
if($this->direction=='rtl') {
$this->helix3->addCSS('bootstrap-rtl.min.css')
->addLess('rtl', 'rtl');
}
$this->helix3->addLess('presets', 'presets/'.$this->helix3->Preset(), array('class'=>'preset'));
//Before Head
if($before_head = $this->helix3->getParam('before_head')) {
echo $before_head . "\n";
}
?>
</head>
<body class="<?php echo $this->helix3->bodyClass( $body_classes ); ?>">
<?php if( $this->params->get('page_loader') == 1 ) { ?>
<!-- Preloader -->
<div id="preloader">
<div id="status"></div>
</div>
<?php } ?>
<div<?php echo $boxed_layout_width; ?> class="body-innerwrapper">
<?php $this->helix3->generatelayout(); ?>
<div class="offcanvas-menu">
<i class="fa fa-remove"></i>
<div class="offcanvas-inner">
<?php if ($this->helix3->countModules('offcanvas')) { ?>
<jdoc:include type="modules" name="offcanvas" style="sp_xhtml" />
<?php } else { ?>
<p class="alert alert-warning"><?php echo JText::_('HELIX_NO_MODULE_OFFCANVAS'); ?></p>
<?php } ?>
</div>
</div>
</div>
<?php
if($this->params->get('compress_css')) {
$this->helix3->compressCSS();
}
if($this->params->get('compress_js')) {
$this->helix3->compressJS( $this->params->get('exclude_js') );
}
if($before_body = $this->helix3->getParam('before_body')) {
echo $before_body . "\n";
}
?>
<jdoc:include type="modules" name="debug" />
</body>
</html>
Change line
//Boxed Layout Width
$this->params->get('boxed_layout') == 1 ? $boxed_layout_width = ' style="max-width:'.$this->helix3->getParam('boxed_layout_width').'"' : '';
To
//Boxed Layout Width
$boxed_layout_width = $this->params->get('boxed_layout') == 1 ? ' style="max-width:'.$this->helix3->getParam('boxed_layout_width').'"' : '';
Related
I'm trying to set a variable to a function that selects a table from a database. It has worked all the other times I have been using the function, but now I get this error message:
Notice: Undefined variable: post in C:\xampp\htdocs\blog\single.php on line 50
Now when I try to use another function that I have and set the same variable it doesn't work either. For some reason on this single.php page it will not recognize the function that I have in another file. The file where functions are lies included in posts.php, in a file called db.php, like this:
single.php :
<?php include('path.php');?>
<?php include('posts.php');
if (isset($_GET['id']))
{
$post = selectOne('posts', ['id' => $_GET['id']]);
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<!-- Custom Styles -->
<link rel="stylesheet" href="assets/css/style.css">
<title><?php echo $post['title'];?> </title>
</head>
<body>
<div id="fb-root"></div>
<!-- <script>
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s);
js.id = id;
js.src =
'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.2&appId=285071545181837&autoLogAppEvents=1';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
</script> -->
<!-- header -->
<?php include(ROOT_PATH . "/app/includes/header.php"); ?>
<!-- // header -->
<!-- Page wrapper -->
<div class="page-wrapper">
<!-- content -->
<div class="content clearfix">
<div class="page-content single">
<h2 style="text-align: center;"><?php echo $post['title']; ?></h2>
<br>
<?php echo html_entity_decode($post['body']); ?>
</div>
<div class="sidebar single">
<!-- fb page -->
<!-- // fb page -->
<!-- Popular Posts -->
<div class="section popular">
<h2>Popular</h2>
<div class="post clearfix">
<img src="images/image_1.png">
How to act inspite of your emotions
</div>
<div class="post clearfix">
<img src="images/image_2.png">
How to act inspite of your emotions
</div>
<div class="post clearfix">
<img src="images/image_3.png">
How to act inspite of your emotions
</div>
<div class="post clearfix">
<img src="images/image_4.png">
How to act inspite of your emotions
</div>
<div class="post clearfix">
<img src="images/image_5.png">
How to act inspite of your emotions
</div>
</div>
<!-- // Popular Posts -->
<!-- topics -->
<div class="section topics">
<h2>Topics</h2>
<ul>
<a href="#">
<li>Poems</li>
</a>
<a href="#">
<li>Quotes</li>
</a>
<a href="#">
<li>Fiction</li>
</a>
<a href="#">
<li>Biography</li>
</a>
<a href="#">
<li>Motivation</li>
</a>
<a href="#">
<li>Inspiration</li>
</a>
<a href="#">
<li>Life Lessons</li>
</a>
<a href="#">
<li>Self Development</li>
</a>
</ul>
</div>
<!-- // topics -->
</div>
</div>
<!-- // content -->
</div>
<!-- // page wrapper -->
<!-- FOOTER -->
<?php include(ROOT_PATH . "/app/includes/footer.php"); ?>
<!-- // FOOTER -->
<!-- JQuery -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Slick JS -->
<script type="text/javascript" src="//cdn.jsdelivr.net/npm/slick-carousel#1.8.1/slick/slick.min.js"></script>
<script src="assets/js/script.js"></script>
</body>
</html>
posts.php:
<?php
include("app/database/db.php");
include("app/helpers/validatePost.php");
$table = 'posts';
$topics = selectAll('topics');
$posts = selectAll($table);
$errors = array();
$title = "";
$id = "";
$body = "";
$topic_id = "";
$published ="";
if (isset($_GET['id'])){
$post = selectOne($table, ['id' => $_GET['id']]);
$id = $post['id'];
$title = $post['title'];
$body = $post['body'];
$topic_id = $post['topic_id'];
$published = $post['published'];
}
if (isset($_GET['delete_id'])){
$count = delete($table, $_GET['delete_id']);
$_SESSION['message'] = "Post deleted succefully";
$_SESSION['type'] = "success";
header("location: " . BASE_URL . "/admin/posts/index.php");
exit();
}
if(isset($_GET['published']) && isset($_GET['p_id'])){
$published = $_GET['published'];
$p_id = $_GET['p_id'];
$count = update($table, $p_id, ['published' => $published]);
$_SESSION['message'] = "Post published state changed";
$_SESSION['type'] = "success";
header("location: " . BASE_URL . "/admin/posts/index.php");
exit();
}
if (isset($_POST['add-post'])){
$errors = validatePost($_POST);
if(!empty($_FILES['image']['name'])){
$image_name = time() . ' _ ' . $_FILES['image']['name'];
$destination = ROOT_PATH . "/assets/images/" . $image_name;
$result = move_uploaded_file($_FILES['image']['tmp_name'], $destination);
if ($result) {
$_POST ['image'] = $image_name;
} else{
array_push($errors, 'failed to upload image');
}
} else{
array_push($errors, "Post image required");
}
if(count($errors) == 0) {
unset($_POST['add-post']);
$_POST['user_id'] = $_SESSION['id'];
$_POST['published'] = isset($_POST['published']) ? 1 : 0;
$_POST['body'] = htmlentities($_POST['body']);
$post_id = create($table, $_POST);
$_SESSION['message'] = "Post created succefully";
$_SESSION['type'] = "success";
header("location: " . BASE_URL . "/admin/posts/index.php");
exit();
} else {
$title = $_POST['title'];
$body = $_POST['body'];
$topic_id = $_POST['topic_id'];
$published = isset($_POST['published']) ? 1 : 0;
}
}
if(isset($_POST['update-post'])){
$errors = validatePost($_POST);
if(!empty($_FILES['image']['name'])){
$image_name = time() . ' _ ' . $_FILES['image']['name'];
$destination = ROOT_PATH . "/assets/images/" . $image_name;
$result = move_uploaded_file($_FILES['image']['tmp_name'], $destination);
if ($result) {
$_POST ['image'] = $image_name;
} else{
array_push($errors, 'failed to upload image');
}
} else{
array_push($errors, "Post image required");
}
if(count($errors) == 0) {
$id = $_POST['id'];
unset($_POST['update-post'], $_POST['id']);
$_POST['user_id'] = $_SESSION['id'];
$_POST['published'] = isset($_POST['published']) ? 1 : 0;
$_POST['body'] = htmlentities($_POST['body']);
$post_id = update($table, $id, $_POST);
$_SESSION['message'] = "Post updated succefully";
$_SESSION['type'] = "success";
header("location: " . BASE_URL . "/admin/posts/index.php");
} else {
$title = $_POST['title'];
$body = $_POST['body'];
$topic_id = $_POST['topic_id'];
$published = isset($_POST['published']) ? 1 : 0;
}
}
db.php: (There are more functions, but i only included the two I tried to use with the variable $post.
function selectOne($table, $conditions)
{
global $conn;
$sql = "SELECT * FROM $table";
//return srecords that match conditions
$i = 0;
foreach($conditions as $key => $value) {
if ($i === 0){
$sql = $sql . " WHERE $key=?";
} else{
$sql = $sql . " AND $key=?";
}
$i++;
}
$sql = $sql . " LIMIT 1";
$stmt = executeQuery($sql, $conditions);
$records = $stmt->get_result()->fetch_assoc();
return $records;
}
function dd($value){
echo "<pre>", print_r($value, true), "</pre>";
die();
}
I'm new to PHP and and using a Wordpress one-page theme where each section has a unique post ID. I want to add a sidebar only to a post with a specific ID. The code for that specific ID should add a few divs for styling as well as the sidebar. I've tried adding a simple if/else statement and putting the code with the extra divs and sidebar in the if, and the original code without the sidebar or extra styling in the else but my code results not only styling for the widget on each post, but also removes the other content from the post I'm targeting. This is the entire php file for the template. Any help is much appreciated!
<?php
/*
Template Name: Onepage
*/
?>
<?php global $smof_data; ?>
<?php get_header();?>
<?php
if ( ( $locations = get_nav_menu_locations() ) && $locations['primary'] && !disable_onepage() ) {
$menu = wp_get_nav_menu_object( $locations['primary'] );
$menu_items = wp_get_nav_menu_items($menu->term_id);
$pages_included = array();
foreach ( $menu_items as $item ):
if ($item->object != 'page') continue;
$menu_state = get_post_meta($item->ID,'menu-item-menu-state',true);
if ($menu_state == 'link') continue;
$pages_included[] = $item->object_id;
endforeach;
} else {
$pages_included[] = array();
}
$count = 0;
/* IF THERE IS AT LEAST ONE PAGE MENU ITEM */
if (!empty($pages_included)) :
$args = array(
'post_type' => 'page',
'post__in' => $pages_included,
'posts_per_page' => count($pages_included),
'orderby' => 'post__in',
);
$onepage_query = new WP_Query();
$onepage_query->query($args);
endif;
if ( $onepage_query->have_posts() ): while( $onepage_query->have_posts() ): $onepage_query->the_post(); $count++;?>
<?php // Some PHP stuffs
$page_template = get_post_meta(get_the_ID(),'_wp_page_template',true);
$page_template = basename($page_template,'.php');
/* ----------------------------- GET OPTIONS ----------------------------------- */
/* Title Options
----------------------------------------------- */
$subtitle = get_post_meta(get_the_ID(),'_wi_subtitle',true);
$subtitle = trim($subtitle);
$title_image = false;
$title_image_ids = get_post_meta(get_the_ID(),'_wi_title-image',false);
$title_image_id = '';
foreach ( $title_image_ids as $tii ) {
if ( !wp_get_attachment_image_src( $tii ) ) continue;
$title_image_id = $tii;
}
if ( $title_image_id ) {
$title_image = wp_get_attachment_image_src($title_image_id,'full');
$title_image = $title_image[0];
}
$hide_title = get_post_meta(get_the_ID(),'_wi_hide-title-area',true);
/* Page Background Options
----------------------------------------------- */
$page_background_type = get_post_meta(get_the_ID(),'_wi_page-background-type',true);
$page_background_color = get_post_meta(get_the_ID(),'_wi_page-background-color',true);
$page_background_image = get_post_meta(get_the_ID(),'_wi_page-background-image',true);
$page_background_image_size = get_post_meta(get_the_ID(),'_wi_page-background-image-size',true);
$page_background_image_position = get_post_meta(get_the_ID(),'_wi_page-background-image-position',true);
$page_background_pattern = get_post_meta(get_the_ID(),'_wi_page-background-pattern',true);
$page_background_pattern_retina = get_post_meta(get_the_ID(),'_wi_page-background-pattern-retina',true);
/* Separator Background Options
----------------------------------------------- */
$disable_separator = get_post_meta(get_the_ID(),'_wi_disable-page-separator',true);
$separator_content = get_post_meta(get_the_ID(),'_wi_separator-content',true);
$background_or_pattern = get_post_meta(get_the_ID(),'_wi_background-image-or-pattern',true);
if ( $background_or_pattern!='pattern' ) $background_or_pattern = 'background';
$background_images = get_post_meta(get_the_ID(),'_wi_background-image',false);
$background_image = '';
foreach ( $background_images as $bgim ) {
if ( !wp_get_attachment_image_src( $bgim) ) continue;
$background_image = $bgim;
}
$overlay_opacity = get_post_meta(get_the_ID(),'_wi_overlay-opacity',true);
$overlay_opacity = absint($overlay_opacity);
$clipmask_opacity = get_post_meta(get_the_ID(),'_wi_clipmask-opacity',true);
$clipmask_opacity = absint($clipmask_opacity);
$enable_parallax = get_post_meta(get_the_ID(),'_wi_enable-parallax-effect',true);
$parallax_class = ( $enable_parallax ) ? ' parallax' : '';
$padding = get_post_meta(get_the_ID(),'_wi_padding-top-bottom',true);
$predefined_pattern = get_post_meta(get_the_ID(),'_wi_predefined-pattern',true);
$retina_custom_patterns = get_post_meta(get_the_ID(),'_wi_retina-custom-pattern',false);
$retina_custom_pattern = '';
foreach ($retina_custom_patterns as $bgim ) {
if ( !wp_get_attachment_image_src( $bgim) ) continue;
$retina_custom_pattern = $bgim;
}
$custom_patterns = get_post_meta(get_the_ID(),'_wi_custom-pattern',false);
$custom_pattern = '';
foreach ( $custom_patterns as $bgim ) {
if ( !wp_get_attachment_image_src( $bgim) ) continue;
$custom_pattern = $bgim;
}
if ( $background_or_pattern != 'pattern' ) {
$background_type = 'image';
if ( $background_image ) {
$background_image = wp_get_attachment_image_src($background_image,'full');
$background_image = $background_image[0];
$background_size = 'cover';
} else {
$background_image = '';
$background_size = '';
}
$retina_background_image = $background_image;
} else { // $background_or_pattern == 'pattern'
$background_type = 'pattern';
if ( $custom_pattern ) {
$pattern = $custom_pattern;
if ( $retina_custom_pattern ) {
$retina_pattern = $retina_custom_pattern;
} else {
$retina_pattern = $custom_pattern;
}
$pattern = wp_get_attachment_image_src($pattern,'full');
$pattern = $pattern[0];
$retina_pattern = wp_get_attachment_image_src($retina_pattern,'full');
$retina_pattern = $retina_pattern[0];
} else {
$pattern = $predefined_pattern;
$retina_pattern = str_replace( '.png' , '_#2X.png' , $pattern );
}
if ( !$pattern ) $pattern = get_template_directory_uri().'/images/sidrbg/argyle.png';
if ( $pattern ) {
$background_image = $pattern;
$background_size = (array) #getimagesize($pattern);
if ( isset($background_size[0]) && isset($background_size[1]) ) {
$background_size = $background_size[0] . 'px ' . $background_size[1] . 'px';
} else {
$background_size = 'auto';
}
} else {
$background_image = '';
$background_size = '';
}
if ( $retina_pattern ) {
$retina_background_image = $retina_pattern;
} else {
$retina_background_image = $pattern;
}
} // image or pattern
?>
<?php if ( !$disable_separator ) :?>
<style type="text/css">
#page-separator-<?php echo esc_html($post->post_name);?> {
background-image:url(<?php echo esc_url($background_image);?>);
-webkit-background-size:<?php echo esc_html($background_size);?>;
-moz-background-size:<?php echo esc_html($background_size);?>;
background-size:<?php echo esc_html($background_size);?>;
padding-top:<?php echo absint($padding);?>px;
padding-bottom:<?php echo absint($padding);?>px;
}
#page-separator-<?php echo esc_html($post->post_name);?> .overlay {
opacity:<?php echo ($overlay_opacity/100);?>;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=<?php echo ($overlay_opacity);?>)";
filter: alpha(opacity=<?php echo ($overlay_opacity);?>);
}
#page-separator-<?php echo esc_html($post->post_name);?> .clipmask {
opacity:<?php echo ($clipmask_opacity/100);?>;
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=<?php echo ($clipmask_opacity);?>)";
filter: alpha(opacity=<?php echo ($clipmask_opacity);?>);
}
#media (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi){
#page-separator-<?php echo esc_html($post->post_name);?> {
background-image:url(<?php echo esc_url($retina_background_image);?>);
}
}
</style>
<div class="<?php echo esc_attr('page-separator background-type-' . $background_type . $parallax_class);?>" id="<?php echo esc_attr('page-separator-' . $post->post_name);?>">
<div class="overlay"></div>
<div class="clipmask"></div>
<div class="container">
<div class="content">
<?php echo do_shortcode($separator_content); ?>
</div><!-- .content -->
</div><!-- .container -->
</div><!-- .page-separator #page-separator-$post->post_name -->
<?php endif; // enable/disable page separator ?>
<style type="text/css">
<?php if($page_background_color){?>
.wi-page#<?php echo esc_html($post->post_name);?> {
background-color:<?php echo sanitize_hex_color($page_background_color);?>;
}
<?php } ?>
/* --------- BACKGROUND PATTERN OPTIONS ------------ */
<?php if ($page_background_type == 'pattern'): ?>
<?php if($page_background_pattern){
$pattern = wp_get_attachment_image_src($page_background_pattern,'full');
$pattern = $pattern[0];
$background_size = (array) #getimagesize($pattern);
$background_size = $background_size[0] . 'px ' . $background_size[1] . 'px';
?>
.wi-page#<?php echo esc_html($post->post_name);?> {
background-image:url(<?php echo esc_url($pattern);?>);
-webkit-background-size:<?php echo esc_html($background_size);?>;
-moz-background-size:<?php echo esc_html($background_size);?>;
background-size:<?php echo esc_html($background_size);?>;
}
<?php } ?>
<?php if($page_background_pattern_retina){
$pattern = wp_get_attachment_image_src($page_background_pattern_retina,'full');
$pattern = $pattern[0];
?>
#media (-webkit-min-device-pixel-ratio: 1.25), (min-resolution: 120dpi){
.wi-page#<?php echo esc_html($post->post_name);?> {
background-image:url(<?php echo esc_url($pattern);?>);
}
}
<?php } ?>
/* --------- BACKGROUND IMAGE OPTIONS ------------ */
<?php elseif ($page_background_type == 'image'): ?>
<?php if($page_background_image){
$page_background_image = wp_get_attachment_image_src($page_background_image,'full');
$page_background_image = $page_background_image[0];
?>
.wi-page#<?php echo esc_html($post->post_name);?> {
background-image:url(<?php echo esc_url($page_background_image);?>);
-webkit-background-size:<?php echo esc_html($page_background_image_size);?>;
-moz-background-size:<?php echo esc_html($page_background_image_size);?>;
background-size:<?php echo esc_html($page_background_image_size);?>;
background-position:<?php echo esc_html($page_background_image_position);?>;
}
<?php } ?>
<?php endif; // page background type ?>
</style>
<?php
if ($post->ID == '4048') {
?>
<div <?php post_class('wi-page '.$page_template);?> id="<?php echo esc_attr($post->post_name);?>">
<?php if ( !$hide_title ){ ?>
<!-- TITLE -->
<div class="title-area">
<div class="container">
<div class="pad">
<?php if ( $title_image ) : ?>
<div class="image">
<img src="<?php echo esc_url($title_image);?>" alt="<?php the_title();?>" />
</div><!-- .image -->
<?php endif; // header_image ?>
<h2 class="title"><?php the_title();?></h2>
<?php if ($subtitle):?>
<h3 class="subtitle"><?php echo wp_kses($subtitle,''); ?></h3>
<?php endif;?>
</div><!-- .pad -->
</div><!-- .container -->
</div><!-- .title-area -->
<?php }
}else{ ?>
<div class="content-area">
<div class="container">
<div class="row-fluid"> <!-- added for styling -->
<div id="primary" class="span8"> <!-- added for styling -->
<?php the_content();?>
</div> <!-- added for styling #primary -->
<?php get_sidebar('video-sidebar');?>
</div><!-- .row-fluid -->
</div><!-- .container -->
<div class="clearfix"></div>
</div> <!-- content-area -->
</div><!-- .wi-page -->
<?php } ?>
<?php
endwhile; // have posts
endif; // have posts
if (!empty($pages_included)) :
wp_reset_query();
endif;
// in case onepage disabled but user wants to use onepage template for some usage
if ( disable_onepage() ):
if (have_posts()) :?>
<div class="container">
<?php while(have_posts()): the_post(); ?>
<article <?php post_class('article wi-single');?> id="post-<?php the_ID();?>">
<?php the_content();?>
<?php wp_link_pages( array( 'before' => '<div class="page-links-container"><div class="page-links"><div class="page-links-label">' . __( 'Pages:', 'wi' ) . '</div>', 'after' => '</div></div>', 'pagelink' => '<span>%</span>' ) ); ?>
</article><!-- .article -->
<?php endwhile;?>
</div><!-- .container -->
<?php endif;
endif; // if disable onepage
?>
<?php get_footer();?>
<?php
if ($post->ID == '4048') {
?>
<div <?php post_class('wi-page '.$page_template);?> id="<?php echo esc_attr($post->post_name);?>">
<?php if ( !$hide_title ){ ?>
<!-- TITLE -->
<div class="title-area">
<div class="container">
<div class="pad">
<?php if ( $title_image ) : ?>
<div class="image">
<img src="<?php echo esc_url($title_image);?>" alt="<?php the_title();?>" />
</div><!-- .image -->
<?php endif; // header_image ?>
<h2 class="title"><?php the_title();?></h2>
<?php if ($subtitle):?>
<h3 class="subtitle"><?php echo wp_kses($subtitle,''); ?></h3>
<?php endif;?>
</div><!-- .pad -->
</div><!-- .container -->
</div><!-- .title-area -->
<?php }
}else{ ?>
<div class="content-area">
<div class="container">
<div class="row-fluid"> <!-- added for styling -->
<div id="primary" class="span8"> <!-- added for styling -->
<?php the_content();?>
</div> <!-- added for styling #primary -->
<?php get_sidebar('video-sidebar');?>
</div><!-- .row-fluid -->
</div><!-- .container -->
<div class="clearfix"></div>
</div> <!-- content-area -->
</div><!-- .wi-page -->
<?php } ?>
You forgot to close in line number 3 ?>
I have a Jomi installation and I see that social icons are inserted at the bottom of my article while I would display them after the head section. What should I look for to modify this since the template settings just allow me to turn on/off the social bar? Should I look inside layouts or styles folder?
On feeling I looked into layouts/com_content/article and there is a default.php that looks something like a template for my articles, but I cannot find anything about social bar, here is its content:
<?php
/**
* #package Warp Theme Framework
* #author YOOtheme http://www.yootheme.com
* #copyright Copyright (C) YOOtheme GmbH
* #license http://www.gnu.org/licenses/gpl.html GNU/GPL
*/
// no direct access
defined('_JEXEC') or die;
// get view
$menu = JSite::getMenu()->getActive();
$view = is_object($menu) && isset($menu->query['view']) ? $menu->query['view'] : null;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
// Create shortcuts to some parameters.
$params = $this->item->params;
$images = json_decode($this->item->images);
$urls = json_decode($this->item->urls);
$canEdit = $this->item->params->get('access-edit');
$user = JFactory::getUser();
?>
<div id="system">
<?php if ($this->params->get('show_page_heading', 1)) : ?>
<h1 class="title"><?php echo $this->escape($this->params->get('page_heading')); ?></h1>
<?php endif; ?>
<article class="item"<?php if ($view != 'article') printf(' data-permalink="%s"', JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catslug), true, -1)); ?>>
<?php if ($params->get('show_title')) : ?>
<header>
<?php if (!$this->print) : ?>
<?php if ($params->get('show_email_icon')) : ?>
<div class="icon email"><?php echo JHtml::_('icon.email', $this->item, $params); ?></div>
<?php endif; ?>
<?php if ($params->get('show_print_icon')) : ?>
<div class="icon print"><?php echo JHtml::_('icon.print_popup', $this->item, $params); ?></div>
<?php endif; ?>
<?php else : ?>
<div class="icon printscreen"><?php echo JHtml::_('icon.print_screen', $this->item, $params); ?></div>
<?php endif; ?>
<?php if ($params->get('show_create_date')) : ?>
<header class="clearfix">
<time datetime="<?php echo substr($this->item->created, 0,10); ?>" pubdate>
<span class="day"><?php echo JHTML::_('date',$this->item->created, JText::_('d')); ?></span>
<span class="month"><?php echo JHTML::_('date',$this->item->created, JText::_('M')); ?></span>
<span class="year"><?php echo JHTML::_('date',$this->item->created, JText::_('Y')); ?></span>
</time>
<?php endif; ?>
<h1 class="title"><?php echo $this->escape($this->item->title); ?></h1>
<?php if (($params->get('show_author') && !empty($this->item->author)) || $params->get('show_category')) : ?>
<p class="meta">
<?php
if ($params->get('show_author') && !empty($this->item->author )) {
$author = $this->item->created_by_alias ? $this->item->created_by_alias : $this->item->author;
if (!empty($this->item->contactid) && $params->get('link_author') == true) {
$needle = 'index.php?option=com_contact&view=contact&id=' . $this->item->contactid;
$menu = JFactory::getApplication()->getMenu();
$item = $menu->getItems('link', $needle, true);
$cntlink = !empty($item) ? $needle . '&Itemid=' . $item->id : $needle;
echo JText::sprintf('<i class="icon-user"></i>');
echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', JRoute::_($cntlink), $author));
} else {
echo JText::sprintf('<i class="icon-user"></i>');
echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author);
}
}
if ($params->get('show_author') && !empty($this->item->author )) {
echo '. ';
}
if ($params->get('show_category')) {
echo JText::_('<i class="icon-folder-open-alt"></i>').' ';
echo JText::_('TPL_WARP_POSTED_IN').' ';
$title = $this->escape($this->item->category_title);
$url = ''.$title.'';
if ($params->get('link_category') AND $this->item->catslug) {
echo $url;
} else {
echo $title;
}
}
?>
</p>
<?php endif; ?>
</header>
<?php endif; ?>
<?php
if (!$params->get('show_intro')) {
echo $this->item->event->afterDisplayTitle;
}
echo $this->item->event->beforeDisplayContent;
if (isset ($this->item->toc)) {
echo $this->item->toc;
}
?>
<div class="content clearfix">
<?php
if ($params->get('access-view')) {
if (isset($urls) AND ((!empty($urls->urls_position) AND ($urls->urls_position=='0')) OR ($params->get('urls_position')=='0' AND empty($urls->urls_position) ))
OR (empty($urls->urls_position) AND (!$params->get('urls_position')))) {
echo $this->loadTemplate('links');
}
if (isset($images->image_fulltext) and !empty($images->image_fulltext)) {
$imgfloat = (empty($images->float_fulltext)) ? $params->get('float_fulltext') : $images->float_fulltext;
$class = (htmlspecialchars($imgfloat) != 'none') ? ' class="size-auto align-'.htmlspecialchars($imgfloat).'"' : ' class="size-auto"';
$title = ($images->image_fulltext_caption) ? ' title="'.htmlspecialchars($images->image_fulltext_caption).'"' : '';
echo '<img'.$class.$title.' src="'.htmlspecialchars($images->image_fulltext).'" alt="'.htmlspecialchars($images->image_fulltext_alt).'" />';
}
echo $this->item->text;
if (isset($urls) AND ((!empty($urls->urls_position) AND ($urls->urls_position=='1')) OR ( $params->get('urls_position')=='1') )) {
echo $this->loadTemplate('links');
}
// optional teaser intro text for guests
} elseif ($params->get('show_noauth') == true AND $user->get('guest')) {
echo $this->item->introtext;
// optional link to let them register to see the whole article.
if ($params->get('show_readmore') && $this->item->fulltext != null) {
$link1 = JRoute::_('index.php?option=com_users&view=login');
$link = new JURI($link1);
echo '<p class="links">';
echo '<a href="'.$link.'">';
$attribs = json_decode($this->item->attribs);
if ($attribs->alternative_readmore == null) {
echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE');
} elseif ($readmore = $this->item->alternative_readmore) {
echo $readmore;
if ($params->get('show_readmore_title', 0) != 0) {
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
}
} elseif ($params->get('show_readmore_title', 0) == 0) {
echo JText::sprintf('COM_CONTENT_READ_MORE_TITLE');
} else {
echo JText::_('COM_CONTENT_READ_MORE');
echo JHtml::_('string.truncate', ($this->item->title), $params->get('readmore_limit'));
}
echo '</a></p>';
}
}
?>
</div>
<?php if ($canEdit) : ?>
<p class="edit"><?php echo JHtml::_('icon.edit', $this->item, $params); ?> <?php echo JText::_('TPL_WARP_EDIT_ARTICLE'); ?></p>
<?php endif; ?>
<?php echo $this->item->event->afterDisplayContent; ?>
</article>
</div>
The only point that could reasonable be the social bar is this line:
<?php echo $this->item->event->afterDisplayContent; ?>
However it looks like a ore wider concept, since afterDisplayContent probably handles many things, and here is where I stop, I have no idea where to look for afterDisplayContent event definition, I guess that I should find an entry for social bar and copy/paste in the position that I want in my module.
i'm getting the following error.
i cant figure it out what is wrong with this code.
there is something that i missed or forget.
can anybody please help me? i'm stuck at the moment.
he keeps saying there something with the array.
Notice: Undefined property: Cms::$contant_types in C:\xampp\htdocs\PassieCMS\app\cms\models\m_cms.php on line 34
Warning: in_array() expects parameter 2 to be array, null given in C:\xampp\htdocs\PassieCMS\app\cms\models\m_cms.php on line 34
<?php
/*
CMS Class
Handle CMS task, allowing admins to view/edit content
*/
class Cms
{
private $content_types = array('wysiwyg', 'textarea', 'oneline');
private $FP;
function __construct()
{
global $FP;
$this->FP = &$FP;
}
function clean_block_id($id)
{
$id = str_replace(' ', '_', $id);
$id = str_replace('-', '_', $id);
$id = preg_replace("/[^a-zA-Z0-9_]/", '',$id);
return strtolower($id);
}
function display_block($id, $type = 'wysiwyg')
{
// clean id
$id = $this->clean_block_id($id);
// check for valid type
$type = strtolower(htmlentities($type, ENT_QUOTES));
if (in_array($type, $this->contant_types) == FALSE)
{
echo "<script>alert('Please enter a valid block type for \'" . $id . "\'');</script>";
return;
}
// get content
$content = "content here...";
// check login status
if ($this->FP->Auth-checkLoginStatus())
{
if($type == 'wysiwyg') { $type2 = 'WYSIWYG';}
if($type == 'textarea') { $type2 = 'Textarea';}
if($type == 'oneline') { $type2 = 'One Line';}
$edit_start = '<div class=""fp_edit>';
$edit_type = '<a class="fp_edit_type" href="' . SITE_PATH .'app/cms/edit.php?id' . $id . '&type='. $type . '">' . $type2 . '</a>';
$edit_link = '<a class="fp_edit_link" href="' . SITE_PATH .'app/cms/edit.php?id' . $id . '&type='. $type . '">Bewerken</a>';
$edit_end = '</div>';
echo $edit_start . $edit_type;
echo $edit_link . $content . $edit_end;
}
else
{
echo $content;
}
}
}
and the index file is
<?php include ("app/init.php");?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>PassieCMS</title>
<link href="resources/css/style.css" rel="stylesheet" type="text/css">
<?php $FP->head(); ?>
</head>
<body class="home <?php $FP->body_class(); ?>">
<?php $FP->toolbar(); ?>
<div id="wrapper">
<h1>Website</h1>
<div id="banner">
<img src="resources/images/banner.jpg" alt="banner" width="900" height="140">
</div>
<ul id="nav">
<li>Home</li>
<li>Test link</li>
<li>Longer Text Link</li>
<li>Contact us</li>
</ul>
<div id="content">
<div class="left">
<h2><?php $FP->Cms->display_block('content-header','oneline'); ?></h2>
<?php $FP->Cms->display_block('content-maincontent'); ?>
</div>
<div class="right">
<?php $FP->Cms->display_block('content-quote'); ?>
<?php $FP->Cms->display_block('content-attribution'); ?>
</div>
</div>
<div id="footer">
Copyright 2014 PassieCMS | <?php $FP->login_link();?> Login optie 2
</div>
</div>
</body>
</html>
Thank you all for your time
if (in_array($type, $this->contant_types) == FALSE)
You have a typo, you have declared it as content_types above. This should work:
if (in_array($type, $this->content_types) == FALSE)
I have built a directory script in php. It is work very well; however, my hosting company is sent me an email saying the script is overloading the server. Is that possible? If it is possible how can I find the issue and correct it.
<?PHP
session_start();
define('DB_HOST','localhost');
define('DB_USER','root');
define('DB_PASSWORD','');
define('DB_DATABASE','salondir');
$link = mysql_connect(DB_HOST,DB_USER,DB_PASSWORD) or die("host Userid and Password Not match");
mysql_select_db(DB_DATABASE,$link) or die("Could not Select DatabBase");
$config_qry = "SELECT * FROM config";
$config_result = mysql_query($config_qry) or die('ERROR.... CHECK CONFIG QUERY');
$config_row = mysql_fetch_assoc($config_result);
?>
<!doctype html>
<html>
<head>
<?PHP $ip = $_SERVER['REMOTE_ADDR'];
if($ip == '::1')
{
$ipdetails = GetIpDetails('98.251.213.154');
}
else
{
$ipdetails = GetIpDetails($ip);
}
//print_r($ipdetails); exit;
if(isset($_GET))
{
if(#$_GET['urltype'] != '')
{
$urltype = $_GET['urltype'];
}
else
{
$urltype = 'home';
}
if(#$_GET['url'] != '')
{
if($_GET['url'] == 'pages')
{
$url = $_GET['url'];
}
else
{
$url = $_GET['url'];
}
}
if(#$_GET['pages'] != '')
{
$pages = $_GET['pages'];
}
else
{
$pages = 0;
}
}
else
{
}
//print_r($_GET); exit;
if($urltype == 'search')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'Search Salon';
$heading = 'Search Salon';
$metakw = 'Search Salon';
$metades = 'Search Salon';
}
else if($urltype == 'photogallery')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'Photo Gallery';
$heading = 'Photo Gallery';
$metakw = 'Photo Gallery';
$metades = 'Photo Gallery';
}
else if($urltype == 'categories')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$explodeurl = explode('-',$url);
$explodecount = count($explodeurl);
if($explodecount == 2)
{
$url1 = ucwords($explodeurl[0]).' '.ucwords($explodeurl[1]);
}
else
{
$url1 = ucwords($url);
}
if($pages != 0)
{
$ttilepage = 'Page # '.$pages;
}
else
{
$ttilepage = '';
}
if(#$_GET['show'] != 'all')
{
$loc = $ipdetails['city'].', '.$ipdetails['state'];
}
else
{
$loc = GetStateStingWithkeyword($url1);
}
$page_title = $url1.' Categories - '.$loc.' '.$ttilepage;
$heading = $url1.' Categories - '.$loc.' '.$ttilepage;
$metakw = $url1.' Categories - '.$loc.' '.$ttilepage;
$metades = $url1.' Categories - '.$loc.' '.$ttilepage;
}
else if($urltype == 'comments')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'Comments';
$heading = 'Comments';
$metakw = 'Comments';
$metades = 'Comments';
}
else if($urltype == 'wishlist')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'Wish List';
$heading = 'Wish List';
$metakw = 'Wish List';
$metades = 'Wish List';
}
else if($urltype == 'home')
{
$pagename = $urltype;
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'Spa Salon Offers Provide Largest Data of Spa Salon, Nails Salon, Beauty Salon, Tanning Salon, Laser Body Treatment, Barber and more...';
$heading = 'Spa Salon Offers Provide Largest Data of Spa Salon, Nails Salon, Beauty Salon, Tanning Salon, Laser Body Treatment, Barber and more...';
$metakw = 'Spa Salon, Nails Salon, Beauty Salon, Barber, Tanning Salons, waxing, Faical, Day Spas, Massage Services, Health Clubs, Body Wrap Salons, Hair Cut, Hair Stylists, Laser Body Treatment, Eyebrow Threading, Best Offers, offers, Beauty salon Offers, Spa Offers, Nail Offers ';
$metades = 'spasalonoffers.com. Find Best Spa Salon Offer nearby you, also find Spa Salon, Nails Salon, Beauty Salon,Tanning Salon, Laser Body Treatment,Barber and more..';
}
else if($urltype == 'postspecial')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'Post Special';
$heading = 'Post Special';
$metakw = 'Post Special';
$metades = 'Post Special';
}
else if($urltype == 'editspecial')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'Edit Special';
$heading = 'Edit Special';
$metakw = 'Edit Special';
$metades = 'Edit Special';
}
else if($urltype == 'editaccountinfo')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'Edit Account';
$heading = 'Edit Account';
$metakw = 'Edit Account';
$metades = 'Edit Account';
}
else if($urltype == 'salonserviceoffer')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'Salon Services';
$heading = 'Salon Services';
$metakw = 'Salon Services';
$metades = 'Salon Services';
}
else if($urltype == 'logout')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'logout';
$heading = 'logout';
$metakw = 'logout';
$metades = 'logout';
}
else if($urltype == 'viewappointment')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'View Appointment';
$heading = 'View Appointment';
$metakw = 'View Appointment';
$metades = 'View Appointment';
}
else if($urltype == 'login')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'login';
$heading = 'login';
$metakw = 'login';
$metades = 'login';
}
else if($urltype == 'myaccount')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'My Account';
$heading = 'My Account';
$metakw = 'My Account';
$metades = 'My Account';
}
else if($urltype == 'managespecials')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'Manage Special';
$heading = 'Manage Special';
$metakw = 'Manage Special';
$metades = 'Manage Special';
}
else if($urltype == 'makeappointment')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'Make Appointment';
$heading = 'Make Appointment';
$metakw = 'Make Appointment';
$metades = 'Make Appointment';
}
else if($urltype == 'salonworkinghours')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'Salon Working Hours';
$heading = 'Salon Working Hours';
$metakw = 'Salon Working Hours';
$metades = 'Salon Working Hours';
}
else if($urltype == 'socialnetworks')
{
$pagename = $_GET['urltype'];
$pageid = 0;
$pageids = 0;
$count_row = 1;
$page_title = 'Social Networks';
$heading = 'Social Networks';
$metakw = 'Social Networks';
$metades = 'Social Networks';
}
else if($urltype == 'getdirection' || $urltype == 'direction')
{
$pagename = $_GET['url'];
$query_Salon = "SELECT * FROM salons WHERE salonurl = '$pagename'";
$Salon_result = mysql_query($query_Salon) or die('Erorr...');
$Salon_row = mysql_fetch_assoc($Salon_result);
$pageid = $Salon_row['salonid'];
$pageids = $Salon_row['salonid'];
$count_row = 1;
$page_title = "Direction - ".$Salon_row['salonname'].' - '.$Salon_row['saloncity'].' - '.$Salon_row['salonstates'];
$heading = strtoupper($Salon_row['salonname']);
$metakw = strtoupper($Salon_row['salonname']);
$metades = strtoupper($Salon_row['salonname']);
}
else if($urltype == 'salondetails' || $urltype == 'biz')
{
$pagename = $_GET['url'];
$query_Salon = "SELECT * FROM salons WHERE salonurl = '$pagename'";
$Salon_result = mysql_query($query_Salon) or die('Erorr...');
$Salon_row = mysql_fetch_assoc($Salon_result);
$pageid = $Salon_row['salonid'];
$pageids = $Salon_row['salonid'];
$count_row = 1;
$page_title = strtoupper($Salon_row['salonname']).', '.strtoupper($Salon_row['saloncity']).','.strtoupper($Salon_row['salonstates']);
$heading = strtoupper($Salon_row['salonname']);
$metakw = strtoupper($Salon_row['salonname']);
$metades = strtoupper($Salon_row['salonname']);
}
?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="RATING" content="General" />
<meta name="DISTRIBUTION" content="Global" />
<meta name="classification" content="<?php echo($metakw); ?>" />
<meta name="keywords" content="<?php echo($metakw); ?>" />
<meta name="description" content="<?php echo($metades); ?>" />
<meta name="subject" content="<?php echo($metades); ?>" />
<meta name="submission" content="<?php echo($config_row['dirurl']); ?>" />
<meta name="google-site-verification" content="TYfy6tRySOfLfJwtM0Q8FPXq5wBJ70h7dUd-2yjLGKA" />
<meta name="author" content="<?php echo($config_row['dirurl']); ?>" />
<meta name="copyright" content="Copyright © <?PHP echo(date('Y')); ?>-<?PHP echo(date('Y')+1); ?> <?php echo($config_row['dirurl']); ?>" />
<meta name="language" content="English" />
<title><?php echo($page_title); ?></title>
<link href="<?PHP echo(GetSeoURL('css/style2.css')); ?>" rel="stylesheet" type="text/css" />
<link href="<?PHP echo(GetSeoURL('css/paginate.css')); ?>" rel="stylesheet" type="text/css" />
<?PHP include('banner_scripts.php'); ?>
<script language="javascript" src="<?PHP echo(GetSeoURL('js/validator.js')); ?>"></script>
<script language="javascript" src="<?PHP echo(GetSeoURL('js/scripts.js')); ?>"></script>
<link rel="stylesheet" href="<?PHP echo(GetSeoURL('css/smoothness/jquery-ui-1.8.2.custom.css')); ?>" />
<script src="<?PHP echo(GetSeoURL('js/jquery.min.js')); ?>" type="text/javascript"></script>
<script src="<?PHP echo(GetSeoURL('js/ui/jquery-ui.js')); ?>" type="text/javascript"></script>
<!--<link id="jquiCSS" rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.18/themes/ui-lightness/jquery-ui.css" type="text/css" media="all">
-->
<link id="jquiCSS" rel="stylesheet" href="<?PHP echo(GetSeoURL('css/jquery-ui.css')); ?>" type="text/css" media="all">
<link href="<?PHP echo(GetSeoURL('css/gridcss.css')); ?>" rel="stylesheet" />
<link href="<?PHP echo(GetSeoURL('css/evol.colorpicker.min.css')); ?>" rel="stylesheet" />
<script src="<?PHP echo(GetSeoURL('js/evol.colorpicker.min.js')); ?>" type="text/javascript"></script>
<script type="text/javascript" language="javascript" src="<?PHP echo(GetSeoURL('js/jquery.easing.min.1.3.js')); ?>"></script>
<script type="text/javascript" language="javascript" src="<?PHP echo(GetSeoURL('js/jquery.jcontent.0.8.min.js')); ?>"></script>
<link href="<?PHP echo(GetSeoURL('css/jcontent.css')); ?>" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<?PHP echo(GetSeoURL('js/jquery.timepicker.js')); ?>"></script>
<link rel="stylesheet" type="text/css" href="<?PHP echo(GetSeoURL('css/jquery.timepicker.css')); ?>" />
<link rel="stylesheet" href="<?PHP echo(GetSeoURL('css/colorbox.css')); ?>" />
<script language="javascript" src="<?PHP echo(GetSeoURL('js/jquery.colorbox.js')); ?>"></script>
<script>
$(document).ready(function(){
$(".ajax").colorbox();
$(".ajax1").colorbox();
$(".group1").colorbox();
$(".group4").colorbox({rel:'group4', slideshow:true, innerWidth:640,transition:"elastic"});
$(".inline").colorbox({inline:true, width:"50%"});
});
$(document).ready(function(){
//demo3
$("div#demo3").jContent({orientation: 'horizontal',
easing: "easeOutBounce",
duration: 500,
auto: true,
pause_on_hover: true,
direction: 'next',
width: 130,
height: 87,
pause: 1500});
});
</script>
</head>
<body>
<div id="wrapper">
<div id="pinkbg">
<script type="text/javascript">
jQuery(document).ready(function(){
$('#l').autocomplete
({
source:'<?PHP echo($gf->GetSeoURL('controller/city.php')); ?>',
minLength:2
});
});
</script>
<style type="text/css"><!--
li.ui-menu-item { font-size:12px !important; }
</style>
<div id="topcontent">
<div id="logo">
<img src="<?PHP echo($gf->GetSeoURL('images/'.$config_row['dirlogo'])); ?>" width="100%" >
</div>
<div id="topmenus">
<div class="buttondiv">
<?PHP include('topmenu.php'); ?>
</div>
<div id="search">
<?PHP include('search.php'); ?>
</div>
</div>
<?PHP
if($userid > 0)
{
if($_SESSION['salonname'] != '')
{
?>
<div id="welcome">Welcome To <?PHP echo(#$_SESSION['salonname']); ?></div>
<?PHP }
}?>
</div>
</div>
<div class="clearfix"></div>
<div id="banner">
<img src="<?PHP echo($gf->GetSeoURL('images/01.jpg')); ?>" width="100%" height="100%" >
</div>
<div class="clearfix"></div>
<div id="center">
<div id="errors">
<?php
if(isset($_SESSION['errtype']))
{
if($_SESSION['errtype'] == 1)
{ ?>
<div class="error"><strong>Error Message: </strong> <?php echo($_SESSION['mess']); ?></div>
<?php }
elseif($_SESSION['errtype'] == 2)
{ ?>
<div class="success"><strong>Successful Message: </strong> <?php echo($_SESSION['mess']); ?></div>
<?php }
elseif($_SESSION['errtype'] == 3)
{ ?>
<div class="warning"><strong>Warning Message: </strong> <?php echo($_SESSION['mess']); ?></div>
<?php }
elseif($_SESSION['errtype'] == 4)
{
?>
<div class="info"><strong>Info Message: </strong> <?php echo($_SESSION['mess']); ?></div>
<?php }
unset($_SESSION['errtype']);
unset($_SESSION['mess']);
}
?>
</div>
<div id="homewrapper"><?PHP
if($pages == '0')
{
?>
<div id="welcomenote"><?PHP echo($config_row['welcomenote']); ?></div>
<?PHP } ?>
<div id="category">
<ul>
<li><div id="image"><img src="<?PHP echo($gf->GetSeoURL('images/beauty.png')); ?>" title="Eyebrow Threading" width="100%" height="100%" ></div>
<div id="text">
Beauty & Hair Salon</div>
</li>
<li><div id="image"><img src="<?PHP echo($gf->GetSeoURL('images/nails.jpg')); ?>" width="100%" height="100%" title="Nails Salon, Spa" name="Nails Salon, Manicure Spa" ></div>
<div id="text">
Nails Salon</div>
</li>
<li><div id="image"><img src="<?PHP echo($gf->GetSeoURL('images/barber.jpg')); ?>" width="100%" height="100%" title="Barber Shop" name="Barber Shop" ></div>
<div id="text">
Barber Shop</div>
</li>
<li><div id="image"><img src="<?PHP echo($gf->GetSeoURL('images/tanning.jpg')); ?>" width="100%" height="100%" title="Tanning Salon" name="Tanning Salon, Tan" ></div>
<div id="text">
Tanning Salon</div>
</li>
<li><div id="image"><img src="<?PHP echo($gf->GetSeoURL('images/spa.jpg')); ?>" title="Day Spa, Massage, Facials, Waxing" name="Day Spa, Spa, Massage, Facials, Body" width="100%" height="100%" ></div>
<div id="text">
Day Spa</div>
</li>
<li><div id="image"><img src="<?PHP echo($gf->GetSeoURL('images/laser-treatment.jpg')); ?>" name="Laser Treatment, Laser Hair Reduction" title="Laser Treatment, Laser Hair Reduction, Laser Pigment Eraser, Laser Tattoo Removal, Laser Toning, Limelight IPL, Thermage" width="100%" height="100%" ></div>
<div id="text">
Laser Treatment</div>
</li>
<li><div id="image"><img src="<?PHP echo($gf->GetSeoURL('images/hair_style.png')); ?>" name="Hair Replacement" title="Wig/unit design, Wig/unit sales, Wig customizing,Styling, Fitting, Coloring, Hair Bonding Attachment" width="100%" height="100%" ></div>
<div id="text">
Hair Replacement</div>
</li>
<li><div id="image"><img src="<?PHP echo($gf->GetSeoURL('images/salon-equipment.jpg')); ?>" width="100%" height="100%" title="Spa & Salon Equipment" name="Spa & Salon Equipment" ></div>
<div id="text">
Salon & Salon Equipment</div>
</li>
<li><div id="image"><img src="<?PHP echo($gf->GetSeoURL('images/job.png')); ?>" name="Salon Jobs" title="Salon Jobs" width="100%" height="100%" ></div>
<div id="text">
Spa & Salon Jobs</div>
</li>
</ul>
</div>
</div>
</div>
<div class="clearfix"></div>
</div>
</body>
</html>
Sure you could write a basic form bomb
while(1)
pcntl_fork();
that will basically create an infinite loop, and each time it loops it will create another infinite loop. That will very quickly bring almost any server to it's knees.
Without looking at your code I couldn't say what part is overloading the server but there are tools to help you find what's taking a long time.
I'd start by looking for any nested loops.