(ну любят некоторые читать начиная с последних)
Может где что есть на эту тему?
Или подправить чего ?

Угу...удачно ты тему поднял =)
Код: Выделить всё
##############################################################
## MOD Title: Post sort order for user
## MOD Author: [R: R@m$e$ :U] < Ramses@FromRU.com > (Ramses) http://www.phpbbguru.net
## MOD Description: Allows user to specify post sort order
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: ~10 minutes
## Files To Edit:
## viewtopic.php
## includes/usercp_register.php
## includes/usercp_avatar.php
## includes/functions_selects.php
## language/lang_english/lang_main.php
## templates/subSilver/profile_add_body.tpl
## Included Files:
## root/db_update.php
##
## Translations/Russian 1.0.0.txt
##############################################################
## For Security Purposes, Please Check: http://www.phpbbguru.net/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum.
##############################################################
## Author Notes:
## Thanks to many russian users for idea...
##
## Find bug? Please write me...
##
## Run SQL-commands in phpMyAdmin or execute root/db_update.php
##
##############################################################
## MOD History:
##
## 2005-03-02 - Version 1.1.0
## - Added button to template
## - Added button to quick_reply [Extended Quick Reply Form v2.2.4 by Xpert & Vladson] template
## - Remake install
##
## 2005-02-13 - Version 1.0.0
## - First version =)))
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ SQL ]------------------------------------------
#
ALTER TABLE `phpbb_users` ADD `user_post_order` VARCHAR( 4 ) DEFAULT 'asc' NOT NULL ;
#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
if ( !empty($post_id) )
{
$start = floor(($forum_topic_data['prev_posts'] - 1) / intval($board_config['posts_per_page'])) * intval($board_config['posts_per_page']);
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
// [start] Post sort order for user
if ( !empty($post_id) )
{
if ($userdata['user_post_order'] == 'desc')
{
$sql = "SELECT COUNT(post_id) AS total_posts
FROM " . POSTS_TABLE . "
WHERE forum_id = " . $forum_id . "
AND topic_id = " . $topic_id;
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, "Could not obtain number of posts in topic", '', __LINE__, __FILE__, $sql);
}
$total_posts = ( $row = $db->sql_fetchrow($result) ) ? intval($row['total_posts']) : 0;
$start = floor(($total_posts - $forum_topic_data['prev_posts'] )/ intval($board_config['posts_per_page'])) * intval($board_config['posts_per_page']);
}
else
{
$start = floor(($forum_topic_data['prev_posts'] - 1) / intval($board_config['posts_per_page'])) * intval($board_config['posts_per_page']);
}
}
// [end] Post sort order for user
#
#-----[ FIND ]------------------------------------------
#
else
{
$post_order = 'asc';
$post_time_order = 'ASC';
}
#
#-----[ REPLACE WITH ]------------------------------------------
#
else
{
if ( $userdata['user_post_order'] == 'desc')
{
$post_time_order = 'DESC';
}
else
{
$post_order = 'asc';
$post_time_order = 'ASC';
}
}
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ FIND ]------------------------------------------
#
if ( !empty($HTTP_POST_VARS['language']) )
{
if ( preg_match('/^[a-z_]+$/i', $HTTP_POST_VARS['language']) )
{
$user_lang = htmlspecialchars($HTTP_POST_VARS['language']);
}
else
{
$error = true;
$error_msg = $lang['Fields_empty'];
}
}
else
{
$user_lang = $board_config['default_lang'];
}
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Post sort order for user
if ( !empty($HTTP_POST_VARS['post_order']) )
{
if ( preg_match('/^[a-z_]+$/i', $HTTP_POST_VARS['post_order']) )
{
$user_post_order = htmlspecialchars($HTTP_POST_VARS['post_order']);
}
else
{
$error = true;
$error_msg = $lang['Fields_empty'];
}
}
else
{
$user_post_order = 'asc';
}
// [end] Post sort order for user
#
#-----[ FIND ]------------------------------------------
#
$user_lang = stripslashes($user_lang);
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Post sort order for user
$user_post_order = stripslashes($user_post_order);
// [end] Post sort order for user
#
#-----[ FIND ]------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE . "
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popup_pm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . "
WHERE user_id = $user_id";
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Post sort order for user
#
#-----[ AFTER, ADD ]------------------------------------------
#
// [end] Post sort order for user
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, user_lang = '" . str_replace("\'", "''", $user_lang) . "'
#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
, user_post_order = '" . str_replace("\'", "''", $user_post_order) . "'
#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $new_password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popup_pm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, ";
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Post sort order for user
#
#-----[ AFTER, ADD ]------------------------------------------
#
// [end] Post sort order for user
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, user_lang
#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
, user_post_order
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, '" . str_replace("\'", "''", $user_lang) . "'
#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
, '" . str_replace("\'", "''", $user_post_order) . "'
#
#-----[ FIND ]------------------------------------------
#
$user_lang = stripslashes($user_lang);
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Post sort order for user
$user_post_order = stripslashes($user_post_order);
// [end] Post sort order for user
#
#-----[ FIND ]------------------------------------------
#
$user_lang = $userdata['user_lang'];
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Post sort order for user
$user_post_order = $userdata['user_post_order'];
// [end] Post sort order for user
#
#-----[ FIND ]------------------------------------------
#
display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, &$new_password, &$cur_password, $password_confirm, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popup_pm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat, $userdata['session_id']);
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Post sort order for user
#
#-----[ AFTER, ADD ]------------------------------------------
#
// [end] Post sort order for user
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, $user_lang
#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
, $user_post_order
#
#-----[ FIND ]------------------------------------------
#
'LANGUAGE_SELECT' => language_select($user_lang, 'language'),
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Post sort order for user
'POST_ORDER_SELECT' => post_order_select($user_post_order, 'post_order'),
// [end] Post sort order for user
#
#-----[ FIND ]------------------------------------------
#
'L_BOARD_LANGUAGE' => $lang['Board_lang'],
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Post sort order for user
'L_POST_ORDER' => $lang['Order'],
// [end] Post sort order for user
#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_avatar.php
#
#-----[ FIND ]------------------------------------------
#
function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current_email, &$coppa, &$username, &$email, &$new_password, &$cur_password, &$password_confirm, &$icq, &$aim, &$msn, &$yim, &$website, &$location, &$occupation, &$interests, &$signature, &$viewemail, &$notifypm, &$popup_pm, &$notifyreply, &$attachsig, &$allowhtml, &$allowbbcode, &$allowsmilies, &$hideonline, &$style, &$language, &$timezone, &$dateformat, &$session_id)
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Post sort order for user
#
#-----[ AFTER, ADD ]------------------------------------------
#
// [end] Post sort order for user
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, &$language
#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
, &$post_order
#
#-----[ FIND ]------------------------------------------
#
$params = array('coppa', 'user_id', 'username', 'email', 'current_email', 'cur_password', 'new_password', 'password_confirm', 'icq', 'aim', 'msn', 'yim', 'website', 'location', 'occupation', 'interests', 'signature', 'viewemail', 'notifypm', 'popup_pm', 'notifyreply', 'attachsig', 'allowhtml', 'allowbbcode', 'allowsmilies', 'hideonline', 'style', 'language', 'timezone', 'dateformat');
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Post sort order for user
#
#-----[ AFTER, ADD ]------------------------------------------
#
// [end] Post sort order for user
#
#-----[ IN-LINE FIND ]------------------------------------------
#
, 'language'
#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
, 'post_order'
#
#-----[ OPEN ]------------------------------------------
#
includes/functions_selects.php
#
#-----[ FIND ]------------------------------------------
#
//
// Pick a language, any language ...
//
function language_select($default, $select_name = "language", $dirname="language")
{
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Post sort order for user
//
// Pick a post order
//
function post_order_select($default, $select_name = "post_order")
{
global $userdata, $lang;
$post_order_select = '<select name="' . $select_name . '">';
if ( $userdata['user_post_order'] == 'desc')
{
$orderdesc = ' selected="selected"';
}
else
{
$orderasc = ' selected="selected"';
}
$post_order_select .= '<option value="asc"' . $orderasc . '>' . $lang['Order_ascending'] . '</option>';
$post_order_select .= '<option value="desc"' . $orderdesc . '>' . $lang['Order_descending'] . '</option>';
$post_order_select .= '</select>';
return $post_order_select;
}
// [end] Post sort order for user
#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Post sort order for user
$lang['Order_ascending'] = 'Oldest First';
$lang['Order_descending'] = 'Newest First';
$lang['Order'] = 'Post Display';
// [end] Post sort order for user
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl
#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_ALWAYS_ALLOW_SMILIES}:</span></td>
<td class="row2">
<input type="radio" name="allowsmilies" value="1" {ALWAYS_ALLOW_SMILIES_YES} />
<span class="gen">{L_YES}</span>
<input type="radio" name="allowsmilies" value="0" {ALWAYS_ALLOW_SMILIES_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
#
#-----[ AFTER, ADD ]------------------------------------------
#
<tr>
<td class="row1">{L_ORDER}</td>
<td class="row2"><select name="forumorder">{S_ORDER_LIST}</select></td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
Код: Выделить всё
<?
#########################################################
## SQL commands to phpBB2
## Author: Niels Chr. Rшd
## Nickname: Niels Chr. Denmark
## Email: ncr@db9.dk
##
## Ver 1.0.7
##
## phpBB2 database update script for mods
## this file is intended to use with phpBB2, when installing mods
## after so you may delete this file, but only admin can use so it really doesen't matter
## The script will look what prefix you are using, and use the existing DB defined by congig.php
## The execution of this script's included SQL is harmless, so you can run it as meny times you like
## note, though that the users last visit, will be set back to his/her last login,
## but that is a minor cosmetic isue, that will correct it self next time the use logs in
##
## the following example are from my mods, and you can add some self, for other mods if you like
## you will after execution get a list over those commands that are run with succes and those with warnings !
## delete the sample lines if you are using it only for other mods
##
#########################################################
define('IN_PHPBB', true);
$phpbb_root_path = './';
include($phpbb_root_path . 'extension.inc');
include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/functions_selects.'.$phpEx);
###################################################################################################
##
## put the SQL commands below here, the SQL commands listed below are only exampels, substitude them with the one you need ##
##
###################################################################################################
$sql=array(
'ALTER TABLE ' . USERS_TABLE . ' ADD `user_post_order` VARCHAR (4) DEFAULT `asc` NOT NULL'
);
$mods = array (
'Post sort order for user 1.0.0'
);
############################################### Do not change anything below this line #######################################
//
// Start session management
//
$userdata = session_pagestart($user_ip, PAGE_INDEX);
init_userprefs($userdata);
//
// End session management
//
if ($userdata['user_level']!=ADMIN)
message_die(GENERAL_ERROR, "You are not Authorised to do this");
$n=0;
$message="<b>This list is a result of the SQL queries needed for mod</b><br/><br/>";
while($sql[$n])
{
$message .= ($mods[$n-1] != $mods[$n]) ? '<p><b><font size=3>'.$mods[$n].'</font></b><br/>' : '';
if(!$result = $db->sql_query($sql[$n]))
$message .= '<b><font color=#FF0000>[Already added]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
else $message .='<b><font color=#0000fF>[Added/Updated]</font></b> line: '.($n+1).' , '.$sql[$n].'<br />';
$n++;
}
message_die(GENERAL_MESSAGE, $message);
?>
Код: Выделить всё
##############################################################
## MOD Title: Post sort order for user [Russian Translation]
## MOD Author: [R: R@m$e$ :U] < Ramses@FromRU.com > (Ramses) http://www.phpbbguru.net
## MOD Description: Allows user to specify post sort order
## MOD Version: 1.0.0
##
## Installation Level: Easy
## Installation Time: ~1 minutes
## Files To Edit:
## language/lang_russian/lang_main.php
## Included Files:
## n/a
##############################################################
## For Security Purposes, Please Check: http://www.phpbbguru.net/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum.
##############################################################
## Author Notes:
## Thanks to many russian users for idea...
##
## Find bug? Please write me...
##
##############################################################
## MOD History:
##
## 2005-02-13 - Version 1.0.0
## - First version =)))
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
language/lang_russian/lang_main.php
#
#-----[ FIND ]------------------------------------------
#
?>
#
#-----[ BEFORE, ADD ]------------------------------------------
#
// [start] Post sort order for user
$lang['Order_ascending'] = 'Со старых';
$lang['Order_descending'] = 'С новых';
$lang['Order'] = 'Порядок сообщений начиная';
// [end] Post sort order for user
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM