Textpattern CMS support forum

You are not logged in. Register | Login | Help

#31 2009-09-17 00:01:56

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,781
Website

Re: soo_page_numbers: page counting and navigation widgets

jsoo wrote:

*maybe, just maybe, if I try the same trick of jumping to the front of the callback array, I would get in ahead of MLP by keeping a standard medium-priority plugin load order. Turnabout is fair play. When I have time I will certainly look into this.

I think this works! (Edit: see next post) txpinsti, I’ve just tried this with a test MLP installation, and it seems to be working. Can you help me test this? Exact procedure depends on whether you are using the standalone version of soo_page_numbers, or in conjunction with soo_txp_obj. In either case, the editing needs to be done wherever you have the class soo_uri declaration. Just above the class definition add these lines:

register_callback('soo_uri_mlp', 'pretext');
function soo_uri_mlp() {
	global $soo_request_uri;
	$soo_request_uri =  $_SERVER['REQUEST_URI'];
}

Then inside class soo_uri, in the __construct() function, look for this line:

	$this->request_uri = $_SERVER['REQUEST_URI'];

and replace it with these lines:

	global $soo_request_uri;
	$this->request_uri = $soo_request_uri;

Last edited by jsoo (2009-09-17 11:15:39)


Code is topiary

Offline

#32 2009-09-17 10:48:05

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,781
Website

Re: soo_page_numbers: page counting and navigation widgets

OK, hold that thought: not quite working yet. Forgot that working on a plugin in the local plugin cache gives you a different load sequence.


Code is topiary

Offline

#33 2009-09-17 11:15:06

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,781
Website

Re: soo_page_numbers: page counting and navigation widgets

OK, I’ve now tested this with a regularly-installed plugin (not in the cache), and also followed my own suggestion for jumping the callback queue. So, the following code goes above the soo_uri class declaration:

global $plugin_callback;
if( is_array($plugin_callback) and $plugin_callback[0]['function'] == '_l10n_pretext' )
	array_unshift($plugin_callback, array(
		'function'	=>	'soo_uri_mlp', 
		'event'		=>	'pretext', 
		'step'		=>	'', 
		'pre'		=>	0 
	));

function soo_uri_mlp() {
	global $soo_request_uri;
	$soo_request_uri =  $_SERVER['REQUEST_URI'];
}

and then the first line of soo_uri::__construct() is replaced by this:

	global $soo_request_uri;		
	$this->request_uri = $soo_request_uri ? $soo_request_uri : $_SERVER['REQUEST_URI'];

This is working correctly on my test MLP installation, for a search setup similar to txpinisti’s.

Last edited by jsoo (2009-09-17 11:18:05)


Code is topiary

Offline

#34 2009-09-18 14:14:18

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,781
Website

Re: soo_page_numbers: page counting and navigation widgets

The download page now has an updated version of the library plugin, including the above changes.


Code is topiary

Offline

#35 2009-09-22 09:34:13

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 560
Website

Re: soo_page_numbers: page counting and navigation widgets

Hey thank you for the plugin! =)

I’m having one problem that I got this code before the pagging:

<txp:php>
  $_GET['zem_contact_send_article']='yes';
</txp:php>

so when I click on a page number the url become: http://www.domain.com/news/blalba?zem_contact_send_article=yes&pg=2
I know you made it to be like this for working with plugins’ params,
but is there a way to disable it please?
(so there will not be: zem_contact_send_article=yes in the url [or any other plugin])

Offline

#36 2009-09-22 11:14:14

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 560
Website

Re: soo_page_numbers: page counting and navigation widgets

2. I found something: (a bug I think)
when using pageby="10" and pagging to page #12+
the <txp:article /> is disappear and not geting loaded.

(this post has nothing to do with my prev post above)

Last edited by THE BLUE DRAGON (2009-09-22 12:00:15)

Offline

#37 2009-09-22 11:53:25

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,781
Website

Re: soo_page_numbers: page counting and navigation widgets

THE BLUE DRAGON wrote:

2. I found something: (a bug I think)
when using pageby="10" and pagging to page #12+
the <txp:article /> is disappear and not geting loaded.

I cannot reproduce this. Are you sure that there are more than 110 articles set to show on that page?


Code is topiary

Offline

#38 2009-09-22 12:07:25

THE BLUE DRAGON
Member
From: Israel
Registered: 2007-11-16
Posts: 560
Website

Re: soo_page_numbers: page counting and navigation widgets

Ohhh sorry you are right
my mistake
the limit in the article_custom was on 5 and the pageby was on 10, that was my problem
sorry and thanks ;)

Last edited by THE BLUE DRAGON (2009-09-22 12:31:45)

Offline

#39 2009-09-22 12:15:07

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,781
Website

Re: soo_page_numbers: page counting and navigation widgets

THE BLUE DRAGON wrote:

I know you made it to be like this for working with plugins’ params,
but is there a way to disable it please?
(so there will not be: zem_contact_send_article=yes in the url [or any other plugin])

I’ll give this some thought. I’m using $_GET because it is convenient, but I could parse the query string instead, and that might be a better general approach.


Code is topiary

Offline

#40 2009-09-22 12:16:38

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,781
Website

Re: soo_page_numbers: page counting and navigation widgets

THE BLUE DRAGON wrote:

the limit in the article_custom was on 5 and the pageby was on 10, that was my problem

Now I’m confused ;) article_custom doesn’t page, and it’s OK to have a smaller limit than pageby. But if you’ve got it working, fine!


Code is topiary

Offline

Board footer

Powered by FluxBB