MyBB Community Forums

Full Version: easy page access
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,
If I am right I think there is no way for a user to go to a specific page number. For instance,
[Image: 47966205kg1.png]

if someone wants to go to page number 50 or 60 then its not really possible unless few clicks are made.

I was thinking that I can maybe work on a modification regarding this. There are two ways..

I can hava a Go to button where the red box is in the pic below...
[Image: 12989429rp5.png]
and when clicked on it will give you a popup box (like the one we get when we click on the image or link in this editor) asking for what page number to go. Or we can have a drop down box like in vb (but that would be little more hard i guess).

if someone is already working or would like to work on this mod that its great otherwise I can try to.
I would also like to see this. For both forums and threads. Technically, it should be an easy template modification that takes the value of a text field as the parameter 'page' and posts to either forumdisplay.php or showthread.php. It would also have to pull the MyBB variable for the current forum/thread id.
ok
I am not very proficient in php but i will see what i can do about it

tell me if I am on the right track...

lets say first i will add a template named as something "multipage_goto" under the "Multipage Pagination Templates"

Then in the global.lang i can add "$l['multipage_goto'] = "Go to";"

Then in the "multipage" template under I can have is like...

<div class="pagination">
<span class="pages">{$lang->multipage_pages}</span>
{$prevpage}{$start}{$mppage}{$end}{$nextpage}{$goto}
}</div>

That will just display the 'Go to' box next to the 'Next' button if I am right.

then the next and real part would be to have a drop down or pop up box appear asking for page number when clicked on the 'Go to' button.

please help me.
thanks!
i guess its not very right...not really working
First off, you'll need to create a form in HTML. Then, you'll need to code the PHP script that makes the form run and fetch the page.
(2008-09-01, 01:30 AM)RenegadeFan Wrote: [ -> ]First off, you'll need to create a form in HTML. Then, you'll need to code the PHP script that makes the form run and fetch the page.

so basically the html form will have an input field (as a pop up box I suppose) to get the page number. So whenever the user will click on the Go to button the forum itself will run and will try to get to that specific page number. Doesnt look like that simple to do.
the html form till go in the them and will something like.......
if i am right

<table>
<tr>
<td onmouseclick="appear" onmouseout="disapper" class="abc">
<form name="pagejump" method="get" action="'.$globals['index_url'].'">
<input type="hidden" name="tid" value="'.$tid.'" />
<input type="text" name="tpg" size="10" />
<input type="submit" value="'.$l['goto'].'" />
</form>
</td>
</tr>
</table>';

then basically this form will have to be called whenever the user will click on Go to
(2008-09-01, 01:30 AM)RenegadeFan Wrote: [ -> ]First off, you'll need to create a form in HTML. Then, you'll need to code the PHP script that makes the form run and fetch the page.

Not necessarily. As a template modification, you'd just need to have a hidden input tag with the name "fid" and the value "$forum['fid']" (or "$mybb->forum['fid']", I'm not quite sure). Then the text field would have the name "page" and would only accept numbers. The post action would be "forumdisplay.php". Something similar would be done for showthread.php.
(2008-09-01, 03:42 AM)GG-Xtreme Wrote: [ -> ]
(2008-09-01, 01:30 AM)RenegadeFan Wrote: [ -> ]First off, you'll need to create a form in HTML. Then, you'll need to code the PHP script that makes the form run and fetch the page.

Not necessarily. As a template modification, you'd just need to have a hidden input tag with the name "fid" and the value "$forum['fid']" (or "$mybb->forum['fid']", I'm not quite sure). Then the text field would have the name "page" and would only accept numbers. The post action would be "forumdisplay.php". Something similar would be done for showthread.php.

something like??.....

<input type="hidden" name="fid" value="'$forum['fid']" />
<input type="text" name="tpg" size="10" />
<input type="submit" value="'.$l['goto'].'" />
Okay, it's not going to be that easy, because the same multipage template is used for both the forum and thread views, and attempting to make a separate instance for each resulted in a total mess. I think to do this without a separate script would require the use of template conditionals.
(2008-09-01, 04:04 AM)abhisheksaini Wrote: [ -> ]something like??.....

<input type="hidden" name="fid" value="'$forum['fid']" />
<input type="text" name="tpg" size="10" />
<input type="submit" value="'.$l['goto'].'" />

I had something like this:
<form action="showthread.php" method="post">
<input type="hidden" name="tid" value="$mybb->thread['tid']">
<input type="text" name="page" size="3">
<input type="submit" value="Go">
</form>
But I ran into the problem that showthread_multipage isn't used and the main multipage template will give you an SQL error if you add anything like this. This could take more work than I thought.
(2008-09-01, 04:06 AM)GG-Xtreme Wrote: [ -> ]Okay, it's not going to be that easy, because the same multipage template is used for both the forum and thread views, and attempting to make a separate instance for each resulted in a total mess. I think to do this without a separate script would require the use of template conditionals.
(2008-09-01, 04:04 AM)abhisheksaini Wrote: [ -> ]something like??.....

<input type="hidden" name="fid" value="'$forum['fid']" />
<input type="text" name="tpg" size="10" />
<input type="submit" value="'.$l['goto'].'" />

I had something like this:
<form action="showthread.php" method="post">
<input type="hidden" name="tid" value="$mybb->thread['tid']">
<input type="text" name="page" size="3">
<input type="submit" value="Go">
</form>
But I ran into the problem that showthread_multipage isn't used and the main multipage template will give you an SQL error if you add anything like this. This could take more work than I thought.

ok...but cannot we just put in the forum and thread display where multipage.. is called.
i dont think its the most appropriate way to do it but certainly it would be the easiest one.
then you are right....i can create a separate template for both thread and forum and call it when the multipage one is called in the forum view and thread view respectively.
if this is the right way then i need to figure out what to put in that template....
(2008-09-01, 04:11 AM)abhisheksaini Wrote: [ -> ]
(2008-09-01, 04:06 AM)GG-Xtreme Wrote: [ -> ]Okay, it's not going to be that easy, because the same multipage template is used for both the forum and thread views, and attempting to make a separate instance for each resulted in a total mess. I think to do this without a separate script would require the use of template conditionals.
(2008-09-01, 04:04 AM)abhisheksaini Wrote: [ -> ]something like??.....

<input type="hidden" name="fid" value="'$forum['fid']" />
<input type="text" name="tpg" size="10" />
<input type="submit" value="'.$l['goto'].'" />

I had something like this:
<form action="showthread.php" method="post">
<input type="hidden" name="tid" value="$mybb->thread['tid']">
<input type="text" name="page" size="3">
<input type="submit" value="Go">
</form>
But I ran into the problem that showthread_multipage isn't used and the main multipage template will give you an SQL error if you add anything like this. This could take more work than I thought.

ok...but cannot we just put in the forum and thread display where multipage.. is called.
i dont think its the most appropriate way to do it but certainly it would be the easiest one.
then you are right....i can create a separate template for both thread and forum and call it when the multipage one is called in the forum view and thread view respectively.
There already is a template called showthread_multipage, but it doesn't seem to be used. I tried putting the multipage code directly into the showthread template, but then all my threads say "Pages (0): 0" and the pages don't show up. Hmm...
Pages: 1 2