Page 1 of 1

[BETA] Page links to Page list

Posted: Sun May 30, 2004 7:36 am
by Hater
My first contribution. :)
Let me say that I have no idea if this is easyMod compliant because I've never used easyMod. I simply copied and sampled other easyMod compliant methodology. (Besides it's one copy and paste so easyMod isn't really necessary. )

I can't say there will be many bugs to work out as this is a rather simple yet effective replacement for the bizarre pagination system that phpBB uses with the normal template.

Demo can be found HERE.

Code: Select all

#################################################################
## Mod Title:   Specific page
## Mod Version: 1.0.0
## Author:      Hater <john@wildemotorsports.com>
## Description: Replaces pagination with drop-down list
##
## Installation Level:  Easy
## Installation Time:   1 Minute
## Files To Edit:       includes/functions.php
## Included Files:      N/A
#################################################################
##
#################################################################
## Before Adding This MOD To Your Forum, 
## You Should Back Up All Files Related To This MOD
#################################################################

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

# 
#-----[ FIND ]------------------------------------------
$page_string = $lang['Goto_page'] . ' ' . $page_string;

# 
#-----[ REPLACE ]----------------------------------------------
# 
//--- MOD Start: Specific page
//	$page_string = $lang['Goto_page'] . ' ' . $page_string;


	$list_name = ' <select name="select_page" onchange="if(this.options[this.selectedIndex].value != -1){ window.location = this.options[this.selectedIndex].value; }">';
	for($i = 1; $i <= $total_pages; $i++)
	{
		$selected = ( $i == $on_page ) ? ' selected="selected"' : ''; // highlight current page by default
		$list_name .= '<option value="' . append_sid($base_url . "&start=" . ( ( $i - 1 ) * $per_page ) )  . '"' . $selected . '>' . $i . '</option>';
	}
	$list_name .= '</select>';

	$page_string = $lang['Goto_page'] . $list_name;

//----- MOD End: Specific page

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

Posted: Wed Jun 02, 2004 6:45 am
by Hater
I'm quite surprised that no one seemed to think that was as grand of an idea as I did.

Ahh well.. It's working fine for me on my forums exactly as intended. :wink:

Posted: Wed Jun 02, 2004 9:08 am
by smithy_dll
Hello and welcome to the world of phpBB MODding,
congratulations on your first MOD,

However, we require that you become aquainted with some technical specifications about the MOD Template, these are guidelines you must follow and does not require you to test you MOD in easyMOD. Please also read the forum rules and adjust your thread title appropriately,

General MODding in phpBB information


thank you for your time,

Posted: Wed Jun 02, 2004 8:13 pm
by Rookie7
Nice mod! Thanks for sharing.