TinyPortal

Development => Block Codes => Topic started by: hyem on February 13, 2008, 12:48:24 AM

Title: Paging articles in TP
Post by: hyem on February 13, 2008, 12:48:24 AM
Creating paging articles in TP, it's really needed inorder to creating some big content or review in one articles

like this :

first page here. (introduction)
<!--pagebreak-->
second page here. (detaill product)
<!--pagebreak-->
third page here (benchmark)
<!--pagebreak-->
etc,.. etc,..


any chance to do it?
- Enable paging for the content types we want to use it on.
Title: Re: Paging articles in TP
Post by: IchBin on February 13, 2008, 12:56:56 AM
No chance of getting in in TP 0.9.8, but I think Bloc has plans for multi-page articles in TP 1.0
Title: Re: Paging articles in TP
Post by: hyem on February 13, 2008, 02:19:36 AM
Wow,.. if it's really come with TP 1.0, that would be great than,.. can't wait to see it :(
Title: Re: Paging articles in TP
Post by: Elrond on February 19, 2008, 02:31:26 PM
There are ways of making multi-page articles, using gets or requests ($_GET['sa'] or $_REQUEST['sa'], making sure to secure them of course so no one pulls script hacks).

Every article uses an unique id ($story['id']) and so, for example, a sub-page's link could look like this...

$link_array=array('1' => 'Main Article', '2' => 'Basic CSS', '3' => 'Advanced CSS');
echo '<div class="titlebg">';
foreach($link_array as $num => $title)
echo '<span class="maintab"><a href="' . $scripturl . '?page=' . $story['id'] . ';subpg=' . $num . '" title="'.$title.'">'.$title.'</a></span>';
echo '</div>';


To change content for each page you put something like...

if(empty($_REQUEST['subpg']) || $_REQUEST['subpg']=='1'){ /* Main Page Content Here */ }
else if($_REQUEST['subpg']=='2'){ /* Second Page Content Here */ }
else{ /* Whatever...hacking attempt or something. */ }


...being certain that requests are secured in any way necessary.
Title: Re: Paging articles in TP
Post by: hyem on November 26, 2008, 01:27:39 PM
What about paging with drop down navigation? how to create it?