SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Unsubscribe from all topic notifications

Started by kegobeer, January 20, 2005, 07:11:38 PM

Previous topic - Next topic


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.

// 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));

DELETE FROM {$db_prefix}log_notify
WHERE ID_TOPIC IN (" . implode(', ', $_POST['notify_topics']) . ")
AND ID_MEMBER = $memID", __FILE__, __LINE__);

elseif (isset($_POST['edit_notify_topics_all']))
   DELETE FROM {$db_prefix}log_notify
   WHERE ID_MEMBER = $memID", __FILE__, __LINE__);

===Profile.english.php=== (or your specific language)
$txt['notifications_update'] = 'Unsubscribe';
$txt['notifications_update_all'] = 'Unsubscribe All';

===Profile.template.php=== (default and whatever theme you are using)
      <td colspan="3" class="windowbg2" align="right">
       <input type="submit" name="edit_notify_topics" value="', $txt['notifications_update'], '" />

      <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'], '" />

Now your laziest members can delete all their topic notifications.  ;D
"The truth of the matter is that you always know the right thing to do. The hard part is doing it." - Norman Schwarzkopf
Posting and you (Click "WATCH THIS MOVIE")


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; ******** (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 ;)
Home of Elmacik