[BETA] Page links to Page list

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
User avatar
Hater
Registered User
Posts: 570
Joined: Tue May 06, 2003 8:56 pm
Location: Wisconsin
Contact:

[BETA] Page links to Page list

Post 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
Last edited by Hater on Thu Jun 03, 2004 6:34 am, edited 1 time in total.

User avatar
Hater
Registered User
Posts: 570
Joined: Tue May 06, 2003 8:56 pm
Location: Wisconsin
Contact:

Post 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:

User avatar
smithy_dll
Former Team Member
Posts: 7630
Joined: Tue Jan 08, 2002 6:27 am
Location: Australia
Name: Lachlan Smith
Contact:

Post 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,

User avatar
Rookie7
Registered User
Posts: 189
Joined: Mon Mar 10, 2003 3:32 pm
Contact:

Post by Rookie7 »

Nice mod! Thanks for sharing.

Post Reply

Return to “[2.0.x] MODs in Development”