Пример #1
0
     break;
 case 20:
     //添加好友----
     var_dump(addFriend("zhangsan", "lisi"));
     break;
 case 21:
     //删除好友
     var_dump(deleteFriend("zhangsan", "lisi"));
     break;
 case 22:
     //查看好友
     var_dump(showFriends("zhangsan"));
     break;
 case 23:
     //查看黑名单
     var_dump(getBlacklist("zhangsan"));
     break;
 case 24:
     //往黑名单中加人
     $usernames = array("usernames" => array("zhangsan", "lisi"));
     var_dump(addUserForBlacklist("wangwu", $usernames));
     break;
 case 25:
     //从黑名单中减人
     var_dump(deleteUserFromBlacklist("zhangsan", "lisi"));
     break;
 case 26:
     //查看用户是否在线
     var_dump(isOnline("zhangsan"));
     break;
 case 27:
Пример #2
0
<?php

// Developer : Ekrem KAYA
// Website   : http://e-piksel.com
// Extension : http://weblenti.com/opencart-spammerbye-spam-referrer-blocker-s1-p82
// GitHub    : https://github.com/epiksel/spammerbye
// Version   : 1.0.0
if (!defined('DIR_APPLICATION')) {
    header("Location: index.php");
    exit;
}
if (isset($_SERVER['HTTP_REFERER']) && !empty($_SERVER['HTTP_REFERER'])) {
    $refurl = getRefUrl($_SERVER['HTTP_REFERER']);
    $status = $refurl == getRefUrl(HTTP_SERVER) || $refurl == getRefUrl(HTTPS_SERVER) ? false : true;
    if ($status) {
        foreach (getBlacklist() as $spammer) {
            if ($refurl == $spammer) {
                $spammerBye = 'Location: http://' . $spammer;
                header($spammerBye);
                exit;
            }
        }
    }
}
function getBlacklist()
{
    $blacklist_data = array();
    if (is_file(DIR_SYSTEM . 'blacklist.txt')) {
        $blacklist = DIR_SYSTEM . 'blacklist.txt';
    } else {
        $blacklist = 'https://raw.githubusercontent.com/epiksel/spammerbye/master/blacklist.txt';