Textpattern Forum

You are not logged in. Register | Login | Help

#1 2004-05-17 02:41:14

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

rsx_page_number

Someone asked for a plugin to display the page number of an article list page. This plugin will do that. At least I am fairly certain it does.

rsx_page_number.txt

Last edited by ramanan (2004-05-17 02:42:51)

Offline

#2 2004-05-17 03:02:59

fri
Member
From: Denmark
Registered: 2004-04-30
Posts: 34
Website

Re: rsx_page_number

ramanam,

you certainly ARE fast.
thankyou – very much

Offline

#3 2004-05-17 04:06:44

fri
Member
From: Denmark
Registered: 2004-04-30
Posts: 34
Website

Re: rsx_page_number

ramanam,

sorry but I get this:
Notice: Undefined variable: offset in C:\WINDOWS\TEMP\plu42E0.TMP on line 14
on top of my page. I’m using txp on my localhost.

Despite this, the pagenumber displays allright, but I need to extract the total number of pages also – to compare – otherwise one does not where one is in in the process of navigating a section…
You know, a deployed output “pages 1 2 3 4” (linked numbers)
or “<< page 2 (…of 5) >>”
That way you size the heystack, when you, as a user of a big site, are skimming it for needles…

I’m posting this in the how to forum as well, in case you miss it here..
I appreciate your effort.

Offline

#4 2004-05-17 18:55:46

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_page_number

That is strange. I will muck around with the plugin some more. Also, I’ll try modifying the plugin to display both the way you suggest.

Offline

#5 2004-05-18 05:59:41

mamash
Member
From: Prague
Registered: 2004-02-21
Posts: 124
Website

Re: rsx_page_number

Ramanan, you’d better turn on error_reporting(E_ALL) for developing. It will make you write 100% correct code, while leaving those of us who run with this setting by default with error-free pages… ;)


Who’s gonna textdrive you home tonight?

Offline

#6 2004-05-18 06:30:59

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_page_number

Oh thanks. Good to know. Everything I code in PHP is me winging-it. Thanks for that tip. The offset error shouldn’t show up anymore. I’ll post all my changes in a bit.

Last edited by ramanan (2004-05-18 07:12:05)

Offline

#7 2004-05-18 08:27:29

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_page_number

I’ve update the plugin. The error with unset variables is gone, and I’ve added 2 more tags, one that returns the last page number, and one that returns a navigation element that looks like this :

Offline

#8 2004-05-19 20:37:04

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_page_number

I’ve updated the plugin once more. You can now supply the text to use for the left and right navigation (it defaults to << and >>). Also, everything is wrapped in span’s you can style with textpattern. I’m using it at my site for the time being if you want to see it in action. The next time I update this i’ll add the other form of navigation suggested (Page 1 2 3 4 5…)

Offline

#9 2004-05-21 15:08:13

fri
Member
From: Denmark
Registered: 2004-04-30
Posts: 34
Website

Re: rsx_page_number

Good work, ramanam.

I’m looking forward to the new variation(1, 2, 3, 4 …)

What would be VERY nice, is a navigation bar, that toggeled linked pages on article-lists, and linked articles when individual articles are on.
(The built in if-tags don’t seem to work when put in top of the page – only after the article-tag.)

Offline

#10 2004-05-21 17:12:37

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: rsx_page_number

How did you want the (1,2,3,4 … ) thing to look. I wrote one, but it seems like it would be ugly, or unwieldly. You want a complete list of all the page nubmers, or just the next few?

Offline

Board footer

Powered by FluxBB