I have articles that my users upload as plain text files through a form. Everything is working great, but I wish to create a pagination with the buttons "previous" and "next".
I tried to search for a jQuery script that could help me, but it seems that they are working only with static files written inside the code, not with the content created dynamically.
The two jQuery's script can be found here:
- jQuery Plugin To Paginate Any long text Content - jPaginate
- jQuery Plugin For Long Content Slideshow - Content Paginator
This is part of my PHP code:
$files = $spathtxt.$sfileita;
$testo = leggifile($files);
$testo= str_replace("%", "%%",$testo);
$testo= str_replace("!*", "<strong>",$testo);
$testo= str_replace("*!", "</strong>",$testo);
$testo = preg_replace(
'#((https?|ftp)://(\S*?\.\S*?))([\s)\[\]{},;"\':<]|\.\s|$)#i',
"<a href=\"$1\" target=\"_blank\">$3</a>$4",$testo
);
And then there is the HTML part where the contents are shown:
<div id="boxpubblicazione">
<img class="alignleft" src="<?Php echo($foto) ?>" alt="image" /> <?Php echo nl2br($testo) ?>
</div>
I thought to insert a "<div>"
or a "<p>"
before the <?php echo nl2br($testo) ?>
imitating what the sample files of the scripts do, only that they used a text written inside the code, like "<p class="queryclass" text text text></p>
, but my idea obviously did not work. Any suggestions? Maybe someone knows some free script that can be used in my case? Thanks in advance. Regards