Beispiel #1
0
function FlashCounterViewDataSet($DATA)
{
    global $blog, $service;
    requireComponent('Textcube.Function.misc');
    $cfg = misc::fetchConfigVal($DATA);
    if (!isset($blog['blogLanguage'])) {
        $blog['blogLanguage'] = $service['language'];
    }
    // Locale language file support.
    switch ($blog['blogLanguage']) {
        case "zh-TW":
            $retval = 'Flash 計數器尺寸 "205x85" 僅適用於黑色底色設定。';
            break;
        case "zh-CN":
            $retval = 'Flash 计数器尺寸 "205x85" 仅适用于黑色底色设定。';
            break;
        default:
            $retval = "플래쉬카운터 '205x85' 크기는 검정색만 설정가능합니다.";
    }
    if ($cfg['flashsize'] == '205') {
        if ($cfg['flashcolor'] == 'white') {
            return $retval;
        }
    }
    return true;
}
Beispiel #2
0
function EntriesWithTags_DataSet($data)
{
    requireComponent('Textcube.Function.misc');
    $cfg = misc::fetchConfigVal($data);
    if (!$cfg['entries'] || empty($cfg['entries']) || intval($cfg['entries'] <= 0)) {
        $cfg['entries'] = 5;
    }
    return true;
}
Beispiel #3
0
function getPlurkDataSet($data)
{
    requireComponent('Textcube.Function.misc');
    $cfg = misc::fetchConfigVal($data);
    if (!$cfg['plurknickname'] || empty($cfg['plurknickname']) || !$cfg['plurkpassword'] || empty($cfg['plurkpassword'])) {
        return "::Input error::\n\n Plurk's nickname and password must input certainly.";
    }
    return true;
}
Beispiel #4
0
function PN_Blog_Statistics_DataSet($DATA)
{
    requireComponent('Textcube.Function.misc');
    $cfg = misc::fetchConfigVal($DATA);
    return true;
}
Beispiel #5
0
function DEFENSIO()
{
    global $blogid, $pluginMenuURL, $pluginURL, $pluginSelfParam, $blog, $user, $blogURL, $defaultURL, $hostURL, $service, $skinSetting, $configVal;
    requireComponent('Textcube.Function.misc');
    $comment_TYPE = !empty($_GET['t']) ? $_GET['t'] : '';
    $page = !empty($_GET['page']) ? $_GET['page'] : 1;
    $perPage = getBlogSetting('rowsPerPage', 10);
    if ($comment_TYPE != "T") {
        $comment_TYPE = "C";
    }
    $data = misc::fetchConfigVal($configVal);
    $blogHome = preg_replace("'^http://'", "", $hostURL);
    print '<div><h2 class="caption"><span class="main-text">Defensio Anti Spam Filter</span></h2></div>';
    if (!isset($data['apikey']) || $data['apikey'] == '') {
        print <<<ENDL
\t\t<div>
\t\t\t<p><a href="http://www.defensio.com">Defensio</a>'s blog spam web service aggressively and intelligently prevents comment and trackback spam from hitting your blog. You should quickly notice a dramatic reduction in the amount of spam you have to worry about.</p><br />
\t\t\t<p>When the filter does rarely make a mistake (say, the odd spam message gets through or a rare good comment is marked as spam) we've made it a joy to sort through your comments and set things straight. Not only will the filter learn and improve over time, but it will do so in a personalized way!</p><br />
\t\t\t<p>In order to use our service, you will need a free Defensio API key. Get yours now at <a href="http://www.defensio.com/signup">Defensio.com</a>.</p>
\t\t</div>
ENDL;
        return;
    }
    print "<div>";
    // TODO: Cache?
    // get stats
    $stats = defensio_get_stats();
    if ($stats !== false) {
        $accuracy = number_format($stats['accuracy'] * 100, 2, '.', '');
        $spam = $stats['spam'];
        $ham = $stats['ham'];
        $fn = $stats['false-negatives'];
        $fp = $stats['false-positives'];
        $apikey = $data['apikey'];
        print <<<ENDL
\t\t<div class="defensio_stats" style="margin:10px;padding:5px;">
\t\t<div style="float:right;"><a href="http://defensio.com/manage/stats/{$apikey}">Detail Stats</a></div>
\t\t<ul>
\t\t\t<li><strong>Recent accuracy: {$accuracy}%</strong><hr></li>
\t\t\t<li><strong>{$spam}</strong> spams, <strong>{$ham}</strong> legitimate comments</li>
\t\t\t<li><strong>{$fn}</strong> false negatives (undetected spam)</li>
\t\t\t<li><strong>{$fp}</strong> false positives (legitimate comments identified as spam)</li>
\t\t</ul>
\t\t</div>
ENDL;
    }
    // get quarntines list
    list($comments, $paging) = defensio_get_data($comment_TYPE, $page, $perPage);
    include 'template/' . ($comment_TYPE == 'C' ? 'comment' : 'trackback') . '.php';
    print "</div>";
}
Beispiel #6
0
function MailNotificationDataSet($DATA)
{
    requireComponent('Textcube.Function.misc');
    $cfg = misc::fetchConfigVal($DATA);
    return true;
}
Beispiel #7
0
function getFlickrPhotosDataSet($DATA)
{
    requireComponent('Textcube.Function.misc');
    $cfg = misc::fetchConfigVal($DATA);
    if (!$cfg['flickruserid'] || empty($cfg['flickruserid'])) {
        return "::Input error::\n\n Flickr's NSID must input certainly.";
    }
    return true;
}