[wp-hackers] Help Wanted with Code Snippet

BB bb at bbiverson.com
Tue Aug 3 14:10:39 UTC 2004


Using that code, I got:

Parse error: parse error, unexpected '}'...

BB

-----Original Message-----
From: Chris Coggburn [mailto:Chris at Coggburn.us] 
Sent: Tuesday, August 03, 2004 4:10 PM
To: hackers at wordpress.org
Subject: Re: [wp-hackers] Help Wanted with Code Snippet

Here, I cleaned up the code a little and removed un-necessary <?php and 
?> tags. I also changed PHP_SELF to __FILE__ which should eliminate 
problems if the file is included into another php script. Try this and 
let me know if it works:

if (basename(__FILE__) == 'index.php' && $_SERVER['QUERY_STRING'] =='') {
previous_post('%', '<img 
src="http://www.bbiverson.com/images/buttons/previous.jpg" alt="Read 
Previous Entry" align="middle" />Previous Entry', 'no', 'no', 1, '')
} else {
previous_post('%', '<img 
src="http://www.bbiverson.com/images/buttons/previous.jpg" alt="Read 
Previous Entry" align="middle" />Previous Entry', 'no', 'no', 1, '') &nbsp;
?><a href="<?php bloginfo('url'); ?>">Latest Entry</a> &nbsp;
<?php
next_post('%','Next Entry<img 
src="http://www.bbiverson.com/images/buttons/next.jpg" alt="Read Next 
Entry" align="middle" />','no','no',1,'');
}


BB wrote:

> Here’s what I tried:
>
> if ($_SERVER['PHP_SELF'] == 'index.php' && $_SERVER['QUERY_STRING'] 
> =='') {
>
> <?php previous_post('%', '<img 
> src="http://www.bbiverson.com/images/buttons/previous.jpg" alt="Read 
> Previous Entry" align="middle" />Previous Entry', 'no', 'no', 1, '') ?>
>
> }else{
>
> <?php previous_post('%', '<img 
> src="http://www.bbiverson.com/images/buttons/previous.jpg" alt="Read 
> Previous Entry" align="middle" />Previous Entry', 'no', 'no', 1, '') 
> ?> &nbsp;
>
> <a href="<?php bloginfo('url'); ?>">Latest Entry</a> &nbsp;
>
> <?php next_post('%','Next Entry<img 
> src="http://www.bbiverson.com/images/buttons/next.jpg" alt="Read Next 
> Entry" align="middle" />','no','no',1,''); ?>
>
> *<?php } ?>*
>
> }
>
> I’m getting “*Parse error*: parse error, unexpected '}' in 
> */home/bbivers/public_html/journal/index.php* on line *101”.* Line 101 
> is the code in *bold*.
>
> BB
>
> ------------------------------------------------------------------------
>
> *From:* Rubén Marrero [mailto:ruben at lingo.com.mx]
> *Sent:* Tuesday, August 03, 2004 11:45 AM
> *To:* hackers at wordpress.org
> *Subject:* Re: [wp-hackers] Help Wanted with Code Snippet
>
>
>
> BB wrote:
>
> As referenced here <http://wordpress.org/support/3/9972>, I'm looking 
> for a way to put some post-to-post navigation at the top of my WP 
> weblog pages. (I'm set to 1 posts paged.)
>
> Here is the code for my index.php file that I need help with:
>
> *If current page is index.php and nothing else after that address, 
> then echo*
>
> if ($_SERVER['PHP_SELF'] == 'index.php' && $_SERVER['QUERY_STRING'] 
> =='') {
>
> <?php previous_post('%', '<img 
> src="http://www.bbiverson.com/images/buttons/previous.jpg" alt="Read 
> Previous Entry" align="middle" />Previous Entry', 'no', 'no', 1, '') ?>`
>
> }else{
>
> *else echo*
>
> <?php previous_post('%', '<img 
> src="http://www.bbiverson.com/images/buttons/previous.jpg" alt="Read 
> Previous Entry" align="middle" />Previous Entry', 'no', 'no', 1, '') 
> ?> &nbsp;
>
> <a href="<?php echo &#036;siteurl; ?>" title="Latest Entry">Latest 
> Entry</a> &nbsp;
>
> <?php next_post('%','Next Entry<img 
> src="http://www.bbiverson.com/images/buttons/next.jpg" alt="Read Next 
> Entry" align="middle" />','no','no',1,''); ?>
>
> <?php } ?>
>
> }
>
> Hvent's tried it, but I think it works
>
> cheers.
>
>------------------------------------------------------------------------
>
>_______________________________________________
>hackers mailing list
>hackers at wordpress.org
>http://wordpress.org/mailman/listinfo/hackers_wordpress.org
>  
>


-- 
Chris Coggburn
http://noderat.com
http://chris.coggburn.us
http://beyonddigital.net


_______________________________________________
hackers mailing list
hackers at wordpress.org
http://wordpress.org/mailman/listinfo/hackers_wordpress.org





More information about the hackers mailing list