Disable Reply Icons

Started by homer09001, November 10, 2009, 01:18:56 PM

Previous topic - Next topic

homer09001

SMF Disable Reply Icons

Current Version V1.0
SMF Disable Reply Icons will disable the selection of the post icon to anyone making a reply to a Post, all replies within each thread will automatically inherit the thread icon from the Original post.

It will also disable the ability to change the icon from within the thread. Admins automatically override these rules and can set their post icon when composing a reply and from within the thread.



Planned Features for V1.1.

  • Compatible with V2 RC2

Credit:
Arantor for the amazing amount of patience and help putting this mod together.

qubbah

how can get this mod run with ajax quick reply?

homer09001

Sorry I have been very busy with work and have not had time to look into this, I will look when I get a chance.

qubbah

Quote from: homer09001 on December 06, 2009, 12:34:16 PM
Sorry I have been very busy with work and have not had time to look into this, I will look when I get a chance.

no problem at all.... TQ

Mr. Gravy

Any progress made?  I just upgraded to RC2 and didn't realize it would be as easy to disable them.  Anxiously awaiting a reply!

Agent 0E

I've installed this mod and now I get the following two errors every time someone clicks on reply to a post.

2: Missing argument 2 for db_query()
File: /home/force9/public_html/hq/Sources/Subs.php
Line: 238

2: Missing argument 3 for db_query()
File: /home/force9/public_html/hq/Sources/Subs.php
Line: 238

How do I fix this?

Agent 0E

I've managed to fix it.

From researching throughout this forum I discovered that those errors are caused by a db_query that is being run without the second and third parameters - ,__FILE__, __LINE__.

When I parsed the mod, I found the following edit made to the /Sources/Display.php file.

// START OF REMOVE REPLY ICON MOD //
$context['thread_icon'] = 'xx'; // set by default first
$query = db_query("SELECT icon FROM {$db_prefix}messages WHERE ID_TOPIC = {$topic} ORDER BY ID_MSG ASC LIMIT 1");
if($row = mysql_fetch_row($query))
  $context['thread_icon'] = $row[0];
// END OF REMOVE REPLY ICON MOD //


The query was missing the ,__FILE__, __LINE__. at the end of it. The file was edited so that code now looks like this

// START OF REMOVE REPLY ICON MOD //
$context['thread_icon'] = 'xx'; // set by default first
$query = db_query("SELECT icon FROM {$db_prefix}messages WHERE ID_TOPIC = {$topic} ORDER BY ID_MSG ASC LIMIT 1",__FILE__, __LINE__);
if($row = mysql_fetch_row($query))
  $context['thread_icon'] = $row[0];
// END OF REMOVE REPLY ICON MOD //


That put a stop to the errors.

Advertisement: