예제 #1
0
파일: plugModel.php 프로젝트: jayxtt999/me
 /**
  * 获取文件夹插件列表
  * @return array
  */
 public function getPlugins()
 {
     $pluginFiles = array();
     $pluginDir = @dir(PLUGIN_PATH);
     if ($pluginDir) {
         while (($file = $pluginDir->read()) !== false) {
             if (preg_match('|^\\.+$|', $file)) {
                 continue;
             }
             if (is_dir(PLUGIN_PATH . '/' . $file)) {
                 $pluginsSubDir = @dir(PLUGIN_PATH . '/' . $file);
                 if ($pluginsSubDir) {
                     while (($subFile = $pluginsSubDir->read()) !== false) {
                         if (preg_match('|^\\.+$|', $subFile)) {
                             continue;
                         }
                         if (strtolower($subFile) == strtolower($file . 'plugin.class.php')) {
                             $pluginFiles[] = strtolower($file);
                         }
                     }
                 }
             }
         }
     } else {
         return array();
     }
     foreach ($pluginFiles as $k => $v) {
         $pluginData = getPluginData($v);
         if (empty($pluginData['name'])) {
             continue;
         }
         $pluginsAll[$v] = $pluginData;
     }
     return $pluginsAll;
 }
예제 #2
0
            } else {
                $bucketname = substr($f, 0, strlen($f) - 4);
                $plugindata["buckets"][] = $bucketname;
                if ($load) {
                    $pluginbuckets[$bucketname][] = $plugindata['dir'];
                }
            }
        }
    }
    return $plugindata;
}
$rPlugins = Query("select * from {enabledplugins}");
while ($plugin = Fetch($rPlugins)) {
    $plugin = $plugin["plugin"];
    try {
        $res = getPluginData($plugin);
        if (!isset($res["nomobile"]) || !$mobileLayout) {
            $plugins[$plugin] = $res;
        }
    } catch (BadPluginException $e) {
        Report(Format("Disabled plugin \"{0}\" -- {1}", $plugin, $e->getMessage()));
        Query("delete from {enabledplugins} where plugin={0}", $plugin);
    }
    Settings::checkPlugin($plugin);
}
if ($loguser['pluginsettings'] != "") {
    $settings = unserialize($loguser['pluginsettings']);
    if (!is_array($settings)) {
        $settings = array();
    }
    foreach ($settings as $setName => $setVal) {
    Query("delete from {enabledplugins} where plugin={0}", $_REQUEST['id']);
    die(header("location: " . actionLink("pluginmanager")));
}
$cell = 0;
$pluginsDir = @opendir("plugins");
$enabledplugins = array();
$disabledplugins = array();
$pluginDatas = array();
if ($pluginsDir !== FALSE) {
    while (($plugin = readdir($pluginsDir)) !== FALSE) {
        if ($plugin == "." || $plugin == "..") {
            continue;
        }
        if (is_dir("./plugins/" . $plugin)) {
            try {
                $plugindata = getPluginData($plugin, false);
            } catch (BadPluginException $e) {
                continue;
            }
            $pluginDatas[$plugin] = $plugindata;
            if (isset($plugins[$plugin])) {
                $enabledplugins[$plugin] = $plugindata['name'];
            } else {
                $disabledplugins[$plugin] = $plugindata['name'];
            }
        }
    }
}
asort($enabledplugins);
asort($disabledplugins);
$ep = array();
예제 #4
0
                $tplname = substr($f, 0, -4);
                $plugindata['templates'][] = $tplname;
                if ($load) {
                    $plugintemplates[$tplname] = $plugindata['dir'];
                }
            }
        }
        closedir($pdir);
    }
    return $plugindata;
}
$rPlugins = Query("select * from {enabledplugins}");
while ($plugin = Fetch($rPlugins)) {
    $plugin = $plugin["plugin"];
    try {
        $plugins[$plugin] = getPluginData($plugin);
    } catch (BadPluginException $e) {
        Report(Format("Disabled plugin \"{0}\" -- {1}", $plugin, $e->getMessage()));
        Query("delete from {enabledplugins} where plugin={0}", $plugin);
    }
    Settings::checkPlugin($plugin);
}
if ($loguser['pluginsettings'] != "") {
    $settings = unserialize($loguser['pluginsettings']);
    if (!is_array($settings)) {
        $settings = array();
    }
    foreach ($settings as $setName => $setVal) {
        if (array_key_exists($setName, $pluginSettings)) {
            $pluginSettings[$setName]["value"] = stripslashes(urldecode($setVal));
        }
예제 #5
0
             break;
         case 'users':
             template('admin-users');
             break;
         case 'plugins':
             template('admin-plugins');
             break;
         case 'cron':
             template('admin-cron');
             break;
         case 'update':
             template('admin-update');
             break;
         case 'setplug':
             $plug = strip_tags($_GET['plug']);
             $pluginfo = getPluginData($plug . '/' . $plug . '.php');
             if (file_exists(SYSTEM_ROOT . '/plugins/' . $plug . '/' . $plug . '_setting.php') && in_array($_GET['plug'], $i['plugins']['actived'])) {
                 require_once SYSTEM_ROOT . '/plugins/' . $plug . '/' . $plug . '_setting.php';
             } else {
                 echo '<b>插件设置页面不存在</b>';
             }
             echo '<br/><br/><br/><br/>' . $pluginfo['Name'] . ' V' . $pluginfo['Version'] . ' // 插件作者:<a href="' . $pluginfo['AuthorUrl'] . '" target="_blank">' . $pluginfo['Author'] . '</a><br/>' . SYSTEM_FN . ' V' . SYSTEM_VER . ' // 程序作者: <a href="http://zhizhe8.net" target="_blank">无名智者</a> &amp; <a href="http://www.longtings.com/" target="_blank">mokeyjay</a>';
             break;
         case 'stat':
             template('admin-stat');
             break;
     }
     break;
 default:
     template('index');
     break;
예제 #6
0
            $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . "baiduid` WHERE `uid` = '{$uid}'");
            $cl1 = $cl1 + $c1['c'];
            //蛋疼的找表。。
            foreach ($i['table'] as $key => $table) {
                $c2 = $m->once_fetch_array("SELECT COUNT(*) AS `c` FROM `" . DB_PREFIX . "{$table}` WHERE `uid` = '{$uid}'");
                if (!empty($c2)) {
                    break;
                }
            }
            $cl2 = $cl2 + $c2['c'];
            $m->query("DELETE FROM `" . DB_NAME . "`.`" . DB_PREFIX . "{$table}` WHERE `uid` = '{$uid}'");
        }
    }
    if (!empty($cl1) || !empty($cl2)) {
        echo "</br><div class='alert alert-success'>为您删除了{$cl1}条绑定信息 和 {$cl2}条贴吧信息</div>";
    } else {
        echo '</br><div class="alert alert-success">看样子您的数据库很干净~</div>';
    }
    ?>
		<h4>接下来您可以:</h4>
		<br/><input type="button" onclick="location = '<?php 
    echo SYSTEM_URL;
    ?>
index.php?pri_plugin=fyy_clean&1'" class="btn btn-primary" value="冗余数据清理(1)" style="width:170px">&nbsp;&nbsp;&nbsp;&nbsp;清除无对应绑定信息的贴吧信息
	<?php 
    $pluginfo = getPluginData('fyy_clean/fyy_clean.php');
    echo '<br/><br/><br/><br/><br/>' . $pluginfo['Name'] . ' V' . $pluginfo['Version'] . ' // 插件作者:<a href="' . $pluginfo['AuthorUrl'] . '" target="_blank">' . $pluginfo['Author'] . '</a><br/>' . SYSTEM_FN . ' V' . SYSTEM_VER . ' // 程序作者: <a href="http://zhizhe8.net" target="_blank">无名智者</a> &amp; <a href="http://www.longtings.com/" target="_blank">mokeyjay</a>';
    die;
} else {
    die('Undefined operation,you must give some f*****g parameters');
}