Jump to content

Search the Community

Showing results for tags 'syntax error'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 11 results

  1. Please anyone I changed something on our companies page.php wp website and I broke it. I almost have it up and running but something is still wrong. I think it is just a syntax error but I am not positive here is the code posted below any help would be awsome! <?php switch (get_option(THEMEPREFIX.'_header_style', 0)) { case 0 : get_header(); break; case 1 : get_header('1'); break; case 2 : get_header('2'); break; } ?> <?php curly_get_slider(); ?> <article <?php post_class(); ?> <div class="container page-content"> <div class="row"> <div class="col-lg-12"> <!-- The Content --> <?php while ( have_posts() ) : the_post(); ?> <?php the_content() ?> <?php endwhile; ?> <?php if( get_option(THEMEPREFIX.'_general_sharing_box_pages') == "false" ) : ?> <div class="social-box"> <p><?php echo get_option(THEMEPREFIX.'_general_sharing_box_text'); ?> <span class="pull-right"> <a rel="nofollow" href="http://www.facebook.com/sharer.php?u='<?php echo urlencode(get_permalink()); ?>&t=<?php echo urlencode(get_the_title()); ?>" data-toggle="tooltip" title="Facebook"><?php echo do_shortcode('[icon icon="facebook" boxed="yes"]') ?></a> <a rel="nofollow" href="http://twitthis.com/twit?url=<?php echo urlencode(get_permalink()); ?>" title="Twitter" class="tw tipsy-top"><?php echo do_shortcode('[icon icon="twitter" boxed="yes"]') ?></a> <a rel="nofollow" href="http://linkedin.com/shareArticle?mini=true&url=<?php echo urlencode(get_permalink()); ?>&title=<?php echo urlencode(get_the_title()); ?>" title="Linkedin" class="li tipsy-top"><?php echo do_shortcode('[icon icon="linkedin" boxed="yes"]') ?></a> <a rel="nofollow" href="http://google.com/bookmarks/mark?op=edit&bkmk=<?php echo urlencode(get_permalink()); ?>&title=<?php echo urlencode(get_the_title()); ?>" title="Google" class="gp tipsy-top"><?php echo do_shortcode('[icon icon="google-plus" boxed="yes"]') ?></a> <a rel="nofollow" href="mailto:?subject=<?php urlencode(get_the_title()); ?>&body=<?php echo urlencode(get_permalink()); ?>" title="Email" class="em tipsy-top"><?php echo do_shortcode('[icon icon="envelope" boxed="yes"]') ?></a> </span></p></div><?php endif; ?> <?php if (comments_open()) { if (get_option(THEMEPREFIX.'_fb_comments') != "true" ) : comments_template(); else : ?> <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 = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=233653370014075"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <h3><?php _e('Comments' , 'CURLYTHEME') ?></h3> <div class="fb-comments" data-href="<?php the_permalink(); ?>" data-width="470" data-num-posts="10"> </div> <?php endif; } ?> </div> </div> </article> <?php $curly->footer(); ?>
  2. een experiencing internal error message on my website for some time now. After being sent the error log, i got this; 20150210T084758: www.traditnow.com/index.php PHP Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ',' or ';' in /hermes/bosoraweb136/b1865/ipg.traditnowcom/wp-content/themes/classipress/includes/functions.php on line 1079 I eventually found the line of code but could not figure out where the error is. echo $currentBefore . __( 'Ads tagged with', APP_TD ) . ' '' . single_tag_title('', false) . ''' . $currentAfter; please help me anybody. i wouldn't mind if someone will help rewrite it. Any one please... echo $currentBefore . __( 'Ads tagged with', APP_TD ) . ' '' . single_tag_title('', false) . ''' . $currentAfter; Thank you
  3. I have a error in line 24 on my code Code error on website: Parse error: syntax error, unexpected T_FUNCTION, expecting ')' in /core/init.php on line 24 Here's the code: <?php session_start(); $GLOBALS['config'] = array( 'mysql' => array( 'host' => 'i added my host here', 'username' => 'i added my username', 'password' => 'and pass', 'db' => 'and password' ), 'remember' => array( 'cookie_name' => 'hash', 'cookie_expiry' => 604800 ), 'session' => array( 'session_name' => 'users', 'token_name' => 'token' ) ); error here: spl_autoload_register(function($class) { require_once 'classes/' . $class . '.php'; }); require_once 'functions/sanatize.php'; I don't know what it means by the error. But its around where i said the error is.
  4. Hey, I just started using WordPress - I'm a complete newbie, and am super perplexed by this error I'm getting in functions.php. I'm hoping I am just making a simple mistake, but I'd really appreciate some suggestions as to what the issue is. The error: Parse error: syntax error, unexpected T_VARIABLE in /homepages/33/d123623052/htdocs/rap3/wp-content/themes/business-turnkey/functions.php on line 196 That line would be at the very bottom of my code. From what I can tell, this error occurs when the code is missing a punctuation mark like a [ ( { , ' etc. I've been looking over the code for ages, and from what I can see all the brackets have a matching end, there's no out of place punctuation. <?php define('THEME_URI', get_stylesheet_directory_uri()); define('THEME_IMAGES', THEME_URI . '/assets/img'); define('THEME_CSS', THEME_URI . '/assets/css'); define('THEME_JS', THEME_URI . '/assets/js'); define('THEME_TEMPLATES', THEME_URI . '/assets/templates'); $GLOBALS['content_width'] = 900; /* Define Theme Defaults */ $options = get_option('turnkey_theme_options'); if($options['templatestyle'] == null) $options['templatestyle'] = 'modern'; if($options['typography'] == null) $options['typography'] = 'typography1'; function turnkeySlider() { $options = get_option('turnkey_theme_options'); if($options['sliderTimer'] != null) $rotateTimer = $options['sliderTimer']; else $rotateTimer = 5000; ?> <script type="text/javascript" charset="utf-8"> jQuery(document).ready(function($) { $('.slide-container').cycle({ fx: 'scrollHorz',next: '#slide-nav .next',prev: '#slide-nav .prev',pause: 1, timeout:<?php echo $rotateTimer; ?>}); }); </script> <?php } add_action('wp_head', 'turnkeySlider'); require_once ( get_stylesheet_directory() . '/theme-options.php' ); require_once ( 'slider/turnkey-slider.php' ); if (function_exists('register_sidebar')) { register_sidebar(array( 'name'=> 'Homepage Widgets', 'id' => 'homepage_widgets', 'before_widget' => '<div class="widget group %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' )); register_sidebar(array( 'name'=> 'Sidebar 1', 'id' => 'sidebar_1', 'before_widget' => '<div class="widget group %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>' )); register_sidebar(array( 'name'=> 'Sidebar 2', 'id' => 'sidebar_2', 'before_widget' => '<div class="widget group %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4>', 'after_title' => '</h4>' )); register_sidebar(array( 'name'=> 'Footer Widgets', 'id' => 'footer-widgets', 'before_widget' => '<div class="widget group %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3>', 'after_title' => '</h3>' )); } if ( function_exists( 'register_nav_menus' ) ) { register_nav_menus( array( 'turnkey_mainnav' => 'TurnKey Main Navigation', 'turnkey_secondary' => 'TurnKey Secondary Navigation' ) ); }; add_theme_support( 'post-thumbnails' ); // Makes Sure thumbnails show up in RSS function do_post_thumbnail_feeds($content) { global $post; if(has_post_thumbnail($post->ID)) { $content = '<div>' . get_the_post_thumbnail($post->ID) . '</div>' . $content; } return $content; } add_filter('the_excerpt_rss', 'do_post_thumbnail_feeds'); add_filter('the_content_feed', 'do_post_thumbnail_feeds'); // Define Thumbnail Images Sizes if ( function_exists( 'add_image_size' ) ) { add_image_size( 'post-thumb-threecol', 390, 200, true ); add_image_size( 'post-thumb-onetwocol', 520, 200, true ); /* Slide Image */ add_image_size( 'special', 580, 340, true ); } if ( !is_admin() ) { // instruction to only load if it is not the admin area function googlejquery() { wp_deregister_script( 'jquery' ); wp_register_script( 'jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'); } add_action('init', 'googlejquery'); wp_register_script('functions', get_bloginfo('template_directory') . '/assets/js/functions.js'); wp_register_script('cycle', get_bloginfo('template_directory') . '/assets/js/cycle.min.js'); wp_register_script('lightbox', get_bloginfo('template_directory') . '/assets/js/lightbox_me.js'); // enqueue the script wp_enqueue_script('jquery'); wp_enqueue_script('functions'); wp_enqueue_script('cycle'); wp_enqueue_script('lightbox'); }; function the_breadcrumb() { if (!is_home()) { echo '<a href="'; echo get_option('home'); echo '">'; bloginfo('name'); echo "</a> » "; if (is_category() || is_single()) { the_category('title_li='); if (is_single()) { echo " » "; the_title(); } } elseif (is_page()) { echo " <span class='current'> "; echo the_title(); echo " </span> "; } } } function rap_register_sidebars() { register_sidebar(array( 'name' => 'Scheduling campaign sidebar', 'id' => 'rap-scheduling-sidebar', 'description' => 'Sidebar for Scheduling Campaign template pages only.', 'before_widget' => '<div class="widget">', 'after_widget' => '</div>', 'before_title' => '<h2 class="widget-title">', 'after_title' => '</h2>' )); } // Add Automatic Feed Links add_theme_support('automatic-feed-links'); add_filter('widget_text', 'do_shortcode'); add_action('widgets_init', 'rap_register_sidebars'); // Below added by Jessica 6/24/13 to display Salesforce lookup fields on Gravity Forms field mapping page add_filter('gf_salesforce_skip_reference_types', '__return_false'); // Below added by Jessica to change the field value on the Join Us and Training forms add_action("gform_pre_submission_1", "pre_submission_JoinUs"); add_action("gform_pre_submission_8", "pre_submission_Training"); add_action("gform_pre_submission_15", "pre_submission_HCAP"); function pre_submission_JoinUs($form){ if ($_POST["input_15"] == 'Former Retail Worker') $_POST["input_15"] = 'Retail Worker'; } function pre_submission_Training($form){ if ($_POST["input_18"] == 'Former Retail Worker') $_POST["input_18"] = 'Retail Worker'; } function pre_submission_HCAP($form){ if ($_POST["input_15"] == 'Former Retail Worker') $_POST["input_15"] = 'Retail Worker'; } ?>
  5. I just edited the tablerate.php in magento, and now I am getting this error, but I don't know what's wrong. Anybody here can help me? The error message reads "Parse error: syntax error, unexpected '*', expecting function (T_FUNCTION) in /home/echoshom/public_html/app/code/core/Mage/Shipping/Model/Carrier/Tablerate.php on line 50" Attached is tablerate.php Tablerate.php
  6. Hi i tried to fix something but ended up screwing something up.Ive got a problem and i dont know how to fix it. Down here u can see the code. the error im getting is "Parse error: syntax error, unexpected end of file." Could someone please help me? Syntax: [ Download ] [ Hide ] [ Select ] [ Expand ] <?php phpinfo(); ?> <?php /* Template Name: Home page */ get_header(); if(have_posts()){ while(have_posts()){ the_post(); $title=get_the_title(); $pageId=get_the_ID(); $subtitle=get_post_meta($pageId, 'subtitle_value', true); $slider=get_post_meta($pageId, 'slider_value', true); include(TEMPLATEPATH . '/includes/page-header.php'); ?> <div id="content-container" class="center"> <!--content--> <?php the_content(); { } ?> <?php for($i=1; $i<=3; $i++){ $suf=$i==3?'-3':''; } ?> <div class="services-box three-columns<?php echo $suf; ?>"> <h4><span><?php echo get_opt('_home_box_title'.$i); ?></span></h4> <?php echo get_opt('_home_box_desc'.$i); ?> <br/> <img src="<?php echo get_opt('_home_box_icon'.$i); ?>" alt="img" /> <a href="<?php echo get_opt('_home_box_btn_link'.$i); ?>" class="button"><span><?php echo get_opt('_home_box_btn_text'.$i); ?></span></a> </div> </div> <?php get_footer(); ?>
  7. My error happens on line #81 My error: Parse error: syntax error, unexpected 'class' (T_CLASS), expecting function (T_FUNCTION) in w06c02cxx.php on line 81 Troubleshooting notes: I've been reviewing this exercise throughout the weekend trying to find my error. I've used my code editors syntax highlighting tools (BBedit 10), but still the error persists. I learned about the 20/20/20 rule during this process and have practiced that while attempting to debug the code. I've scoured the web trying to find examples to help me, but i'm a new and nothing i've thus found has helped me to resolve my error, hoping someone here can help. I think the error is happening in my survey class, somewhere before line #81 Link to error: http://zephir.seattlecentral.edu/~jstein11/itc250/z14/surveys/w06c02cxx.php require '../inc_0700/config_inc.php'; #provides configuration, pathing, error handling, db credentials $config->titleTag = smartTitle(); #Fills <title> tag. If left empty will fallback to $config->titleTag in config_inc.php $config->metaDescription = smartTitle() . ' - ' . $config->metaDescription; //END CONFIG AREA ---------------------------------------------------------- get_header(); #defaults to header_inc.php $mySurvey = new Survey(1);//all our code happens in here if ($mySurvey->isValid){ echo ' The title of the surevis is ' . $mySurvey->Title . ' <br />'; echo ' The title of the surevis is ' . $mySurvey->Description . ' <br />'; }else{echo ' No such survey exists';} dumpDie($mySurvey); //like var_dump inside/available this app because of common file get_footer(); #defaults to footer_inc.php class Survey{//class creates one object at a time, creates as many as you want //create properties public $SurveyID = 0; public $Title = ''; public $Description = ''; public $isValid = FALSE; public $Questions = array();// how we add an array of questions to a survey function __construct($id){ $id = (int)$id; //cast to an integer - stops most sequal injection in this case if($id == 0){ return false; //don't bother asking database, there is no frog, don't ask - no data no dice } $sql = "select Title, Description, SurveyID from sp14_surveys where SurveyID = $id"; $result = mysqli_query(IDB::conn(),$sql) or die(trigger_error(mysqli_error(IDB::conn()), E_USER_ERROR)); //echo '<div align="center"><h4>SQL STATEMENT: <font color="red">' . $sql . '</font></h4></div>'; if(mysqli_num_rows($result) > 0) {#there are records - present data while($row = mysqli_fetch_assoc($result)) {# pull data from associative array $this->SurveyID = (INT)$row['SurveyID']; $this->Title = $row['Title']; $this->Description = $row['Description']; } $this->isValid = TRUE; } @mysqli_free_result($result);//at symbol surpresses multiple copies of an error silences a line basically $sql = "select * from sp14_questions where Survey14 = $id"; $result = mysqli_query(IDB::conn(),$sql) or die(trigger_error(mysqli_error(IDB::conn()), E_USER_ERROR)); if(mysqli_num_rows($result) > 0) {#there are records - present data while($row = mysqli_fetch_assoc($result)) {# pull data from associative array $this->Questions[] = new Question((INT)$row['QuestionID'],$row['Question'],$row['Description']); } }//end of constructor }//end of survey class //BEGIN new question object class Question{ public $QuestionID = 0; public $Text = ''; public $Description = ''; function __construct($QuestionID, $Question, $Description){ $this->QuestionID = $QuestionID; $this->Question = $Question;// field is named Question $this->Description = $Description;// the context info about the question asked }//END question Constructor }// END question Class } w06c02cxx.php
  8. Hi I need to make a quety using between because i need to check if a classroom is reserved between two differents time idtempoInicio and idTempoFim this is my query SELECT `idsala`, `idtempoInicio`, `idTempoFim`, `data` FROM `req_material_reserva` WHERE `idsala` = 3 AND `idtempoInicio` BETWEEN = 12 AND `idTempoFim` = 12 AND `data` = "2014-05-05" Error Code: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where `idtempoInicio` between = 12 AND `idTempoFim` = 12 AND `data` = "2014-05-0' at line 1 any help please??
  9. Hi Everyone, This should just be a quick fix but I can't find what I have done wrong - Parse error: syntax error, unexpected '$error' (T_VARIABLE) in... on line 30. Here is the code class database_action { function __construct($value, $ssl = false){ $mysql_credentials = array('host' => "localhost", 'database_username' => "root", 'database_password' => "", 'database_name' => "test", 'table_name' => "test"); // New MySQLi Connection Object if(isset($ssl) && $ssl == true){ $mysqli = new mysqli("https://".$mysql_credentials['host'],$mysql_credentials['database_username'],$mysql_credentials['database_password'],$mysql_credentials['database_name']); } else { $mysqli = new mysqli($mysql_credentials['host'],$mysql_credentials['database_username'],$mysql_credentials['database_password'],$mysql_credentials['database_name']); } // Check for MySQLi Error if($mysqli -> connect_error()){ exit('MySQL Connection Error: ('.$mysqli -> connect_errno().')'.$mysqli -> connect_error()); $error = $mysqli -> connect_errno().' - '.$mysqli -> connect_error(); } // MySQLi Query $sql_statement = $mysqli -> stmt_init(); if($sql_statement = $mysqli -> prepare('INSERT INTO test VALUES(`?`)')){ $sql_statement -> bind_param('s',$value); $sql_statement -> execute(); if(isset($sql_statement -> $error) || isset($sql_statement -> $errno)){ $sql_error = $sql_statement -> $errno.' - '.$sql_statement -> $error; } $sql_statement -> close(); } else { $sql_error = $sql_statement -> $errno.' - '.$sql_statement -> $error; } $mysqli -> close(); // Return $errors or $sql_error if set otherwise return success if(isset($this -> $error)){ return $this -> $error; } elseif(isset($this -> $sql_error)){ return $this -> $sql_$error } else { return true; } } } Thanks, Timothy $value = 'test'; new database_action($value);
  10. Hello i am getting this error message, please help me to correct it : Invalid query: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'table (id, name, description, linkdown, pubsite, category, image, os) VALUES ('' at line 1 The code is as follows : <?php /// In order /// you /// information in this file: /// Copyright 2012 /// All rights reserved. include("connect.php"); $name = trim(mysql_real_escape_string($_POST["name"])); $description = trim(mysql_real_escape_string($_POST["description"])); $linkdown = trim(mysql_real_escape_string($_POST["linkdown"])); $pubsite = trim(mysql_real_escape_string($_POST["pubsite"])); $category = trim(mysql_real_escape_string($_POST["category"])); $image = trim(mysql_real_escape_string($_POST["image"])); $os = trim(mysql_real_escape_string($_POST["os"])); $results = mysql_query("INSERT INTO table (id, name, description, linkdown, pubsite, category, image, os) VALUES ('', '$name', '$description', '$linkdown', '$pubsite', '$category', '$image', '$os')"); if($results) { echo "Successfully Added"; } else { die('Invalid query: '.mysql_error()); } ?> <a href="index.php">Back to index</a>
  11. <?php // Register Widgetized Areas if(function_exists('register_sidebar')) { register_sidebar(array( 'name' => 'Sidebar', 'before_widget' => '<div class="widget">', 'after_widget' => '</div>', 'before_title' => '<h3 class="sidebar-widget-title"><span>', 'after_title' => '</span></h3>', )); register_sidebar(array( 'name' => 'Magazine', 'before_widget' => '<div class="magazine-widget">', 'after_widget' => '</div><div class="clear"></div>', 'before_title' => '<div class="widget-line-title"><h3>', 'after_title' => '</h3></div>', )); register_sidebar(array( 'name' => 'Footer 1', 'before_widget' => '<div class="widget-footer">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-footer-title">', 'after_title' => '</h3>', )); register_sidebar(array( 'name' => 'Footer 2', 'before_widget' => '<div class="widget-footer">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-footer-title">', 'after_title' => '</h3>', )); register_sidebar(array( 'name' => 'Footer 3', 'before_widget' => '<div class="widget-footer">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-footer-title">', 'after_title' => '</h3>', )); register_sidebar(array( 'name' => 'Footer 4', 'before_widget' => '<div class="widget-footer">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-footer-title">', 'after_title' => '</h3>', )); } // Add post format add_theme_support('post-formats', array('gallery', 'audio', 'video')); // Remove Gallery Styling add_filter( 'gallery_style', 'my_gallery_style', 99 ); function my_gallery_style() { return "<div id='gallery'>"; } /* function SearchFilter($query) { if ($query->is_search) { $query->set('post_type', array( 'post', 'reviews')); } return $query; } add_filter('pre_get_posts','SearchFilter'); */ // Add post thumbnail functionality if ( function_exists( 'add_theme_support' ) ) { add_theme_support('post-thumbnails', array('post','reviews','gallery','portfolio')); add_image_size('carousel-thumb', 130, 90, true); add_image_size('big-post-thumb', 300, 150, true); add_image_size('small-post-thumb', 75, 60, true); add_image_size('related-thumb', 140, 90, true); add_image_size('big-nivo-thumb', 1000, 400, true); add_image_size('small-nivo-thumb', 620, 340, true); add_image_size('featured-thumb', 620, 270, true); add_image_size('featured-thumb', 940, 500, true); add_image_size('full-featured-thumb', 1000, 500, true); add_image_size('blog1-thumb', 300, 160, true); add_image_size('gallery-image', 140, 140, true); add_image_size('portfolio1-thumb', 300, 180, true); add_image_size('portfolio2-thumb', 220, 130, true); } // Widgets include_once('panel/widgets/1-column-magazine-widget.php'); include_once('panel/widgets/2-column-magazine-widget.php'); include_once('panel/widgets/recent-posts-widget.php'); include_once('panel/widgets/tabs-sidebar-widget.php'); include_once('panel/widgets/facebook-like-widget.php'); include_once('panel/widgets/tweets-widget.php'); include_once('panel/widgets/flickr-widget.php'); include_once('panel/widgets/carousel-magazine-widget.php'); include_once('panel/widgets/social-widget.php'); include_once('panel/widgets/search-widget.php'); include_once('panel/widgets/adds300x250-widget.php'); include_once('panel/widgets/adds620x90-widget.php'); include_once('panel/widgets/latest-reviews.php'); include_once('panel/widgets/social-counter-widget.php'); include_once('panel/widgets/video-widget.php'); // UI Panel Options include_once('panel/panel-options.php'); // Metaboxes include_once('panel/metaboxes/metaboxes.php'); // Profile Metaboxes include_once('panel/profile.php'); // Shortcodes include_once('panel/shortcodes/shortcodes.php'); // Include reedwan framework file for the backstreet theme panel include_once('panel/reedwan-framework.php'); // Translation load_theme_textdomain('Backstreet', get_template_directory() . '/languages'); // Adds RSS feeds link if(!get_option('reedwan_feedburner')) { add_theme_support('automatic-feed-links'); } ////////////////////////////////////////////////////////////////// // Register reviews post type ////////////////////////////////////////////////////////////////// add_action( 'init', 'register_reviews_post_type' ); function register_reviews_post_type() { register_post_type( 'reviews', array( 'labels' => array( 'name' => __( 'Reviews' ), 'singular_name' => __( 'Review' ), 'add_new' => __( 'Add New' ), 'add_new_item' => __( 'Add New Review' ), 'edit' => __( 'Edit' ), 'edit_item' => __( 'Edit Review' ), 'new_item' => __( 'New Review' ), 'view' => __( 'View Review' ), 'view_item' => __( 'View Review' ), 'search_items' => __( 'Search Reviews' ), 'not_found' => __( 'No reviews found' ), 'not_found_in_trash' => __( 'No reviews found in Trash' ), 'parent' => __( 'Parent Review' ), ), 'public' => true, 'show_ui' => true, 'has_archive' => true, 'publicly_queryable' => true, 'show_in_nav_menus' => false, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => array('slug'=>'review'), 'supports' => array('title', 'editor', 'thumbnail', 'comments', 'author'), ) ); flush_rewrite_rules(); } ////////////////////////////////////////////////////////////////// // Register reviews category taxonomy ////////////////////////////////////////////////////////////////// add_action( 'init', 'create_review_category', 0 ); function create_review_category() { $labels = array( 'name' => _x( 'Review Categories', 'taxonomy general name' ), 'singular_name' => _x( 'Review Category', 'taxonomy singular name' ), 'search_items' => __( 'Search Review Categories' ), 'all_items' => __( 'All Review Categories' ), 'parent_item' => __( 'Parent Review Category' ), 'parent_item_colon' => __( 'Parent Review Category:' ), 'edit_item' => __( 'Edit Review Category' ), 'update_item' => __( 'Update Review Category' ), 'add_new_item' => __( 'Add New Review Category' ), 'new_item_name' => __( 'New Review Category Name' ), 'menu_name' => __( 'Categories' ), ); register_taxonomy('review_category',array('reviews'), array( 'public' => true, 'show_in_nav_menus' => true, 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'query_var' => true, )); } ////////////////////////////////////////////////////////////////// // Register gallery post type ////////////////////////////////////////////////////////////////// add_action( 'init', 'register_gallery_post_type' ); function register_gallery_post_type() { register_post_type( 'gallery', array( 'labels' => array( 'name' => __( 'Gallery' ), 'singular_name' => __( 'Gallery' ), 'add_new' => __( 'Add New' ), 'add_new_item' => __( 'Add New Gallery' ), 'edit' => __( 'Edit' ), 'edit_item' => __( 'Edit Gallery' ), 'new_item' => __( 'New Gallery' ), 'view' => __( 'View Gallery' ), 'view_item' => __( 'View Gallery' ), 'search_items' => __( 'Search Gallery' ), 'not_found' => __( 'No gallery found' ), 'not_found_in_trash' => __( 'No gallery found in Trash' ), 'parent' => __( 'Parent Gallery' ), ), 'public' => true, 'show_ui' => true, 'has_archive' => true, 'publicly_queryable' => true, 'show_in_nav_menus' => false, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => array('slug'=>'gallery'), 'supports' => array('title', 'editor', 'thumbnail'), ) ); flush_rewrite_rules(); } ////////////////////////////////////////////////////////////////// // Register portfolio post type ////////////////////////////////////////////////////////////////// add_action( 'init', 'register_portfolio_post_type' ); function register_portfolio_post_type() { register_post_type( 'portfolio', array( 'labels' => array( 'name' => __( 'Portfolio' ), 'singular_name' => __( 'Portfolio' ), 'add_new' => __( 'Add New' ), 'add_new_item' => __( 'Add New Portfolio' ), 'edit' => __( 'Edit' ), 'edit_item' => __( 'Edit Portfolio' ), 'new_item' => __( 'New Portfolio' ), 'view' => __( 'View Portfolio' ), 'view_item' => __( 'View Portfolio' ), 'search_items' => __( 'Search Portfolio' ), 'not_found' => __( 'No portfolio found' ), 'not_found_in_trash' => __( 'No portfolio found in Trash' ), 'parent' => __( 'Parent Portfolio' ), ), 'public' => true, 'show_ui' => true, 'has_archive' => true, 'publicly_queryable' => true, 'show_in_nav_menus' => false, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => array('slug'=>'portfolio'), 'supports' => array('title', 'editor', 'thumbnail'), ) ); flush_rewrite_rules(); } ////////////////////////////////////////////////////////////////// // Register portfolio category taxonomy ////////////////////////////////////////////////////////////////// add_action( 'init', 'create_portfolio_category', 0 ); function create_portfolio_category() { $labels = array( 'name' => _x( 'Portfolio Categories', 'taxonomy general name' ), 'singular_name' => _x( 'Portfolio Category', 'taxonomy singular name' ), 'search_items' => __( 'Search Portfolio Categories' ), 'all_items' => __( 'All Portfolio Categories' ), 'parent_item' => __( 'Parent Portfolio Category' ), 'parent_item_colon' => __( 'Parent Portfolio Category:' ), 'edit_item' => __( 'Edit Portfolio Category' ), 'update_item' => __( 'Update Portfolio Category' ), 'add_new_item' => __( 'Add New Portfolio Category' ), 'new_item_name' => __( 'New Portfolio Category Name' ), 'menu_name' => __( 'Portfolio Categories' ), ); register_taxonomy('portfolio_category',array('portfolio'), array( 'public' => true, 'show_in_nav_menus' => true, 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'query_var' => true, )); } // How comments are displayed function reedwan_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID() ?>"> <div class="the-comment"> <div class="alignleft"> <?php echo get_avatar($comment,$size='70'); ?> <div class="clear"></div> <div class="reply-comment"><?php comment_reply_link(array_merge( $args, array('reply_text' => 'Reply', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?></div> </div> <div class="comment-box"> <div class="comment-author"> <span class="name"><?php echo get_comment_author_link() ?></span> <small><?php printf(__('%1$s at %2$s', 'Backstreet'), get_comment_date(), get_comment_time()) ?><a><?php edit_comment_link(__(' Edit','Backstreet')) ?></a></small> </div> <div class="comment-text"> <?php if ($comment->comment_approved == '0') : ?> <em><?php _e('Your comment is awaiting moderation.', 'Backstreet') ?></em> <br /> <?php endif; ?> <?php comment_text() ?> </div> </div> </div> // Related Post function get_related_posts($post_id, $tags = array()) { $query = new WP_Query(); $post_types = get_post_types(); unset($post_types['page'], $post_types['attachment'], $post_types['revision'], $post_types['nav_menu_item']); if($tags) { foreach($tags as $tag) { $tagsA[] = $tag->term_id; } } $query = new WP_Query( array('showposts' => 4,'post_type' => $post_types,'post__not_in' => array($post_id),'tag__in' => $tagsA,'ignore_sticky_posts' => 1, )); return $query; } // Kresi Pagination function kriesi_pagination($pages = '', $range = 2) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { echo "<div class='pagination'>"; if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'><span class='arrows'>«</span> First</a>"; if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'><span class='arrows'>‹</span> Previous</a>"; for ($i=1; $i <= $pages; $i++) { if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) { echo ($paged == $i)? "<span class='current'>".$i."</span>":"<a href='".get_pagenum_link($i)."' class='inactive' >".$i."</a>"; } } if ($paged < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($paged + 1)."'>Next <span class='arrows'>›</span></a>"; if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last <span class='arrows'>»</span></a>"; echo "</div>\n"; } } // Limit Word function string_limit_words($string, $word_limit) { $words = explode(' ', $string, ($word_limit + 1)); if(count($words) > $word_limit) { array_pop($words); } return implode(' ', $words); } <?php // Register Widgetized Areas if(function_exists('register_sidebar')) { register_sidebar(array( 'name' => 'Sidebar', 'before_widget' => '<div class="widget">', 'after_widget' => '</div>', 'before_title' => '<h3 class="sidebar-widget-title"><span>', 'after_title' => '</span></h3>', )); register_sidebar(array( 'name' => 'Magazine', 'before_widget' => '<div class="magazine-widget">', 'after_widget' => '</div><div class="clear"></div>', 'before_title' => '<div class="widget-line-title"><h3>', 'after_title' => '</h3></div>', )); register_sidebar(array( 'name' => 'Footer 1', 'before_widget' => '<div class="widget-footer">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-footer-title">', 'after_title' => '</h3>', )); register_sidebar(array( 'name' => 'Footer 2', 'before_widget' => '<div class="widget-footer">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-footer-title">', 'after_title' => '</h3>', )); register_sidebar(array( 'name' => 'Footer 3', 'before_widget' => '<div class="widget-footer">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-footer-title">', 'after_title' => '</h3>', )); register_sidebar(array( 'name' => 'Footer 4', 'before_widget' => '<div class="widget-footer">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-footer-title">', 'after_title' => '</h3>', )); } // Add post format add_theme_support('post-formats', array('gallery', 'audio', 'video')); // Remove Gallery Styling add_filter( 'gallery_style', 'my_gallery_style', 99 ); function my_gallery_style() { return "<div id='gallery'>"; } /* function SearchFilter($query) { if ($query->is_search) { $query->set('post_type', array( 'post', 'reviews')); } return $query; } add_filter('pre_get_posts','SearchFilter'); */ // Add post thumbnail functionality if ( function_exists( 'add_theme_support' ) ) { add_theme_support('post-thumbnails', array('post','reviews','gallery','portfolio')); add_image_size('carousel-thumb', 130, 90, true); add_image_size('big-post-thumb', 300, 150, true); add_image_size('small-post-thumb', 75, 60, true); add_image_size('related-thumb', 140, 90, true); add_image_size('big-nivo-thumb', 1000, 400, true); add_image_size('small-nivo-thumb', 620, 340, true); add_image_size('featured-thumb', 620, 270, true); add_image_size('featured-thumb', 940, 500, true); add_image_size('full-featured-thumb', 1000, 500, true); add_image_size('blog1-thumb', 300, 160, true); add_image_size('gallery-image', 140, 140, true); add_image_size('portfolio1-thumb', 300, 180, true); add_image_size('portfolio2-thumb', 220, 130, true); } // Widgets include_once('panel/widgets/1-column-magazine-widget.php'); include_once('panel/widgets/2-column-magazine-widget.php'); include_once('panel/widgets/recent-posts-widget.php'); include_once('panel/widgets/tabs-sidebar-widget.php'); include_once('panel/widgets/facebook-like-widget.php'); include_once('panel/widgets/tweets-widget.php'); include_once('panel/widgets/flickr-widget.php'); include_once('panel/widgets/carousel-magazine-widget.php'); include_once('panel/widgets/social-widget.php'); include_once('panel/widgets/search-widget.php'); include_once('panel/widgets/adds300x250-widget.php'); include_once('panel/widgets/adds620x90-widget.php'); include_once('panel/widgets/latest-reviews.php'); include_once('panel/widgets/social-counter-widget.php'); include_once('panel/widgets/video-widget.php'); // UI Panel Options include_once('panel/panel-options.php'); // Metaboxes include_once('panel/metaboxes/metaboxes.php'); // Profile Metaboxes include_once('panel/profile.php'); // Shortcodes include_once('panel/shortcodes/shortcodes.php'); // Include reedwan framework file for the backstreet theme panel include_once('panel/reedwan-framework.php'); // Translation load_theme_textdomain('Backstreet', get_template_directory() . '/languages'); // Adds RSS feeds link if(!get_option('reedwan_feedburner')) { add_theme_support('automatic-feed-links'); } ////////////////////////////////////////////////////////////////// // Register reviews post type ////////////////////////////////////////////////////////////////// add_action( 'init', 'register_reviews_post_type' ); function register_reviews_post_type() { register_post_type( 'reviews', array( 'labels' => array( 'name' => __( 'Reviews' ), 'singular_name' => __( 'Review' ), 'add_new' => __( 'Add New' ), 'add_new_item' => __( 'Add New Review' ), 'edit' => __( 'Edit' ), 'edit_item' => __( 'Edit Review' ), 'new_item' => __( 'New Review' ), 'view' => __( 'View Review' ), 'view_item' => __( 'View Review' ), 'search_items' => __( 'Search Reviews' ), 'not_found' => __( 'No reviews found' ), 'not_found_in_trash' => __( 'No reviews found in Trash' ), 'parent' => __( 'Parent Review' ), ), 'public' => true, 'show_ui' => true, 'has_archive' => true, 'publicly_queryable' => true, 'show_in_nav_menus' => false, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => array('slug'=>'review'), 'supports' => array('title', 'editor', 'thumbnail', 'comments', 'author'), ) ); flush_rewrite_rules(); } ////////////////////////////////////////////////////////////////// // Register reviews category taxonomy ////////////////////////////////////////////////////////////////// add_action( 'init', 'create_review_category', 0 ); function create_review_category() { $labels = array( 'name' => _x( 'Review Categories', 'taxonomy general name' ), 'singular_name' => _x( 'Review Category', 'taxonomy singular name' ), 'search_items' => __( 'Search Review Categories' ), 'all_items' => __( 'All Review Categories' ), 'parent_item' => __( 'Parent Review Category' ), 'parent_item_colon' => __( 'Parent Review Category:' ), 'edit_item' => __( 'Edit Review Category' ), 'update_item' => __( 'Update Review Category' ), 'add_new_item' => __( 'Add New Review Category' ), 'new_item_name' => __( 'New Review Category Name' ), 'menu_name' => __( 'Categories' ), ); register_taxonomy('review_category',array('reviews'), array( 'public' => true, 'show_in_nav_menus' => true, 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'query_var' => true, )); } ////////////////////////////////////////////////////////////////// // Register gallery post type ////////////////////////////////////////////////////////////////// add_action( 'init', 'register_gallery_post_type' ); function register_gallery_post_type() { register_post_type( 'gallery', array( 'labels' => array( 'name' => __( 'Gallery' ), 'singular_name' => __( 'Gallery' ), 'add_new' => __( 'Add New' ), 'add_new_item' => __( 'Add New Gallery' ), 'edit' => __( 'Edit' ), 'edit_item' => __( 'Edit Gallery' ), 'new_item' => __( 'New Gallery' ), 'view' => __( 'View Gallery' ), 'view_item' => __( 'View Gallery' ), 'search_items' => __( 'Search Gallery' ), 'not_found' => __( 'No gallery found' ), 'not_found_in_trash' => __( 'No gallery found in Trash' ), 'parent' => __( 'Parent Gallery' ), ), 'public' => true, 'show_ui' => true, 'has_archive' => true, 'publicly_queryable' => true, 'show_in_nav_menus' => false, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => array('slug'=>'gallery'), 'supports' => array('title', 'editor', 'thumbnail'), ) ); flush_rewrite_rules(); } ////////////////////////////////////////////////////////////////// // Register portfolio post type ////////////////////////////////////////////////////////////////// add_action( 'init', 'register_portfolio_post_type' ); function register_portfolio_post_type() { register_post_type( 'portfolio', array( 'labels' => array( 'name' => __( 'Portfolio' ), 'singular_name' => __( 'Portfolio' ), 'add_new' => __( 'Add New' ), 'add_new_item' => __( 'Add New Portfolio' ), 'edit' => __( 'Edit' ), 'edit_item' => __( 'Edit Portfolio' ), 'new_item' => __( 'New Portfolio' ), 'view' => __( 'View Portfolio' ), 'view_item' => __( 'View Portfolio' ), 'search_items' => __( 'Search Portfolio' ), 'not_found' => __( 'No portfolio found' ), 'not_found_in_trash' => __( 'No portfolio found in Trash' ), 'parent' => __( 'Parent Portfolio' ), ), 'public' => true, 'show_ui' => true, 'has_archive' => true, 'publicly_queryable' => true, 'show_in_nav_menus' => false, 'exclude_from_search' => false, 'hierarchical' => false, 'rewrite' => array('slug'=>'portfolio'), 'supports' => array('title', 'editor', 'thumbnail'), ) ); flush_rewrite_rules(); } ////////////////////////////////////////////////////////////////// // Register portfolio category taxonomy ////////////////////////////////////////////////////////////////// add_action( 'init', 'create_portfolio_category', 0 ); function create_portfolio_category() { $labels = array( 'name' => _x( 'Portfolio Categories', 'taxonomy general name' ), 'singular_name' => _x( 'Portfolio Category', 'taxonomy singular name' ), 'search_items' => __( 'Search Portfolio Categories' ), 'all_items' => __( 'All Portfolio Categories' ), 'parent_item' => __( 'Parent Portfolio Category' ), 'parent_item_colon' => __( 'Parent Portfolio Category:' ), 'edit_item' => __( 'Edit Portfolio Category' ), 'update_item' => __( 'Update Portfolio Category' ), 'add_new_item' => __( 'Add New Portfolio Category' ), 'new_item_name' => __( 'New Portfolio Category Name' ), 'menu_name' => __( 'Portfolio Categories' ), ); register_taxonomy('portfolio_category',array('portfolio'), array( 'public' => true, 'show_in_nav_menus' => true, 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'query_var' => true, )); } // How comments are displayed function reedwan_comment($comment, $args, $depth) { $GLOBALS['comment'] = $comment; ?> <li <?php comment_class(); ?> id="comment-<?php comment_ID() ?>"> <div class="the-comment"> <div class="alignleft"> <?php echo get_avatar($comment,$size='70'); ?> <div class="clear"></div> <div class="reply-comment"><?php comment_reply_link(array_merge( $args, array('reply_text' => 'Reply', 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?></div> </div> <div class="comment-box"> <div class="comment-author"> <span class="name"><?php echo get_comment_author_link() ?></span> <small><?php printf(__('%1$s at %2$s', 'Backstreet'), get_comment_date(), get_comment_time()) ?><a><?php edit_comment_link(__(' Edit','Backstreet')) ?></a></small> </div> <div class="comment-text"> <?php if ($comment->comment_approved == '0') : ?> <em><?php _e('Your comment is awaiting moderation.', 'Backstreet') ?></em> <br /> <?php endif; ?> <?php comment_text() ?> </div> </div> </div> // Related Post function get_related_posts($post_id, $tags = array()) { $query = new WP_Query(); $post_types = get_post_types(); unset($post_types['page'], $post_types['attachment'], $post_types['revision'], $post_types['nav_menu_item']); if($tags) { foreach($tags as $tag) { $tagsA[] = $tag->term_id; } } $query = new WP_Query( array('showposts' => 4,'post_type' => $post_types,'post__not_in' => array($post_id),'tag__in' => $tagsA,'ignore_sticky_posts' => 1, )); return $query; } // Kresi Pagination function kriesi_pagination($pages = '', $range = 2) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { echo "<div class='pagination'>"; if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'><span class='arrows'>«</span> First</a>"; if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'><span class='arrows'>‹</span> Previous</a>"; for ($i=1; $i <= $pages; $i++) { if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems )) { echo ($paged == $i)? "<span class='current'>".$i."</span>":"<a href='".get_pagenum_link($i)."' class='inactive' >".$i."</a>"; } } if ($paged < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($paged + 1)."'>Next <span class='arrows'>›</span></a>"; if ($paged < $pages-1 && $paged+$range-1 < $pages && $showitems < $pages) echo "<a href='".get_pagenum_link($pages)."'>Last <span class='arrows'>»</span></a>"; echo "</div>\n"; } } // Limit Word function string_limit_words($string, $word_limit) { $words = explode(' ', $string, ($word_limit + 1)); if(count($words) > $word_limit) { array_pop($words); } return implode(' ', $words); } // add_filter('widget_text', 'do_shortcode');
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.