MOD download & history

Small mod, that makes locked topics go to the end of the forum view

Moderator: Moderators

Forum rules
The content in this forum is dated Dec. 21 2005 and can be used as Archive only. This Forum is LOCKED and READ ONLY !

MOD download & history

Postby Niels on Sat 01. Jun, 2002 17:17

Code: Select all
##############################################################
## MOD Title:          Locked at the end
## MOD Author:         Niels < ncr@db9.dk > (Niels Chr. Rød) http://mods.db9.dk
## MOD Description:    Makes locked topic shows last in the topic's
##                     page list that way, making them "out of
##                     sigt, out of mind".
## MOD Version:        1.2.5
## MOD Compatibility:  2.0.x
##
## Installation Level: Easy
## Installation Time:  2 Minutes (1mn by EasyMOD of Nuttzy)
## Files To Edit:      3
##      modcp.php
##      search.php
##      viewforum.php
##
## Included Files:     0
##
##############################################################
## MOD History:
##
##   2003-12-16 - Version 1.2.5
##      - phpBB template & EasyMOD compliance enhancement
##
##   2003-08-04 - Version 1.2.4
##      - How-to rewrite to be EasyMOD compatible
##
##   2003-08-03 - Version 1.2.3
##      - correction to search.php
##
##   ????-??-?? - Version 1.2.2
##      - included order to the modcp.php (phpBB2 ver 2.0.4)
##        blanchas78@hotmail.com
##
##   ????-??-?? - Version 1.2.1
##      - included order in search result
##
##   ????-??-?? - Version 1.2.0
##      - now re-write for phpBB2 ver 2.0.2
##
##   ????-??-?? - Version 1.0.2
##      - release for phpBB2 ver 2.0.0 History started
##
##   ????-??-?? - Version 0.9.0
##      - initial release RC-4
##
##############################################################
Last edited by Niels on Thu 18. Dec, 2003 21:39, edited 5 times in total.
(if a how-to is EM ready, it will mostly be bullet prof, since a machine is more picky than a human. :D)
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Jérôme on Sun 02. Jun, 2002 02:24

The small but very efficient and nixe MOD by Niels is made obviously made for phpBB 2.0.0.

Here is the slightly modified code for phpBB 2.0.1:
(Niels, feel free to delete this posting as soon as the code is updated in your ZIPfile...

Code: Select all
########################################################
## Mod Title: Locked in button Mod
## Mod Version: 1.0.3 for phpBB2.0.1
## Author: Niels Chr. Rød Denmark < ncr@db9.dk <mailto:ncr@db9.dk> >
## Improved by: mitsubitsu
##
## Makes locked topic shows last in the topic's page list
## that way, making them "out of sigt, out of mind"
##
## This mod is only for phpBB2!!
##
##
## Installation Level: Easy
## Installation Time: 1 Minute
## Files To Edit: 1
## phpBB2/viewforum.php

########################################################
##
## Installation Notes:
## None
########################################################


#
#-----[ OPEN FILE ]------------------------------------------
#
phpBB2/viewfurum.php

#
#-----[FIND]------------------------------------------
#
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
   FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
   WHERE t.forum_id = $forum_id
      AND t.topic_poster = u.user_id
      AND p.post_id = t.topic_first_post_id
      AND p2.post_id = t.topic_last_post_id
      AND u2.user_id = p2.poster_id
      AND t.topic_type <> " . POST_ANNOUNCE . "
      $limit_topics_time
   ORDER BY t.topic_type DESC, t.topic_last_post_id DESC

#
#-----[REPLACE WITH] ------------------------------------------
#
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time
   FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2
   WHERE t.forum_id = $forum_id
      AND t.topic_poster = u.user_id
      AND p.post_id = t.topic_first_post_id
      AND p2.post_id = t.topic_last_post_id
      AND u2.user_id = p2.poster_id
      AND t.topic_type <> " . POST_ANNOUNCE . "
      $limit_topics_time
   ORDER BY t.topic_type DESC, t.topic_status ASC, t.topic_last_post_id DESC

#
#-----[ SAVE FILE ]------------------------------------------
#
phpBB2/viewfurum.php
Jérôme
Special supporter
 
Posts: 45
Joined: Tue 30. Apr, 2002 23:58
Location: Saarburg, Germany

Postby conanqtran on Sun 09. Jun, 2002 10:43

Note that if you have the sort forum mod (sort by latest post, last post or sort by leter ABC) , u might get the "could not get forum information" error. This would fix the problem:

Code: Select all
FIND:

ELSE
{
$order_sql = "ORDER BY t.topic_type DESC, t.topic_last_post_id DESC ";
}

REPLACE WITH

ELSE
{
   $order_sql = "ORDER BY t.topic_type DESC, t.topic_status ASC, t.topic_last_post_id DESC ";
}


thats it, u don't need to do anything else, this will make the locked topics appears last in ur forum.
.:: Check out my phpBB mods: transaction mod :: The Ultimate Empire ::.
conanqtran
Poster
Poster
 
Posts: 25
Joined: Wed 24. Apr, 2002 01:05

Postby bieniu on Sat 10. Aug, 2002 18:11

hi ..

i don't know why but this hack doesn't work at my forum ( www.czatowisko.pl/forum ). i was trying original and jerome's hack for v 2.0.1 but there's the same mistake still - blank page -- probably mistakes in php code .. have anyone got the same problems with this hack ?
bieniu
Poster
Poster
 
Posts: 1
Joined: Sat 10. Aug, 2002 18:06
Location: zgierz

upgrade

Postby Niels on Mon 16. Dec, 2002 16:11

This mod, have stayed the same for ages, now, I have come up with a add-on for it, you may use it or not depending on if you find it usefull.

as well have having the "viewtopic page" display locked topics last, I find it usefull if users are preforming a serch for specific word/autors, using the search function - that they get locked at the end in the result as well.
also announcements, and sticky topics should be displayed first - since they are usual good info for the users searching for answers.

this litle mod, does that
new version is 1.2.1

in file search.php
Code: Select all
[FIND]
$sql .= " ORDER BY ";

[AFTER, ADD]
// added mod, makes locked go to button in search
$sql .= ' t.topic_status ASC, t.topic_type DESC, ';


this is now included in the how-to
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Sat 02. Aug, 2003 23:14

the user blanchas have suggested to have this implemented in modcp.php as well, I I think this is best as well, therefor the version 1.2.2. have the changes need for this file as well.

at the same time, I did spot a minor problem in search.php witch is also corrected (1.2.3.)

to upgrade do the modcp.php
and in file search.php
Code: Select all
[FIND]
// added mod, makes locked go to button in search
$sql .= ' t.topic_status ASC, t.topic_type DESC,';

[REPLACE WITH]
// added mod, makes locked go to button in search
$sql .= ' t.topic_type DESC,t.topic_status ASC, ';
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46

Postby Niels on Sat 23. Aug, 2003 20:59

now EM ready
User avatar
Niels
Poster
Poster
 
Posts: 4390
Joined: Sat 27. Jul, 2002 15:46


Return to Locked at the end [2.0.6/EM]

Who is online

Users browsing this forum: No registered users and 0 guests

cron