Home Private Messages Search
CPG Dragonfly™ CMS Dedicated Server & Bandwidth Sponsored by DedicatedNOW
Toggle Content
 
Forums ⇒ DragonflyCMS ⇒ CPG-BB (forum) ⇒ Mod Wanted - "go to page" text box


Mod Wanted - "go to page" text box
Please post bugs in the Projects Module.
Post anything and everything else about CPG-BB in this forum.
Formerly known as phpBB but no longer compatible.

Go to page 1, 2  Next
Post new topic    Reply to topic    Printer Friendly Page     Forum Index ⇒  Add-Ons & BlocksCPG-BB (forum)

View previous topic :: View next topic  
Author Message
hqarrse
Diamond Supporter
Diamond Supporter

Offline Offline
Joined: Mar 20, 2005
Posts: 177

PostPosted: Tue Jun 19, 2007 4:54 am
Post subject: Mod Wanted - "go to page" text box

Does anyone know of a mod for the viewtopic and viewforum files to all me to add a "go to page" text field to the forums pages?

At present the page does all it's calculations about how many posts / pages there are, then generates the links in the pagination (1 2 3 ...200 next) - these links are to posts, not pages. When you go to page x, you are sending a link to post y.

I would like the reverse. To send it a page number like "page=20". It would then recognize that variable and then calculate which post number to start at, based on "no of posts per page * page".

If not then I'll try and crack it, but I'm sure this must have been done before.

Thanks

(I have looked for this without success on here, phpbb and nukecops and haven't found anything even though it seems a simple, useful mod. If it's somewhere obvious I apologise)

_________________
Olive Net
British Army
Royal Navy
Military Clothing and Equipment - This Tribe

hqarrse's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Slackware 12 / CentOS, PHP 5.6, MySQL 5, Apache 2
Back to top
View user's profile Send e-mail Visit poster's website
piraja
Nice poster
Nice poster

Offline Offline
Joined: Apr 28, 2006
Posts: 63
Location: Finland
PostPosted: Tue Jun 19, 2007 6:15 pm
Post subject: Re: Mod Wanted - "go to page" text box

hqarrse wrote:
If it's somewhere obvious I apologise)

Me too!
Very interested about this kind of mod!


piraja's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux / 2.0 / 5.0.67 / 5.2.6 / 9.2.1
Back to top
View user's profile Visit poster's website
hqarrse
Diamond Supporter
Diamond Supporter

Offline Offline
Joined: Mar 20, 2005
Posts: 177

PostPosted: Wed Jun 20, 2007 11:43 am
Post subject: Re: Mod Wanted - "go to page" text box

It's quite an easy programming tweak, but I'm pushed for time hence the 'has this been done before'. If no one comes to the rescue with the code I'll crack it tomorrow and post it on here.

_________________
Olive Net
British Army
Royal Navy
Military Clothing and Equipment - This Tribe

hqarrse's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Slackware 12 / CentOS, PHP 5.6, MySQL 5, Apache 2
Back to top
View user's profile Send e-mail Visit poster's website
hqarrse
Diamond Supporter
Diamond Supporter

Offline Offline
Joined: Mar 20, 2005
Posts: 177

PostPosted: Thu Jun 21, 2007 4:18 am
Post subject: Re: Mod Wanted - "go to page" text box

OK, here's the forum pages mod (much easier than I expected):

In viewforum.php

change this (about line 35)

Code::

$start = (isset($_GET['start']) ? intval($_GET['start']) : 0);


to


Code::

$start = 0;
if (isset($_GET['start']))
{
	$start = intval($_GET['start']);
}
elseif (isset($_POST['startpage']))
{
	$start = $board_config['topics_per_page']*(intval($_POST['startpage']) - 1);
}


Then in themes/THEME/forums/viewforum_body.html add the following where you want your 'go to page' bit:

Code::
<form action="{U_VIEW_FORUM}" method="post" name="gotopageform">

(in here I have table / layout)

        <input name="startpage" type="text" size="3" maxlength="4" />
          <input type="submit" name="Submit" value="Go to Page" id="Submit" />
    
(also in here)

</form>

Topic pages to follow

_________________
Olive Net
British Army
Royal Navy
Military Clothing and Equipment - This Tribe

hqarrse's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Slackware 12 / CentOS, PHP 5.6, MySQL 5, Apache 2


Last edited by hqarrse on Thu Jun 21, 2007 4:47 am; edited 1 time in total
Back to top
View user's profile Send e-mail Visit poster's website
hqarrse
Diamond Supporter
Diamond Supporter

Offline Offline
Joined: Mar 20, 2005
Posts: 177

PostPosted: Thu Jun 21, 2007 4:39 am
Post subject: Re: Mod Wanted - "go to page" text box

And the topics:

viewtopic.php at about line 50:

change
Code::
$start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0;

to

Code::
$start = 0;
if (isset($_POST['startpage']))
{
	$start = $board_config['posts_per_page']*(intval($_POST['startpage']) - 1);
}
elseif (isset($_GET['start']))
{
	$start = intval($_GET['start']);
}


then in viewtopic_body.html

Code::

<form action="{U_VIEW_TOPIC}" method="post" name="gotopageform">


<input name="startpage" type="text" size="3" maxlength="4" length="3"/>
          <input type="submit" name="Submit" value="Go to Page" id="Submit" />

</form>


Neither of those has been run live yet so there's no guarantee there won't be side effects. Obviously I'll post any that I find once I start using it.

_________________
Olive Net
British Army
Royal Navy
Military Clothing and Equipment - This Tribe

hqarrse's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Slackware 12 / CentOS, PHP 5.6, MySQL 5, Apache 2
Back to top
View user's profile Send e-mail Visit poster's website
aptd
Heavy poster
Heavy poster

Offline Offline
Joined: May 04, 2007
Posts: 186

PostPosted: Thu Jun 21, 2007 7:14 am
Post subject: Re: Mod Wanted - "go to page" text box

Looks good man, nice...


aptd's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux | Apache[1.3.37] (Unix) | MySQL[4.1.21] | PHP[4.4.5] | DF[9.1.2.1]
Back to top
View user's profile Visit poster's website
Eestlane
I18N / L10N Lead Dev
I18N / L10N Lead Dev

Offline Offline
Joined: Apr 06, 2005
Posts: 1404
Location: Estonia
PostPosted: Thu Jun 21, 2007 8:34 am
Post subject: Re: Mod Wanted - "go to page" text box

Good work.

What happens if wrong page number is used or maybe even letter instead of number?


Eestlane's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.0.63/5.0.67/5.2.8/9.2.1
Back to top
View user's profile Send e-mail Visit poster's website
hqarrse
Diamond Supporter
Diamond Supporter

Offline Offline
Joined: Mar 20, 2005
Posts: 177

PostPosted: Thu Jun 21, 2007 9:15 am
Post subject: Re: Mod Wanted - "go to page" text box

Eestlane wrote:
Good work.

What happens if wrong page number is used or maybe even letter instead of number?

Wrong page numbers are OK - if they're too big you get empty threads or the most recent topics, but....

The character causes a database error page instead of just returning to the same page. I'll sort that out now.

_________________
Olive Net
British Army
Royal Navy
Military Clothing and Equipment - This Tribe

hqarrse's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Slackware 12 / CentOS, PHP 5.6, MySQL 5, Apache 2
Back to top
View user's profile Send e-mail Visit poster's website
piraja
Nice poster
Nice poster

Offline Offline
Joined: Apr 28, 2006
Posts: 63
Location: Finland
PostPosted: Thu Jun 21, 2007 10:03 am
Post subject: Re: Mod Wanted - "go to page" text box

Good work, hqarrse! Very nice!


piraja's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux / 2.0 / 5.0.67 / 5.2.6 / 9.2.1
Back to top
View user's profile Visit poster's website
Eestlane
I18N / L10N Lead Dev
I18N / L10N Lead Dev

Offline Offline
Joined: Apr 06, 2005
Posts: 1404
Location: Estonia
PostPosted: Thu Jun 21, 2007 10:24 am
Post subject: Re: Mod Wanted - "go to page" text box

If it's working well, I suggest adding it to core.


Eestlane's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.0.63/5.0.67/5.2.8/9.2.1
Back to top
View user's profile Send e-mail Visit poster's website
piraja
Nice poster
Nice poster

Offline Offline
Joined: Apr 28, 2006
Posts: 63
Location: Finland
PostPosted: Thu Jun 28, 2007 5:54 am
Post subject: Re: Mod Wanted - "go to page" text box

How about the "database error pages"? Any changes coming? Rolling Eyes Embarassed


piraja's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux / 2.0 / 5.0.67 / 5.2.6 / 9.2.1
Back to top
View user's profile Visit poster's website
Eestlane
I18N / L10N Lead Dev
I18N / L10N Lead Dev

Offline Offline
Joined: Apr 06, 2005
Posts: 1404
Location: Estonia
PostPosted: Sun Jul 01, 2007 9:16 am
Post subject: Re: Mod Wanted - "go to page" text box

I think that the URL's where it goes to shouldn't work only with POST as if someone wants to bookmark that page or give a link for a friend (s)he can't do it if not using regular paging system.


Eestlane's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.0.63/5.0.67/5.2.8/9.2.1
Back to top
View user's profile Send e-mail Visit poster's website
hqarrse
Diamond Supporter
Diamond Supporter

Offline Offline
Joined: Mar 20, 2005
Posts: 177

PostPosted: Tue Jul 03, 2007 5:50 am
Post subject: Re: Mod Wanted - "go to page" text box

I hadn't seen that, but it's not a big issue in my opinion so I'm not going to have a chance to tackle that one, sorry!

_________________
Olive Net
British Army
Royal Navy
Military Clothing and Equipment - This Tribe

hqarrse's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Slackware 12 / CentOS, PHP 5.6, MySQL 5, Apache 2
Back to top
View user's profile Send e-mail Visit poster's website
Eestlane
I18N / L10N Lead Dev
I18N / L10N Lead Dev

Offline Offline
Joined: Apr 06, 2005
Posts: 1404
Location: Estonia
PostPosted: Tue Jul 03, 2007 10:15 am
Post subject: Re: Mod Wanted - "go to page" text box

Well, I could do it myself also, if I would use it, so no problem.


Eestlane's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Linux/2.0.63/5.0.67/5.2.8/9.2.1
Back to top
View user's profile Send e-mail Visit poster's website
Phoenix
• Many Posts •
• Many Posts •

Offline Offline
Joined: Apr 19, 2004
Posts: 8799
Location: Netizen
PostPosted: Tue Jul 03, 2007 10:24 am
Post subject: Re: Mod Wanted - "go to page" text box

The "page" you bookmark will become meaningless as time and posts progress.

I've lost count of the number of indexed "pages" I've found in a search where the result is useless as the topic/post is no longer there - in your own interest it is best not done.

_________________
DonationsPro for DragonflyCMS, SMF, MyBB, vBulletin

Phoenix's server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS)
Back to top
View user's profile Visit poster's website Photo Gallery
Display posts from previous:   
Post new topic    Reply to topic    Printer Friendly Page    Forum Index ⇒  Add-Ons & BlocksCPG-BB (forum)
Page 1 of 2
All times are GMT
Go to page 1, 2  Next



Jump to:  


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum


 
   Toggle Content User Info

Welcome Anonymous

Nickname
Password
(Register)

   Toggle Content Last CVS commits
· Fixed .ico Expires header.
· Removed domain name from cookies so subdomains wont access them anymore.
· CSS and JS, case insensitives.
· CSS and JS, send correct HTTP 1.1 headers and fixed issues where themes and...
· Further security class improvements.
· 301 redirects on LEO changes
· Option to force 3xx http status codes
· Validate googlebot.com and google.com crawlers.
· CCBot
· Rss with etag and atom.

read more...

   Toggle Content Community

Support for DragonflyCMS in a other languages:

Deutsch
Español

   Toggle Content X-links
UltraEdit Browse Happy logo Firefox MySQL PostgreSQL Valid CSS! Valid XHTML 1.0! Unicode Encoded Badge NukeBiz Resources Raven DragonflyCMS Dedicated Now InsideSupport Lampe Berger

You are seeing squares or questionmarks on this page?

All content of this website is copyrighted by the Creative Commons NC-SA
The logos and trademarks used on this site are the property of their respective owners
We are not responsible for comments posted by our users, as they are the property of the poster.
Our server runs on a P3 1.2GHz with 512MB RAM with no accelerators
Support GoPHP5.org
Interactive software released under GNU GPL, Code Credits, Privacy Policy