Recent Topics

1 Apr 11, 2005 23:09    

I've done some searching and so far I haven't been able to find a solution for this. If anyone has done it or has any ideas I'd appreciate it.

I would like to replace the standard <<<Previous Page :: Next Page>>> with actual graphical links. _main.php uses the "posts_nav_link" function (traced back to /b2evocore/_functions_bposts.php) for this link.

* posts_nav_link(-)
*/
function posts_nav_link($sep=' :: ', $prelabel='#', $nxtlabel='#', $page='')
{
global $request, $p;
global $Settings;

if( !empty( $request ) && empty($p) && ($Settings->get('what_to_show') == 'paged'))
{
global $MainList;
$max_paged = $MainList->get_max_paged();
if( $max_paged > 1 )
{
previous_posts_link( $prelabel, $page );
echo htmlspecialchars($sep);
next_posts_link( $nxtlabel, $max_paged, $page );
}
}
}

(posts_nav_link function code)

Any of you .php gurus have any ideas on this one? Appreciate it.

2 Apr 12, 2005 02:37

you should have trace it little bit more ;)

the magic code is in your snippet

 previous_posts_link( $prelabel, $page );
echo htmlspecialchars($sep);
next_posts_link( $nxtlabel, $max_paged, $page );

got it?

i don't have access to my b2evo at the moment, so i can't test it. but you can try to set $prelabel to something like <img src="...."... /> maybe it works. don't know.
if that works, delete your changes and edit your skin.

<?php posts_nav_link(); ?>

to

<?php posts_nav_link('','<img src="your_previous_goes_here.gif".... />','<img src="and_for_next_here.gif" .../>'); ?>

if this does not work, you have to hack the code.
locate previous_posts_link and next_posts_link in /b2evocore/_functions_bposts.php

look for this code

			echo '<a href="';
			echo next_posts($max_page, $page);
			echo '">'. htmlspecialchars($label) .'</a>';

delete the htmlspecialchars($label) and add your images there.

3 Mar 26, 2007 07:35

Ok, but is there now a solution only editing the _main.php in my skin directory?

This:

<?php posts_nav_link('','<img src="your_previous_goes_here.gif".... />','<img src="and_for_next_here.gif" .../>'); ?> 

sadly doesn´t work (at least in my 1.9.2 b2evo version).

Why I only want asolution for the _main.php?

First because it´s easier and second because I want to leave the navlinks on the button of the blog-pages at they are. I only want to exchange the text-links around the calendar with icons.

How is this possible?

Thanks in advance,
Daniel

5 Mar 27, 2007 07:29

Sorry EdB for digging up a so old thread, but I have used the search-function before asking ;)

This is in the docs:

posts_nav_link [line 539]

void posts_nav_link( [ $sep = ' :: '], [ $prelabel = '#'], [ $nxtlabel = '#'], [ $page = '']  )  



But as I posted earlier, I used exactly that syntax; when I use e.g

<p class="center"><strong><?php posts_nav_link( ' :: ', '<img src="../../rsc/icons/chain_link.gif">', 'go next'); ?></strong></p>

you will see

<img src="../../rsc/icons/chain_link.gif"> :: go next

on the blog sidebar!!!

What do you suggest?

6 Mar 29, 2007 21:41

Hmm, no one who has a nice idea or solution for me? :(


Form is loading...