[2.0.10] Topic Cement!

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

Rating:

Excellent!
28
78%
Very Good
7
19%
Good
0
No votes
Fair
0
No votes
Poor
1
3%
 
Total votes: 36

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

[2.0.10] Topic Cement!

Post by Extensions Robot »

MOD Name: Topic Cement!
Author: Renegade88
MOD Description: This hack adds a column to the Moderator Control Panel called "priority", and allows the moderator to change the priority of any topic from the default zero to +/- 32767.

If you have a forum specifically for displaying information in a preset order, but you wish to allow users to add comments or questions to each thread (for example, downloads or frequently asked questions), this hack is for you.

It adds another sort criteria to the viewtopic display order. First, it displays by topic type (announcement/sticky/normal), then it sorts in order from highest priority to lowest priority and finally by last topic time. So for topics with priority of zero, the behavior will be the same as before the hack. You can define exactly which topics are displayed first and in which order, regardless of last post date. They are "cemented" in place.

MOD Version: 1.0.3 (Updated 08/31/04)



Download File: mod_topic_cement_1.0.3.zip
mods overview page: View
File Size: 3216 Bytes

Security Score:
Last edited by Extensions Robot on Mon Apr 30, 2007 12:30 am, edited 1 time in total.
(this is a non-active account manager for the phpBB Extension Customisations Team)
ycl6
Registered User
Posts: 5696
Joined: Sat Feb 15, 2003 10:35 am
Location: Taiwan
Contact:

Post by ycl6 »

MOD Validated/Released

Notes:
Forum moderator can set a thread's priority value in modcp to make topic(s) appear on top or below of the rest of the topics in viewforum
fredol
Registered User
Posts: 188
Joined: Mon May 31, 2004 7:02 pm
Contact:

Post by fredol »

Hi,

This is a very cool MOD, but I think there might be a little mistake in the MOD :?

Code: Select all

#
#-----[ OPEN ]------------------------------------------ 
#
viewforum.php
#
#-----[ FIND ]------------------------------------------ 
#
	ORDER BY t.topic_last_post_id DESC ";
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
DESC
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
, t.topic_last_post_id DESC
I think it should be t.topic_priority and not topic_last_post_id again ;) and I also think it should be added BEFORE, so AFTER ORDER BY (to get ORDER BY t.topic_priority DESC, t.topic_last_post_id DESC) Right??

And just a thought, but why not add a little something so ADMIN and MODS can set the priority when posting a new topic, instead of having to go in the MOD CP ?
Anyway, great MOD! :D

Thanks,
fredol
User avatar
stickerboy
Former Team Member
Posts: 7349
Joined: Mon Mar 29, 2004 2:27 pm
Location: Scotland
Name: Kenny Cameron
Contact:

Post by stickerboy »

Yeah. i've this installed since it was in Beta.
There were few glitches, but mostly my fault :wink:

It is a great mod though - congrats :)
i use it quite often
I'm a web-designing code-decrypting tech-support musician
|| Twitter || Flickr || phpBB Snippets ||
Formerly known as cherokee red
ddominey86
Registered User
Posts: 11
Joined: Sun Jul 04, 2004 4:06 pm

Post by ddominey86 »

great work :D
Renegade88
Registered User
Posts: 73
Joined: Tue Jun 18, 2002 8:57 am
Contact:

Post by Renegade88 »

fredol wrote: Hi,

This is a very cool MOD, but I think there might be a little mistake in the MOD :?

Code: Select all

#
#-----[ OPEN ]------------------------------------------ 
#
viewforum.php
#
#-----[ FIND ]------------------------------------------ 
#
	ORDER BY t.topic_last_post_id DESC ";
#
#-----[ IN-LINE FIND ]------------------------------------------ 
#
DESC
#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------ 
#
, t.topic_last_post_id DESC
I think it should be t.topic_priority and not topic_last_post_id again ;) and I also think it should be added BEFORE, so AFTER ORDER BY (to get ORDER BY t.topic_priority DESC, t.topic_last_post_id DESC) Right??

And just a thought, but why not add a little something so ADMIN and MODS can set the priority when posting a new topic, instead of having to go in the MOD CP ?
Anyway, great MOD! :D

Thanks,
fredol



You are absolutely right.
This mod was perfect (400 installations to prove it), but the PHPBB team made me switch from the FIND and REPLACE command to the INLINE FIND and INLINE REPLACE and I didn't want to do it because the code was perfect, but it wasn't going to get approved otherwise. I was nervous that I would make a mistake, changing good code for no gain apparent to me. Looks like my worries were not unfounded. I tried to be extra careful, but it looks like I messed up the conversion anyway. I will try to update that, good catch.
Renegade88
Registered User
Posts: 73
Joined: Tue Jun 18, 2002 8:57 am
Contact:

Post by Renegade88 »

by the way, the original code was:

Code: Select all

#
#-----[ FIND ]------------------------------------------ 
#
	ORDER BY t.topic_last_post_id DESC ";

#
#-----[ REPLACE WITH ]------------------------------------------ 
#
	ORDER BY t.topic_priority DESC, t.topic_last_post_id DESC ";

So the priority actually goes before like you said.
fredol
Registered User
Posts: 188
Joined: Mon May 31, 2004 7:02 pm
Contact:

Post by fredol »

Hi,
Renegade88 wrote: You are absolutely right.
This mod was perfect (400 installations to prove it), but the PHPBB team made me switch from the FIND and REPLACE command to the INLINE FIND and INLINE REPLACE and I didn't want to do it because the code was perfect, but it wasn't going to get approved otherwise. I was nervous that I would make a mistake, changing good code for no gain apparent to me. Looks like my worries were not unfounded. I tried to be extra careful, but it looks like I messed up the conversion anyway. I will try to update that, good catch.

Well I beleive they did that cause using IN-LINE allow to make the MOD works even with other MODs installed & changes made to the lines, while FIND would not work. This made it "better", and also installable with EasyMOD ;)

Anyway it's just a little mistake, now corrected, and the MOD works great!! :D

Thanks
fredol
guriguri
Registered User
Posts: 8
Joined: Fri Aug 27, 2004 5:35 am

Installed properly but it doesn't work.

Post by guriguri »

I installed Topic Cement three times ( Once with EM, and twice manually)
but it didn't work at all.

I can see 'Priorty' box with zero in default and 'Prioritize' button next to ulock button also.

Simply nothing happens even though I checked 'check box' and set priority numbers then hit 'Prioritize' button.

I use 'NoseBleed' style and it doesn't have much difference to SubSilver.
Is there any known issue on conflict with custom styles and mods?

I presume if I enter priority number in box and hit button, then each topic is saved 'priority number' and works by that order first before Zero.

Help pls.


Origianl Source

Code: Select all

#
#-----[ FIND ]------------------------------------------ 
#
	  <td class="row2" align="center" valign="middle"> 
		<input type="checkbox" name="topic_id_list[]" value="{topicrow.TOPIC_ID}" />
	  </td>
#
#-----[ AFTER, ADD ]------------------------------------------ 
#
	  <td class="row1" align="center" valign="middle"> 
		<input type="Text" name="topic_cement:{topicrow.TOPIC_ID}" value="{topicrow.TOPIC_PRIORITY}" maxlength="5" size="5" />
	  </td>
Modified Source with NoseBleed Style
#
#-----[ FIND ]------------------------------------------
#
<td class="row3" align="center" valign="middle"> <input type="checkbox" class="noborder" name="topic_id_list[]" value="{topicrow.TOPIC_ID}" />
</td>


#
#-----[ AFTER, ADD ]------------------------------------------
#
<td class="row1" align="center" valign="middle">
<input type="Text" name="topic_cement:{topicrow.TOPIC_ID}" value="{topicrow.TOPIC_PRIORITY}" maxlength="5" size="5" />
</td>[/code]

I had to find blue color line with NoseBleed style.
This is the biggest difference while installing.
EverQuest will never die!!
Admin | EQ II Korean Forum
Renegade88
Registered User
Posts: 73
Joined: Tue Jun 18, 2002 8:57 am
Contact:

Post by Renegade88 »

you are doing this right: check the topic you want to prioritize (mandatory), type the new priority in, then hit the [prioritize] button.

I assume that you have made the correction listed above. I am waiting for 1.0.2 to get approved to fix that blunder. Actually, did you fix that problem above?

To answer your question, no, there is no KNOWN conflicts. However, I assume most people would do what you are doing, fixing the problems on the fly.

When you hit the button, the moderator panel topics will resort.

If that is not happening, I don't know what the problem would be. Perhaps the FORM isn't set right in nosebleed? Can you try with Firefox? If it works in one browser and not another, that would point to a problem with the FORM in the template.
guriguri
Registered User
Posts: 8
Joined: Fri Aug 27, 2004 5:35 am

source

Post by guriguri »

Actually, did you fix that problem above?

Nope. I just started using and learning php Board! <-- newbie.
Can you try with Firefox? If it works in one browser and not another, that would point to a problem with the FORM in the template.

Nope. I can't. I don't know what Firefox is indeed.

btw I tried to change Orders but failed. (still post never be sorted)

Here are my source. Too long.. well I tried to figure out what is a problem. but I don't have any idea now.

Modcp.php

Code: Select all

Code removed by wGEric, Please don't post large amounts of code.  Thanks.
EverQuest will never die!!
Admin | EQ II Korean Forum
guriguri
Registered User
Posts: 8
Joined: Fri Aug 27, 2004 5:35 am

Modcp_body.tpl

Post by guriguri »

modcp_body.tpl

Code: Select all

Code removed by wGEric, Please don't post large amounts of code
viewforum.php

Code: Select all

Code removed by wGEric, Please don't post large amounts of code
EverQuest will never die!!
Admin | EQ II Korean Forum
Renegade88
Registered User
Posts: 73
Joined: Tue Jun 18, 2002 8:57 am
Contact:

Post by Renegade88 »

I don't know why you posted that whole thing.

I asked, "did you fix the known bug in the 1.0.1 script before you ran it"?

You said "no".

Mystery solved.

Solution: Read the posts above and correct as necessary.
guriguri
Registered User
Posts: 8
Joined: Fri Aug 27, 2004 5:35 am

Post by guriguri »

Renegade88 wrote: I don't know why you posted that whole thing.

I asked, "did you fix the known bug in the 1.0.1 script before you ran it"?

You said "no".

Mystery solved.

Solution: Read the posts above and correct as necessary.


I read it. I misunderstood that, sorry for long scripts.

What exactly is the known bug in the 1.0.1 script?
Post never resort? same problem that I have? Is that a bug?
Who made this topic cement works fine with which style? only with subSilver?

Reply pls. anyone who made it. and link to ur forum too.
EverQuest will never die!!
Admin | EQ II Korean Forum
Renegade88
Registered User
Posts: 73
Joined: Tue Jun 18, 2002 8:57 am
Contact:

Post by Renegade88 »

Can you go back to the top of the thread and read in order, please? Fredol found a bug in the script, suggested a fix. I confirmed the bug and displayed the original (bug-free) code.

You question "What is the known bug?" was answered literally before you posted the first time.

##added##

around line 236 of viewforum.php change the line to :
ORDER BY t.topic_priority DESC, t.topic_last_post_id DESC ";


This doesn't have anything to do with your templates.
Post Reply

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