Recent Topics

1 May 20, 2008 15:32    

My b2evolution Version: Not Entered

This has been the issue following and preventing me get things going on my software site, it is important to me in the single view mode..

As you may know, i have requested help about changing the pagelinks..and EdB helped me with this earlier,
now they appear: "Overview - Download - Instructions - Etc." instead of "Pages : 1*2*3... "

now, what i d like to is add a tabbed menu behind them, it is easy to do, but i cant figure out how to do the ".current" or ".selected" tab to look different.. just like the head nav menu of b2evolution website

public blog list have this ability to display differently when the blog is selected (like in the simple_zen or some other skins), i wonder if ".selected" can be applied to pagelinks ??

i am thinking of using if/else sth like : <li {if '{}' = ''.$Item->get_permanent_url().'?page=2'}class="current"{/if}><a href=

i really dont know and cant figure out.. can someone guide me through ?[/code]

2 May 20, 2008 15:52

http://b2evolution.pastebin.com/f5921bf34

/**
 *
 * /inc/items/model/_item.class.php starting at line 1500
 */


		for( $i = 1; $i <= $this->pages; $i++ )
		{
			$text = str_replace('%d', $i, $pagelink);

			if( $i != $current_page )
			{
				if( $i == 1 )
				{	// First page special:
					$page_links[] = '<span class="page' . $text . '"><a href="'.$url.'">'.$text.'</a>' . '</span>';
				}
				else
				{
					$page_links[] = '<span class="page' . $text . '"><a href="'.url_add_param( $url, 'page='.$i ).'">'.$text.'</a>' . '</span>';
				}
			}
			else
			{
				$page_links[] = '<span class="page' . $text . ' selected">' . $text . '</span>';
			}
		}

3 May 20, 2008 16:38

thank you Afwas, that was exactly what was i looking for, you have done it again..hope this will be inspiring for other modifications

5 Jun 15, 2008 15:09

Anyone could explain further more about this ? I tried the code above, but nothing change...or maybe there's something I missed about setting or something ?

6 Jun 15, 2008 15:19

hi kopijun,

Welcome to the forums.

What the code does is add a class to the menu. Normally it looks like:

<span class="page1">


but when the page is selected the span tag changes to:

<span class="page1 selected">


If you view the sourcecode you will see that.

To use it, change your css file (stylesheet.css in the folder of the skin you are using) and add the selected class, like so:

.selected {
    color: red;
}

If you want some more information from us, try to formulate what you want with it.

Good luck

7 Jun 15, 2008 16:10

hi and welcome to forums, it looks a bit complicated but it aint that hard actually, first i d recommend you move the pagelinks to where you want to use them (possibly under the title over the post content) (presuming you want to use the pages as tabs as i did).

Then apply the code Afwas gave you both in core file and the css and bam! (: that's it you will see the change.Just try you will see the progress and report back if you ve done it but it's not the way you wanted, i ll try to help you further..You can see how it looks to have an idea in my blog..They really look nice, Thanks to Afwas once more B)

8 Jun 15, 2008 16:16

Hi afwas...Thanks for your quick response....Actually I'm still new with this b2evo...So below is my code in item_class.php :


$page_links = array();

		for( $i = 1; $i <= $this->pages; $i++ )
		{
			$text = str_replace('%d', $i, $pagelink);

			if( $i != $current_page )
			{
				if( $i == 1 )
				{	// First page special:
					$page_links[] = '<span class="page' . $text . '"><a href="'.$url.'">'.$text.'</a>' . '</span>';
				}
				else
				{
					$page_links[] = '<span class="page' . $text . '"><a href="'.url_add_param( $url, 'page='.$i ).'">'.$text.'</a>' . '</span>';
				}
			}
			else
			{
				$page_links[] = '<span class="page' . $text . ' selected">' . $text . '</span>';
			}
		}

I just try add :

.selected {
    color: red;
} 

to my style.css file to simple testing....But nothing changed....Or it's not so simple like that ? I use b2evolution 2.4.2 and the terrafirma skin..

9 Jun 15, 2008 16:30

It's about as easy as this. What does the source say? does the class selected turn up where you expect?
This code works together with the <!-- More --> tag.
tilqicom has a worked out example that looks really nice.

Good luck

10 Jun 15, 2008 16:56

unfortunately the class selected doesn't turn up...Afwas, do you have sample link to blog that work with this code ?

And tilqicom, where is the link to your blog ? is it prosoftware.com ?

12 Jun 16, 2008 09:58

hi kopjun welcome to forums, i will look into that and let you know further, however as a preliminary response; crack open your /inc/items/model/_item.class.php file and replace the corresponding lines with [url=http://b2evolution.pastebin.com/f5921bf34]the code in the pastebin[/url] and the css code Afwas gave earlier..

Watch out for the start&end lines, any typos in the css or any blank space in the php file.. and do not expect a tab view right away, you should style it further to have an actual tab.. just watch for the red color change in the pagelinks where Afwas defined it as an example, when you had that change we will look into that later.Because you will need to modify the pagelinks where you want them and maybe even the text of the pagelinks if you dont want to use them as 1-2-3-4 as i dont.It might be a little harder to notice the change behind a single number rather than a word.bye for now..good luck with it


Form is loading...