Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: von COLLINZO on October 14, 2013, 11:46:13 AM

Title: Delete All Mail Queue Button
Post by: von COLLINZO on October 14, 2013, 11:46:13 AM
Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=3791)

This modification adds an extra button 'Delete All' to the Mail Queue Admin interface which makes it easier when deleting loads of mails in the Queue.

(http://i.creativecommons.org/l/by/3.0/88x31.png) (http://creativecommons.org/licenses/%3Cbr%20/%3Eby/3.0/)
This work is licensed under a Creative Commons Attribution
3.0 Unported License (http://
Title: Re: Delete All Mail Queue Button
Post by: 4Kstore on October 15, 2013, 09:47:49 PM
Thanks, this is great to save time.
Title: Re: Delete All Mail Queue Button
Post by: Matthew K. on October 16, 2013, 02:33:18 PM
What license is this modification released under...? Hmm
Title: Re: Delete All Mail Queue Button
Post by: luuuciano on October 24, 2013, 08:09:30 PM
Nice one!
This mod should be added to smf core...

A few times I had to do that I entered over phpmyadmin, to drop the queue table... lol
Title: Re: Delete All Mail Queue Button
Post by: von COLLINZO on December 09, 2013, 06:33:58 PM
@Labradoodle-360, I forgot that coz I was kinda in a hurry....I just updated it....
@4kstore, thanks
@luuuciano, lol...I also did same thing for a long time before I discovered a thread here with tips to manually apply those tiny modifications....then I decided to convert it to a mod just to help some others....I'm just sad I cant locate the exact thread after a lot of search because I forgot the thread title  keywords
Title: Re: Delete All Mail Queue Button
Post by: wwwserfer on January 14, 2015, 06:48:16 AM
Why noted that this mod is compatible with  SMF 1.1.x, when it is not so-??
Title: Re: Delete All Mail Queue Button
Post by: margarett on September 04, 2015, 05:17:02 AM
This MOD does not install cleanly. This is because install.xml is looking for spaces instead of tabs, as well as inexistent spaces at the end of the lines.

The fixed install.xml (for the current code of course) could be something like this
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns:smf="http://www.simplemachines.org/" xmlns="http://www.simplemachines.org/xml/modification">
    <id>von-COLLINZO:DeleteAllMailQueue</id>
    <version>1.0</version>
    <file name="$sourcedir/ManageMail.php">
        <operation>
            <search position="after"><![CDATA[ 'clear' => 'ClearMailQueue',]]></search>
            <add><![CDATA[
//Begin: von COLLINZO: Delete all Mail Queue button
'clear2' => 'ClearMailQueue2',
//End: von COLLINZO: Delete all Mail Queue button
]]></add>
        </operation>

        <operation>
            <search position="replace"><![CDATA[ 'value' => '[<a href="' . $scripturl . '?action=admin;area=mailqueue;sa=clear;' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['mailqueue_clear_list_warning'] . '\');">' . $txt['mailqueue_clear_list'] . '</a>] <input type="submit" name="delete_redirects" value="' . $txt['delete'] . '" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" class="button_submit" />',]]></search>
            <add><![CDATA[ //Begin: von COLLINZO: Delete all Mail Queue button
'value' => '[<a href="' . $scripturl . '?action=admin;area=mailqueue;sa=clear;' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['mailqueue_clear_list_warning'] . '\');">' . $txt['mailqueue_clear_list'] . '</a>] [<a href="' . $scripturl . '?action=admin;area=mailqueue;sa=clear2;' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');">' . $txt['delete'] . ' ' . $txt['all'] . '</a>] <input type="submit" name="delete_redirects" value="' . $txt['delete'] . '" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" class="button_submit" />',
//End: von COLLINZO: Delete all Mail Queue button ]]></add>
</operation>

        <operation>
            <search position="end" />
            <add><![CDATA[ //Begin: von COLLINZO: Delete all Mail Queue button
function ClearMailQueue2()
{
global $smcFunc;

checkSession('get');

$smcFunc['db_query']('', 'TRUNCATE TABLE {db_prefix}mail_queue', array() );
redirectexit('action=admin;area=mailqueue');

}
//End: von COLLINZO: Delete all Mail Queue button ]]></add>
        </operation>
    </file>
</modification>
Title: Re: Delete All Mail Queue Button
Post by: motu828 on February 06, 2017, 09:50:52 AM
Is this mod runnig ok for 2.0.13?. Thanks
Title: Re: Delete All Mail Queue Button
Post by: Ninja ZX-10RR on September 30, 2020, 10:32:20 AM
Quote from: margarett on September 04, 2015, 05:17:02 AM
This MOD does not install cleanly. This is because install.xml is looking for spaces instead of tabs, as well as inexistent spaces at the end of the lines.

The fixed install.xml (for the current code of course) could be something like this
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE modification SYSTEM "http://www.simplemachines.org/xml/modification">
<modification xmlns:smf="http://www.simplemachines.org/" xmlns="http://www.simplemachines.org/xml/modification">
    <id>von-COLLINZO:DeleteAllMailQueue</id>
    <version>1.0</version>
    <file name="$sourcedir/ManageMail.php">
        <operation>
            <search position="after"><![CDATA[ 'clear' => 'ClearMailQueue',]]></search>
            <add><![CDATA[
//Begin: von COLLINZO: Delete all Mail Queue button
'clear2' => 'ClearMailQueue2',
//End: von COLLINZO: Delete all Mail Queue button
]]></add>
        </operation>

        <operation>
            <search position="replace"><![CDATA[ 'value' => '[<a href="' . $scripturl . '?action=admin;area=mailqueue;sa=clear;' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['mailqueue_clear_list_warning'] . '\');">' . $txt['mailqueue_clear_list'] . '</a>] <input type="submit" name="delete_redirects" value="' . $txt['delete'] . '" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" class="button_submit" />',]]></search>
            <add><![CDATA[ //Begin: von COLLINZO: Delete all Mail Queue button
'value' => '[<a href="' . $scripturl . '?action=admin;area=mailqueue;sa=clear;' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['mailqueue_clear_list_warning'] . '\');">' . $txt['mailqueue_clear_list'] . '</a>] [<a href="' . $scripturl . '?action=admin;area=mailqueue;sa=clear2;' . $context['session_var'] . '=' . $context['session_id'] . '" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');">' . $txt['delete'] . ' ' . $txt['all'] . '</a>] <input type="submit" name="delete_redirects" value="' . $txt['delete'] . '" onclick="return confirm(\'' . $txt['quickmod_confirm'] . '\');" class="button_submit" />',
//End: von COLLINZO: Delete all Mail Queue button ]]></add>
</operation>

        <operation>
            <search position="end" />
            <add><![CDATA[ //Begin: von COLLINZO: Delete all Mail Queue button
function ClearMailQueue2()
{
global $smcFunc;

checkSession('get');

$smcFunc['db_query']('', 'TRUNCATE TABLE {db_prefix}mail_queue', array() );
redirectexit('action=admin;area=mailqueue');

}
//End: von COLLINZO: Delete all Mail Queue button ]]></add>
        </operation>
    </file>
</modification>

Years later... Thanks old friend :)
Much faster than having to edit myself ;D