예제 #1
0
        foreach ($selid as $v) {
            $v = (int) $v;
            if ($v < 1) {
                continue;
            }
            $medalService->{$functionName}($v);
        }
        adminmsg('operate_success', "{$basename}&action=verify");
    }
    /* 勋章设置 */
} elseif ($action == 'set') {
    S::gp(array('step'), 'P');
    if (!$step) {
        ifcheck($db_md_ifopen, 'ifopen');
        ifcheck($db_md_ifapply, 'ifapply');
        require_once PrintApp('admin_set');
    } else {
        S::gp(array('config'), 'P');
        foreach ($config as $key => $value) {
            setConfig($key, $value);
        }
        updatecache_c();
        adminmsg('operate_success', "{$basename}&action=set");
    }
}
/**
 * JSON处理
 * 
 * @return Ambigous <multitype:, string>
 */
function getMedalJson($medal)
예제 #2
0
파일: admin.php 프로젝트: adi00/wumaproject
             $temp_uid = $temp['photo']['uid'];
             $rt['title'] = $belong . "<a href=\"u.php?uid={$temp_uid}\" target=\"_blank\">" . $temp['photo']['username'] . "</a>";
         } elseif ($rt['type'] == 'album') {
             $belong = getLangInfo('app', 'photo_belong');
             $temp_uid = $temp['album']['uid'];
             $rt['title'] = $belong . "<a href=\"u.php?uid={$temp_uid}\" target=\"_blank\">" . $temp['album']['username'] . "</a>";
         } elseif ($rt['type'] == 'group') {
             $rt['title'] = "<a href=\"{$rt['link']}\" target=\"_blank\">" . $temp['group']['name'] . "</a>";
         } elseif ($rt['type'] == 'diary') {
             $rt['title'] = "<a href=\"{$rt['link']}\" target=\"_blank\">" . $temp['diary']['subject'] . "</a>";
         } else {
             $rt['title'] = "<a href=\"{$rt['link']}\" target=\"_blank\">" . substrs($rt['link'], 40) . "</a>";
         }
         $sharedb[] = $rt;
     }
     require_once PrintApp('share');
 } elseif ($job == 'delete') {
     InitGP(array('selid', 'type', 'ifhidden', 'username', 'postdate_s', 'postdate_e', 'ordertype', 'page', 'lines'));
     empty($selid) && adminmsg("no_share_selid", "{$basename}&action=share");
     require_once "mode/o/require/core.php";
     foreach ($selid as $key => $id) {
         $sharedb = $db->get_one("SELECT uid FROM pw_share WHERE id=" . pwEscape($id));
         if (empty($sharedb)) {
             adminmsg('data_error', "{$basename}&action=share");
         }
         $uids[] = $sharedb['uid'];
         $db->update("DELETE FROM pw_share WHERE id=" . pwEscape($id));
         if ($affected_rows = delAppAction('share', $id)) {
             countPosts("-{$affected_rows}");
         }
     }
예제 #3
0
파일: set.php 프로젝트: jechiy/PHPWind
} elseif ($action == 'colonystyle') {
    if (empty($_POST['step'])) {
        $dir = $imgdir . '/g/';
        $files1 = opendir($dir);
        $array = array();
        while ($skinfile = readdir($files1)) {
            if (strstr($skinfile, 'skin_')) {
                $array[] = $skinfile;
            }
        }
        $names = array();
        $query = $db->query("SELECT * FROM pw_cnskin");
        while ($rt = $db->fetch_array($query)) {
            $names[$rt['dir']] = $rt['name'];
        }
        require_once PrintApp('admin');
    } else {
        S::gp(array('name', 'style_name'));
        $db->update("DELETE FROM pw_cnskin");
        $pwSQL = array();
        foreach ($name as $key => $value) {
            $pwSQL[] = array($value, $style_name[$key]);
        }
        $db->update("REPLACE INTO pw_cnskin (dir, name) VALUES " . S::sqlMulti($pwSQL));
        adminmsg('operate_success', "{$basename}&action=colonystyle");
    }
}
function Delcnimg($filename)
{
    return pwDelatt("cn_img/{$filename}", $GLOBALS['db_ifftp']);
}
예제 #4
0
파일: admin.php 프로젝트: adi00/wumaproject
     !is_numeric($lines) && ($lines = 30);
     $page < 1 && ($page = 1);
     $numofpage = ceil($count / $lines);
     if ($numofpage && $page > $numofpage) {
         $page = $numofpage;
     }
     $pages = numofpage($count, $page, $numofpage, "{$basename}&action=writes&job=list{$urladd}&");
     $start = ($page - 1) * $lines;
     $limit = pwLimit($start, $lines);
     $query = $db->query("SELECT o.id,o.uid,m.username,o.postdate,o.source,o.content,o.c_num FROM pw_owritedata o LEFT JOIN pw_members m ON o.uid=m.uid WHERE {$sql} " . "ORDER BY postdate {$ordertype} " . $limit);
     while ($rt = $db->fetch_array($query)) {
         $rt['s_content'] = substrs($rt['content'], 40);
         $rt['postdate'] = $rt['postdate'] ? get_date($rt['postdate']) : '-';
         $writedb[] = $rt;
     }
     require_once PrintApp('write');
 } elseif ($job == 'delete') {
     InitGP(array('selid', 'content', 'username', 'postdate_s', 'postdate_e', 'ordertype', 'page', 'lines'));
     empty($selid) && adminmsg("no_write_selid", "{$basename}&action=writes");
     require_once "mode/o/require/core.php";
     foreach ($selid as $key => $id) {
         $writedb = $db->get_one("SELECT uid FROM pw_owritedata WHERE id=" . pwEscape($id));
         if (empty($writedb)) {
             adminmsg('data_error', "{$basename}&action=writes");
         }
         $uids[] = $writedb['uid'];
         $db->update("DELETE FROM pw_owritedata WHERE id=" . pwEscape($id));
         $affected_rows = delAppAction('write', $id) + 1;
         countPosts("-{$affected_rows}");
     }
     $uids = array_unique($uids);
예제 #5
0
            } else {
                if ($adminitem == 'usermanage') {
                    //用户管理
                    S::gp(array('username'));
                    $params = array();
                    if ($username) {
                        $userService = L::loadClass('userservice', 'user');
                        /* @var $userService PW_UserService */
                        $userInfo = $userService->getByUserName($username);
                        $userInfo && ($params['uid'] = $userInfo['uid']);
                    }
                    //get data
                    $count = (int) $kmdService->countKmdUsers($params);
                    $count > 0 && ($users = $kmdService->searchUsers($params, $offset, $pagesize));
                    $pages = numofpage($count, $page, ceil($count / $pagesize), "{$basename}&username={$username}&");
                    require_once PrintApp('set');
                }
            }
        }
    }
}
function sendKmdMessages($uid, $title, $content, $paramsTitle = array(), $paramsContent = array())
{
    $uid = intval($uid);
    if ($uid < 1 || !$title || !$content) {
        return false;
    }
    $userService = L::loadClass('userservice', 'user');
    /* @var $userService PW_UserService */
    $userInfo = $userService->get($uid);
    if (!$userInfo) {
예제 #6
0
파일: admin.php 프로젝트: adi00/wumaproject
        empty($fFilterType) && ($fFilterType = array($currentFilterType));
        empty($fFilterTime) && ($fFilterTime = array($currentFilterTime));
        $filterTypeData = array_merge(array('current' => $currentFilterType), array('filters' => $fFilterType), array('filterItems' => $fFilterTypeValues));
        $filterTimeData = array_merge(array('current' => $currentFilterTime), array('filters' => $fFilterTime), array('filterItems' => $fFilterTimeValues));
        if ($itemsCount) {
            $filterTypeData = $filterTimeData = $itemsCount;
        } else {
            $filterTypeData = pwEscape(serialize($filterTypeData));
            $filterTimeData = pwEscape(serialize($filterTimeData));
        }
        $sqlUpdateHot = "UPDATE pw_modehot SET type_name=" . pwEscape($typeName) . ",\r\n\t\t\t\t\t\tfilter_type=" . $filterTypeData . ", filter_time=" . $filterTimeData . ", \r\n\t\t\t\t\t\tdisplay=" . pwEscape($display) . ", active=" . pwEscape($active) . " WHERE id=" . pwEscape($id);
        $db->update($sqlUpdateHot);
        $basename = $basename . "&action=hotEdit&hotId=" . $id;
        adminmsg('operate_success');
    } else {
        InitGP(array('hotId'), 'G');
        $sqlQueryHotById = "SELECT * FROM pw_modehot WHERE id=" . pwEscape($hotId);
        $rt = $db->get_one($sqlQueryHotById);
        $active = $rt["active"] ? 'checked' : '';
        $display = $rt["display"] ? 'checked' : '';
        $filterTypeData = (array) unserialize($rt["filter_type"]);
        $filterTimeData = (array) unserialize($rt["filter_time"]);
        if (!$filterTypeData['filters'] && !$filterTimeData['filters']) {
            $itemsCount = $rt["filter_type"];
        }
        $htmlFilterType = $utility->getFilterHtmlData($utility->getFilter($rt['tag'], 'type'), $filterTypeData, 'filterTypeItem_');
        $htmlFilterTime = $utility->getFilterHtmlData($utility->getFilter($rt['tag'], 'time'), $filterTimeData, 'filterTimeItem_', $rt['type_name']);
    }
}
require_once PrintApp('hot');
예제 #7
0
파일: admin.php 프로젝트: adi00/wumaproject
     !$perpage && ($perpage = $db_perpage);
     (int) $page < 1 && ($page = 1);
     $limit = pwLimit(($page - 1) * $perpage, $perpage);
     $query = $db->query("SELECT d.* FROM pw_diary d LEFT JOIN pw_members m ON d.uid=m.uid {$sql} {$order} {$by} {$limit}");
     while ($rt = $db->fetch_array($query)) {
         $rt['postdate'] = $rt['postdate'] ? get_date($rt['postdate']) : '-';
         $diarydb[] = $rt;
     }
     $db->free_result($query);
     @extract($db->get_one("SELECT COUNT(*) AS count FROM pw_diary d LEFT JOIN pw_members m ON d.uid=m.uid {$sql}"));
     if ($count > $perpage) {
         require_once R_P . 'require/forum.php';
         $pages = numofpage($count, $page, ceil($count / $perpage), "{$basename}&action={$action}&step=list&groupid={$groupid}&author={$author}&keyword={$keyword}&postdate1={$postdate1}&postdate2={$postdate2}&hits={$hits}&replies={$replies}&tcounts={$tcounts}&counts={$counts}&orderby={$orderby}&sc={$sc}&perpage={$perpage}&");
     }
     if (!$_POST['direct']) {
         require_once PrintApp('diary');
     }
 } elseif ($step == 'delete') {
     require_once "mode/o/require/core.php";
     $selids = '';
     InitGP(array('selid'), 'P', 1);
     if (is_array($selid)) {
         foreach ($selid as $value) {
             if (is_numeric($value)) {
                 $selids[] = $value;
             }
         }
         $selids = pwImplode($selids);
     }
     !$selids && adminmsg('operate_error', "{$basename}&action=cp");
     $selids = strpos($selids, ',') !== false ? "IN ({$selids})" : "= {$selids}";
예제 #8
0
파일: admin.php 프로젝트: adi00/wumaproject
                $pwSQL['lastpid'] = implode(',', getLastPid($photo['aid']));
            }
            $upsql = $pwSQL ? ',' . pwSqlSingle($pwSQL) : '';
            $db->update("UPDATE pw_cnalbum SET photonum=photonum-1{$upsql} WHERE aid=" . pwEscape($photo['aid']));
            pwDelatt($photo['path'], $db_ifftp);
            $lastpos = strrpos($photo['path'], '/') + 1;
            pwDelatt(substr($photo['path'], 0, $lastpos) . 's_' . substr($photo['path'], $lastpos), $db_ifftp);
            pwFtpClose($ftp);
            $affected_rows = delAppAction('photo', $pid) + 1;
            countPosts("-{$affected_rows}");
        }
        $uids = array_unique($uids);
        updateUserAppNum($uids, 'photo', 'recount');
        adminmsg('operate_success', "{$basename}&action=photos&job=list&aid={$aid}&cid={$cid}&cname=" . rawurlencode($cname) . "&aname=" . rawurlencode($aname) . "&uploader=" . rawurlencode($uploader) . "&pintro=" . rawurlencode($pintro) . "&uptime_s={$uptime_s}&uptime_e={$uptime_e}&orderway={$orderway}&ordertype={$ordertype}&lines={$lines}&page={$page}&");
    } else {
        require_once PrintApp('groups');
    }
}
function Delcnimg($filename)
{
    return pwDelatt("cn_img/{$filename}", $GLOBALS['db_ifftp']);
}
function updatecache_cnc()
{
    global $db;
    $classdb = array();
    $query = $db->query('SELECT fid,cname FROM pw_cnclass WHERE ifopen=1');
    while ($rt = $db->fetch_array($query)) {
        $classdb[$rt['fid']] = $rt['cname'];
    }
    $classdb = serialize($classdb);