Page 1 of 1

Problem with wordpress file, query.php

Posted: Tue Apr 20, 2010 5:33 pm
by skynet88
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?

Re: Problem with wordpress file, query.php

Posted: Tue Apr 20, 2010 5:37 pm
by Benjamin
Interesting, it's missing braces.

Re: Problem with wordpress file, query.php

Posted: Tue Apr 20, 2010 5:47 pm
by skynet88
oh ya thx for the fast feedback... can u show me the correct code? thx in advanced :D

Re: Problem with wordpress file, query.php

Posted: Wed Apr 21, 2010 3:21 am
by JAY6390
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?

Re: Problem with wordpress file, query.php

Posted: Fri Apr 23, 2010 6:16 pm
by skynet88
this is my query.php file...

download here:

http://www.mediafire.com/file/muzrzzzurd1/query.php

someone please correct my query.php file..i really need your assist....thx in advanced.. :)

Re: Problem with wordpress file, query.php

Posted: Sat Apr 24, 2010 11:37 pm
by skynet88
someone please help me..i cannot solve this problem yet :roll:

Re: Problem with wordpress file, query.php

Posted: Sun Apr 25, 2010 2:01 am
by greyhoundcode
What version of Wordpress are you using? The code looks somewhat different in my query.php file.

Re: Problem with wordpress file, query.php

Posted: Sun Apr 25, 2010 11:28 am
by skynet88
i use 2.9.2 version

Re: Problem with wordpress file, query.php

Posted: Mon Apr 26, 2010 7:59 am
by skynet88
up! up! someone please help me...i'm no idea about this prob

Re: Problem with wordpress file, query.php

Posted: Wed Apr 28, 2010 8:41 am
by skynet88
up! up! help me please!! :cry:

Re: Problem with wordpress file, query.php

Posted: Wed Apr 28, 2010 3:20 pm
by Jonah Bron
Did you try putting in the curly brace ( { ) as suggested?

Re: Problem with wordpress file, query.php

Posted: Wed Apr 28, 2010 3:30 pm
by Benjamin
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.

Re: Problem with wordpress file, query.php

Posted: Thu Apr 29, 2010 6:39 am
by skynet88
thx benjamin..finally,my problem has been solved...sorry for bumping to much in this thread..

:wink: