Advertisement:

Author Topic: Delete All Mail Queue Button  (Read 6285 times)

Offline von COLLINZO

  • Semi-Newbie
  • *
  • Posts: 43
  • Gender: Male
  • No Coding, No life!
    • collinsedim on Facebook
    • @@edimcollins on Twitter
    • Leakite Android Blog
Delete All Mail Queue Button
« on: October 14, 2013, 11:46:13 AM »
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
.

Offline 4Kstore

  • SMF Hero
  • ******
  • Posts: 4,326
  • Gender: Male
    • agustintari on Facebook
    • @agustintarifa on Twitter
    • SSIMPLE TEAM PAGE
Re: Delete All Mail Queue Button
« Reply #1 on: October 15, 2013, 09:47:49 PM »
Thanks, this is great to save time.
¡¡NEW MOD: Sparkles User Names!!!

Offline Matthew K.

  • SMF Super Hero
  • *******
  • Posts: 12,431
  • Gender: Male
    • matthew.kerle on Facebook
    • @matthew_kerle on Twitter
Re: Delete All Mail Queue Button
« Reply #2 on: October 16, 2013, 02:33:18 PM »
What license is this modification released under...? Hmm

Offline luuuciano

  • SMF Hero
  • ******
  • Posts: 2,979
    • http://cbasites.net/
Re: Delete All Mail Queue Button
« Reply #3 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
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).

Offline von COLLINZO

  • Semi-Newbie
  • *
  • Posts: 43
  • Gender: Male
  • No Coding, No life!
    • collinsedim on Facebook
    • @@edimcollins on Twitter
    • Leakite Android Blog
Re: Delete All Mail Queue Button
« Reply #4 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

Online wwwserfer

  • Semi-Newbie
  • *
  • Posts: 40
Re: Delete All Mail Queue Button
« Reply #5 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-??

Offline margarett

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,759
  • Gender: Male
Re: Delete All Mail Queue Button
« Reply #6 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
Code: [Select]
<?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

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

Offline motu828

  • Semi-Newbie
  • *
  • Posts: 67
Re: Delete All Mail Queue Button
« Reply #7 on: February 06, 2017, 09:50:52 AM »
Is this mod runnig ok for 2.0.13?. Thanks

Offline Ninja ZX-10RR

  • SMF Hero
  • ******
  • Posts: 2,163
  • Gender: Male
  • Sniper Legends
    • Flavio93Zena on Facebook
    • Virtual Interactive Games Entertainment Forum
Re: Delete All Mail Queue Button
« Reply #8 on: September 30, 2020, 10:32:20 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
Code: [Select]
<?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