[BETA] Topic Type MOD (Latest: 1.1.2)

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Post Reply
User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

[BETA] Topic Type MOD (Latest: 1.1.2)

Post 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
Last edited by GPHemsley on Sat Jul 14, 2007 5:41 am, edited 25 times in total.
User avatar
Carpe Diem
Registered User
Posts: 580
Joined: Tue Dec 10, 2002 11:19 pm

Post by Carpe Diem »

Very good idea of a mod, this is absolutely useful.
Thank you!
Will report if any bugs would show up..
:)
User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post 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....
User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post 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, 
Last edited by GPHemsley on Sun Sep 07, 2003 4:26 am, edited 1 time in total.
User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post 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.
Last edited by GPHemsley on Wed May 14, 2003 1:39 am, edited 1 time in total.
inlakefield
Registered User
Posts: 43
Joined: Sun Jan 19, 2003 10:36 pm
Location: Ennismore, Ontario
Contact:

Nice Job!

Post 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
[email protected]
netclectic
Former Team Member
Posts: 4439
Joined: Wed Mar 13, 2002 3:08 pm
Location: Omnipresent
Contact:

Re: [DEV] New Post Type MOD

Post 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.
Defend the game:
Image
User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post 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.
User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post by GPHemsley »

Updated to Version 1.0.2
Be sure to read all above updates.
User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post by GPHemsley »

*bump*
I just wanted to make sure this stayed on the first page.... Many people may need this. ;)
User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post 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.
User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post by GPHemsley »

Updated to Version 1.0.3
Be sure to read all above updates.
User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post by GPHemsley »

GPHemsley wrote: *bump*
I just wanted to make sure this stayed on the first page.... Many people may need this. ;)
User avatar
GPHemsley
Registered User
Posts: 1475
Joined: Fri Apr 18, 2003 3:12 am
Location: Long Beach, NY
Name: Gordon Hemsley
Contact:

Post 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! ;) )
ycl6
Translator
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post 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
Post Reply

Return to “[2.0.x] MODs in Development”