Previous Thread
Next Thread
Print Thread
Rate Thread
Forcing unique topic view order per forum
#245208 05/03/2003 1:08 PM
Joined: Apr 2003
Posts: 30
User
OP Offline
User
Joined: Apr 2003
Posts: 30
Ok ... first I will preface this to say I am VERY new to this whole hacking thing, and I dont understand any of it ... just ask Josh. hehehe

For most of my forums on my sites I want to have the normal topic order as the default view ... newest topics with replies on top, etc. However, there are certian forums that I want to have different, or unique topic viewing.

1) I would like to have topics in order of when the initial post starter was made (newest to oldest). For instance, this would be for news. So, the most recent news post would be on top. Right now, if a person replies to a news topic that is from 2 weeks ago, it puts that on top of the listing, and that is not what I want.

2) I would like to have topics ordered by alpha (A - Z). This would be for a databased style forum. The order would not change when replies are added. For instance, for my gaming site, each topic would be the name of a game and in alpha order ... like:

RalliSport Challenge
Rally Fusion: Race Of Champions
Rayman Arena
RedCard Soccer 2003
Roller Coaster Tycoon
Run Like Hell

etc.....

Thanks! I am sure I will have more questions as we go along. I am still unsure exactly everything that I want to do with the structure, but this will be a good start.

Sponsored Links
Re: Forcing unique topic view order per forum
#245209 05/03/2003 9:57 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
Offline
I type Like navaho
Joined: Nov 2001
Posts: 10,369
That is doable.

I did something similar for Coy7 at www.IyariLimon.com

Bascially you're going to hack around in postlist.php

Haven't looked at any code, but here's my guess.

For number one, I would add an "if" statement to override the "dateslip" check. The way you describe in #1 is how it functions with dateslip off. The posts stay in their order.

For number 2, you'd use an "if" statment, to see if it's a certain board, you'll alter the "ORDER BY" line of the query.

It would change to
"ORDER BY t1.B_Subject ASC"
I believe.

Re: Forcing unique topic view order per forum
Daine #245210 05/03/2003 10:44 PM
Joined: Jan 2003
Posts: 250
Member
Offline
Member
Joined: Jan 2003
Posts: 250
You can easily sort a forum alphabetically by subject by clicking the SUBJECT link in the topic page (postlist).

Here is the URL to sort this forum alpha, ascending:

Code
<br />https://www.ubbdev.com/forum/postlist.php?Cat=&Board=php&page=0&view=collapsed&sb=2&o=<br />


So you could just append the extra "&page=0&view=collapsed&sb=2&o=" to the URL for those forums you want sorted in this fashion in to your UBBTHREADS.TMPL file.

In UBBTHREADS.TMPL find:
Code
<br /><a href="{$config['phpurl']}/postlist.php?Cat=$Cat&amp;Board={$forum[$c][$f]['Keyword']}"><br />


Change it to:
Code
<br /><a href="{$config['phpurl']}/postlist.php?Cat=$Cat&amp;Board={$forum[$c][$f]['Keyword']}{$forum[$c][$f]['SortBy']}"><br />


$forum is an multi-dimensional array that holds display and organization info about each forum. We are going to add an entry in that array called "SortBy" and stick our sort info in it, and then append it to the URL on the forums page.

Then open UBBTHREADS.PHP and find:
Code
<br />$forum[$x][$y]['Keyword'] = $Keyword;<br />


After that add:
Code
<br />if ($Keyword == "XXXX") {<br />    $forum[$x][$y]['SortBy'] = "&page=0&view=collapsed&sb=2&o=";<br />}<br />else {<br />    $forum[$x][$y]['SortBy'] = "";<br />}<br />


Replace XXXX with the Keyword of the forum you want to sort. If you want to sort more than one forum alphabetically by subject, the just change the "if" statement to:
Code
<br />if (($Keyword == "XXXX") || ($Keyword == "YYYY")) {<br />


That will make is so that the forums identified by the keywords you specify will be sorted alpha, ascending when the user clicks on the link to open the forum.

Hope that helps!





"Some dream of doing great things, while others stay awake and get on with it."
      -- Anonymous
Re: Forcing unique topic view order per forum
#245211 05/04/2003 1:31 PM
Joined: Apr 2003
Posts: 30
User
OP Offline
User
Joined: Apr 2003
Posts: 30
Thanks. I am not up to speed today, so I am going to wait until I have a clear head before I try this ... I will post back here when I do with more questions or response.

Re: Forcing unique topic view order per forum
#245212 05/05/2003 9:34 AM
Joined: Jan 2003
Posts: 250
Member
Offline
Member
Joined: Jan 2003
Posts: 250
No worries. Let me know if you need help.


"Some dream of doing great things, while others stay awake and get on with it."
      -- Anonymous
Sponsored Links
Re: Forcing unique topic view order per forum
#245213 06/12/2004 2:14 PM
Joined: Apr 2003
Posts: 30
User
OP Offline
User
Joined: Apr 2003
Posts: 30
Ok .. bringing a topic up from the past (forgot about this).

This worked, thanks.

NOW ... what about:

Another option I am looking into is having a forum stay in order of date and time the initial topic post is created, but still allow people to reply. I want people to be able to reply to the topic and always be able to , but if someone replies to a topic from last month, it will bump it up to the top above more recent topics, and I do not want that. Basically, I want most recent topics created (not replied to) at top , decending to the last one created. This would only be for a couple forums, not all... for instance, a site news forum. I do not want to do this to all the forums.

Thanks.

Re: Forcing unique topic view order per forum
#245214 06/12/2004 6:19 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
Offline
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Basically you want to shut dateslip off on a per forum basis.

This should work -in postlist.php - after the get_input stuff.

Code
<br />if ($Board == "keyword") {<br />   $config['dateslip'] = 0;<br />}<br />


Where I have "keyword" use the real keyword for the board. Then the posts will remain in order by date posted. (Dateslip will be off in that forum. )

Re: Forcing unique topic view order per forum
Daine #245215 06/12/2004 6:33 PM
Joined: Apr 2003
Posts: 30
User
OP Offline
User
Joined: Apr 2003
Posts: 30
Hey Josh, can you point me where specifically I need to put that? Do I need to replace anything? Also, what about multiple forums that I want that for?

Thanks man.

Re: Forcing unique topic view order per forum
#245216 06/12/2004 6:39 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
Offline
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Add it after the get_input lines at the top. After this:

$o = get_input("o","both");



If you have more than one board -

if (($Board == "keyword") || ($Board == "keyword2")) {

instead of that other "if" line I posted.

Re: Forcing unique topic view order per forum
Daine #245217 06/12/2004 6:53 PM
Joined: Apr 2003
Posts: 30
User
OP Offline
User
Joined: Apr 2003
Posts: 30
Thanks Josh! Can I bug you for ONE MORE THING ?

I want to change the "Subject Poster Views Replies Last post" links to just text ... meaning that since I am forcing the way each forum is being viewed, those do not need to be "clickable" and changable, but the text needs to be there for column labelling. I am assuming I edit the postlist.tmpl deal, but I cannot figure out what to edit out without screwing it up.

Help please?

Thank you.

Sponsored Links
Re: Forcing unique topic view order per forum
#245218 06/12/2004 9:25 PM
Joined: Nov 2001
Posts: 10,369
I type Like navaho
Offline
I type Like navaho
Joined: Nov 2001
Posts: 10,369
In the postlist.tmpl - it's plain HTML, you'll find each comment has code like this:

<a href="{$config['phpurl']}/postlist.php?Cat=$Cat&Board=$Board&page=$page&view=$view&sb=$sortsubject&o=$o">
{$ubbt_lang['SUBJECT_TEXT']}
</a>


Remove the <a href..... > part and the </a> from each column heading.

Re: Forcing unique topic view order per forum
Daine #245219 06/12/2004 9:33 PM
Joined: Apr 2003
Posts: 30
User
OP Offline
User
Joined: Apr 2003
Posts: 30
Thanks ... I was doing that in a text editor, and it wasn't working, so I just did it via the control panel and it works.

Thanks again for your help!


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
Pilgrim
Pilgrim
NH, USA
Posts: 190
Joined: June 2000
Forum Statistics
Forums63
Topics37,543
Posts293,773
Members13,838
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online 339
Topics Created 0
Posts Made 1
Users Online 3
Birthdays 28
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,805
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 9
isaac 8
driv 2
temp 2
Morgan 1
Top Likes Received
isaac 38
Gizmo 10
Brett 7
Morgan 2
Top Likes Received (30 Days)
isaac 4
Gizmo 2
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2020 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 7.7.5
(Snapshot build 20200524.dev)
Responsive Width:

PHP: 5.4.45 Page Time: 0.054s Queries: 39 (0.025s) Memory: 3.3446 MB (Peak: 3.6269 MB) Data Comp: Zlib Server Time: 2020-05-29 00:29:35 UTC
Valid HTML 5 and Valid CSS