Recent Topics

1 Aug 27, 2009 19:03    

My b2evolution Version:

Okily dokily, neighbours, I could use your assistance if you can spare a moment. I'm integrating a b2evolution 3.3.1 installation with a website I've been designing. Part of that, of course, is creating an appropriate skin. I didn't get very far with that before running into this issue.

I started with the Custom skin included with 3.3.1. and, because I already have a PHP include to generate the HTML common to the beginning of every document on the site, I replaced

// -------------------------- HTML HEADER INCLUDED HERE --------------------------
skin_include( '_html_header.inc.php' );
// Note: You can customize the default HTML header by copying the generic
// /skins/_html_header.inc.php file into the current skin folder.
// -------------------------------- END OF HEADER --------------------------------

with an include for my own file. Looks great, seemed to work great, and there's no reason it shouldn't since it's just HTML that's being replaced, right? Apparently, _html_header.inc.php does something more than just generate the HTML header, because once it is replaced, the pagination links from

	<?php
		// -------------------- PREV/NEXT PAGE LINKS (POST LIST MODE) --------------------
		mainlist_page_links( array(
				'block_start' => '<p class="center">'.T_('Pages:').' <strong>',
				'block_end' => '</strong></p>',
			) );
		// ------------------------- END OF PREV/NEXT PAGE LINKS -------------------------
	?>

now generate a "Bad Request" error:

Error wrote:

Additional information about this error:
Illegal value received for parameter «page»!

The only difference in the pagination links before and after replacement of the default HTML header is the addition of the invalid "page" parameter, whose value is "News", the short name of my blog:

<!-- With _html_header.inc.php: -->
<a href="/news/blog1.php?paged=2">2</a>

<!-- With my own HTML: -->
<a href="/news/blog1.php?page=News&amp;paged=2">2</a>

I've traced the problem as far as page_links() on line 1650 of _item.class.php, except this defines the page parameter by $i, which is just a counter integer for a for loop, so it shouldn't end up as "News", should it?

Of course, I'm probably on the wrong track as mainlist_page_links() refers to $MainList->page_links(), and I'm looking at $Item->page_links(), right? And i'm not sure where to look for the MainList class definition. I'm not even sure what in the _html_header.inc.php caused the difference to begin with, and I'm a bit lost tracing dependencies.

Any insight would be much appreciated!

2 Aug 27, 2009 19:32

I'm guessing your website uses $page ;)

¥

3 Aug 27, 2009 19:53

That it does... Crisis averted.

That's what I get for not using classes for my own work and assuming that "News" was from b2evolution and couldn't paaahsibly be from any of my code.

Good call, ¥åßßå — thanks!

4 Aug 28, 2009 08:04

Been there, done that, got a crappy t-shirt for my efforts ;)

¥


Form is loading...