Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jun 2001
Posts: 43
User
User
Offline
Joined: Jun 2001
Posts: 43
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): Alf

Date: 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.

Sponsored Links
Joined: Apr 2006
Posts: 1
Lurker
Lurker
Offline
Joined: Apr 2006
Posts: 1

I like this

thanks

Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808
at first it seems to work under 6.5.4 but it dont save the settings. If you try to set to 1 (last post date) and save your profile the table is not updated. In the table is 0.

If you edit the table with phpmyadmin you see that the modification itself works well. Only changing the setting over editbasic doesnt work.

Any ideas ?

Another wish: it would be nice to have this mod on forum base and not on user base. In 6.5.4 there is no way to set a forum fix in other sorting.

Joined: Jul 2001
Posts: 808
Coder
Coder
Joined: Jul 2001
Posts: 808


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Gizmo
Gizmo
Portland, OR, USA
Posts: 5,833
Joined: January 2000
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)