I did it by myself!
I wrote an utility that lets you subscribe all users (or a subset) to all forums (or a subset).
Just create a
utility
subfolder under your SMF forum,
create a file in it, say,
subscribeall.php
then copy+paste this code in it:
<?php
require '../Settings.php';
$db_con = mysql_connect($db_server,$db_user,$db_passwd);
if (isset($_POST['go']) && $_POST['go']) {
$users = array();
$boards = array();
foreach (array_keys($_REQUEST) as $k) {
if (substr($k,0,10) == 'subscribe_') {
array_push($users,substr($k,10));
}
}
foreach (array_keys($_REQUEST) as $k) {
if (substr($k,0,6) == 'board_') {
array_push($boards,substr($k,6));
}
}
subscribe($users,$boards);
} else {
$sql = "SELECT * FROM smf_members WHERE 1 ORDER BY memberName";
$rs = mysql_db_query($db_name,$sql,$db_con);
echo '<html><head></head>';
echo '<body>';
echo '<h1>Batch subscribe users</h1>';
echo '<form method="post">';
if ($rs && mysql_num_rows($rs) > 0) {
while ($rec = mysql_fetch_assoc($rs)) {
$sel = '';
if ($rec['cate_id'] == $default) $sel = 'SELECTED ';
echo '<input type="checkbox" value="1" name="subscribe_'.$rec['ID_MEMBER'].'" checked>'.$rec['memberName']."<br /></option>\n";
}
mysql_free_result($rs);
}
echo '<h2>To boards:</h2>';
// Get boards
$sql = "SELECT * FROM smf_boards ORDER BY name";
$rs = mysql_db_query($db_name,$sql,$db_con);
if ($rs && mysql_num_rows($rs) > 0) {
while ($rec = mysql_fetch_assoc($rs)) {
echo '<input type="checkbox" value="1" name="board_'.$rec['ID_BOARD'].'" checked>'.$rec['name']."<br /></option>\n";
}
mysql_free_result($rs);
}
echo '<input type="submit" name="go" value="Go!">';
echo '</form>';
echo '</body></html>';
}
function subscribe($users,$boards) {
global $db_con,$db_name;
foreach ($users as $u) {
echo "<br>Subscribing user #$u...<br>";
$sql = "DELETE FROM smf_log_notify WHERE ID_TOPIC=0 AND ID_MEMBER = $u";
mysql_db_query($db_name,$sql,$db_con);
if ($errno = mysql_errno()) {
echo "$sql<br/>";
$rs = $errno . ": " . mysql_error(). "<br/>\n";
echo "result: $rs";
}
echo "to board #<br>";
foreach ($boards as $b) {
echo "$b ";
$sql = "INSERT INTO smf_log_notify (ID_MEMBER,ID_TOPIC,ID_BOARD) VALUES ($u,0,$b)";
mysql_db_query($db_name,$sql,$db_con);
if ($errno = mysql_errno()) {
echo "$sql<br/>";
$rs = $errno . ": " . mysql_error(). "<br/>\n";
echo "result: $rs";
}
}
}
}
?>
then opening:
http://yourserver.com/forum/utility/subscribeall.php
will let you select and do the job!
thank you SOOO much this is GREAT.
Now if i can only figure out how to globally change the users Notification options from the worthless defaults (or change the defaults themselves as they are terrible)