PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
skynet88
Forum Commoner
Posts: 42 Joined: Tue Apr 20, 2010 5:23 pm
Contact:
Post
by skynet88 » Tue Apr 20, 2010 5:33 pm
i got this message when i open my website:
Parse error: syntax error, unexpected T_ELSE in /home/mrkh4nc/public_html/shortsaleforum.net/wp-includes/query.php on line 2695
and when i checked my php with PHP syntax chechk online it show '2695' is wrong:
Code: Select all
2690: $content = $post->post_content;
2691: if ( $page > 1 )
2692: $more = 1;
2693: $multipage = 1;
2694: $numpages = count($pages);
2695: } else {
2696: $pages[0] = $post->post_content;
2697: $multipage = 0;
2698: }
2699:
2700: do_action_ref_array('the_post', array(&$post));
2701:
2702: return true;
2703: }
2704:
2705:
2706: ?>
anybody can help me?
Benjamin
Site Administrator
Posts: 6935 Joined: Sun May 19, 2002 10:24 pm
Post
by Benjamin » Tue Apr 20, 2010 5:37 pm
Interesting, it's missing braces.
skynet88
Forum Commoner
Posts: 42 Joined: Tue Apr 20, 2010 5:23 pm
Contact:
Post
by skynet88 » Tue Apr 20, 2010 5:47 pm
oh ya thx for the fast feedback... can u show me the correct code? thx in advanced
JAY6390
Forum Newbie
Posts: 20 Joined: Sat Apr 17, 2010 6:51 am
Location: UK
Post
by JAY6390 » Wed Apr 21, 2010 3:21 am
You would need to post the full code for this to be sure of it but I'm thinking the if ( $page > 1 ) thats in this text is actually right (ie the curly braces aren't supposed to be there) since the next line is indented to imply it's just a one line if. If you add a { after the if ( $page > 1 ) does it fix the issue?
skynet88
Forum Commoner
Posts: 42 Joined: Tue Apr 20, 2010 5:23 pm
Contact:
Post
by skynet88 » Sat Apr 24, 2010 11:37 pm
someone please help me..i cannot solve this problem yet
greyhoundcode
Forum Regular
Posts: 613 Joined: Mon Feb 11, 2008 4:22 am
Post
by greyhoundcode » Sun Apr 25, 2010 2:01 am
What version of Wordpress are you using? The code looks somewhat different in my query.php file.
skynet88
Forum Commoner
Posts: 42 Joined: Tue Apr 20, 2010 5:23 pm
Contact:
Post
by skynet88 » Sun Apr 25, 2010 11:28 am
i use 2.9.2 version
skynet88
Forum Commoner
Posts: 42 Joined: Tue Apr 20, 2010 5:23 pm
Contact:
Post
by skynet88 » Mon Apr 26, 2010 7:59 am
up! up! someone please help me...i'm no idea about this prob
skynet88
Forum Commoner
Posts: 42 Joined: Tue Apr 20, 2010 5:23 pm
Contact:
Post
by skynet88 » Wed Apr 28, 2010 8:41 am
up! up! help me please!!
Jonah Bron
DevNet Master
Posts: 2764 Joined: Thu Mar 15, 2007 6:28 pm
Location: Redding, California
Post
by Jonah Bron » Wed Apr 28, 2010 3:20 pm
Did you try putting in the curly brace ( { ) as suggested?
Benjamin
Site Administrator
Posts: 6935 Joined: Sun May 19, 2002 10:24 pm
Post
by Benjamin » Wed Apr 28, 2010 3:30 pm
Since the original author didn't use braces nor indentation correctly, it's hard to say where the missing brace is. So I guessed.
Code: Select all
function setup_postdata($post) {
global $id, $authordata, $day, $currentmonth, $page, $pages, $multipage, $more, $numpages;
$id = (int) $post->ID;
$authordata = get_userdata($post->post_author);
$day = mysql2date('d.m.y', $post->post_date, false);
$currentmonth = mysql2date('m', $post->post_date, false);
$numpages = 1;
$page = get_query_var('page');
if ( !$page )
$page = 1;
if ( is_single() || is_page() || is_feed() )
$more = 1;
$content = $post->post_content;
if ( $page > 1 ) {
$more = 1;
$multipage = 1;
$numpages = count($pages);
} else {
$pages[0] = $post->post_content;
$multipage = 0;
}
do_action_ref_array('the_post', array(&$post));
return true;
}
Also:
Forum Rules 1 1.1 4 wrote:
4. All users of any level are restricted from bumping (
as defined here ) any given thread within twenty-four (24) hours of its last post. Non-trivial posts are not considered bumping. A bump post found in violation will be deleted, and you may or may not receive a warning. Persons bumping excessively be considered as spammers and dealt with accordingly.
skynet88
Forum Commoner
Posts: 42 Joined: Tue Apr 20, 2010 5:23 pm
Contact:
Post
by skynet88 » Thu Apr 29, 2010 6:39 am
thx benjamin..finally,my problem has been solved...sorry for bumping to much in this thread..