diff -Nur old/NP_TrackBack.php new/NP_TrackBack.php --- old/NP_TrackBack.php 2007-09-10 10:18:43.000000000 -0700 +++ new/NP_TrackBack.php 2007-09-10 10:20:08.000000000 -0700 @@ -695,10 +695,10 @@ } // 7. Send notification e-mail if needed - if (($block == false || $this->getOption('NoNotifyBlocked') == 'no') - && $this->getOption('Notify') == 'yes') + if (($block == false || $this->getBlogOption(getBlogIDFromItemID($tb_id), 'NoNotifyBlocked') == 'no') + && $this->getBlogOption(getBlogIDFromItemID($tb_id), 'Notify') == 'yes') { - $destAddress = $this->getOption('NotifyEmail'); + $destAddress = $this->getBlogOption(getBlogIDFromItemID($tb_id), 'NotifyEmail'); $vars = array ( 'tb_id' => $tb_id, @@ -1894,7 +1894,13 @@ global $member, $nucleus, $blogid; // only show to admins - if (!$member->isLoggedIn() || !$member->isAdmin()) return; + if (preg_match("/MD$/", $nucleus['version'])) { + $isblogadmin = $member->isBlogAdmin(-1); + } else { + $isblogadmin = $member->isBlogAdmin($blogid); + } + + if (!($member->isLoggedIn() && ($member->isAdmin() || $isblogadmin))) return; array_push( $data['options'], @@ -1922,9 +1928,9 @@ $this->createOption('tplTbMore', 'Trackback count (more)', 'text', "<%number%> Trackbacks"); $this->createOption('dateFormat', 'Date format', 'text', "%e/%m/%g"); - $this->createOption('Notify', 'Send e-mail notification on ping receipt','yesno','no'); - $this->createOption('NoNotifyBlocked', 'Don\'t send e-mail notification for blocked pings','yesno','no'); - $this->createOption('NotifyEmail', 'Which e-mail address to send these notification to?','text',''); + $this->createBlogOption('Notify', 'Send e-mail notification on ping receipt','yesno','no'); + $this->createBlogOption('NoNotifyBlocked', 'Don\'t send e-mail notification for blocked pings','yesno','no'); + $this->createBlogOption('NotifyEmail', 'Which e-mail address to send these notification to?','text',''); $this->createOption('DropTable', 'Clear the database when uninstalling','yesno','no'); $this->createOption('BlockSpams', 'Blocked Spams directly?','yesno','yes'); diff -Nur old/trackback/index.php new/trackback/index.php --- old/trackback/index.php 2007-09-10 10:19:13.000000000 -0700 +++ new/trackback/index.php 2007-09-10 10:19:59.000000000 -0700 @@ -17,7 +17,7 @@ $oPluginAdmin = new PluginAdmin('TrackBack'); - if (!($member->isLoggedIn() && $member->isAdmin())) + if (!$member->isLoggedIn()) { $oPluginAdmin->start(); echo '
' . _ERROR_DISALLOWED . '
'; @@ -46,10 +46,18 @@ case 'delblocked': $res = mysql_query (" - DELETE FROM - ".sql_table('plugin_tb')." + DELETE + t + FROM + ".sql_table('plugin_tb')." AS t, + ".sql_table('item')." AS i, + ".sql_table('team')." AS team WHERE - block = 1 + t.tb_id = i.inumber AND + i.iblog = team.tblog AND + team.tmember = '".$member->id."' AND + team.tadmin = 1 AND + t.block = 1 "); echo "All blocked trackbacks deleted"; break; @@ -59,11 +67,17 @@ $res = mysql_query (" UPDATE - ".sql_table('plugin_tb')." + ".sql_table('plugin_tb')." AS t, + ".sql_table('item')." AS i, + ".sql_table('team')." AS team SET - block = 1 + t.block = 1 WHERE - id = '".$tb."' + t.tb_id = i.inumber AND + i.iblog = team.tblog AND + team.tmember = '".$member->id."' AND + team.tadmin = 1 AND + t.id = '".$tb."' "); $action = requestVar('next'); @@ -74,11 +88,17 @@ $res = mysql_query (" UPDATE - ".sql_table('plugin_tb')." + ".sql_table('plugin_tb')." AS t, + ".sql_table('item')." AS i, + ".sql_table('team')." AS team SET - block = 0 + t.block = 0 WHERE - id = '".$tb."' + t.tb_id = i.inumber AND + i.iblog = team.tblog AND + team.tmember = '".$member->id."' AND + team.tadmin = 1 AND + t.id = '".$tb."' "); $action = requestVar('next'); @@ -88,10 +108,18 @@ $tb = intRequestVar('tb'); $res = mysql_query (" - DELETE FROM - ".sql_table('plugin_tb')." - WHERE - id = '".$tb."' + DELETE + t + FROM + ".sql_table('plugin_tb')." AS t, + ".sql_table('item')." AS i, + ".sql_table('team')." AS team + WHERE + t.tb_id = i.inumber AND + i.iblog = team.tblog AND + team.tmember = '".$member->id."' AND + team.tadmin = 1 AND + t.id = '".$tb."' "); $action = requestVar('next'); @@ -140,9 +168,13 @@ COUNT(*) AS count FROM ".sql_table('plugin_tb')." AS t, + ".sql_table('team')." AS team, ".sql_table('item')." AS i WHERE t.tb_id = i.inumber AND + i.iblog = team.tblog AND + team.tmember = '".$member->id."' AND + team.tadmin = 1 AND t.block = 1 "); @@ -164,9 +196,13 @@ t.link AS link FROM ".sql_table('plugin_tb')." AS t, + ".sql_table('team')." AS team, ".sql_table('item')." AS i WHERE t.tb_id = i.inumber AND + i.iblog = team.tblog AND + team.tmember = '".$member->id."' AND + team.tadmin = 1 AND t.block = 1 ORDER BY timestamp DESC @@ -210,9 +246,13 @@ COUNT(*) AS count FROM ".sql_table('plugin_tb')." AS t, + ".sql_table('team')." AS team, ".sql_table('item')." AS i WHERE t.tb_id = i.inumber AND + i.iblog = team.tblog AND + team.tmember = '".$member->id."' AND + team.tadmin = 1 AND t.block = 0 "); @@ -232,9 +272,13 @@ UNIX_TIMESTAMP(t.timestamp) AS timestamp FROM ".sql_table('plugin_tb')." AS t, + ".sql_table('team')." AS team, ".sql_table('item')." AS i WHERE t.tb_id = i.inumber AND + i.iblog = team.tblog AND + team.tmember = '".$member->id."' AND + team.tadmin = 1 AND t.block = 0 ORDER BY timestamp DESC @@ -276,12 +320,16 @@ $ires = mysql_query (" SELECT - ititle, - inumber + i.ititle, + i.inumber FROM - ".sql_table('item')." + ".sql_table('item')." AS i, + ".sql_table('team')." AS t WHERE - inumber = '".$id."' + t.tblog = i.iblog AND + t.tmember = '".$member->id."' AND + t.tadmin = 1 AND + i.inumber = '".$id."' "); if ($irow = mysql_fetch_array($ires)) @@ -357,11 +405,16 @@ case 'index': $bres = mysql_query (" SELECT - bnumber AS bnumber, - bname AS bname, - burl AS burl + b.bnumber AS bnumber, + b.bname AS bname, + b.burl AS burl FROM - ".sql_table('blog')." + ".sql_table('blog')." AS b, + ".sql_table('team')." AS t + WHERE + b.bnumber = t.tblog AND + t.tmember = '".$member->id."' AND + t.tadmin = 1 ORDER BY bname ");