I found myself having to delete 36 pages of topic notifications and desperately needing an Unsubscribe All button. I know, I know, I should have paid attention and unsubscribed from topics periodically. What can I say, I'm pretty forgetful.
So, here's the mod. This is for 1.01.
===Profile.php===
After
// We are editing topic notifications......
elseif (isset($_POST['edit_notify_topics']) && !empty($_POST['notify_topics']))
{
foreach ($_POST['notify_topics'] as $index => $id)
$_POST['notify_topics'][$index] = (int) $id;
// Make sure there are no zeros left.
$_POST['notify_topics'] = array_diff($_POST['notify_topics'], array(0));
db_query("
DELETE FROM {$db_prefix}log_notify
WHERE ID_TOPIC IN (" . implode(', ', $_POST['notify_topics']) . ")
AND ID_MEMBER = $memID", __FILE__, __LINE__);
}
Add
elseif (isset($_POST['edit_notify_topics_all']))
{
db_query("
DELETE FROM {$db_prefix}log_notify
WHERE ID_MEMBER = $memID", __FILE__, __LINE__);
}
===Profile.english.php=== (or your specific language)
After
$txt['notifications_update'] = 'Unsubscribe';
Add
$txt['notifications_update_all'] = 'Unsubscribe All';
===Profile.template.php=== (default and whatever theme you are using)
Change
<td colspan="3" class="windowbg2" align="right">
<input type="submit" name="edit_notify_topics" value="', $txt['notifications_update'], '" />
</td>
to
<td colspan="3" class="windowbg2" align="right">
<input type="submit" name="edit_notify_topics_all" value="', $txt['notifications_update_all'], '" /><input type="submit" name="edit_notify_topics" value="', $txt['notifications_update'], '" />
</td>
Now your laziest members can delete all their topic notifications. ;D
i compiled this as a mod and gave credits to kegobeer, i hope he doesnt drive angry with me :)
its available for English and Turkish languages.
here it is;
http://www.elmacik.com/ ******** (edit: I removed the link because this is already a mod)
ATTENTION: one file probably will give TEST FAILED result, just ignore it as its turkish language file ;)
(this means if you dont have turkish language installed, it will say "failed" you can still install succesfully)
tested with SMF 1.1 Beta 3 Public and worked very well ;)