• Index :: PHPBB3 Modifications :: Simple phpBB3 Smiley Pagination Mod
  • Change font size
  • •

It is currently 08:57 am Wed Aug 20 2008

  • Home
  • WinMX
  • BitTorrent
  • Video
  • Computer Problem
  • Ubuntu/Linux
  • PHP scripts & phpBB3 Mods
  • Forums

Simple phpBB3 Smiley Pagination Mod


I noticed there were several people looking for a pagination mod for the new version of phpbb (phpbb3), but no one had released anything to do the job.

The following code is simple, it does not even go into previous and next alternatives. It is a basic, pagination script for smilies, nothing more.

Perhaps at another time I may feel compelled to improve upon it, but as of now, it serves the purpose.

There is no guarantees implied or otherwise, using this mod could cause sterility in mice, turn the pope agnostic, or even get Bill Clinton laid. Well, perhaps he doesn't need help. Even more likely none of those will happen and it will do exactly as implied.

But you cannot say you have not been warned. Simple phpBB3 smilie pagination MOD.

For support, additional questions or Feature request with NO Guarantees, feel free to visit our phpbb3 and PHP Forum


[code]
#################################################################
## MOD Title: Simple Smiley Pagination phpbb3 MOD
## MOD Author: Vladd44 < vladd44@vladd44.com > http://www.vladd44.com
## MOD Description: Limit how many smilies will appear on the smilies popup window
## with page links to the rest.
##
## MOD Version: 1.0.4
## phpBB3 Version: 3.0.2
##
## Installation Level: Easy
## Installation Time: 5 Minutes
##
## Files To Edit: includes/functions_posting.php
## styles/subsilver2/template/posting_smilies.html

##
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v3
#################################################################
## History:
##
## 2008-09-15 - version 1.0.4
## 2008-09-14 - version 1.0.3
## 2008-09-14 - version 1.0.2
## 2008-09-01 - version 1.0.1
## 2008-06-19 - version 1.0.0
## - Initial Release.
##
#################################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD.
#################################################################

#
#-----[ OPEN ]---------------------------------------------------
#
includes/functions_posting.php

#
#-----[ FIND ]---------------------------------------------------
#
$sql = 'SELECT *
FROM ' . SMILIES_TABLE .
(($mode == 'inline') ? ' WHERE display_on_posting = 1 ' : '') . '
ORDER BY smiley_order';

#
#-----[ REPLACE WITH ]-------------------------------------------
#
// For pagination.
$smiley_limit = 100;
if (isset($_GET['start'])) {
$start = intval($_GET['start']);
} else {
$start =0;
}
$sql = 'SELECT *
FROM ' . SMILIES_TABLE .
(($mode == 'inline') ? ' WHERE display_on_posting = 1 ' : '') . '
ORDER BY smiley_order ASC LIMIT '.$start.', '.$smiley_limit.'';
// end pagination





#
#-----[ FIND ]---------------------------------------------------
#
page_footer();
#
#-----[ Before, ADD ]-------------------------------------------
#
// additions to pagination
if ($start){
$cp = $start / $smiley_limit+1;
} else {
$cp = 1;
}
$pagination = '';
$ref = $db->sql_query('SELECT * FROM '. SMILIES_TABLE );
$n_smiles = $db->sql_affectedrows('SELECT * FROM '. SMILIES_TABLE );
$total_pages =ceil($n_smiles/$smiley_limit);
for ($apl=1; $apl<=$total_pages; $apl++) {
$pagination.= '<a href="'.$phpbb_root_path.'posting.php?mode=smilies&start='.(($apl-1)*$smiley_limit).'"> '.$apl.' ';
}
$pagination = "
Now Showing Page $cp of $total_pages.
Total Pages $pagination
";
$template->assign_vars(array(
'PAGINATION' => $pagination ));
// end additon to pagination






#
#-----[ OPEN ]---------------------------------------------------
#

styles/subsilver2/template/posting_smilies.html

#
#-----[ FIND ]---------------------------------------------------
#


#
#-----[ BEFORE, ADD ]---------------------------------------------
#
<tr>
<td align="center"><span class="genmed">{PAGINATION}</span></td>
</tr>

#
#-----[ SAVE/CLOSE ALL FILES ]-----------------------------------
#
# EoM
[/code]







Common Misspelled words on this page are
© 2003, 2004, 2005, 2006, 2007 2008 Vladd44.com Privacy Policy.