Jump to content

Search the Community

Showing results for tags 'parse 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 10 results

  1. 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
  2. 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'; } ?>
  3. 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
  4. can some one help me with this code I'm getting a Parse error: syntax error, unexpected T_ENDWHILE error code on the last line of code. source code below <?php while ( have_posts() ) : the_post(); ?> <h1><?php the_title(); ?></h1> <?php get_template_part( 'content', 'page' ); ?> </div> <?php thinkup_input_allowcomments(); ?> <?php endwhile; wp_reset_query(); ?> <?php $mytrails = new WP_Query(array( 'post_type' => '$mytrails' )); ?> <?php endwhile; ?>
  5. 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(); ?>
  6. I have this parse error but I do not know where exactly the script went wrong. I am trying to put the contents of $new_message into another file that gets created. And yes, the PHP code that is inside $new_message should be there, I want it to also be inserted into the file that gets created. Error: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in D:\Hosting\12059488\html\blog\makepost\makepost.php on line 36 $new_message = "<h1 class=\"title\">$title</h1><p> $post <br><br>-$name <br>$date at $time<br><a href=\"reply.php?n=blogentry$n.php\">Comment</a> <?php session_start(); if($_SESSION[\'USERNAME\'] == \'TEP\') { echo \"<a href=\"../makepost/changepost.php?posts=blogentry$n.php\">Edit</a>\"; } ?></p><hr>\n";
  7. Hello again! having an error issue. Parse error: syntax error, unexpected 'DISTINCT' (T_STRING) in /home/jayden1/public_html/newmembers.php on line 91 <?php $year = (date('Y')); $month = (date('m')); $day = date(('d')- 30); $datecheck = mktime(0,0,0,$month,$day,$year); $new = $mysqli->query(SELECT DISTINCT signupdate FROM profiledata); $signupdate = $new; if(mysql_num_rows($signupdate)>0){ print "<ul>"; while($users=mysql_fetch_array($signupdate)){ print "<li>{$users[0]}</li>"; } ?> i have went through it like 100 times. I know i am missing something somewhere. Anyone know what I forgot?
  8. Please help with that error: Parse error: syntax error, unexpected '$GLOBALS' (T_VARIABLE) in C:\Program Files\EasyPHP-12.1\www\xxxx\admincp\func.php on line 11 here is the code: <?php //include_once "admincp/system_cls.php"; $GLOBALS['sessionhash'] = session_id(); // ###################### escape string. ############### function EscapeString($text) { $text = htmlentities($text, ENT_NOQUOTES, "" . CHARSET . ""); if (!get_magic_quotes_gpc()) { $text = mysql_real_escape_string($text); } return $text; } // ###################### escape string html. ############### function EscapeStringHtml($text) { if (!get_magic_quotes_gpc() AND !get_magic_quotes_runtime()) { $text = mysql_real_escape_string($text); } return $text; } // ################## checks for valid numbers ############## function valid_id($id) { if (preg_match("/^([0-9]+)$/", $id)) { return $id; } else { return '0'; } } function getVal($a) { if ($_POST[$a]) { $ret = EscapeString($_POST[$a]); } else { $ret = EscapeString($_GET[$a]); } return $ret; } //Define function to insert security image function insertSecurityImage($inputname) { $refid = md5(mktime() * rand()); $insertstr = "<img src=\"securityimage.php?refid=" . $refid . "\" alt=\"Security Image\" title=\"Security Image\" /><input type=\"hidden\" name=\"" . $inputname . "\" value=\"" . $refid . "\" />"; return $insertstr; } //Define function to check security image confirmation function checkSecurityImage($referenceid, $enteredvalue) { $db = new DBM; $db->connect(); $referenceid = EscapeString($referenceid); $enteredvalue = EscapeString($enteredvalue); $Q = "SELECT ID FROM " . TABLE_PREFIX . "security_images WHERE referenceid='$referenceid' AND BINARY hiddentext='$enteredvalue'"; //echo $Q; $db->query($Q); if ($db->num_rows()) { return true; } else { return false; } } function DetectLongString($aboutme) { $text = explode(" ", EscapeString($aboutme)); $totalwords = count($text); for ($x = 0; $x < $totalwords; $x++) { if (strlen($text[$x]) > 50) { $text[$x] = wordwrap($text[$x], 50, "<br />", 1); } } $textnormal = implode(" ", $text); return $textnormal; } // ############# make checkbox ##################### // ################################################# function makeCheckbox($value, $gotvalue, $text = "", $extra = "", $name) { $selected = ($value == $gotvalue) ? "checked=\"checked\"" : ""; $option = ($text != "") ? $text : $value; $option .= " <input type=\"checkbox\" value=\"$value\" name=\"$name\" $selected $extra />\n"; return $option; } // ############# make checkbox ##################### //################################################# function makeInputbox($value, $name, $extra = '') { $option = " <input type=\"text\" value=\"$value\" name=\"$name\" $extra />\n"; return $option; } // ############# make options ##################### //################################################# function makeOption($value, $gotvalue, $text = "") { $selected = ($value == $gotvalue) ? "selected=\"selected\"" : ""; $option = "<option value=\"$value\" $selected>"; if ($text) { $option .= $text . "</option>\n"; } else { $option .= $value . "</option>\n"; } return $option; } // ############# make Radio ##################### //################################################# function makeRadio($value, $gotvalue, $text = "", $extra = "", $name, $class) { $selected = ($value == $gotvalue) ? "checked=\"checked\"" : ""; $optiont = ($text != "") ? $text : $value; $option .= "<label class=\"$class\" for=\"$extra\">$optiont<input id=\"$extra\" type=\"radio\" value=\"$value\" name=\"$name\" $selected /></label>\n"; return $option; } function MakeYearSelect() { $current = date("Y"); do { $selected = ($_POST['year'] == $current) ? "selected=\"selected\"" : ""; $mdate .= "<option value=\"$current\" $selected>$current</option>\n"; $current--; } while ($current >= 1950); return $mdate; } function MakeDateSelect($pre, $year, $month, $day, $type, $err, $ary = '') { global $Months; if (!$type) { $mtime[0] = $year; $mtime[1] = $month; $mtime[2] = $day; } else { $mtime = explode("-", $type); } $mdate = "<select name=\"{$pre}year{$ary}\" errortext=\"$err\">\n"; $mdate .= "<option value=\"\">-------</option>\n"; for ($x = 1900; $x < 2030; $x++) { $selected = ($mtime[0] == $x) ? "selected=\"selected\"" : ""; $mdate .= "<option value=\"$x\" $selected>$x</option>\n"; } $mdate .= "</select> - \n"; $mdate .= "<select name=\"{$pre}month{$ary}\">\n"; $mdate .= "<option value=\"\">-------</option>\n"; for ($y = 1; $y < 13; $y++) { $j = ($y < 10) ? $j = "0$y" : $y; $selected = ($mtime[1] == $y) ? "selected=\"selected\"" : ""; $mdate .= "<option value=\"$j\" $selected>" . date('F', mktime(0, 0, 0, $j, 1, date('Y'))) . "</option>\n"; } $mdate .= "</select> - \n"; $mdate .= "<select name=\"{$pre}day{$ary}\">\n"; $mdate .= "<option value=\"\">-------</option>\n"; for ($z = 01; $z < 32; $z++) { $j = ($z < 10) ? $j = "0$z" : $z; $selected = ($mtime[2] == $z) ? "selected=\"selected\"" : ""; $mdate .= "<option value=\"$j\" $selected>$z</option>\n"; } $mdate .= "</select>"; return $mdate; } function EscapeWord($search) { $searchword = EscapeString($search); $query = ereg_replace("[\n,]", " ", $searchword); $query = str_replace(". ", " ", $query); $query = preg_replace("/[\(\)\"':;\[\]!#{}_\-+\\\\]/s", "", $query); $query = ereg_replace("( ){2,}", " ", $query); $query = trim($query); $querywc = str_replace("%", "\\%", $query); $querywc = str_replace("_", "\\_", $querywc); $querywc = str_replace("*", "%", $querywc); $querywc = preg_replace("/(%){1,}/s", '%', $querywc); return $querywc; } function SendUserEmail($to, $subject, $mailmsg) { // sends email to users after registration is complete global $name_of_site; $signupEmail = "<html><head></head><body>"; $signupEmail .= $mailmsg; $signupEmail .= "</body></html>"; $header = "From: $name_of_site <" . FROM . ">\r\nContent-type: text/html; charset=" . CHARSET . "\n"; if (!mail($to, $subject, $signupEmail, $header)) { echo "Mail Failed"; } } function ErrorEmail($subject, $postvars, $message) { global $name_of_site; while (list($key, $value) = each($postvars)) { $message .= "[$key] => $value\r\n"; } $message .= "\r\n----Variables sent from Payment Module script----\r\n"; $header = "From: $name_of_site Payment Module <" . FROM . ">\r\n"; mail(FROM, $subject, $message, $header); } function gettotalusers() { global $_db; $datecut = time() - 600; $_db->query("SELECT COUNT(*) AS sessions FROM " . TABLE_PREFIX . "session WHERE lastactivity>{$datecut} and userid=0"); $loggedins = $_db->_fetch_row('DB_FETCH_ASSOC'); ; $numberguest = $loggedins['sessions']; $totalusers = "There are ($numberguest) Guests online right now."; return $totalusers; } function gettotalbuyers() { global $_db; $datecut = time() - 600; $_db->query("SELECT COUNT(*) AS sessions FROM " . TABLE_PREFIX . "session WHERE lastactivity>{$datecut} and userid!=0"); $loggedins = $_db->_fetch_row('DB_FETCH_ASSOC'); $numberbuyers = $loggedins['sessions']; $totalbuyers = "There are ($numberbuyers) Users online right now."; return $totalbuyers; } function CleanSessionTbl() { global $db; $db2 = new DBM; $db->connect(); $newsess_time = time() - 3600; // one hour $sql1 = "SELECT lastactivity FROM " . TABLE_PREFIX . "session WHERE lastactivity <= '$newsess_time'"; $get_session = $db->query($sql1); if ($db->num_rows()) { $db2->connect(); while ($old = $db->_fetch_row('DB_FETCH_ASSOC')) { $sql = "DELETE FROM " . TABLE_PREFIX . "session WHERE lastactivity = '" . $old['lastactivity'] . "'"; $del_session = $db2->query($sql); } if ($del_session) { @$db->free_result(); @$db2->free_result(); } } } function VerifySession() { if ((isset($_COOKIE["oid"]) AND !empty($_COOKIE["oid"]) AND isset($_SESSION['oid']) == $_COOKIE["oid"])) { if ($_SESSION["sessionhash"] == $_COOKIE["sess"]) { return true; } else { $_SESSION = array(); return false; } } else { return false; } } function LookupCountry($id) { $db = new DBM; $db->connect(); $sql = "select printable_name from " . TABLE_PREFIX . "country where country_id = '$id'"; $db->query($sql); if ($db->num_rows()) { $rows = $db->_fetch_row('DB_FETCH_ASSOC'); return $rows['printable_name']; } } function CreateJsString() { global $countryid, $ChooseStateProvince; $db = new DBM; $db->connect(); $listing = " <!-- function Fill_Sub1(formf) { var main_select = document.getElementById(formf).country_id; var sub_select = document.getElementById(formf).state_id; if( main_select.options[main_select.selectedIndex].value == 0 ) { sub_select.length = 0; }\n"; if ($countryid != '' AND $countryid != '0') { $selectC = "where country_id = '$countryid'"; } $sql = "select country_id, printable_name from " . TABLE_PREFIX . "country $selectC"; $db->query($sql); $_db2 = new DBM; $_db2->connect(); while ($Row1 = $db->_fetch_row('DB_FETCH_ASSOC')) { $listing .= "if(main_select.options[main_select.selectedIndex].value == \"{$Row1[country_id]}\") { sub_select.length = 0;\n"; $listing .= "sub_select.options[0] = new Option('$ChooseStateProvince');\n"; $listing .= "sub_select.options[0].value = '0';\n"; $sql2 = "select s.state_id, s.printable_name from " . TABLE_PREFIX . "state s where s.country_id='{$Row1[country_id]}' order by printable_name "; $rs2 = $_db2->query($sql2); //$selectedctrl=0; $ctr1 = 1; while ($Row2 = $_db2->_fetch_row('DB_FETCH_ASSOC')) { //$listing .= "alert('$Row2[modelname]');"; $listing .= "sub_select.options[$ctr1] = new Option('{$Row2[printable_name]}');\n"; $listing .= "sub_select.options[$ctr1].value = '{$Row2[state_id]}';\n"; if ($_POST['state_id'] == $Row2['state_id']) { $selectedctrl3 = $ctr1; $listing .= "sub_select.options[$selectedctrl3].selected=true;\n"; } else { $selectedctrl3 = 0; } $ctr1++; } $listing .= "} else \n"; } $listing .= " {\n"; $listing .= " sub_select.length = 0;\n"; $listing .= " sub_select.options[0] = new Option('$ChooseStateProvince');\n"; $listing .= " sub_select.options[0].value = '0';\n"; $listing .= "}\n"; $listing .= " }\n"; $listing .= "Fill_Sub1('{$_GET['fn']}'); -->\n"; return $listing; } if (!file_exists(FULL_PATH . "/install.php")) { $datecut = time() - 600; $_db = new DBM; $_db->connect(); $loggedins = $_db->query_first("SELECT COUNT(*) AS sessions FROM " . TABLE_PREFIX . "session WHERE lastactivity>{$datecut}"); $numberguest = $loggedins['sessions']; $Cartotal = $_db->query_first("select COUNT(cid) AS Total from " . TABLE_PREFIX . "car_mst where cstatus = 'A'"); $total_cars = $Cartotal['Total']; // lets start poll class only for user, not admin $CarInfo = new Cars($db); $CarInfo->GetMostPopular(); if (!eregi("admincp", $_SERVER['REQUEST_URI'])) { $db = new DBM; $Booth = &new Booth($db); if ($SystemInfo->_systemstatus['Display_Poll'] == 'A') { $Poll = $Booth->display_booth(); } } $SystemInfo->GetVersion(); require_once (FULL_PATH . "/sponsor_cls.php"); if (!$GLOBALS['noshutdownfunc']) { register_shutdown_function("CleanSessionTbl"); } } elseif (!eregi("install", $_SERVER['REQUEST_URI']) AND !eregi("install", $_SERVER['PHP_SELF'])) { echo "Please delete the install.php file"; exit; } include_once 'global.php'; ?>
  9. Thank you to everyone who is taking the time to read my post and help me. Brief - I want the user to enter their eMail into the form and submit it to signup.php; the PHP file will do the following: Generate a random User_ID that is 16 characters long. Check the database to make sure the Unque_ID does not exist. If it does exists the script will generate another random User_ID and attempt again . If it does NOT exist the PHP script will continue. Check the database to make sure the eMail does not exists. If it does exists the fuction will not create a new account and displays "eMail already exists." If it does NOT exists then the script will continue. The PHP script will add the informtion to the table named "eMail" as a new entry. I keep getting this error: Parse error: syntax error, unexpected T_FUNCTION in /home/diamon79/public_html/signup.php on line 12 Line 12 is function generateRandomString($User_ID = 16) { The form to submit content: <form action="signup.php" method="post"> eMail: <input type="text" name="eMail"> <input type="submit"> </form> The PHP script the form is posted to: <?php $con = mysql_connect("localhost","*********","*******"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("diamon79_mysql", $con); $eMail == '$_POST[eMail]' function generateRandomString($User_ID = 16) { return substr(str_shuffle("0123456789"), 0, $User_ID); } $searchquery = "SELECT * FROM eMail WHERE `Column_A` = '$User_ID'"; $searchresult = mysql_query($searchquery) or die(mysql_error()); if (mysql_num_rows($searchresult) == 0) { eMailCheck(); } // no rows found else { generateRandomString($User_ID = 16); } function eMailCheck() $searcheMailquery = "SELECT * FROM eMail WHERE `Column_B` = '$eMail'"; $searcheMailresult = mysql_query($searcheMailquery) or die(mysql_error()); if (mysql_num_rows($searcheMailresult) == 0) { PostInformation(); } // no rows found else { echo "eMail already exists"; } function PostInformation() $sql="INSERT INTO eMail (User_ID, eMail) VALUES ('$User_ID','$_POST[eMail]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con); ?> I downloaded Notepad++ to be able to debug the script, but I cannot figure out how to use it properly so I am posting here. Thank you. Brett Hartel
  10. <?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.