當前位置: 首頁>>代碼示例>>PHP>>正文


PHP tomedia函數代碼示例

本文整理匯總了PHP中tomedia函數的典型用法代碼示例。如果您正苦於以下問題:PHP tomedia函數的具體用法?PHP tomedia怎麽用?PHP tomedia使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了tomedia函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: respond

 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $reply = pdo_fetch("SELECT * FROM " . tablename('vote_reply') . " WHERE `rid`=:rid LIMIT 1", array(':rid' => $rid));
     if ($reply == false) {
         return $this->respText('活動已經取消...');
     }
     $nowtime = time();
     $endtime = $reply['endtime'] + 86399;
     if ($reply['status'] == 0) {
         return $this->respText("投票已暫停,請等待...");
     }
     if ($reply['votelimit'] == 1) {
         if ($reply['votetotal'] > 0 && $reply['votenum'] >= $reply['votetotal']) {
             return $this->respText("投票人數已滿,活動結束...");
         }
     } else {
         if ($reply['starttime'] > $nowtime) {
             return $this->respText("投票未開始,請等待...");
         } elseif ($endtime < $nowtime) {
             return $this->respText("投票已結束...");
         } else {
             //                if ($reply['status'] != 1) {
             //                     return $this->respText("投票已暫停,請等待...");
             //                }
         }
     }
     return $this->respNews(array('Title' => $reply['title'], 'Description' => $reply['description'], 'PicUrl' => tomedia($reply['thumb']), 'Url' => $this->createMobileUrl("index", array("id" => $rid))));
 }
開發者ID:eduNeusoft,項目名稱:weixin,代碼行數:30,代碼來源:processor.php

示例2: setHeader

 public function setHeader()
 {
     global $_W, $_GPC;
     $_var_0 = m('user')->getOpenid();
     $_var_1 = m('user')->followed($_var_0);
     @session_start();
     if (!$_var_1) {
         $_var_2 = intval($_GPC['mid']);
         $_var_3 = m('common')->getSysset();
         $this->header = array('url' => $_var_3['share']['followurl']);
         $_var_4 = false;
         if (!empty($_var_2)) {
             if (!empty($_SESSION[EWEI_SHOP_PREFIX . '_shareid']) && $_SESSION[EWEI_SHOP_PREFIX . '_shareid'] == $_var_2) {
                 $_var_2 = $_SESSION[EWEI_SHOP_PREFIX . '_shareid'];
             }
             $_var_5 = m('member')->getMember($_var_2);
             if (!empty($_var_5)) {
                 $_SESSION[EWEI_SHOP_PREFIX . '_shareid'] = $_var_2;
                 $_var_4 = true;
                 $this->header['icon'] = $_var_5['avatar'];
                 $this->header['text'] = '來自好友 <span>' . $_var_5['nickname'] . '</span> 的推薦';
             }
         }
         if (!$_var_4) {
             $this->header['icon'] = tomedia($_var_3['shop']['logo']);
             $this->header['text'] = '歡迎進入 <span>' . $_var_3['shop']['name'] . '</span>';
         }
     }
 }
開發者ID:noikiy,項目名稱:mygit,代碼行數:29,代碼來源:core1.php

示例3: doMobileIndex

 public function doMobileIndex()
 {
     global $_W, $_GPC;
     // 分享量
     if ($_W['isajax'] && $_GPC['op'] == 'share') {
         pdo_query("UPDATE " . tablename('qiyue_qiuqian') . " SET sharenum=sharenum+1 WHERE uniacid=:uniacid", array(':uniacid' => $_W['uniacid']));
         message(array('error_code' => 0), '', 'ajax');
     }
     $qian_r = pdo_fetch("SELECT * FROM " . tablename('qiyue_qiuqian') . " WHERE uniacid=:uniacid", array(':uniacid' => $_W['uniacid']));
     $morepic = array();
     $imgcount = 0;
     if ($qian_r['morepic']) {
         $f_exp = "::::::";
         $r_exp = PHP_EOL;
         $rr = explode($r_exp, $qian_r['morepic']);
         $imgcount = count($rr);
         for ($i = 0; $i < $imgcount; $i++) {
             $fr = explode($f_exp, $rr[$i]);
             $morepic[] = array('title' => $fr['1'], 'url' => tomedia($fr['0']));
         }
     }
     $_share = $this->module['config'];
     unset($_share['cnzzid']);
     // 去掉CNZZ
     $cnzzid = $this->module['config']['cnzzid'];
     // 增加瀏覽量
     pdo_query("UPDATE " . tablename('qiyue_qiuqian') . " SET viewnum=viewnum+1 WHERE uniacid=:uniacid", array(':uniacid' => $_W['uniacid']));
     include $this->template('index');
 }
開發者ID:aspnmy,項目名稱:weizan,代碼行數:29,代碼來源:site.php

示例4: respond

 public function respond()
 {
     $rid = $this->rule;
     $fromuser = $this->message['from'];
     if (!empty($rid)) {
         $reply = pdo_fetch("SELECT * FROM " . tablename($this->table_reply) . " WHERE rid = :rid", array(':rid' => $rid));
         if ($reply) {
             if ($reply['starttime'] > time()) {
                 //檢測時間是否開始
                 return $this->respText("本次活動尚未開始,敬請期待!");
             } elseif ($reply['endtime'] < time() || $reply['endtime'] == 0) {
                 //檢測時間是否結束或者狀態是否為結束
                 return $this->respText("本次活動已經結束,請關注我們後續的活動!");
             } elseif ($reply['endtime'] == 2) {
                 //檢測狀態是否暫停
                 return $this->respText("本次活動暫停中");
             } else {
                 //活動大狀態正常 檢測每天的時間是否正常
                 $news = array();
                 $news[] = array('title' => $reply['title'], 'description' => $reply['description'], 'picurl' => tomedia($reply['thumb']), 'url' => $this->createMobileUrl('main', array('id' => $reply['id'])));
                 return $this->respNews($news);
             }
         }
     }
     return null;
 }
開發者ID:nsoff,項目名稱:wdlcms,代碼行數:26,代碼來源:processor.php

示例5: fieldsFormDisplay

 public function fieldsFormDisplay($rid = 0)
 {
     global $_W;
     load()->func('tpl');
     $replies = array();
     $replies = pdo_fetchall("SELECT * FROM " . tablename($this->tablename) . " WHERE rid = :rid AND parent_id = -1 ORDER BY `displayorder` DESC, id ASC", array(':rid' => $rid));
     if (!empty($replies)) {
         $parent_id = $replies[0]['id'];
         pdo_update($this->tablename, array('parent_id' => $parent_id), array('rid' => $rid));
         pdo_update($this->tablename, array('parent_id' => 0), array('rid' => $rid, 'id' => $parent_id));
     }
     $rows = pdo_fetchall("SELECT * FROM " . tablename($this->tablename) . " WHERE rid = :rid ORDER BY `parent_id` ASC, `id` ASC", array(':rid' => $rid));
     $replies = array();
     foreach ($rows as &$row) {
         if (!empty($row['thumb'])) {
             $row['thumb'] = tomedia($row['thumb']);
         }
         if (empty($row['parent_id'])) {
             $replies[$row['id']][] = $row;
         } else {
             $replies[$row['parent_id']][] = $row;
         }
     }
     $replies = array_values($replies);
     include $this->template('display');
 }
開發者ID:zhang19960118,項目名稱:html11,代碼行數:26,代碼來源:module.php

示例6: respond

 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $sql = "SELECT * FROM " . tablename('news_reply') . " WHERE rid = :id AND parent_id = -1 ORDER BY displayorder DESC, id ASC LIMIT 8";
     $commends = pdo_fetchall($sql, array(':id' => $rid));
     if (empty($commends)) {
         $sql = "SELECT * FROM " . tablename('news_reply') . " WHERE rid = :id AND parent_id = 0 ORDER BY RAND()";
         $main = pdo_fetch($sql, array(':id' => $rid));
         if (empty($main['id'])) {
             return false;
         }
         $sql = "SELECT * FROM " . tablename('news_reply') . " WHERE id = :id OR parent_id = :parent_id ORDER BY parent_id ASC, displayorder DESC, id ASC LIMIT 8";
         $commends = pdo_fetchall($sql, array(':id' => $main['id'], ':parent_id' => $main['id']));
     }
     if (empty($commends)) {
         return false;
     }
     $news = array();
     foreach ($commends as $c) {
         $row = array();
         $row['title'] = $c['title'];
         $row['description'] = $c['description'];
         !empty($c['thumb']) && ($row['picurl'] = tomedia($c['thumb']));
         $row['url'] = empty($c['url']) ? $this->createMobileUrl('detail', array('id' => $c['id'])) : $c['url'];
         $news[] = $row;
     }
     return $this->respNews($news);
 }
開發者ID:zhang19960118,項目名稱:html11,代碼行數:29,代碼來源:processor.php

示例7: tpl_form_field_image

function tpl_form_field_image($name, $value = '')
{
    $thumb = empty($value) ? 'images/global/nopic.jpg' : $value;
    $thumb = tomedia($thumb);
    $html = <<<EOF

<div class="input-group">
\t<input type="text" name="{$name}" value="{$value}" class="form-control" autocomplete="off" readonly="readonly">
\t<span class="input-group-btn">
\t\t<button class="btn btn-default" onclick="appupload(this)" type="button">上傳圖片</button>
\t</span>
</div>
<span class="help-block">
\t<img style="max-height:100px;" src="{$thumb}" >
</span>

<script>
window.appupload = window.appupload || function(obj){
\trequire(['jquery', 'util'], function(\$, u){
\t\tu.image(obj, function(url){
\t\t\t\$(obj).parent().prev().val(url.attachment);
\t\t\t\$(obj).parent().parent().next().find('img').attr('src',url.url);
\t\t});
\t});
}
</script>

EOF;
    return $html;
}
開發者ID:zhang19960118,項目名稱:html11,代碼行數:30,代碼來源:tpl.func.php

示例8: setHeader

 public function setHeader()
 {
     global $_W, $_GPC;
     $openid = m('user')->getOpenid();
     $followed = m('user')->followed($openid);
     @session_start();
     if (!$followed) {
         $mid = intval($_GPC['mid']);
         $set = m('common')->getSysset();
         $this->header = array('url' => $set['share']['followurl']);
         $friend = false;
         if (!empty($mid)) {
             if (!empty($_SESSION[EWEI_SHOP_PREFIX . '_shareid']) && $_SESSION[EWEI_SHOP_PREFIX . '_shareid'] == $mid) {
                 $mid = $_SESSION[EWEI_SHOP_PREFIX . '_shareid'];
             }
             $member = m('member')->getMember($mid);
             if (!empty($member)) {
                 $_SESSION[EWEI_SHOP_PREFIX . '_shareid'] = $mid;
                 $friend = true;
                 $this->header['icon'] = $member['avatar'];
                 $this->header['text'] = '來自好友 <span>' . $member['nickname'] . '</span> 的推薦';
             }
         }
         if (!$friend) {
             $this->header['icon'] = tomedia($set['shop']['logo']);
             $this->header['text'] = '歡迎進入 <span>' . $set['shop']['name'] . '</span>';
         }
     }
 }
開發者ID:noikiy,項目名稱:mygit,代碼行數:29,代碼來源:core.php

示例9: doWebSetting

 public function doWebSetting()
 {
     global $_W, $_GPC;
     checklogin();
     load()->func('tpl');
     $item = pdo_fetch("SELECT * FROM " . tablename($this->modulename . '_setting') . " WHERE weid = :weid", array(':weid' => $_W['uniacid']));
     if (!empty($item)) {
         if (!empty($item['share_image'])) {
             $share_image = tomedia($item['share_image']);
         }
     }
     if (checksubmit('submit')) {
         $data = array('weid' => $_W['weid'], 'share_title' => trim($_GPC['share_title']), 'share_desc' => trim($_GPC['share_desc']), 'share_cancel' => trim($_GPC['share_cancel']), 'share_url' => trim($_GPC['share_url']), 'follow_url' => trim($_GPC['follow_url']));
         if (!empty($_GPC['share_image'])) {
             $data['share_image'] = $_GPC['share_image'];
             load()->func('file');
             file_delete($_GPC['share_image-old']);
         }
         if (!empty($item)) {
             pdo_update($this->modulename . '_setting', $data, array('weid' => $_W['uniacid']));
         } else {
             pdo_insert($this->modulename . '_setting', $data);
         }
         message('更新成功!', $this->createWebUrl('setting'), 'success');
     }
     include $this->template('setting');
 }
開發者ID:keycoolkui,項目名稱:weixinfenxiao,代碼行數:27,代碼來源:site.php

示例10: settingsDisplay

 public function settingsDisplay($settings)
 {
     global $_W, $_GPC;
     load()->func('file');
     $_W['page']['title'] = '簽文參數設置';
     if ($_W['isajax'] && $_GPC['op'] == 'delete' && $_GPC['filename']) {
         file_delete($_GPC['filename']);
         exit('ok');
     }
     if (checksubmit()) {
         // 配置
         $dat = $_GPC['add'];
         $dat['imgUrl'] = $_GPC['imgUrl'];
         $this->saveSettings($dat);
         // 簽文
         $qian = $_GPC['qian'];
         $f_exp = "::::::";
         $r_exp = PHP_EOL;
         $morepic = "";
         for ($i = 0; $i < count($qian['filename']); $i++) {
             //替換非法字符
             $name = str_replace($f_exp, "", $qian['title'][$i]);
             $name = str_replace($r_exp, "", $name);
             $pic = str_replace($f_exp, "", $qian['filename'][$i]);
             $pic = str_replace($r_exp, "", $pic);
             if ($pic) {
                 $morepic .= $pic . $f_exp . $name . $r_exp;
             }
         }
         // 去掉最後的字符
         // $morepic = substr($morepic,0,strlen($morepic)-2);
         $morepic = trim($morepic);
         $check = pdo_fetchcolumn("SELECT COUNT(*) FROM " . tablename('qiyue_qiuqian') . " WHERE uniacid=:uniacid", array(':uniacid' => $_W['uniacid']));
         if ($check) {
             pdo_update('qiyue_qiuqian', array('morepic' => $morepic), array('uniacid' => $_W['uniacid']));
         } else {
             $add['uniacid'] = $_W['uniacid'];
             $add['morepic'] = $morepic;
             pdo_insert('qiyue_qiuqian', $add);
         }
         message('設置成功', 'referer', 'success');
     }
     if (empty($settings)) {
         $settings = array('title' => '新年祈福簽', 'desc' => '我在' . $_W['account']['name'] . '求了一支新年簽,你也來吧!', 'imgUrl' => tomedia('./addons/qiuqian/icon.jpg'));
     }
     $qian_r = pdo_fetch("SELECT * FROM " . tablename('qiyue_qiuqian') . " WHERE uniacid=:uniacid", array(':uniacid' => $_W['uniacid']));
     $morepic = array();
     if ($qian_r['morepic']) {
         $f_exp = "::::::";
         $r_exp = PHP_EOL;
         $rr = explode($r_exp, $qian_r['morepic']);
         for ($i = 0; $i < count($rr); $i++) {
             $fr = explode($f_exp, $rr[$i]);
             $morepic[] = array('title' => $fr['1'], 'filename' => $fr['0']);
         }
         unset($qian_r['morepic']);
     }
     include $this->template('setting');
 }
開發者ID:aspnmy,項目名稱:weizan,代碼行數:59,代碼來源:module.php

示例11: doWebChatlog

 public function doWebChatlog()
 {
     global $_GPC, $_W;
     load()->func('tpl');
     $acids = uni_accounts($_W['uniacid']);
     if (!empty($acids)) {
         $data = array();
         foreach ($acids as $acid) {
             if (in_array($acid['level'], array(3, 4))) {
                 $data[] = $acid;
             }
         }
     }
     $starttime = empty($_GPC['starttime']) ? strtotime(date('Y-m-d')) : strtotime($_GPC['starttime']);
     if (!empty($_GPC['token'])) {
         unset($_GPC['token']);
         $avatar = '';
         $endtime = $starttime + 23 * 3600 + 3599;
         $acid = intval($_GPC['acid']);
         if (!empty($_GPC['nickname']) && empty($_GPC['openid'])) {
             $user = pdo_fetch('SELECT b.openid,a.avatar FROM ' . tablename('mc_members') . ' AS a LEFT JOIN ' . tablename('mc_mapping_fans') . ' AS b ON a.uid = b.uid WHERE a.nickname = :nickname', array(':nickname' => trim($_GPC['nickname'])));
             if (empty($user['openid'])) {
                 message('沒有找到昵稱為 "' . $_GPC['nickname'] . '" 的用戶', $this->createWebUrl('chatlog', array('acid' => $acid, 'nickname' => $_GPC['nickname'], 'openid' => $_GPC['openid'], 'starttime' => $_GPC['starttime'])), 'error');
             } else {
                 if (!empty($user['avatar'])) {
                     $avatar = tomedia($user['avatar']);
                     $nickname = $user['nickname'];
                 }
             }
         } else {
             $openid = trim($_GPC['openid']);
             $user = pdo_fetch('SELECT b.openid,a.avatar,a.nickname FROM ' . tablename('mc_members') . ' AS a LEFT JOIN ' . tablename('mc_mapping_fans') . ' AS b ON a.uid = b.uid WHERE b.openid = :openid', array(':openid' => trim($_GPC['openid'])));
             if (!empty($user['avatar'])) {
                 $avatar = tomedia($user['avatar']);
                 $nickname = $user['nickname'];
             }
         }
         if ($acid > 0 && !empty($starttime) && !empty($endtime) && !empty($openid)) {
             $pindex = max(1, intval($_GPC['page']));
             $acc = WeAccount::create($acid);
             $params = array('openid' => trim($_GPC['openid']), 'starttime' => $starttime, 'endtime' => $endtime, 'pageindex' => $pindex, 'pagesize' => 1000);
             $logs = $acc->fetchChatLog($params);
             $next = 1;
             if (is_error($logs) || empty($logs['recordlist']) || count($logs['recordlist']) < $params['pagesize']) {
                 $next = 0;
             }
             $codedata = array();
             $codedata[1000] = '創建未接入會話';
             $codedata[1001] = '接入會話';
             $codedata[1002] = '主動發起會話';
             $codedata[1004] = '關閉會話';
             $codedata[1005] = '搶接會話';
             $codedata[2001] = '公眾號收到消息';
             $codedata[2002] = '客服發送消息';
             $codedata[2003] = '客服收到消息';
         }
     }
     include $this->template('chatlog');
 }
開發者ID:legeng,項目名稱:project-2,代碼行數:59,代碼來源:site.php

示例12: getpicurl

 private function getpicurl($url)
 {
     global $_W;
     if ($url) {
         return tomedia($url);
     } else {
         return $_W['siteroot'] . 'addons/lxy_marry/template/img/art_pic.png';
     }
 }
開發者ID:eduNeusoft,項目名稱:weixin,代碼行數:9,代碼來源:module.php

示例13: respond

 public function respond()
 {
     global $_W;
     $rid = $this->rule;
     $sql = "SELECT * FROM " . tablename('hl_tug_reply') . " WHERE `rid`=:rid LIMIT 1";
     $row = pdo_fetch($sql, array(':rid' => $rid));
     if (empty($row['id'])) {
         return array();
     }
     return $this->respNews(array('Title' => $row['title'], 'Description' => $row['description'], 'PicUrl' => tomedia($row['picture']), 'Url' => $this->createMobileUrl('index', array('id' => $rid))));
 }
開發者ID:keycoolkui,項目名稱:weixinfenxiao,代碼行數:11,代碼來源:processor.php

示例14: getData

 public function getData($page)
 {
     global $_W;
     $data = htmlspecialchars_decode($page['datas']);
     $d = json_decode($data, true);
     $goodsids = array();
     foreach ($d as $k1 => &$dd) {
         if ($dd['temp'] == 'goods') {
             foreach ($dd['data'] as $k2 => $ddd) {
                 $goodsids[] = array('id' => $ddd['goodid'], 'k1' => $k1, 'k2' => $k2);
             }
         } elseif ($dd['temp'] == 'richtext') {
             $dd['content'] = $this->unescape($dd['content']);
         }
     }
     unset($dd);
     $arr = array();
     foreach ($goodsids as $a) {
         $arr[] = $a['id'];
     }
     if (count($arr) > 0) {
         $goodinfos = pdo_fetchall("SELECT id,title,productprice,marketprice,thumb FROM " . tablename('ewei_shop_goods') . " WHERE id in ( " . implode(',', $arr) . ") and uniacid= :uniacid ", array(':uniacid' => $_W['uniacid']), 'id');
         $goodinfos = set_medias($goodinfos, 'thumb');
         foreach ($d as $k1 => &$dd) {
             if ($dd['temp'] == 'goods') {
                 foreach ($dd['data'] as $k2 => &$ddd) {
                     $cdata = $goodinfos[$ddd['goodid']];
                     $ddd['name'] = $cdata['title'];
                     $ddd['priceold'] = $cdata['productprice'];
                     $ddd['pricenow'] = $cdata['marketprice'];
                     $ddd['img'] = $cdata['thumb'];
                 }
                 unset($ddd);
             }
         }
         unset($dd);
     }
     $data = json_encode($d);
     $data = rtrim($data, "]");
     $data = ltrim($data, "[");
     $pageinfo = htmlspecialchars_decode($page['pageinfo']);
     $p = json_decode($pageinfo, true);
     $page_title = empty($p[0]['params']['title']) ? "未設置頁麵標題" : $p[0]['params']['title'];
     $page_desc = empty($p[0]['params']['desc']) ? "未設置頁麵簡介" : $p[0]['params']['desc'];
     $page_img = empty($p[0]['params']['img']) ? "" : tomedia($p[0]['params']['img']);
     $page_keyword = empty($p[0]['params']['kw']) ? "" : $p[0]['params']['kw'];
     $shopset = m('common')->getSysset(array('shop', 'share'));
     $system = $shopset;
     $system['shop'] = set_medias($system['shop'], 'logo');
     $system = json_encode($system);
     $pageinfo = rtrim($pageinfo, "]");
     $pageinfo = ltrim($pageinfo, "[");
     return array('page' => $page, 'pageinfo' => $pageinfo, 'data' => $data, 'share' => array('title' => $page_title, 'desc' => $page_desc, 'imgUrl' => $page_img), 'footermenu' => intval($p[0]['params']['footer']), 'system' => $system);
 }
開發者ID:ChainBoy,項目名稱:wxfx,代碼行數:54,代碼來源:model.php

示例15: fieldsFormDisplay

 public function fieldsFormDisplay($rid = 0)
 {
     global $_W;
     load()->func('tpl');
     $replies = pdo_fetchall("SELECT * FROM " . tablename($this->tablename) . " WHERE rid = :rid ORDER BY `displayorder` DESC", array(':rid' => $rid));
     foreach ($replies as &$reply) {
         if (!empty($reply['thumb'])) {
             $reply['src'] = tomedia($reply['thumb']);
         }
     }
     include $this->template('display');
 }
開發者ID:eduNeusoft,項目名稱:weixin,代碼行數:12,代碼來源:module.php


注:本文中的tomedia函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。