Page 1 of 10

[BETA] Topic Type MOD (Latest: 1.1.2)

Posted: Sun May 11, 2003 1:33 am
by GPHemsley
MOD Name: Topic Type MOD
MOD Description: Create new topic types and manage pre-existing ones (like "Sticky" and "Announcement").

MOD Version: 1.1.2
phpBB Version: 2.0.6
Installation Level: Moderate
Installation Time: 15-30 Minutes

Go to the SourceForge.net Project Page
View the CVS Repository

Preview Version 1.2.0 [2.0.12]
Download Version 1.1.2 [2.0.6]
Download Version 1.1.1 [2.0.5]
Download Version 1.1.0 [2.0.4]

Preview: screen.gif | screen.png | screen2.gif | screen2.png
See Also: Request Topic

This MOD is EasyMOD Compatible.
This MOD is compatible with phpBB 2.0.6!

To-Do List
Make 2.0.5-compatible version. - Version 1.1.1
Fix display so edited Topic Type appears at the bottom of the Forum and the choices when posting. - Version 1.1.2
• Add choice for where in topic list it goes. - Version 1.2.0
• Make option to add and remove post types in Admin Panel. - Version 1.2.0

Updated: 2007-07-14

Posted: Sun May 11, 2003 8:36 am
by Carpe Diem
Very good idea of a mod, this is absolutely useful.
Thank you!
Will report if any bugs would show up..
:)

Posted: Sun May 11, 2003 3:59 pm
by GPHemsley
OK... Make sure that if you are creating more, you advance the numbers in the constants file each time.... See below.

What to do to add one:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php

#
#-----[ FIND ]------------------------------------------
#
define('POST_GLOBAL_ANNOUNCE', 3);
#
#-----[ AFTER, ADD ]------------------------------------------
#
define('POST_SPECIAL', 4);

#
#-----[ FIND ]------------------------------------------
#
define('AUTH_ATTACH', 11);
#
#-----[ AFTER, ADD ]------------------------------------------
#
define('AUTH_SPECIAL', 12);
To add another, with a different name:

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php

#
#-----[ FIND ]------------------------------------------
#
define('POST_SPECIAL', 4);
#
#-----[ AFTER, ADD ]------------------------------------------
#
define('POST_ANOTHER', 5);

#
#-----[ FIND ]------------------------------------------
#
define('AUTH_SPECIAL', 12);
#
#-----[ AFTER, ADD ]------------------------------------------
#
define('AUTH_ANOTHER', 13);
This is what I mean by advancing the numbers. You must change the new number each time you add another type....

Posted: Sun May 11, 2003 4:09 pm
by GPHemsley
An error has been found by inlakefield in Version 1.0.1 and earlier.
It says

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------
#
$order_sql = ( !isset($post_id) ) ? '' : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC";
#
#-----[ IN-LINE FIND ]------------------------------------------
#
f.auth_delete, 
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
f.auth_sticky, 
when it should say

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php

#
#-----[ FIND ]------------------------------------------
#
$order_sql = ( !isset($post_id) ) ? '' : "GROUP BY p.post_id, t.topic_id, t.topic_title, t.topic_status, t.topic_replies, t.topic_time, t.topic_type, t.topic_vote, t.topic_last_post_id, f.forum_name, f.forum_status, f.forum_id, f.auth_view, f.auth_read, f.auth_post, f.auth_reply, f.auth_edit, f.auth_delete, f.auth_sticky, f.auth_announce, f.auth_pollcreate, f.auth_vote, f.auth_attachments ORDER BY p.post_id ASC";
#
#-----[ IN-LINE FIND ]------------------------------------------
#
f.auth_delete, 
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
f.auth_special, 

Posted: Sun May 11, 2003 5:08 pm
by GPHemsley
There is something that you have to do in Version 1.0.2 and earlier.

You have to edit the mod_install.php if you are making something that is not named Special or if you make more than one new type. See below.
The mod_install.php contains the following code:

Code: Select all

$sql[] = "ALTER TABLE " . AUTH_ACCESS_TABLE . " ADD auth_special tinyint(1) NOT NULL";
$sql[] = "ALTER TABLE " . FORUMS_TABLE . " ADD auth_special tinyint(2) NOT NULL";
If you are installing "Special" and "Another", like above, change the code to this:

Code: Select all

$sql[] = "ALTER TABLE " . AUTH_ACCESS_TABLE . " ADD auth_special tinyint(1) NOT NULL";
$sql[] = "ALTER TABLE " . FORUMS_TABLE . " ADD auth_special tinyint(2) NOT NULL";
$sql[] = "ALTER TABLE " . AUTH_ACCESS_TABLE . " ADD auth_another tinyint(1) NOT NULL";
$sql[] = "ALTER TABLE " . FORUMS_TABLE . " ADD auth_another tinyint(2) NOT NULL";
If you are installing a different one, say just "Another", you would need to change it to this code:

Code: Select all

$sql[] = "ALTER TABLE " . AUTH_ACCESS_TABLE . " ADD auth_another tinyint(1) NOT NULL";
$sql[] = "ALTER TABLE " . FORUMS_TABLE . " ADD auth_another tinyint(2) NOT NULL";
Get the point?
The code

Code: Select all

auth_special
(which appears twice) must be changed in mod_install.php to reflect the type you've created.

Nice Job!

Posted: Sun May 11, 2003 6:52 pm
by inlakefield
This is an awesome mod (which I requested) and it is working great. If you want to see it in action, visit http://www.twindragons.ca/gforum
- dnoyeb2002
Image
admin@twindragons.ca

Re: [DEV] New Post Type MOD

Posted: Sun May 11, 2003 9:06 pm
by netclectic
GPHemsley wrote: *THIS MOD HAS BEEN SUBMITTED TO THE DATABASE*

While this is true (for version 1.0.0 at least), please refrain from trying to 'imitate' the mod db.

Posted: Sun May 11, 2003 9:49 pm
by GPHemsley
I wasn't trying to imitate it.... I would think it's obvious that this isn't officially released, considering that message, who released it, and where it was released..... I was just trying to provide the same amount of useful information that John does when he releases them.

Posted: Sun May 11, 2003 11:52 pm
by GPHemsley
Updated to Version 1.0.2
Be sure to read all above updates.

Posted: Tue May 13, 2003 3:15 pm
by GPHemsley
*bump*
I just wanted to make sure this stayed on the first page.... Many people may need this. ;)

Posted: Wed May 14, 2003 1:37 am
by GPHemsley
This is an update to a fix I posted above. Remember this is for Version 1.0.2 and earlier.
Instead of running the mod_install.php, there should be the following step in the procedure:

Code: Select all

#
#-----[ SQL ]------------------------------------------
# Change the prefix "phpbb_" to whatever your prefix is
#
ALTER TABLE phpbb_auth_access ADD auth_special tinyint(1) NOT NULL;
ALTER TABLE phpbb_forums ADD auth_special tinyint(2) NOT NULL;
This will be included in Version 1.0.3 and later.

Posted: Wed May 14, 2003 1:51 am
by GPHemsley
Updated to Version 1.0.3
Be sure to read all above updates.

Posted: Thu May 15, 2003 10:39 am
by GPHemsley
GPHemsley wrote: *bump*
I just wanted to make sure this stayed on the first page.... Many people may need this. ;)

Posted: Fri May 16, 2003 10:39 am
by GPHemsley
GPHemsley wrote: *bump*
I just wanted to make sure this stayed on the first page.... Many people may need this. ;)


(Ugh... I hate doing this twice in a row.... Please: if you've downloaded and installed the MOD, give a little note here.... Even if you don't have any problems, I like compliments, too! ;) )

Posted: Fri May 16, 2003 11:12 am
by ycl6
I think there are muny uses of it. Any chance of developing it so that any posts get changed to this Topic Type will be save into a special page on that particular board (or special borad), like some kind of keeping useful topics mechanism?

~Mac