Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
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
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
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
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
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
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
Re: soo_page_numbers: page counting and navigation widgets
THE BLUE DRAGON wrote:
2. I found something: (a bug I think)
when usingpageby="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
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
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=yesin 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
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
Re: soo_page_numbers: page counting and navigation widgets
jsoo wrote:
Now I’m confused ;) article_custom doesn’t page
and you are right again O_o
I’m using rss_suparchive for creating an article list that support paging
and when I’m having a smaller limit than pageby it doesn’t work when you cross the limit.
Offline
Re: soo_page_numbers: page counting and navigation widgets
THE BLUE DRAGON wrote:
<txp:php>
$_GET['zem_contact_send_article']='yes';
</txp:php>
Would it work for you to use $_POST instead?
Code is topiary
Offline
Re: soo_page_numbers: page counting and navigation widgets
jsoo wrote:
Would it work for you to use
$_POSTinstead?
great!
thanks =)
Offline
Re: soo_page_numbers: page counting and navigation widgets
Anyway, here’s a mod that should fix your problem:
In the soo_uri class, function __construct(), replace the last line, namely:
$this->query_params = $_GET;
with:
parse_str($this->query_string, $this->query_params);
Let me know if that works and I’ll probably roll it into the next release. As I said, it’s probably a better approach, not just for your situation, but in general.
Code is topiary
Offline
Re: soo_page_numbers: page counting and navigation widgets
jsoo wrote:
Let me know if that works and I’ll probably roll it into the next release.
Yea changed it back to $_GET, replaced the line, and it’s works good =)
Offline