OSDN Git Service

2.0.3 jp10
[nucleus-jp/nucleus-plugins.git] / trunk / NP_TrackBack / trackback / index.php
index 0dd0b7c..ae07874 100644 (file)
@@ -7,7 +7,7 @@
        
        
        // Send out Content-type
-       sendContentType('application/xhtml+xml', 'admin-trackback', _CHARSET);  
+       //sendContentType('application/xhtml+xml', 'admin-trackback', _CHARSET);        
 
        $oPluginAdmin = new PluginAdmin('TrackBack');
 
@@ -27,7 +27,9 @@
        if (!in_array($action, $aActionsNotToCheck)) {
                if (!$manager->checkTicket()) doError(_ERROR_BADTICKET);
        }
+
        $oPluginAdmin->start();
+       //$oPluginAdmin->admin->pagehead();
        
 //modify start+++++++++
                $plug =& $oPluginAdmin->plugin;
        $oTemplate->set ('CONF', $CONF);
        $oTemplate->set ('plugindirurl', $oPluginAdmin->plugin->getAdminURL());
        $oTemplate->set ('ticket', $manager->_generateTicket());
-       \r       $ajaxEnabled = ($oPluginAdmin->plugin->getOption('ajaxEnabled') == 'yes') ? true : false;
+       $ajaxEnabled = ($oPluginAdmin->plugin->getOption('ajaxEnabled') == 'yes') ? true : false;
        $oTemplate->set ('ajaxEnabled', $ajaxEnabled);
 
        switch($action) {
 
 //modify start+++++++++
                case 'tableUpgrade':
-                       mysql_query("
+                       sql_query("
                                CREATE TABLE IF NOT EXISTS
                                        ".sql_table('plugin_tb_lookup')."
                                (
                                 CHANGE `blog_name` `blog_name` TEXT NOT NULL,
                                 DROP PRIMARY KEY,
                                 ADD `id` INT( 11 ) NOT NULL AUTO_INCREMENT PRIMARY KEY FIRST ;";
-                       $res = @mysql_query($q);
+                       $res = @sql_query($q);
                        if (!$res){
                                echo 'Could not alter table: ' . mysql_error();
                        }else{
                                $tableVersion = 1;
                                $oTemplate->template('templates/updatetablefinished.html');
                        }
-                       @mysql_query('ALTER TABLE `' . sql_table('plugin_tb') . '` ADD INDEX `tb_id_block_timestamp_idx` ( `tb_id`, `block`, `timestamp` DESC )');
+                       @sql_query('ALTER TABLE `' . sql_table('plugin_tb') . '` ADD INDEX `tb_id_block_timestamp_idx` ( `tb_id`, `block`, `timestamp` DESC )');
                        break;
 //modify end+++++++++
 
                case 'block':
                        $tb = intRequestVar('tb');
 
-                       $res = mysql_query ("
+                       $res = sql_query ("
                                UPDATE
                                        ".sql_table('plugin_tb')."
                                SET
                        $action = requestVar('next');
                        break;
                case 'blocked_clear':
-                       $res = mysql_query ("DELETE FROM ".sql_table('plugin_tb')." WHERE block = 1");
+                       $res = sql_query ("DELETE FROM ".sql_table('plugin_tb')." WHERE block = 1");
                        $action = requestVar('next');
                        break;
                        
                case 'blocked_spamclear':
-                       $res = mysql_query ("DELETE FROM ".sql_table('plugin_tb')." WHERE block = 1 and spam = 1");
+                       $res = sql_query ("DELETE FROM ".sql_table('plugin_tb')." WHERE block = 1 and spam = 1");
                        $action = requestVar('next');
                        break;
 
                case 'unblock':
                        $tb = intRequestVar('tb');
 
-                       $res = mysql_query ("
+                       $res = sql_query ("
                                UPDATE
                                        ".sql_table('plugin_tb')."
                                SET
                case 'delete':
                        $tb = intRequestVar('tb');
 
-                       $res = mysql_query ("
+                       $res = sql_query ("
                                DELETE FROM
                                        ".sql_table('plugin_tb')."
                                WHERE
 
                case 'blocked':
                case 'all':     
-                       $rres = mysql_query ("
+                       $rres = sql_query ("
                                SELECT
                                        COUNT(*) AS count
                                FROM
                        } else {\r                               $start  = intRequestVar('start') ? intRequestVar('start') : 0;
                                $amount = intRequestVar('amount') ? intRequestVar('amount') : 25;
 
-                               $rres = mysql_query ("
+                               $rres = sql_query ("
                                        SELECT
                                        i.ititle AS story,
                                        i.inumber AS story_id,
                                        t.blog_name AS blog_name,
                                        t.excerpt AS excerpt,
                                        t.url AS url,
-                                       t.timestamp AS timestamp,
+                                       UNIX_TIMESTAMP(t.timestamp) AS timestamp,
                                        t.spam AS spam,
                                        t.link AS link
                                        FROM
                        $start  = intRequestVar('start') ? intRequestVar('start') : 0;
                        $amount = intRequestVar('amount') ? intRequestVar('amount') : 25;
 
-                       $ires = mysql_query ("
+                       $ires = sql_query ("
                                SELECT
                                        ititle,
                                        inumber
                                $story['id']    = $id;
                                $story['title'] = $irow['ititle'];
 
-                               $rres = mysql_query ("
+                               $rres = sql_query ("
                                        SELECT
                                                COUNT(*) AS count
                                        FROM
                                else
                                        $count = 0;
                                        
-                               $rres = mysql_query ("
+                               $rres = sql_query ("
                                        SELECT
                                                t.id AS id,
                                                t.title AS title,
                                                        
                
                case 'index':
-                       $bres = mysql_query ("
+                       $bres = sql_query ("
                                SELECT
                                        bnumber AS bnumber,
                                        bname AS bname,
                        
                        while ($brow = mysql_fetch_array($bres))
                        {
-                               $ires = mysql_query ("
+                               $ires = sql_query ("
                                        SELECT
                                                i.inumber AS inumber,
                                            i.ititle AS ititle,