News:

Wondering if this will always be free?  See why free is better.

Main Menu

Delete All Mail Queue Button

Started by von COLLINZO, October 14, 2013, 11:46:13 AM

Previous topic - Next topic

von COLLINZO

Link to Mod

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.

Creative Commons License
This work is licensed under a Creative Commons Attribution
3.0 Unported License
.

4Kstore

Thanks, this is great to save time.

¡¡NEW MOD: Sparkles User Names!!!

Matthew K.

What license is this modification released under...? Hmm

luuuciano

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
No me agradan los foros que no te dejan borrar TU PROPIO usuario, como por ejemplo smfsimple.com.
E incluso te mandan emails no solicitados, de los cuales, quizá, no puedas escapar porque NO te dejan posibilidad a deshabilitarlos (a menos que NO te tengan en su lista negra).

von COLLINZO

@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

wwwserfer

Why noted that this mod is compatible with  SMF 1.1.x, when it is not so-??

margarett

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>
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

motu828

Is this mod runnig ok for 2.0.13?. Thanks

Ninja ZX-10RR

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
Quote from: BeastMode topic=525177.msg3720020#msg3720020
It's so powerful that on this post and even in the two PMs you sent me,you still answered my question very quickly and you're apologizing for the delay. You're the #1 support I've probably ever encountered man, so much respect for that. Thank you, and get better soon.

I'll keep this in my siggy for a while just to remind me that someone appreciated what I did while others didn't.

♥ Jess ♥

STOP EDITING MY PROFILE

Advertisement: