示例#1
0
 /**
  *
  */
 protected function _initialize()
 {
     G('begin');
     /* 读取站点配置 */
     //S('config',null);
     $config = S('config');
     if (empty($config)) {
         $config = config();
         S('config', $config, 86400);
     }
     C($config);
     $bbsinfo = S('bbsinfo');
     if (empty($bbsinfo)) {
         $bbsinfo = bbsinfo();
         S('bbsinfo', $bbsinfo, 86400);
     }
     if (C('WEB_LOCK') == '1') {
         exit("网站暂时关闭");
     }
     $userinfo = getuserinfo();
     if (empty($userinfo)) {
         $userinfo = null;
     }
     $listdata = S('listdata');
     if (empty($listdata)) {
         $listarticle = M('Article');
         $listdata = $listarticle->where('status = 0')->order('view')->limit(15)->getField('id,title,review');
         S('listdata', $listdata, 600);
     }
     $this->assign('listdata', $listdata);
     $this->assign('userinfo', $userinfo);
     $this->assign('bbsinfo', $bbsinfo);
 }
示例#2
0
 function buy()
 {
     global $_G;
     if (!empty($_G['gp_id'])) {
         $member = getuserinfo($_G['gp_id'], array('groupid'));
         $this->_check($member['groupid']);
     }
 }
示例#3
0
 function buy()
 {
     global $_G;
     if (!empty($_GET['id'])) {
         $member = getuserinfo($_GET['id']);
         $this->_check($member['groupid']);
     }
 }
示例#4
0
 function buy()
 {
     global $_G;
     if (!empty($_G['gp_id'])) {
         $member = getuserinfo($_G['gp_id'], array('groupid', 'username'));
         if ($_G['group']['allowviewip']) {
             $_G['gp_username'] = $member['username'];
             $this->usesubmit();
         } else {
             $this->_check($member['groupid']);
         }
     }
 }
示例#5
0
 public function index()
 {
     $userinfo = getuserinfo();
     /**
              if(I('get.id')){
                 $usercent = D('Userinfo');
                 $user = $usercent->getuserid(I('get.id'));
                 $article = D('Article');
                 $userarticle = $article->userid(I('get.id'));
                 if(!$user){
                     $this->error("找遍所有的街,都没有该用户~");
                 }
                 if(I('get.id') == $userinfo['id']){
                     $modify = 'yes';
                     $this->assign('modify',$modify);
                 }
             }else
             **/
     if (I('get.user')) {
         $usercent = D('Userinfo');
         $user = $usercent->getusername(I('get.user'));
         $article = D('Article');
         $userarticle = $article->username(I('get.user'));
         if (!$user) {
             $this->error("找遍所有的街,都没有该用户~");
         }
         if (I('get.user') == $userinfo['username']) {
             $modify = 'yes';
             $this->assign('modify', $modify);
         }
     } else {
         $user = S(cookie('auth'));
         if (empty($user)) {
             $this->error("先去登录吧~", U('Sign/index'));
         }
         $article = D('Article');
         $userarticle = $article->userid($user['id']);
         $modify = 'yes';
         $this->assign('modify', $modify);
     }
     $userinfo = getuserinfo();
     if (empty($userinfo)) {
         $userinfo = null;
     }
     $this->assign('user', $user);
     $this->assign('userarticle', $userarticle);
     $this->assign('userinfo', $userinfo);
     $this->display();
 }
示例#6
0
 function usesubmit()
 {
     global $_G;
     $user = !empty($_G['gp_id']) ? htmlspecialchars($_G['gp_id']) : '';
     if ($user) {
         $member = getuserinfo($user, array('groupid'));
         $this->_check($member['groupid']);
     }
     $user_db = DB::fetch_first("SELECT * FROM " . DB::table('dsu_marcothief') . " WHERE uid='{$_G['uid']}'");
     if (!$user_db) {
         DB::query("INSERT INTO " . DB::table('dsu_marcothief') . " (uid) VALUES ('{$_G['uid']}')");
     }
     $time = $this->parameters['hrs'] * 60 * 60 + $_G['timestamp'];
     DB::query("UPDATE " . DB::table('dsu_marcothief') . " SET protect='{$time}' WHERE uid='{$_G['uid']}'");
     usemagic($this->magic['magicid'], $this->magic['num']);
     updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']);
     showmessage('dsu_marcothief:magic_2', 'plugin.php?id=dsu_marcothief&mod=bag', array(), array('locationtime' => true, 'showdialog' => 1));
 }
示例#7
0
 public function new_article()
 {
     $authcode = cookie('auth');
     if (empty(cookie('auth'))) {
         $this->error("请先登录,然后再操作!");
     }
     $userinfo = M(userinfo);
     $info = $userinfo->where("authcode ='{$authcode}'")->find();
     if ($info['status'] == 1) {
         $this->error("帐户已被锁定", '', 5);
     }
     $userinfo = getuserinfo();
     if (empty($userinfo)) {
         $userinfo = null;
     }
     $node = M('node');
     $nodedata = $node->select();
     $this->assign('node', $nodedata);
     $this->assign('userinfo', $userinfo);
     $this->display();
 }
示例#8
0
            }
            //lets create a next page link if needed
            if ($page != $pages) {
                $CONTENT .= "<a href='news.php?page=" . ($page + 1) . "'>next</a>\r\n";
            }
            $CONTENT .= "<div align=\"right\"><a href='news.php?onepage=1'>Show all requests on one page.</a></div><br />\r\n";
        }
    } else {
        $CONTENT .= "There are no active news at this time.<BR>\r\n";
    }
    $WORK = insert_into_template($MAIN, "{CONTENT}", $CONTENT);
    $WORK = filltemplate($WORK, "News");
    //when we output this lets make sure that the output is stripped of any template elements that are not used.
    printf("%s", striptemplate($WORK));
}
//===Main code================================================================
//check to see if the user is logged in.
$user = getuserinfo();
if (0 == strcmp($user['email'], "anonymous")) {
    $logged_in = 0;
} else {
    $logged_in = 1;
}
//start main code here.
//lets handle the user interaction here.
if (isset($HTTP_GET_VARS['category']) && is_numeric($HTTP_GET_VARS['category'])) {
    $category = $HTTP_GET_VARS['category'];
} else {
    $category = 0;
}
shownews($category);
示例#9
0
     login();
 } else {
     if ($ask == "logout") {
         logout();
     } else {
         if ($ask == "main") {
             seemain();
         } else {
             if ($ask == "news") {
                 news();
             } else {
                 if ($ask == "hot") {
                     gethot();
                 } else {
                     if ($ask == "userinfo") {
                         getuserinfo();
                     } else {
                         if ($ask == "sendmsg") {
                             sendmsg();
                         } else {
                             if ($ask == "msg") {
                                 msg();
                             } else {
                                 if ($ask == "register") {
                                     register();
                                 } else {
                                     if ($ask == "edituser") {
                                         edituser();
                                     } else {
                                         if ($ask == "changepsd") {
                                             changepsd();
示例#10
0
function getuserinfo($id)
{
    $sql = "select * from " . WIIDBPRE . "_user where user_id=" . $id;
    $rs = mysql_query($sql);
    $row = mysql_fetch_assoc($rs);
    if ($row) {
        return $row;
    } else {
        return '';
    }
}
switch ($act) {
    case 'print':
        $id = sqlReplace(trim($_GET['id']));
        if (!empty($id)) {
            $row = getuserinfo($id);
            if (!$row) {
                alertInfo('数据不存在', '', 1);
            }
            require_once 'PHPWord.php';
            $PHPWord = new PHPWord();
            //复制模板文件,变成下载文件
            $now = time();
            $y_url = '../userfiles/print.docx';
            $x_url = '../userfiles/docx/' . $now . '.docx';
            $document = $PHPWord->loadTemplate($y_url);
            $document->setValue('name', $row['user_name']);
            //姓名
            $document->setValue('phone', $row['user_phone']);
            //姓名
            //文件内容替换完毕  保存  下载
示例#11
0
function login()
{
    //this function draws a complete login form
    global $user, $HTTP_POST_VARS;
    //lets make sure that if our user is logged in or logging in that we know it.
    if (!isset($user)) {
        $user = getuserinfo();
    }
    if (0 == strcmp($user['username'], "anonymous") && isset($HTTP_POST_VARS['user'])) {
        $user = userlogin($HTTP_POST_VARS['user'], $HTTP_POST_VARS['pass'], $HTTP_POST_VARS['automatic']);
    }
    //lets see if we need to present the user with a login box
    if (0 == strcmp($user['username'], "anonymous")) {
        if (iset($_SERVER["QUERY_STRING"])) {
            $url = $_SERVER["SCRIPT_NAME"] . "?" . $_SERVER["QUERY_STRING"] . "&login=1";
        } else {
            $url = $_SERVER["SCRIPT_NAME"] . "?login=1";
        }
        $WORK = "Please Enter your username and password to login:<BR>\r\n";
        $WORK .= "<form method='post' action='" . $url . "'>\r\n";
        $WORK .= "Username: <input type='text' name='user' size='20'><BR>\r\n";
        $WORK .= "Password: <input type='password' name='pass' size='20'><BR>\r\n";
        $WORK .= "Log me on automatically each visit: <input type='checkbox' name='automatic' checked><BR>\r\n";
        $WORK .= "<input type='submit' value='Login'>\r\n";
        $WORK .= "</form>\r\n";
    } else {
        $WORK = "You are currently logged in as " . $user['username'] . ".<BR>\r\n";
    }
    return $WORK;
}
<?php

/*
	[Discuz!] (C)2001-2009 Comsenz Inc.
	This is NOT a freeware, use is subject to license terms

	$Id: magic_reporter.inc.php 16688 2008-11-14 06:41:07Z cnteacher $
*/
if (!defined('IN_DISCUZ')) {
    exit('Access Denied');
}
if (submitcheck('usesubmit')) {
    if (empty($username)) {
        showmessage('magics_info_nonexistence');
    }
    $member = getuserinfo($username, array('uid', 'groupid'));
    checkmagicperm($magicperm['targetgroups'], $member['groupid']);
    $query = $db->query("SELECT action FROM {$tablepre}sessions WHERE uid='{$member['uid']}'");
    if (!($msession = $db->fetch_array($query))) {
        $magicmessage = 'magics_RTK_on_message';
    } else {
        include language('actions');
        $magicmessage = 'magics_RTK_off_message';
    }
    usemagic($magicid, $magic['num']);
    updatemagiclog($magicid, '2', '1', '0', '', '', $member['uid']);
    showmessage($magicmessage, '', 1);
}
function showmagic()
{
    global $username, $lang;
示例#13
0
function filltemplate($TEMPLATE, $TITLE)
{
    //this function will consolidate code in most pages.
    global $list_prefix;
    //lets process the page title.
    $WORK = insert_into_template($TEMPLATE, "{TITLE}", $TITLE);
    //lets process the links
    $WORK = insert_into_template($WORK, "{NAVLINKS}", GETNAVLINKS());
    $WORK = insert_into_template($WORK, "{APPLINKS}", GETPLAPPLINKS(getuserinfo()));
    //lets process the sitename
    $sql = "SELECT * FROM " . $list_prefix . "config WHERE `key` = 'sitename';";
    $result = db_query($sql);
    $rows = db_num_rows($result);
    if (isset($rows) && $rows > 0) {
        $row = db_fetch_array($result);
        $VALUE = $row['value'];
    } else {
        $VALUE = "localhost";
    }
    $WORK = insert_into_template($WORK, "{SITENAME}", $VALUE);
    //lets process the site description
    $sql = "SELECT * FROM " . $list_prefix . "config WHERE `key` = 'sitedescription';";
    $result = db_query($sql);
    $rows = db_num_rows($result);
    if (isset($rows) && $rows > 0) {
        $row = db_fetch_array($result);
        $VALUE = $row['value'];
    } else {
        $VALUE = "Another FishCMS site.";
    }
    $WORK = insert_into_template($WORK, "{SITEDESCRIPTION}", $VALUE);
    //lets process the site copyright notice.
    $sql = "SELECT * FROM " . $list_prefix . "config WHERE `key` = 'copyright';";
    $result = db_query($sql);
    $rows = db_num_rows($result);
    if (isset($rows) && $rows > 0) {
        $row = db_fetch_array($result);
        $VALUE = $row['value'];
    } else {
        $VALUE = "FishCMS is licensed under the GNU Public License<BR>\n&copy; 2005 by G.A. Heath and Michael Rice.";
    }
    $WORK = insert_into_template($WORK, "{COPYRIGHT}", $VALUE);
    //lets process the site email address.
    $sql = "SELECT * FROM " . $list_prefix . "config WHERE `key` = 'email';";
    $result = db_query($sql);
    $rows = db_num_rows($result);
    if (isset($rows) && $rows > 0) {
        $row = db_fetch_array($result);
        $VALUE = $row['value'];
    } else {
        $VALUE = "FishCMS is licensed under the GNU Public License<BR>\n&copy; 2005 by G.A. Heath and Michael Rice.";
    }
    $WORK = insert_into_template($WORK, "{EMAIL}", $VALUE);
    //lets process the blocks
    //for now we will support 4 sets of blocks in the templates, later this will be dynamic.
    //block 1
    $WORK = insert_into_template($WORK, "{BLOCKS1}", getblocks(1));
    //block 2
    $WORK = insert_into_template($WORK, "{BLOCKS2}", getblocks(2));
    //block 3
    $WORK = insert_into_template($WORK, "{BLOCKS3}", getblocks(3));
    //block 4
    $WORK = insert_into_template($WORK, "{BLOCKS4}", getblocks(4));
    //   $WORK=insert_into_template ($WORK, "", );
    return $WORK;
}
示例#14
0
 $smarty->assign('date', $date);
 $text = $func->text2html($row["comment"]);
 if ($row['file']) {
     $text .= $dsp->FetchAttachmentRow($row['file']);
 }
 $smarty->assign('text', $text);
 if ($row['userid'] == 0) {
     preg_match("@<!--(.*)-->@", $row['comment'], $tmp);
     $userdata['username'] = t('Gast') . "_" . trim($tmp[1]);
     $userdata['type'] = t('Gast');
     $userdata["avatar"] = "";
     $userdata["rank"] = t('Gast');
     $userdata["posts"] = "";
     $userdata["signature"] = "";
 } else {
     $userdata = getuserinfo($row["userid"]);
 }
 $smarty->assign('username', $dsp->FetchUserIcon($row['userid'], $userdata["username"]));
 $type = $userdata["type"];
 if ($auth['type'] >= 2) {
     $type .= '<br />IP: <a href="http://www.dnsstuff.com/tools/whois.ch?ip=' . $row['ip'] . '" target="_blank">' . $row['ip'] . '</a>';
 }
 $smarty->assign('type', $userdata["type"]);
 $smarty->assign('posts', t('Beiträge') . ': <a href="index.php?mod=board&action=ranking">' . $userdata['posts'] . '</a>');
 $smarty->assign('avatar', $userdata["avatar"]);
 if ($cfg['board_ranking']) {
     $smarty->assign('rank', t('Rang') . ': <a href="index.php?mod=board&action=ranking">' . $userdata['rank'] . '</a>');
 }
 $signature = '';
 if ($userdata["signature"]) {
     $signature = '<hr size="1" width="100%" color="cccccc">' . $func->text2html($userdata["signature"]);