[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.
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 » Sun Sep 07, 2003 6:21 am

W00t! It's all fixed! I just gotta test is out, wrap it up, and get it ready for release. Expect it very soon! :D

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 » Sun Sep 07, 2003 6:39 am

Updated to Version 1.1.2
Be sure to read all above updates.

If you are using phpBB Version 2.0.4 or 2.0.5, this version of the MOD will not completely install correctly. Variables were changed between versions, so please use version 1.1.0 if you are still using phpBB Version 2.0.4 and version 1.1.1 if you are still using phpBB Version 2.0.4.

User avatar
drumstix42
Registered User
Posts: 1100
Joined: Tue Sep 24, 2002 11:01 pm
Location: NJ
Contact:

Post by drumstix42 » Sun Sep 07, 2003 9:34 pm

Is there any kind of update file?
Need a phpBB update or mod installed? PM me for any questions and pricing!
HostMonster.com (Unlimited Space, Unlimited Transfer, Unlimited Domains, $6.95/month )

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 » Mon Sep 08, 2003 10:30 am

Right now, since there are so many previous versions and not enough time for me to do them all, I'll make them on a custom basis. So what is your previous version?

User avatar
drumstix42
Registered User
Posts: 1100
Joined: Tue Sep 24, 2002 11:01 pm
Location: NJ
Contact:

Post by drumstix42 » Mon Sep 08, 2003 7:14 pm

Hmm, I believe I'm using 1.1.0

I'm not totally positive. See I keep all my zip files for my forums in one folder, and all them in the same unzip folder. I have the 112 from yesterday.

And the only other one I see is...

1.1.0

Strange. Thought I had 1.1.1 :lol:

Edit: By the way, I'm using phpBB 2.0.6
Need a phpBB update or mod installed? PM me for any questions and pricing!
HostMonster.com (Unlimited Space, Unlimited Transfer, Unlimited Domains, $6.95/month )

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 » Wed Sep 17, 2003 10:37 am

Well, I've recently gotten my first official rejection of this MOD. :lol:
Problem was that there is hardcoded text in the template when they should be lang variables. No big deal; that'll be incorporated in the next release. I'm just surprised that no one's picked up on it 'til now. :o

If I have the time (with school and all), I'll check it out soon and post the fix here. No need to worry, though, unless you read English. ;)

inapto
Registered User
Posts: 7
Joined: Thu Sep 25, 2003 2:07 am

Post by inapto » Thu Sep 25, 2003 3:23 am

I've installed this MOD and it's working fine. Thank you very much !!!

I'll now work on creating more topic types (I need several).

inapto
Registered User
Posts: 7
Joined: Thu Sep 25, 2003 2:07 am

Post by inapto » Thu Sep 25, 2003 3:38 pm

Dumb question, but should I edit all 16 + 2 files with categories "special 2", "special 3", ... or just some? Which ones?

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 » Fri Sep 26, 2003 7:55 pm

Unfortunately, that is the only way to currently do it. :? The next version will hopefully include the Add/Remove function for post types, but I don't know when that will be released: School == Homework, plus I have to figure out how to actually go about coding it. 8)

carloclaessen
Registered User
Posts: 494
Joined: Sun Mar 23, 2003 11:55 pm

Post by carloclaessen » Fri Sep 26, 2003 11:39 pm

edit ** wrong place**

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 » Sun Jan 04, 2004 11:54 pm

Just in case anyone is following the development of this, I have put all of the files I have into CVS. Though the main SourceForge page isn't yet updated to the link, you can find all of the files (including the latest version of the developmental 1.1.3) here: http://cvs.sourceforge.net/viewcvs.py/n ... _type_mod/.

Explanation of the directories:
/ - Contains the latest zip and text file for the current version.
archive/ - Contains all old zips and text files from previous versions.
copy/ - Contains all files that are considered "included" with/for the MOD. They are stored in the new directory structure used for 1.1.3 and up.
preview/ - Contains screenshots/previews of this MOD in action.
website/ - Contains the files used for http://newposttypemod.sourceforge.net/. Nothing useful for the everyday user.

I don't know when I'll be able to focus on this MOD, nor how much, but you can always find the latest in CVS. On a final note, there have been a total of 341 downloads of all of the packages released there since version 1.0.0! :mrgreen:

User avatar
Carpe Diem
Registered User
Posts: 580
Joined: Tue Dec 10, 2002 11:19 pm

Post by Carpe Diem » Tue Jan 06, 2004 10:28 pm

miraclewhipkey wrote: I have it! It took quite a few tweaks, but it works.

After applying the original mod (downloaded from the original post), these are the files I changed:

posting.php
viewforum.php
modcp.php
includes/functions_post.php

and one database change:

Code: Select all

ALTER TABLE `phpbb_topics` ADD `topic_order_type` TINYINT( 2 ) UNSIGNEDDEFAULT '2' NOT NULL ;
changes to functions_post.php, find this:

Code: Select all

function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length)
replace with this:

Code: Select all

function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$topic_order_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length)
find this:

Code: Select all

$sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type, topic_vote = $topic_vote WHERE topic_id = $topic_id";
replace with this:

Code: Select all

$sql  = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote, topic_order_type) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote, '$topic_order_type')" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type, topic_vote = $topic_vote WHERE topic_id = $topic_id";
changes to posting.php:
find this

Code: Select all

//
// Set topic type
//
$topic_type = ( !empty($HTTP_POST_VARS['topictype']) ) ? intval($HTTP_POST_VARS['topictype']) : POST_NORMAL;
and after that add this see note at the bottom about this part

Code: Select all

//
//Set topic order type
//
if ( $topic_type == POST_ANNOUNCE )
{
	$topic_order_type = 0;
}
else if ( $topic_type == POST_STICKY )
{
	$topic_order_type = 1;
}
else
{
	$topic_order_type = 2;
}
in the same file, find this:

Code: Select all

submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length);
replace with this:

Code: Select all

submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, &$topic_order_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length);
changes to viewforum.php, find this:

Code: Select all

$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 
	LIMIT $start, ".$board_config['topics_per_page'];
replace with this:

Code: Select all

$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_order_type ASC, t.topic_last_post_id DESC 
	LIMIT $start, ".$board_config['topics_per_page'];
changes to modcp.php, find this:

Code: Select all

$sql = "SELECT t.*, u.username, u.user_id, p.post_time
			FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p
			WHERE t.forum_id = $forum_id
				AND t.topic_poster = u.user_id
				AND p.post_id = t.topic_last_post_id
			ORDER BY t.topic_type DESC, p.post_time DESC
			LIMIT $start, " . $board_config['topics_per_page'];
replace with this:

Code: Select all

$sql = "SELECT t.*, u.username, u.user_id, p.post_time
			FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p
			WHERE t.forum_id = $forum_id
				AND t.topic_poster = u.user_id
				AND p.post_id = t.topic_last_post_id
			ORDER BY t.topic_order_type ASC, p.post_time DESC
			LIMIT $start, " . $board_config['topics_per_page'];
I think that was everything. It works great for me now. When a post is made, it gives it an extra id number which is only used for sorting on the forum view pages (viewforum and modcp), that way the topic type id will still be available for other uses. When the topic type is ANNOUNCE, it gets a 0, STICKY gets a 1, and everything else that you want to act normal will get a 2. 2 is also the default for the database field.

If you wanted to add more topic types in the future, that do have priority over normal posts, you would only have to modify the statement on posting.php and throw in an extra if else condition. Just keep in mind that the lower the number, the higher priority. You can now change the sort order in that one area without having to alter any other files at all. Note: this will not affect announcment priority, as that is determined seperately from all the rest.

cheers,
Clay


Is this part included in the original MOD installation file or is it something we will have to apply extra? I took a look at the installation text file and could not find it in there.. to me it seems important since without it the special topic type appears on the top of stickies...

Or is there a more up to date installation file somewhere that I'm not aware of?

Thx in advance.

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 » Tue Jan 06, 2004 10:35 pm

Carpe Diem wrote: Is this part included in the original MOD installation file or is it something we will have to apply extra? I took a look at the installation text file and could not find it in there.. to me it seems important since without it the special topic type appears on the top of stickies...

Or is there a more up to date installation file somewhere that I'm not aware of?

Thx in advance.

Nope, nothing of the sort is yet included in the MOD. Though there is a newer (developmental) version of this MOD in CVS, it doesn't have this feature either. Honestly, I forgot all about that post, and I don't remember it having that information. Either way, I'll see what I can do to work the feature into the next release. :mrgreen:

User avatar
Carpe Diem
Registered User
Posts: 580
Joined: Tue Dec 10, 2002 11:19 pm

Post by Carpe Diem » Tue Jan 06, 2004 10:56 pm

GPHemsley wrote:
Carpe Diem wrote:Is this part included in the original MOD installation file or is it something we will have to apply extra? I took a look at the installation text file and could not find it in there.. to me it seems important since without it the special topic type appears on the top of stickies...

Or is there a more up to date installation file somewhere that I'm not aware of?

Thx in advance.

Nope, nothing of the sort is yet included in the MOD. Though there is a newer (developmental) version of this MOD in CVS, it doesn't have this feature either. Honestly, I forgot all about that post, and I don't remember it having that information. Either way, I'll see what I can do to work the feature into the next release. :mrgreen:


Wow, hey man, thx a lot for such a rapid reply!

Great work btw. At last I got around to install the mod and it works very well.

In addition I have "modded" your mod(!) so that it now includes also the changes for the Global Announcement Mod if one should have it installed. I had it and had to change some stuff to make your mod work properly with it. If you are intereseted I could post those changes here for you and you could include them in the original installation file as an "add-on" for those with the Global Announcement Mod, should you see it fit to your purposes.
:)

Just let me know.

Cheers
/Carpe Diem

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 » Tue Jan 06, 2004 10:58 pm

Sure! I'll accept any add-ons for things that most users will not use, but some might. I'll also accept changes to my current code to make it better! It'll help all of us, in the long run! :mrgreen:

Post Reply

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