[2.0.6] Topic display order

The cleanup is complete. This forum is now read only.
Post Reply

Rating:

Excellent!
12
50%
Very Good
5
21%
Good
4
17%
Fair
2
8%
Poor
1
4%
 
Total votes: 24

Extensions Robot
Extensions Robot
Extensions Robot
Posts: 27926
Joined: Sat Aug 16, 2003 7:36 am

[2.0.6] Topic display order

Post by Extensions Robot » Wed Oct 29, 2003 1:16 am

MOD Name: Topic display order
Author: Ptirhiik - RPGnet-fr
MOD Description: This mod add a sort box at the bottom of the viewforum, allowing to sort topics per title, author, time, and of course last reply . A default value can be set in the ACP for each forum.

Disclaimer: This MOD has not been Validated by the MOD Team. The MOD has been tested for functionality only. For more information see this topic. However, the author has proven to be trustworthy.

MOD Version: 1.0.2

Download File: mod-topic_display_order.zip
File Size: 9737 Bytes
Last edited by Extensions Robot on Mon Apr 30, 2007 12:29 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)

Nuttzy99
Former Team Member
Posts: 4917
Joined: Fri Aug 03, 2001 7:09 am
Location: the 11th dimension
Contact:

Post by Nuttzy99 » Mon Dec 15, 2003 5:11 pm

Again, this MOD was not thoroughly validated, but we are make a one-time exception.

-Nuttzy :cool:
SpellingCow.com - Free spell check service for your forums or any web form!
No Support via PM please!

webcoyote
Registered User
Posts: 4
Joined: Thu Nov 13, 2003 8:17 pm
Contact:

Should sort on Views also

Post by webcoyote » Tue Dec 23, 2003 7:48 am

I suggest you add 'Views' as another sort choice. I added it in include/functions.php:

Code: Select all

  $forum_display_sort = array(
      'lang_key'  => array('Last_Post', 'Views', 'Sort_Topic_Title', 'Sort_Time', 'Sort_Author'),
      'fields'    => array('t.topic_last_post_id', 't.topic_views', 't.topic_title', 't.topic_time', 'u.username'),
  );
see: "mod - topic_display_order-part1.txt" for the original mod.

User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Post by Ptirhiik » Tue Dec 23, 2003 8:33 am

Versatile isn't it ? ;)

User avatar
bjjbeijing
Registered User
Posts: 29
Joined: Tue Dec 16, 2003 5:48 pm

Receiving errors... think it's SQL related...

Post by bjjbeijing » Thu Jan 01, 2004 9:54 am

In file [viewforum.php] could not find:

$sql = "SELECT t.*,
FROM " . TOPICS_TABLE . "
WHERE t.forum_id =
AND t.topic_poster =
AND p.post_id =
AND p2.post_id =
AND u2.user_id =
AND t.topic_type <> " . POST_ANNOUNCE . "
$limit_topics_time
ORDER BY t.topic_type DESC, t.topic_last_post_id DESC
LIMIT

Unprocessed Commands
SQL line #43
ALTER TABLE phpbb_forums ADD forum_display_sort TINYINT(1) NOT NULL;
ALTER TABLE phpbb_forums ADD forum_display_order TINYINT(1) NOT NULL;

Hi guys,

I'm receiving the following error when installing with Easy MOD. I suspect it's got something to do with SQL. So, any ideas on how I can get my tables updated?

Many thanks in advance!

User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Post by Ptirhiik » Thu Jan 01, 2004 10:40 am

This means another mod has modified this lines, and therefore easymod can't find them in the source. You have so to figure which mod has modified these, in which way, and how to adapt this to fit the mod.

User avatar
bjjbeijing
Registered User
Posts: 29
Joined: Tue Dec 16, 2003 5:48 pm

MODS made to my BB

Post by bjjbeijing » Thu Jan 01, 2004 7:45 pm

Ptirhiik - RPGnet-fr wrote: This means another mod has modified this lines, and therefore easymod can't find them in the source. You have so to figure which mod has modified these, in which way, and how to adapt this to fit the mod.


Hi Ptirhiik,

There is just one viewforum.php file, right? If so, is it in the ROOT directory?

I've installed through EASYMOD in the following order:

1) EasyMOD 0.0.11a
2) Admin Userlist 1.6.1
3) Fading Links 1.0.2
4) Forum Permissions List 1.0.0
5) Select Default Language 1.3.3
6) Country Flags 2.2.0
7) Global Announcement 1.2.8
8) Admin / Mod Color Management 2.0.1
9) Protect User Account 1.2.4

I've gone back and looked at which MOD changed the text and it appears that it is the Global Announement MOD.

Code: Select all

#-----[ OPEN ]------------------------------------------------ 
# 
viewforum.php

# 
#-----[ FIND ]------------------------------------------------ 
# 
// 
// All announcement data, this keeps announcements 
// on each viewforum page ... 

# 
#-----[ BEFORE, ADD ]----------------------------------------- 
#

// 
// All GLOBAL announcement data, this keeps GLOBAL announcements 
// on each viewforum page ... 
// 
$sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_time, p.post_username 
   FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . USERS_TABLE . " u2 
   WHERE t.topic_poster = u.user_id 
      AND p.post_id = t.topic_last_post_id 
      AND p.poster_id = u2.user_id 
      AND t.topic_type = " . POST_GLOBAL_ANNOUNCE . " 
   ORDER BY t.topic_last_post_id DESC "; 
if( !$result = $db->sql_query($sql) ) 
{ 
   message_die(GENERAL_ERROR, "Couldn't obtain topic information", "", __LINE__, __FILE__, $sql); 
} 

$topic_rowset = array(); 
$total_announcements = 0; 
while( $row = $db->sql_fetchrow($result) ) 
{ 
   $topic_rowset[] = $row; 
   $total_announcements++; 
} 

$db->sql_freeresult($result); 
// End add - Global announcement MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
$topic_rowset = array();
$total_announcements = 0;

# 
#-----[ REPLACE WITH ]---------------------------------------- 
# 

// 2 rows deleted - Global announcement MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
		AND t.topic_type <> " . POST_ANNOUNCE . " 

# 
#-----[ AFTER, ADD ]------------------------------------------
#
		AND t.topic_type <> " . POST_GLOBAL_ANNOUNCE . " 
# 
#-----[ FIND ]------------------------------------------------ 
# 
'FOLDER_ANNOUNCE_NEW_IMG' => $images['folder_announce_new'],

# 
#-----[ AFTER, ADD ]------------------------------------------ 
#

// Start add - Global announcement MOD
'FOLDER_GLOBAL_ANNOUNCE_IMG' => $images['folder_global_announce'],
'FOLDER_GLOBAL_ANNOUNCE_NEW_IMG' => $images['folder_global_announce_new'],
// End add - Global announcement MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
'L_ANNOUNCEMENT' => $lang['Post_Announcement'], 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// Start add - Global announcement MOD
'L_GLOBAL_ANNOUNCEMENT' => $lang['Post_global_announcement'], 
// End add - Global announcement MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
if( $topic_type == POST_ANNOUNCE ) 
{ 
	$topic_type = $lang['Topic_Announcement'] . ' ';
} 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

// Start add - Global announcement MOD
else if( $topic_type == POST_GLOBAL_ANNOUNCE ) 
{ 
   $topic_type = $lang['Topic_global_announcement'] . ' '; 
} 
// End add - Global announcement MOD

# 
#-----[ FIND ]------------------------------------------------ 
# 
if( $topic_rowset[$i]['topic_type'] == POST_ANNOUNCE ) 
{ 
   $folder = $images['folder_announce']; 

# 
#-----[ BEFORE, ADD ]----------------------------------------- 
#

// Start add - Global announcement MOD
if( $topic_rowset[$i]['topic_type'] == POST_GLOBAL_ANNOUNCE ) 
{ 
	$folder = $images['folder_global_announce']; 
	$folder_new = $images['folder_global_announce_new']; 
} 
else 
// End add - Global announcement MOD
#
#
Any ideas on how to fix this problem? Your input is highly appreciated!

Many thanks,

Andy
andy@baxiroushu.com

madnessmotors
Registered User
Posts: 269
Joined: Sun Aug 17, 2003 7:33 pm
Contact:

Re: Receiving errors... think it's SQL related...

Post by madnessmotors » Sat Jan 03, 2004 2:58 am

bjjbeijing wrote: In file [viewforum.php] could not find:



Unprocessed Commands
SQL line #43
ALTER TABLE phpbb_forums ADD forum_display_sort TINYINT(1) NOT NULL;
ALTER TABLE phpbb_forums ADD forum_display_order TINYINT(1) NOT NULL;

Hi guys,

I'm receiving the following error when installing with Easy MOD. I suspect it's got something to do with SQL. So, any ideas on how I can get my tables updated?
$sql = "SELECT t.*,
FROM " . TOPICS_TABLE . "
WHERE t.forum_id =
AND t.topic_poster =
AND p.post_id =
AND p2.post_id =
AND u2.user_id =
AND t.topic_type <> " . POST_ANNOUNCE . "
$limit_topics_time
ORDER BY t.topic_type DESC, t.topic_last_post_id DESC
LIMIT
Many thanks in advance!


Change your find to this

Code: Select all

      
$sql = "SELECT t.*, 
FROM " . TOPICS_TABLE . " 
WHERE t.forum_id = 
AND t.topic_poster = 
AND p.post_id = 
AND p2.post_id = 
AND u2.user_id = 
AND t.topic_type <> " . POST_ANNOUNCE . " 
AND t.topic_type <> " . POST_GLOBAL_ANNOUNCE . " 
$limit_topics_time 
ORDER BY t.topic_type DESC, t.topic_last_post_id DESC 
LIMIT

User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Post by Ptirhiik » Sat Jan 03, 2004 3:02 am

It is not enough : if you do only this, a part of the mod won't be applied, as the global announcement double this part.

quentin
Registered User
Posts: 197
Joined: Tue May 20, 2003 7:30 am
Location: Geneva, Switzerland
Contact:

Post by quentin » Sat Jan 03, 2004 8:05 am

awesome mod, i have had it installed for a little while and it is really a cool feature.

Quentin
The largest message boards on the web !
Web Design Library (coming soon)
Friends sites: Heroes of might and magic - Biometric security

djwins
Registered User
Posts: 92
Joined: Thu May 01, 2003 7:06 pm

Post by djwins » Sun Jan 04, 2004 6:26 pm

it would be cool if you could just click on the column headers to sort instead of using a drop down box.

User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Post by Ptirhiik » Sun Jan 04, 2004 7:03 pm

You can easely do this only modifying you template and adding links to the viewforum + sort, order & page.

JKeats
Registered User
Posts: 312
Joined: Thu Mar 20, 2003 12:32 am
Contact:

Post by JKeats » Mon Jan 05, 2004 9:55 pm

i posted on the other board before i found this thread... so i'll ask here instead...

i installed the mod to edit the date and time for posts, and was hoping to use it in conjunction with this mod so that for certain forum i could basically arrange the posts in whatever order i choose...

however, it didn't work. after installing both... and setting the sort order to date... regardless of the date i set for the posts, no order change was made.

i'm wondering if, for some reason, this mod doesn't work in a way that would allow the edit-post-date mod to change the order of posts?

anyone have any ideas?
The only thing necessary for the triumph of evil is for good men to do nothing.

User avatar
Ptirhiik
Registered User
Posts: 7411
Joined: Mon Jan 06, 2003 10:36 pm
Contact:

Post by Ptirhiik » Mon Jan 05, 2004 10:01 pm

This mod deals with topic in a forum, not posts in a topic.

JKeats
Registered User
Posts: 312
Joined: Thu Mar 20, 2003 12:32 am
Contact:

Post by JKeats » Mon Jan 05, 2004 10:54 pm

my appologies... that's what i meant... by post i mean the post that started the topic... not the replies to that initial post.

it's not changing the order when i edit the date of the topic.

for example... if i have two announcements... announcement1 was posted before announcement2.

even if i change the date for announcement1 to come before announcement2, they are not being resorted in the forum when i set the forum to sort by date. i've tried sorting by date acending and decending with no change either way.
The only thing necessary for the triumph of evil is for good men to do nothing.

Post Reply

Return to “[2.0.x] MOD Database Cleanup”