Mod Name / Version: User can select sort topics by creation date or by last reply "dateslip".
Description: User can individually select sort topics by creation date or by last reply "dateslip".
Working Under: UBB.Threads 6.5
Mod Status: Finished
Any pre-requisites: Author(s): AlfDate: 10/07/04
Credits: Files Altered: languages\english\editbasic.php
templates\default\editbasic.tmpl
changebasic.php
editbasic.php
postlist.php
New Files: Database Altered: yes
Info/Instructions: 1. languages\english\editbasic.php:
-----------------------------------------------------------
1.1. after the line
$ubbt_lang['SELECT'] = "Select";
put
$ubbt_lang['PROF_SORTORDER'] = "Sort threads by: ";
$ubbt_lang['PROF_SORTORDER0'] = "creation date";
$ubbt_lang['PROF_SORTORDER1'] = "last post date";
2. languages\russian\editbasic.php:
-----------------------------------------------------------
appropriate changes for russian language version:
$ubbt_lang['PROF_SORTORDER'] =
$ubbt_lang['PROF_SORTORDER0'] =
$ubbt_lang['PROF_SORTORDER1'] =
3. templates\default\editbasic.tmpl:
-----------------------------------------------------------
3.1. after
<!-- privates is defined in editbasic.php since it is an admin option -->
$privates
put
$sortorder
4. changebasic.php:
-----------------------------------------------------------
4.1. after
$profilehash = get_input("profilehash","post");
put
$PostSortOrder = get_input("PostSortOrder","post");
4.2. after
$displayname_q = addslashes($displayname);
put
$PostSortOrder_q = addslashes($PostSortOrder);
4.3. after
U_AcceptPriv = '$AcceptPriv_q',
put
U_PostSortOrder = '$PostSortOrder_q',
5. editbasic.php:
-----------------------------------------------------------
5.1. replace the line
SELECT U_LoginName,U_Password,U_Email,U_Fakeemail,U_Name,U_Signature,U_Homepage,U_Occupation,U_Hobbies,U_Location,U_Bio,U_TextCols,U_TextRows,U_Extra1,U_Extra2,U_Extra3,U_Extra4,U_Extra5,U_Picture,U_Visible,U_AcceptPriv,U_OnlineFormat,U_Birthday,U_ShowBday,U_PicWidth,U_PicHeight
with
SELECT U_LoginName,U_Password,U_Email,U_Fakeemail,U_Name,U_Signature,U_Homepage,U_Occupation,U_Hobbies,U_Location,U_Bio,U_TextCols,U_TextRows,U_Extra1,U_Extra2,U_Extra3,U_Extra4,U_Extra5,U_Picture,U_Visible,U_AcceptPriv,U_OnlineFormat,U_Birthday,U_ShowBday,U_PicWidth,U_PicHeight,U_PostSortOrder
5.2. replace the line
list($LoginName,$ChosenPassword,$Email,$Fakeemail,$Name,$Signature,$Homepage,$Occupation,$Hobbies,$Location,$Bio,$TextCols,$TextRows,$ICQ,$Extra2,$Extra3,$Extra4,$Extra5,$Picture,$Visible,$AcceptPriv,$OnlineFormat,$Birthday,$ShowBday,$PicWidth,$PicHeight) = $dbh -> fetch_array($sth);
with
list($LoginName,$ChosenPassword,$Email,$Fakeemail,$Name,$Signature,$Homepage,$Occupation,$Hobbies,$Location,$Bio,$TextCols,$TextRows,$ICQ,$Extra2,$Extra3,$Extra4,$Extra5,$Picture,$Visible,$AcceptPriv,$OnlineFormat,$Birthday,$ShowBday,$PicWidth,$PicHeight,$PostSortOrder) = $dbh -> fetch_array($sth);
5.3. after
// ----------------------------------------------
// Set the default for accepting private messages
if ($AcceptPriv == "yes") {
$acceptyes = "checked="checked"";
}
else {
$acceptno = "checked="checked"";
}
put
// ----------------------------------------------
// Set the default for threads sorting order
if ($PostSortOrder == 1) {
$postsort1 = "checked="checked"";
}
else {
$postsort0 = "checked="checked"";
}
5.4. after
if ($config['private'] == "1") {
$privates = "
{$ubbt_lang['PROF_PRIV']}<br />
<input type="radio" name ="AcceptPriv" value="yes" $acceptyes class="formboxes" /> {$ubbt_lang['TEXT_YES']}
<input type="radio" name ="AcceptPriv" value="no" $acceptno class="formboxes" /> {$ubbt_lang['TEXT_NO']}
<br />
<br />
";
}
put
$sortorder = "
{$ubbt_lang['PROF_SORTORDER']}<br />
<input type="radio" name ="PostSortOrder" value="0" $postsort0 class="formboxes" /> {$ubbt_lang['PROF_SORTORDER0']}
<input type="radio" name ="PostSortOrder" value="1" $postsort1 class="formboxes" /> {$ubbt_lang['PROF_SORTORDER1']}
<br />
<br />
";
6. postlist.php:
-----------------------------------------------------------
6.1. instead of
$user = $userob -> authenticate("U_Display, U_Groups, U_View, U_PostsPer, U_FlatPosts, U_TimeOffset,U_TimeFormat,U_LastOn");
put
$user = $userob -> authenticate("U_Display, U_Groups, U_View, U_PostsPer, U_FlatPosts, U_TimeOffset,U_TimeFormat,U_LastOn, U_PostSortOrder");
6.2. Instead of
if (!$config['dateslip']) {
put
if (isset($user) && isset($user['U_PostSortOrder'])) {
$dateslip = $user['U_PostSortOrder'];
} else {
$dateslip = $config['dateslip'];
}
if (!$dateslip) {
7. Alter database structure:
-----------------------------------------------------------
ALTER TABLE `w3t_Users` ADD `U_PostSortOrder` TINYINT UNSIGNED DEFAULT '0' NOT NULL;
Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.
Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.