コード例 #1
2
ファイル: News_Admin.php プロジェクト: viveleroi/AspenMSM
 /**
  * @abstract Displays and processes the edit news form
  * @param integer $id
  * @access public
  */
 public function edit($id = false)
 {
     if (!files()->setUploadDirectory()) {
         sml()->say("The file upload directory does not appear to be writable. Please create the folder and set proper permissions.");
     }
     $form = new Form('news', $id);
     if (!$id) {
         $form->setCurrentValue('timestamp', date("Y-m-d H:i:s"));
     }
     // if form has been submitted
     if ($form->isSubmitted()) {
         $file = files()->upload('pdf_filename');
         if (is_array($file) && !empty($file[0])) {
             $form->setCurrentValue('pdf_filename', $file[0]['file_name']);
         }
         if ($form->save($id)) {
             sml()->say('News entry has successfully been updated.');
             router()->redirect('view');
         }
     }
     // make sure the template has access to all current values
     $data['form'] = $form;
     template()->addCss('admin/datepicker.css');
     template()->addJs('admin/datepicker.js');
     template()->addJs('edit.js');
     template()->display($data);
 }
コード例 #2
0
ファイル: other.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function Introduce()
 {
     $http_user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
     $is_android = false === strpos($http_user_agent, 'android') ? false : true;
     $is_iphone = false === strpos($http_user_agent, 'iphone') ? false : true;
     include template('wap_introduce');
 }
コード例 #3
0
function index()
{
    global $body;
    global $navigation;
    $body = <<<EOD
\t{$navigation}
\t<div id="rightcontent" style="float:left;width:720px;border-left:1px dotted #ccc;padding-left:20px;">
\t\t<h2>Monitor</h2>
\t\t<h3>See what users are typing in real-time on your site</h3>

\t\t<div>
\t\t\t<div id="centernav" style="width:700px">
\t\t\t\t<script>
\t\t\t\t\tjQuery(document).ready(function () {
\t\t\t\t\t\tjQuery.cometchatspy();\t 
\t\t\t\t\t});
\t\t\t\t</script>
\t\t\t\t<div id="data"></div>
\t\t\t</div>

\t\t</div>

\t\t<div style="clear:both;padding:7.5px;"></div>
\t</div>

\t<div style="clear:both"></div>
EOD;
    template();
}
コード例 #4
0
ファイル: ui.php プロジェクト: quericy/Tieba-Cloud-Sign
/**
 * 加载头部
 * @param string $title 页面标题
 */
function loadhead($title = '')
{
    if (defined('SYSTEM_NO_UI')) {
        return;
    }
    $title = empty($title) ? strip_tags(SYSTEM_NAME) : $title . ' - ' . strip_tags(SYSTEM_NAME);
    doAction('top');
    echo '<!DOCTYPE html><html><head>';
    echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
    echo '<meta http-equiv="charset" content="utf-8">';
    echo '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
    echo '<title>' . $title . '</title>';
    echo '<meta name="generator" content="Tieba Cloud Sign Ver.' . SYSTEM_VER . '" />';
    echo '<link href="favicon.ico" rel="shortcut icon"/>';
    echo '<meta name="author" content="Kenvix (http://zhizhe8.net) at StusGame GROUP (http://www.stus8.com)" />';
    echo '<link rel="canonical" href="http://www.stus8.com" />';
    echo '<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />';
    echo '<script src="source/js/jquery.min.js"></script>';
    echo '<link rel="stylesheet" href="source/css/bootstrap.min.css">';
    echo '<script src="source/js/bootstrap.min.js"></script>';
    echo '<style type="text/css">body { font-family:"微软雅黑","Microsoft YaHei";background: #eee; }</style>';
    echo '<script type="text/javascript" src="source/js/js.js"></script>';
    echo '<link rel="stylesheet" href="source/css/ui.css">';
    echo '<link rel="stylesheet" href="source/css/my.css">';
    echo '<script type="text/javascript" src="source/js/my.js"></script>';
    echo '<meta name="keywords" content="' . option::get('system_keywords') . '" />';
    echo '<meta name="description" content="' . option::get('system_description') . '" />';
    doAction('header');
    echo '</head><body>';
    if (option::get('trigger') == 1) {
        echo "<script>\$.ajax({ async:true, url: '" . SYSTEM_URL . "do.php', type: 'GET', data : {},dataType: 'HTML'});</script>";
    }
    template('navi');
    doAction('body');
}
コード例 #5
0
ファイル: index.php プロジェクト: bdemirel/worksheet
function html($rows = null)
{
    $style = "\n    <style>\n      .qbuttons\n      {\n        background-color: hsl(217, 90%, 55%);\n        color: white;\n        border: none;\n        border-radius: 3px;\n        padding: 2px 5px;\n        font-size: 1.1em;\n        font-weight: bold;\n        position: relative;\n        align: right;\n        top: 25%;\n        margin: 0 5px;\n      }\n      #worksheets\n      {\n        background-color: hsl(217, 90%, 55%);\n        color: white;\n        border: none;\n        border-radius: 3px;\n        padding: 2px 5px;\n        font-size: 1.1em;\n        font-weight: bold;\n        position: relative;\n        top: 25%;\n      }\n      nav\n      {\n        text-align: justify;\n      }\n      nav:after\n      {\n        content: '';\n        display: inline-block;\n        width: 100%;\n        height: 0;\n        font-size:0;\n        line-height:0;\n      }\n      div\n      {\n        display: inline-block;\n      }\n      #gotop\n      {\n        appearance: button;\n        -moz-appearance: button;\n        -webkit-appearance: button;\n        text-decoration: none;\n        font: menu;\n        color: ButtonText;\n        display: inline-block;\n        padding: 0px 6px;\n        background-color: white;\n        color: hsl(217, 90%, 55%);\n        border: none;\n        border-radius: 3px;\n        height: 50%;\n        width: 8%;\n        font-size: 1.1em;\n        font-weight: bold;\n        /*position: relative;\n        left: 3%;\n        top: 25%;*/\n      }\n    </style>\n  ";
    $addition = "\n  <a id='gotop' href='#top'>Go To Top</a>";
    $html = "\n  <form method='post'>\n    <nav>\n      <div id='top'>\n        <button type='button' id='worksheets' onclick='window.location.href=\"wslist.php\"'>Go To Worksheets</button>\n      </div>\n      <div>\n        <input class='qbuttons' type='submit' name='add' value='Add'>\n        <input class='qbuttons' type='submit' name='edit' value='Edit Selected'>\n        <input class='qbuttons' type='submit' name='prepare' value='Prepare'>\n      </div>\n    </nav>\n    <br>\n    <table>\n      <thead>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>\n    \t      Select\n    \t    </th>\n    \t    <th>\n    \t      Question\n    \t    </th>\n    \t    <th>\n    \t      Topic\n    \t    </th>\n\t\t\t\t</tr>\n\t\t\t</thead>\n      <tbody>\n        {$rows}\n      </tbody>\n    </table>\n  </form>";
    template($html, $style, 1, $addition);
}
コード例 #6
0
 /**
  * This is the main task switch where we decide what to do.
  */
 function mainSwitch()
 {
     switch (rsgInstance::getVar('rsgOption', '')) {
         case 'rsgComments':
             require_once JPATH_RSGALLERY2_SITE . '/lib/rsgcomments/rsgcomments.php';
             break;
         case 'rsgVoting':
             require_once JPATH_RSGALLERY2_SITE . '/lib/rsgvoting/rsgvoting.php';
             break;
         case 'myGalleries':
             require_once JPATH_RSGALLERY2_SITE . '/lib/mygalleries/mygalleries.php';
             break;
         case 'search':
             require_once JPATH_RSGALLERY2_SITE . '/lib/rsgsearch/search.php';
             break;
         default:
             switch (rsgInstance::getVar('task', '')) {
                 case 'xml':
                     xmlFile();
                     break;
                 case "downloadfile":
                     downloadFile();
                     break;
                 default:
                     // require the base class rsgDisplay
                     require_once JPATH_RSGALLERY2_SITE . '/templates/meta/display.class.php';
                     // show the template
                     template();
             }
     }
 }
コード例 #7
0
 public function index()
 {
     $page = isset($_GET['page']) ? intval($_GET['page']) : '1';
     $url = tsurl('feed', 'index', array('page' => ''));
     $lstart = $page * 20 - 20;
     $arrFeeds = $this->findAll('feed', null, 'addtime desc', null, $lstart . ',20');
     $feedNum = $this->findCount("feed");
     $pageUrl = pagination($feedNum, 20, $page, $url);
     if ($page > 1) {
         $title = '社区动态 - 第' . $page . '页';
     } else {
         $title = '社区动态';
     }
     foreach ($arrFeeds as $key => $item) {
         $data = json_decode($item['data'], true);
         if (is_array($data)) {
             foreach ($data as $key => $itemTmp) {
                 $tmpkey = '{' . $key . '}';
                 $tmpdata[$tmpkey] = stripslashes(urldecode($itemTmp));
             }
         }
         $arrFeed[] = array('user' => aac('user')->getOneUser($item['userid']), 'content' => strtr($item['template'], $tmpdata), 'addtime' => $item['addtime']);
     }
     include template('index');
 }
コード例 #8
0
ファイル: common.php プロジェクト: WSKINGS/chat_tickets
function end_exit($content, $url = 'javascript:history.go(-1);', $t = 2)
{
    $temp = template('exit.html');
    $temp->assign(array('content' => $content, 'url' => $url, 'time' => $t));
    $temp->display();
    die;
}
コード例 #9
0
ファイル: form_email.php プロジェクト: NazarK/sqp
function frm($name)
{
    if (form_post("submit")) {
        $message = "";
        foreach ($_REQUEST as $key => $value) {
            if (str_beg($key, "cb_")) {
                $message .= "{$value}\r\n";
            }
            if (str_beg($key, "f_")) {
                $caption = $_REQUEST["c_" . str_replace("f_", "", $key)];
                $message .= "{$caption}:\r\n{$value}\r\n\r\n";
            }
        }
        $from = "no-reply-site-form@" . $_SERVER['HTTP_HOST'];
        $to = setting("admin_email");
        $subject = form_post("subject");
        $local = $_SERVER['REMOTE_ADDR'] == "127.0.0.1";
        if (form_file_uploaded("uploadedfile")) {
            $tmp = $_FILES['uploadedfile']['tmp_name'];
            $fname = $_FILES['uploadedfile']['name'];
            /*           if($local) {
                         die("<pre>$message tmp[$tmp] fname[$fname]</pre>");
            		   } else {*/
            mail_attach($from, $to, $subject, $message, $tmp, $fname);
            //		   }
        } else {
            /*           if($local) {
                         die("<pre>$message</pre>");
            		   } else*/
            mail_from($to, $subject, $message, $from);
        }
        return form_post("success");
    }
    return template("form_email", "content", template("form_email_" . $name));
}
コード例 #10
0
ファイル: Spend_listController.php プロジェクト: hubs/yuncms
 public function init()
 {
     $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1;
     $userid = cookie('_userid');
     $where = array('userid' => $userid);
     if (isset($_GET['dosubmit'])) {
         $type = isset($_GET['type']) && intval($_GET['type']) ? intval($_GET['type']) : '';
         $endtime = isset($_GET['endtime']) && trim($_GET['endtime']) ? strtotime(trim($_GET['endtime'])) : '';
         $starttime = isset($_GET['starttime']) && trim($_GET['starttime']) ? strtotime(trim($_GET['starttime'])) : '';
         if (!empty($starttime) && empty($endtime)) {
             $endtime = TIME;
         }
         if (!empty($starttime) && !empty($endtime) && $endtime < $starttime) {
             showmessage(L('wrong_time_over_time_to_time_less_than'));
         }
         if (!empty($starttime)) {
             $where['creat_at'] = array('between', $starttime . ',' . $endtime);
         }
         if (!empty($type)) {
             $where['type'] = $type;
         }
     }
     $list = $this->spend_db->where($where)->order('id desc')->listinfo($page);
     $pages = $this->spend_db->pages;
     include template('pay', 'spend_list');
 }
コード例 #11
0
 public function index()
 {
     if ($this->checkFormSubmit()) {
         $this->save();
     } else {
         global $G;
         $province = intval($_GET['province']);
         $city = intval($_GET['city']);
         $county = intval($_GET['county']);
         $districtlist = $provincelist = $citylist = $countylist = array();
         $provincelist = $this->t('district')->where(array('fid' => 0))->select();
         $districtlist = $provincelist;
         if ($province) {
             $citylist = $this->t('district')->where(array('fid' => $province))->select();
             $districtlist = $citylist;
         }
         if ($city) {
             $countylist = $this->t('district')->where(array('fid' => $city))->select();
             $districtlist = $countylist;
         }
         if ($county) {
             $districtlist = $this->t('district')->where(array('fid' => $county))->select();
         }
         include template('district');
     }
 }
コード例 #12
0
ファイル: qtype.php プロジェクト: eappl/prototype
 function onqtype($msg = '', $ty = '')
 {
     $hasIntoQtypePrivilege = $_ENV['menu']->checkPermission($this->ask_login_name, $_SERVER['QUERY_STRING'], "intoQtype");
     // 是否有进入操作员管理页面权限
     if ($hasIntoQtypePrivilege['return']) {
         if (isset($this->get[2])) {
             $qtype_info = $_ENV['qtype']->GetQType(intval($this->get[2]));
             $qtype_info['faq'] = unserialize($qtype_info['faq']);
             $qtype_info['complain'] = unserialize($qtype_info['complain']);
             $qtype_info['trading'] = unserialize($qtype_info['trading']);
         }
         $qtype_list = $_ENV['qtype']->GetAllQType(0, '', 0);
         foreach ($qtype_list as $qtypeId => $qtypeInfo) {
             if ($qtypeInfo['pid'] > 0) {
                 $qtype_list[$qtypeId]['parentName'] = $qtype_list[$qtypeInfo['pid']]['name'];
             } else {
                 $qtype_list[$qtypeId]['parentName'] = "无分类";
             }
             $qtype_list[$qtypeId]['complain'] = unserialize($qtypeInfo['complain']);
             $qtype_list[$qtypeId]['faq'] = unserialize($qtypeInfo['faq']);
             $qtype_list[$qtypeId]['trading'] = unserialize($qtypeInfo['trading']);
         }
         $msg && ($message = $msg);
         $ty && ($type = $ty);
         include template('qtype', 'admin');
     } else {
         $hasIntoQtypePrivilege['url'] = "?admin_main";
         __msg($hasIntoQtypePrivilege);
     }
 }
コード例 #13
0
ファイル: doing.php プロジェクト: source-hunter/tipask
 function ondefault()
 {
     $navtitle = "问答动态";
     $type = 'atentto';
     $recivetype = $this->get[2];
     if ($recivetype) {
         $type = $recivetype;
     }
     if (!$this->user['uid']) {
         $type = 'all';
     }
     $navtitletable = array('all' => '问答动态', 'my' => '我的动态', 'atentto' => '关注的动态');
     $navtitle = $navtitletable[$type];
     $page = max(1, intval($this->get[3]));
     $pagesize = $this->setting['list_default'];
     $startindex = ($page - 1) * $pagesize;
     $doinglist = $_ENV['doing']->list_by_type($type, $this->user['uid'], $startindex, $pagesize);
     $rownum = $_ENV['doing']->rownum_by_type($type, $this->user['uid']);
     $departstr = page($rownum, $pagesize, $page, "doing/default/{$type}");
     if ($type == 'atentto') {
         $recommendsize = $rownum ? 3 : 6;
         $recommandusers = $_ENV['doing']->recommend_user($recommendsize);
     }
     include template('doing');
 }
コード例 #14
0
ファイル: index.php プロジェクト: NikoVonLas/RaptorGameEngine
 function actionIndex()
 {
     if (isset($_SESSION['id'])) {
         header("Location: /cabinet");
     }
     if (isset($_GET['result'])) {
         switch (@$_GET['result']) {
             case 'regerror':
                 echo "<script>alert('Введены неверные данные или аккаунт уже существует');</script>";
                 break;
             case 'loginerror':
                 echo "<script>alert('Неверный логин или пароль');</script>";
                 break;
             default:
                 break;
         }
     }
     $main = new Templater();
     $main->import("interface/index.tpl");
     $main->setvar("%URL%", "http://" . $GLOBALS['url']);
     $main->setvar("%LOGIN_URL%", "/index/login");
     $main->setvar("%STORAGE_TPL_URL%", "/storage/tpl");
     $main->setvar("%YEAR%", date("Y"));
     $main->setvar("%CSS%", "<style>" . templater("css/main.css", array("%ROOT%" => "/storage/tpl")) . "</style>");
     $main->setvar("%REGISTER%", template("interface/register.tpl"));
     $cursor = Database::Get("news", array('public' => 1))->sort(array('date' => -1))->limit(1)->getNext();
     $newss = templater("interface/news.tpl", array("%SUBJECT%" => $cursor['title'], "%DATE%" => $cursor['date'], "%ANNOUNCE%" => $cursor['short'], "%LINK_MORE%" => "http://" . $GLOBALS['url'] . "/news/read?id=" . $cursor['_id'], "%ID%" => $cursor['_id']));
     $main->setvar("%NEWS%", $newss);
     $main->setvar("%GAME_TITLE%", $GLOBALS['name']);
     $main->setvar("%STORAGE_STATIC_URL%", "/storage/static");
     $main->renderEcho();
 }
コード例 #15
0
ファイル: IndexController.php プロジェクト: hubs/yuncms
 /**
  * 申请友情链接
  */
 public function register()
 {
     if (isset($_POST['dosubmit'])) {
         if ($_POST['name'] == "") {
             showmessage(L('sitename_noempty'), U('link/index/register'));
         }
         if ($_POST['url'] == "") {
             showmessage(L('siteurl_not_empty'), U('link/index/register'));
         }
         if (!in_array($_POST['linktype'], array('0', '1'))) {
             $_POST['linktype'] = '0';
         }
         $link_db = Loader::model('link_model');
         $_POST['logo'] = String::htmlspecialchars($_POST['logo']);
         if ($_POST['linktype'] == '0') {
             $sql = array('typeid' => $_POST['typeid'], 'linktype' => $_POST['linktype'], 'name' => $_POST['name'], 'url' => $_POST['url']);
         } else {
             $sql = array('typeid' => $_POST['typeid'], 'linktype' => $_POST['linktype'], 'name' => $_POST['name'], 'url' => $_POST['url'], 'logo' => $_POST['logo']);
         }
         $link_db->insert($sql);
         showmessage(L('add_success'), U('link/index'));
     } else {
         $setting = S('common/link');
         if (isset($setting['is_post']) && $setting['is_post'] == '0') {
             showmessage(L('suspend_application'), HTTP_REFERER);
         }
         $this->type = Loader::model('type_model');
         $types = $this->type->get_types();
         // 获取站点下所有友情链接分类
         $SEO = seo('', L('application_links'), '', '');
         include template('link', 'register');
     }
 }
コード例 #16
0
ファイル: magic_detector.php プロジェクト: tang86/discuz-utf8
 function usesubmit()
 {
     global $_G;
     $list = $uids = array();
     $num = !empty($this->parameters['num']) ? intval($this->parameters['num']) : 10;
     $limit = $num + 20;
     $giftMagicID = C::t('common_magic')->fetch_by_identifier('gift');
     $mid = $giftMagicID['available'] ? intval($giftMagicID['magicid']) : 0;
     if ($mid) {
         foreach (C::t('common_magiclog')->fetch_all_by_magicid_action_uid($mid, 2, $_G['uid'], 0, $limit) as $value) {
             $uids[] = intval($value['uid']);
         }
     }
     if ($uids) {
         $counter = 0;
         $members = C::t('common_member')->fetch_all($uids);
         foreach (C::t('common_member_field_home')->fetch_all($uids) as $uid => $value) {
             $value = array_merge($members[$uid], $value);
             $info = !empty($value['magicgift']) ? unserialize($value['magicgift']) : array();
             if (!empty($info['left']) && (empty($info['receiver']) || !in_array($_G['uid'], $info['receiver']))) {
                 $value['avatar'] = addcslashes(avatar($uid, 'small'), "'");
                 $list[$uid] = $value;
                 $counter++;
                 if ($counter >= $num) {
                     break;
                 }
             }
         }
     }
     usemagic($this->magic['magicid'], $this->magic['num']);
     updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']);
     $op = 'show';
     include template('home/magic_detector');
 }
コード例 #17
0
ファイル: attach.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function Main()
 {
     global $attach_list, $_J;
     $pagenum = 10;
     $listcpattach = $this->Config['company_enable'] && $_J['member']['companyid'] > 0 ? true : false;
     if ($_GET['code'] == 'myattach') {
         $where = "AND uid = '" . MEMBER_ID . "'";
     } elseif ($_GET['code'] == 'myfollowattach') {
         $buddyids = get_buddyids(MEMBER_ID, $this->Config['topic_myhome_time_limit']);
         if ($buddyids) {
             $where = "AND item<>'company' AND uid IN(" . implode(',', $buddyids) . ")";
         } else {
             $where = "AND uid = 0";
         }
     } elseif ($listcpattach && $_GET['code'] == 'company') {
         $where = "AND item='company' AND itemid='" . $_J['member']['companyid'] . "'";
         $current_cp = 'current';
     } else {
         $where = "AND item<>'company'";
         $current_new = 'current';
     }
     $attach = $this->AttachLogic->attachs_list($pagenum, $where);
     $attach_list = $attach['list'];
     if ($attach['page']) {
         $page_arr = $attach['page'];
     }
     $hot_down_list = $this->AttachLogic->down_hot_attach();
     $this->Title = '附件文档';
     include template("attach");
 }
コード例 #18
0
 function output()
 {
     global $main, $vars;
     $main->menu->hide = true;
     $this->tpl['gmap_key_ok'] = include_gmap("?page=gmap&subpage=js&node=" . get('node'));
     return template($this->tpl, __FILE__);
 }
コード例 #19
0
function message($msg, $redirect = '', $type = '')
{
    global $_W;
    if ($redirect == 'refresh') {
        $redirect = $_W['script_name'] . '?' . $_SERVER['QUERY_STRING'];
    } elseif (!empty($redirect) && !strexists($redirect, 'http://')) {
        $urls = parse_url($redirect);
        $redirect = $_W['siteroot'] . 'app/index.php?' . $urls['query'];
    }
    if ($redirect == '') {
        $type = in_array($type, array('success', 'error', 'info', 'warning', 'ajax', 'sql')) ? $type : 'info';
    } else {
        $type = in_array($type, array('success', 'error', 'info', 'warning', 'ajax', 'sql')) ? $type : 'success';
    }
    if ($_W['isajax'] || $type == 'ajax') {
        $vars = array();
        $vars['message'] = $msg;
        $vars['redirect'] = $redirect;
        $vars['type'] = $type;
        exit(json_encode($vars));
    }
    if (empty($msg) && !empty($redirect)) {
        header('location: ' . $redirect);
    }
    $label = $type;
    if ($type == 'error') {
        $label = 'danger';
    }
    if ($type == 'ajax' || $type == 'sql') {
        $label = 'warning';
    }
    include template('common/message', TEMPLATE_INCLUDEPATH);
    exit;
}
コード例 #20
0
ファイル: magic_doodle.php プロジェクト: Kingson4Wu/php_demo
 function usesubmit()
 {
     global $_G;
     $config = urlencode(getsiteurl() . 'home.php?mod=misc&ac=swfupload&op=config&doodle=1');
     $src = IMGDIR . "/doodle.swf?fid={$_G[gp_handlekey]}&oid={$_G[gp_mtarget]}&from={$_G[gp_from]}&config={$config}";
     include template('home/magic_doodle');
 }
コード例 #21
0
function recommendtopic()
{
    $arrTopics = aac('group')->findAll('group_topic', array('isaudit' => 0, 'isrecommend' => 1), 'uptime desc', null, 10);
    foreach ($arrTopics as $key => $item) {
        $arrTopic[$key] = $item;
        $arrTopic[$key]['title'] = tsTitle($item['title']);
        // 标题过滤
        $arrTopic[$key]['desc'] = tsCutContent(strip_tags($item['content']), 50);
        // 简介
        $arrTopic[$key]['user'] = aac('user')->getOneUser($item['userid']);
        // 用户信息
        $arrTopic[$key]['group'] = aac('group')->getOneGroup($item['groupid']);
        // 群组信息
        /* 匹配标题图片 */
        $pattern = "/<[img|IMG].*?src=[\\'|\"](.*?(?:[\\.gif|\\.jpg|\\.png]))[\\'|\"].*?[\\/]?>/";
        preg_match($pattern, tsDecode($item['content']), $match);
        if (!$match[1]) {
            // 内容里面没有图片
            $match[0] = '<img src="/plugins/home/recommendtopic/images/default.png" />';
            $match[1] = '/plugins/home/recommendtopic/images/default.png';
        }
        $arrTopic[$key]['thumb'] = $match;
    }
    include template('recommendtopic', 'recommendtopic');
}
コード例 #22
0
 function usesubmit()
 {
     global $_G;
     $list = $uids = array();
     $num = !empty($this->parameters['num']) ? intval($this->parameters['num']) : 10;
     $limit = $num + 20;
     loadcache('magics');
     $mid = !empty($_G['magics']['gift']) ? intval($_G['magics']['gift']['magicid']) : 0;
     if ($mid) {
         $query = DB::query('SELECT * FROM ' . DB::table('common_magiclog') . " WHERE magicid = '{$mid}' AND action='2' AND uid != '{$_G['uid']}' ORDER BY dateline DESC LIMIT 0,{$limit}");
         while ($value = DB::fetch($query)) {
             $uids[] = intval($value['uid']);
         }
     }
     if ($uids) {
         $counter = 0;
         $query = DB::query('SELECT m.username, mfh.uid, mfh.magicgift FROM ' . DB::table('common_member') . " m LEFT JOIN " . DB::table('common_member_field_home') . " mfh USING(uid) WHERE m.uid IN (" . dimplode($uids) . ")");
         while ($value = DB::fetch($query)) {
             $info = !empty($value['magicgift']) ? unserialize($value['magicgift']) : array();
             if (!empty($info['left']) && (empty($info['receiver']) || !in_array($_G['uid'], $info['receiver']))) {
                 $value['avatar'] = addcslashes(avatar($value['uid'], 'small'), "'");
                 $list[$value['uid']] = $value;
                 $counter++;
                 if ($counter >= $num) {
                     break;
                 }
             }
         }
     }
     usemagic($this->magic['magicid'], $this->magic['num']);
     updatemagiclog($this->magic['magicid'], '2', '1', '0', '0', 'uid', $_G['uid']);
     $op = 'show';
     include template('home/magic_detector');
 }
コード例 #23
0
ファイル: job.mod.php プロジェクト: YouthAndra/huaitaoo2o
 function Modify()
 {
     $ids = (int) $this->Get['ids'];
     $action = "admin.php?mod=job&code=domodify";
     $joblist = jlogic('job')->id2job($ids);
     include template('admin/job');
 }
コード例 #24
0
ファイル: answer.php プロジェクト: source-hunter/tipask
 function onappend()
 {
     $this->load("message");
     $qid = intval($this->get[2]) ? $this->get[2] : intval($this->post['qid']);
     $aid = intval($this->get[3]) ? $this->get[3] : intval($this->post['aid']);
     $question = $_ENV['question']->get($qid);
     $answer = $_ENV['answer']->get($aid);
     if (!$question || !$answer) {
         $this->message("回答内容不存在!");
         exit;
     }
     $viewurl = urlmap('question/view/' . $qid, 2);
     if (isset($this->post['submit'])) {
         $_ENV['answer']->append($answer['id'], $this->user['username'], $this->user['uid'], $this->post['content']);
         if ($answer['authorid'] == $this->user['uid']) {
             //继续回答
             $_ENV['message']->add($this->user['username'], $this->user['uid'], $question['authorid'], $this->user['username'] . '继续回答了您的问题:' . $question['title'], $this->post['content'] . '<br /> <a href="' . url('question/view/' . $qid, 1) . '">点击查看</a>');
             $_ENV['doing']->add($this->user['uid'], $this->user['username'], 7, $qid, $this->post['content']);
             $this->message('继续回答成功!', $viewurl);
         } else {
             //继续追问
             $_ENV['message']->add($this->user['username'], $this->user['uid'], $answer['authorid'], $this->user['username'] . '对您的回答进行了追问', $this->post['content'] . '<br /> <a href="' . url('question/view/' . $qid, 1) . '">点击查看问题</a>');
             $_ENV['doing']->add($this->user['uid'], $this->user['username'], 6, $qid, $this->post['content'], $answer['id'], $answer['authorid'], $answer['content']);
             $this->message('继续提问成功!', $viewurl);
         }
     }
     include template("appendanswer");
 }
コード例 #25
0
ファイル: spend_list.php プロジェクト: ahmatjan/huluphp
 public function init()
 {
     $page = isset($_GET['page']) && intval($_GET['page']) ? intval($_GET['page']) : 1;
     $userid = param::get_cookie('_userid');
     $sql = " `userid` = '{$userid}'";
     if (isset($_GET['dosubmit'])) {
         $type = isset($_GET['type']) && intval($_GET['type']) ? intval($_GET['type']) : '';
         $endtime = isset($_GET['endtime']) && trim($_GET['endtime']) ? strtotime(trim($_GET['endtime'])) : '';
         $starttime = isset($_GET['starttime']) && trim($_GET['starttime']) ? strtotime(trim($_GET['starttime'])) : '';
         if (!empty($starttime) && empty($endtime)) {
             $endtime = SYS_TIME;
         }
         if (!empty($starttime) && !empty($endtime) && $endtime < $starttime) {
             showmessage(L('wrong_time_over_time_to_time_less_than'));
         }
         if (!empty($starttime)) {
             $sql .= $sql ? " AND `creat_at` BETWEEN '{$starttime}' AND '{$endtime}' " : " `creat_at` BETWEEN '{$starttime}' AND '{$endtime}' ";
         }
         if (!empty($type)) {
             $sql .= $sql ? " AND `type` = '{$type}' " : " `type` = '{$type}'";
         }
     }
     $list = $this->spend_db->listinfo($sql, '`id` desc', $page);
     $pages = $this->spend_db->pages;
     include template('pay', 'spend_list');
 }
コード例 #26
0
 function huxcity()
 {
     global $_G;
     $citysetting = $_G['cache']['plugin']['huxcity'];
     $uid = $_G['uid'];
     $username = $_G['username'];
     if (($citysetting['powtobbs'] == '1' || $citysetting['bantobbs'] == '1') && $uid) {
         $uidnum = C::t('#huxcity#hux_city_user')->fetch_by_uid($uid, 'power,bantime');
         if (!$uidnum) {
             $setarr = array('uid' => $uid, 'username' => $username, 'power' => 100, 'regtime' => TIMESTAMP);
             C::t('hux_city_user')->insert($setarr);
         } else {
             $userpow = $uidnum['power'];
         }
     }
     if ($citysetting['powtobbs'] == '1' && $uid && $uidnum && $userpow <= 0) {
         $nopow_msg = lang('plugin/huxcity', 'no_pow');
         $pow_yes = lang('plugin/huxcity', 'pow_yes');
         $pow_no = lang('plugin/huxcity', 'pow_no');
         include template('huxcity:powtobbs');
         return $return;
     } elseif ($citysetting['bantobbs'] == '1' && $uid && $uidnum && $uidnum['bantime'] != 0) {
         $ban_msg = lang('plugin/huxcity', 'baned') . dgmdate($uidnum['bantime']);
         $ban_yes = lang('plugin/huxcity', 'ban_yes');
         $ban_no = lang('plugin/huxcity', 'ban_no');
         include template('huxcity:bantobbs');
         return $returnb;
     } else {
         return '';
     }
 }
コード例 #27
0
ファイル: tag.php プロジェクト: shenhua4286/gxw
 /**
  * 按照模型搜索
  */
 public function lists()
 {
     $tag = safe_replace(addslashes($_GET['tag']));
     $keyword_data_db = pc_base::load_model('keyword_data_model');
     //获取标签id
     $r = $this->keyword_db->get_one(array('keyword' => $tag, 'siteid' => $this->siteid), 'id');
     if (!$r['id']) {
         showmessage('不存在此关键字!');
     }
     $tagid = intval($r['id']);
     $page = max($_GET['page'], 1);
     $pagesize = 20;
     $where = '`tagid`=\'' . $tagid . '\' AND `siteid`=' . $this->siteid;
     $infos = $keyword_data_db->listinfo($where, '`id` DESC', $page, $pagesize);
     $pages = $keyword_data_db->pages;
     $total = $keyword_data_db->number;
     if (is_array($infos)) {
         $datas = array();
         foreach ($infos as $info) {
             list($contentid, $modelid) = explode('-', $info['contentid']);
             $this->db->set_model($modelid);
             $res = $this->db->get_one(array('id' => $contentid), 'title, description, url, inputtime, style');
             $res['title'] = str_replace($tag, '<font color="#f00">' . $tag . '</font>', $res['title']);
             $res['description'] = str_replace($tag, '<font color="#f00">' . $tag . '</font>', $res['description']);
             $datas[] = $res;
         }
     }
     $SEO = seo($siteid, '', $tag);
     include template('content', 'tag_list');
 }
コード例 #28
0
 function viewthread_postsightmlafter_output()
 {
     global $_G, $postlist;
     $return = array();
     if (!in_array($_G['fid'], $_G['cache']['plugin']['dzapp_haodai']['forumlisthot'])) {
         return;
     }
     if (file_exists(DISCUZ_ROOT . './data/sysdata/cache_dzapp_haodai_jyfx_' . $_G['cache']['plugin']['dzapp_haodai']['API_citynames_1231'] . '.php')) {
         include_once DISCUZ_ROOT . './data/sysdata/cache_dzapp_haodai_jyfx_' . $_G['cache']['plugin']['dzapp_haodai']['API_citynames_1231'] . '.php';
         $jyfx_article = $jyfx_article['items'];
     }
     if (file_exists(DISCUZ_ROOT . './data/sysdata/cache_dzapp_haodai_dkgl_' . $_G['cache']['plugin']['dzapp_haodai']['API_citynames_1231'] . '.php')) {
         include_once DISCUZ_ROOT . './data/sysdata/cache_dzapp_haodai_dkgl_' . $_G['cache']['plugin']['dzapp_haodai']['API_citynames_1231'] . '.php';
         $dkgl_article = $dkgl_article['items'];
     }
     if (file_exists(DISCUZ_ROOT . './data/sysdata/cache_dzapp_haodai_dkzx_' . $_G['cache']['plugin']['dzapp_haodai']['API_citynames_1231'] . '.php')) {
         include_once DISCUZ_ROOT . './data/sysdata/cache_dzapp_haodai_dkzx_' . $_G['cache']['plugin']['dzapp_haodai']['API_citynames_1231'] . '.php';
         $dkzx_article = $dkzx_article['items'];
     }
     $haodai_article = array_merge($jyfx_article, $dkgl_article, $dkzx_article);
     if (!$haodai_article) {
         return;
     }
     shuffle($haodai_article);
     $haodaistyle = 2;
     include_once template('dzapp_haodai:hook_forum');
     foreach ($postlist as $key => $post) {
         if ($post['first']) {
             $return[] = $haodai_html;
         } else {
             $return[] = '';
         }
     }
     return $return;
 }
コード例 #29
0
ファイル: qqgroup.class.php プロジェクト: tianyunchong/php
 public function viewthread_modoption()
 {
     global $_G;
     if (!$_G['adminid']) {
         return false;
     }
     $usergroupsfeedlist = unserialize($_G['setting']['qqgroup_usergroup_feed_list']);
     if (empty($usergroupsfeedlist) || !in_array($_G['groupid'], $usergroupsfeedlist)) {
         if (self::$util->isfounder($_G['member']) == false) {
             return false;
         }
     }
     $tid = $_G['tid'];
     $title = urlencode(trim($_G['forum_thread']['subject']));
     $post = C::t('forum_post')->fetch_all_by_tid_position($_G['fotum_thread']['posttableid'], $_G['tid'], 1);
     include_once libfile('function/discuzcode');
     $content = preg_replace("/\\[audio(=1)*\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/audio\\]/ies", '', trim($post[0]['message']));
     $content = preg_replace("/\\[flash(=(\\d+),(\\d+))?\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/flash\\]/ies", '', $content);
     $content = preg_replace("/\\[media=([\\w,]+)\\]\\s*([^\\[\\<\r\n]+?)\\s*\\[\\/media\\]/ies", '', $content);
     $content = preg_replace("/\\[hide[=]?(d\\d+)?[,]?(\\d+)?\\]\\s*(.*?)\\s*\\[\\/hide\\]/is", '', $content);
     $content = strip_tags(discuzcode($content, 0, 0, 0));
     $content = preg_replace('%\\[attach\\].*\\[/attach\\]%im', '', $content);
     $content = str_replace('&nbsp;', ' ', $content);
     $content = urlencode(cutstr($content, 50, ''));
     include template('qqgroup:push');
     return trim($return);
 }
コード例 #30
0
ファイル: tinymce.php プロジェクト: NazarK/sqp
function page_admin_edit($table, $field, $id)
{
    use_layout("admin");
    requires_admin();
    global $tables;
    if (!isset($tables[$table]['liveedit'])) {
        die("can't edit this table tables[{$table}]['liveedit'] not set");
    }
    if (isset($_POST['editor1'])) {
        $html = form_post("editor1");
        $html = str_replace('\\"', '"', $html);
        $html = str_replace("\\'", "'", $html);
        $html = str_replace("\\\\", "\\", $html);
        $f = "on_{$table}_{$field}_update";
        if (function_exists($f)) {
            $f($id, $html);
        }
        db_query("UPDATE %s SET %s='%s' WHERE id=%d", $table, $field, $html, $id);
        if (CLOSE_ON_SAVE) {
            die("<script> window.close();</script>");
        }
        flash("message", "Изменения сохранены");
    }
    $content = db_result(db_query("SELECT %s FROM %s WHERE id=%d", $field, $table, $id));
    $o = "";
    if (form_post("back")) {
        $back = form_post("back");
        $o .= "<a href={$back}><<Назад</a>";
    }
    $o .= template("tinymce", "content", $content);
    return $o;
}