Пример #1
0
 public function index()
 {
     //处理ss
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //设置 导航 bd
     import('@.TREE.TreeAction');
     $tree = new TreeAction();
     // 		import('@.NTF.NTFAction');
     // 		$ntf = new NTFAction();
     // 		$ntf->setntf();
     import('@.NV.NVAction');
     $nv = new NVAction();
     $nv->setnv();
     $atc = M('atc');
     //获得焦点图
     $atcfcsls = $atc->join('tb_bd ON f_atc_bdid=bdid')->where("atcps=1 AND atcvw=1 AND atcnw=0 AND atcdnmc=1 AND atccv<>'dflt'")->order('atctp DESC,atcmdftm DESC')->limit(0, 5)->select();
     for ($i = 0; $i < count($atcfcsls); $i++) {
         if (mb_strlen($atcfcsls[$i]['atctpc'], 'utf-8') > 10) {
             $atcfcsls[$i]['atctpcsrk'] = mb_substr($atcfcsls[$i]['atctpc'], 0, 10, 'utf-8') . '...';
         } else {
             $atcfcsls[$i]['atctpcsrk'] = $atcfcsls[$i]['atctpc'];
         }
         if ($i == 0) {
             $atcfcsls[$i]['class'] = 'active';
         } else {
             $atcfcsls[$i]['class'] = '';
         }
     }
     $this->assign('atcfcsls', $atcfcsls);
     //左侧部分的文章
     //首先找出所有第一级的bd
     $bd = M('bd');
     $bdls = $bd->order('bdodr ASC')->select();
     //在按照这个顺序前提下,使用tree方法就能有序的得到
     $bdlsnog = $bd->where('bdpid=0')->order('bdodr ASC')->select();
     //NO 1 generation
     for ($i = 0; $i < count($bdlsnog); $i++) {
         $bdidall = $tree->unlimitedForListID($bdls, $bdlsnog[$i]['bdid'], 'bdid', 'bdnm', 'bdpid', 'bdodr');
         //设置搜索条件
         $sccdt = 'f_atc_bdid=' . $bdlsnog[$i]['bdid'];
         $tmp = explode('-', $bdidall);
         for ($j = 0; $j < count($tmp); $j++) {
             if ($tmp[$j] != '') {
                 $sccdt = $sccdt . ' OR f_atc_bdid=' . $tmp[$j];
             }
         }
         $atcls = $atc->field('atcid,atctpc,atcmdftm,atctp')->where("atcps=1 AND atcvw=1 AND atcnw='n' AND (" . $sccdt . ")")->order('atctp DESC,atcmdftm DESC')->limit(0, 6)->select();
         for ($j = 0; $j < count($atcls); $j++) {
             if (mb_strlen($atcls[$j]['atctpc'], 'utf-8') > 15) {
                 $atcls[$j]['atctpcsrk'] = mb_substr($atcls[$j]['atctpc'], 0, 15, 'utf-8') . '...';
             } else {
                 $atcls[$j]['atctpcsrk'] = $atcls[$j]['atctpc'];
             }
             $time = strtotime($atcls[$j]['atcmdftm']);
             $atcls[$j]['atcmdftm'] = date("Y/m/d", $time);
             if ($atcls[$j]['atctp'] == 1) {
                 $atcls[$j]['atcstyle'] = 'font-weight:bold';
                 $atcls[$j]['atcflag'] = 'glyphicon glyphicon-equalizer';
             }
         }
         //$this->assign('atcls'.$bdlsnog[$i]['bdid'],$atcls);
         $bdlsnog[$i]['atcls'] = $atcls;
     }
     $this->assign('bdlsnog', $bdlsnog);
     //获得通知公告
     $atcls = $atc->field('atcid,atctpc,atcmdftm,atctp')->where("atcps=1 AND atcvw=1 AND atcnw=0 AND atcanc=1")->order('atctp DESC,atcmdftm DESC')->limit(0, 6)->select();
     for ($j = 0; $j < count($atcls); $j++) {
         $time = strtotime($atcls[$j]['atcmdftm']);
         $atcls[$j]['atcmdftm'] = date("Y/m/d", $time);
         if ($atcls[$j]['atctp'] == 1) {
             $atcls[$j]['atcstyle'] = 'font-weight:bold';
             $atcls[$j]['atcflag'] = 'glyphicon glyphicon-equalizer';
         }
     }
     $this->assign('atclsanc', $atcls);
     //获得院校动态
     $atcls = $atc->field('atcid,atctpc,atcmdftm,atctp')->where("atcps=1 AND atcvw=1 AND atcnw=0 AND atcdnmc=1")->order('atctp DESC,atcmdftm DESC')->limit(0, 6)->select();
     for ($j = 0; $j < count($atcls); $j++) {
         $time = strtotime($atcls[$j]['atcmdftm']);
         $atcls[$j]['atcmdftm'] = date("Y/m/d", $time);
         if ($atcls[$j]['atctp'] == 1) {
             $atcls[$j]['atcstyle'] = 'font-weight:bold';
             $atcls[$j]['atcflag'] = 'glyphicon glyphicon-equalizer';
         }
     }
     $this->assign('atclsdnmc', $atcls);
     //获得二维码
     //首先获得服务器的广域网域名
     $sys = M('sys');
     $syso = $sys->find();
     $url = 'http://' . $syso['sysip'] . '/' . $syso['sysnm'] . '/wap.php';
     $this->assign('url', $url);
     import('@.QR.QRAction');
     $qr = new QRAction();
     $qrimgurl = $qr->getQR($url);
     $qr = $qrimgurl;
     $this->assign('qr', $qr);
     //通用部分
     $this->assign('title', 'Geek标准');
     $this->assign('theme', 'Geek主题');
     $this->display('index');
 }
Пример #2
0
 function view()
 {
     header("Content-Type:text/html; charset=utf-8");
     //处理ss
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //设置 导航 bd
     import('@.TREE.TreeAction');
     $tree = new TreeAction();
     // 		import('@.NTF.NTFAction');
     // 		$ntf = new NTFAction();
     // 		$ntf->setntf();
     import('@.NV.NVAction');
     $nv = new NVAction();
     $nv->setnv();
     $atcid = $_GET['atcid'];
     $atc = M('atc');
     $mo = $atc->join('tb_bd ON f_atc_bdid=bdid')->where("atcid=" . $atcid)->find();
     import('@.TREE.TreeAction');
     $tree = new TreeAction();
     $bd = M('bd');
     $bdls = $bd->order('bdodr ASC')->select();
     //在按照这个顺序前提下,使用tree方法就能有序的得到
     $str = $tree->findF($bdls, $mo['f_atc_bdid'], 'bdid', 'bdnm', 'bdpid');
     $this->assign('brd', $str);
     $bdo = $bd->where('bdid=' . $mo['f_atc_bdid'])->find();
     $bdlsxd = $bd->where('bdpid=' . $bdo['bdpid'])->order('bdodr ASC')->select();
     $this->assign('bdlsxd', $bdlsxd);
     //对文章内容进行小调整
     $imgrule = '/<img.*src=(\\"|\')(.+)\\1.*>/U';
     //图片规则
     if (preg_match_all($imgrule, $mo['atcctt'], $quote)) {
         //p($quote);die;//$quote平时可以随意查看,有帮助,特别是$quoto[1]代表了啥,2代表了啥,0代表了啥
         for ($i = 0; $i < count($quote[0]); $i++) {
             if (!preg_match("/icon_/", $quote[2][$i])) {
                 $newimg = str_replace("<img ", "<img style='width:100%' ", $quote[0][$i]);
             }
             $mo['atcctt'] = str_replace($quote[0][$i], "<a href='" . $quote[2][$i] . "'>" . $newimg . '</a>', $mo['atcctt']);
         }
     }
     $data = array('atccnt' => $mo['atccnt'] + 1);
     $atc->where('atcid=' . $mo['atcid'])->setField($data);
     $mo['atccnt'] = $mo['atccnt'] + 1;
     if ($mo['atccv'] != 'dflt') {
         $alt = $mo['atccv'];
     }
     $this->assign('alt', $alt);
     if ($mo['atccv'] == 'dflt') {
         $mo['atccv'] = '';
     }
     //获得二维码
     //首先获得服务器的广域网域名
     $sys = M('sys');
     $syso = $sys->find();
     $url = 'http://' . $syso['sysip'] . '/' . $syso['sysnm'] . '/admin.php/Atc/view/atcid/' . $atcid;
     $this->assign('url', $url);
     import('@.QR.QRAction');
     $qr = new QRAction();
     $qrimgurl = $qr->getQR($url);
     $qr = $qrimgurl;
     $this->assign('qr', $qr);
     $this->assign('mo', $mo);
     $this->assign('title', '查看');
     $this->assign('theme', '查看详细');
     $this->display('view');
 }
Пример #3
0
 function view()
 {
     header("Content-Type:text/html; charset=utf-8");
     //处理ss
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     //设置 导航 bd
     import('@.TREE.TreeAction');
     $tree = new TreeAction();
     // 		import('@.NTF.NTFAction');
     // 		$ntf = new NTFAction();
     // 		$ntf->setntf();
     import('@.NV.NVAction');
     $nv = new NVAction();
     $nv->setnv();
     $atcid = $_GET['atcid'];
     $atc = M('atc');
     $mo = $atc->join('tb_bd ON f_atc_bdid=bdid')->where("atcid=" . $atcid)->find();
     import('@.TREE.TreeAction');
     $tree = new TreeAction();
     $bd = M('bd');
     $bdls = $bd->order('bdodr ASC')->select();
     //在按照这个顺序前提下,使用tree方法就能有序的得到
     $str = $tree->findF($bdls, $mo['f_atc_bdid'], 'bdid', 'bdnm', 'bdpid');
     $this->assign('brd', $str);
     $bdo = $bd->where('bdid=' . $mo['f_atc_bdid'])->find();
     $bdlsxd = $bd->where('bdpid=' . $bdo['bdpid'])->order('bdodr ASC')->select();
     $this->assign('bdlsxd', $bdlsxd);
     //对文章内容进行小调整
     $imgrule = '/<img.*src=(\\"|\')(.+)\\1.*>/U';
     //图片规则
     if (preg_match_all($imgrule, $mo['atcctt'], $quote)) {
         //p($quote);die;//$quote平时可以随意查看,有帮助,特别是$quoto[1]代表了啥,2代表了啥,0代表了啥
         for ($i = 0; $i < count($quote[0]); $i++) {
             if (!preg_match("/icon_/", $quote[2][$i])) {
                 $newimg = str_replace("<img ", "<img style='width:100%' ", $quote[0][$i]);
             }
             $mo['atcctt'] = str_replace($quote[0][$i], "<a href='" . $quote[2][$i] . "'>" . $newimg . '</a>', $mo['atcctt']);
         }
     }
     $data = array('atccnt' => $mo['atccnt'] + 1);
     $atc->where('atcid=' . $mo['atcid'])->setField($data);
     $mo['atccnt'] = $mo['atccnt'] + 1;
     if ($mo['atccv'] != 'dflt') {
         $alt = $mo['atccv'];
     }
     $this->assign('alt', $alt);
     if ($mo['atccv'] == 'dflt') {
         $mo['atccv'] = '';
     }
     //获得二维码
     //首先获得服务器的广域网域名
     $sys = M('sys');
     $syso = $sys->find();
     $url = 'http://' . $syso['sysip'] . '/' . $syso['sysnm'] . '/admin.php/Atc/view/atcid/' . $atcid;
     $this->assign('url', $url);
     import('@.QR.QRAction');
     $qr = new QRAction();
     $qrimgurl = $qr->getQR($url);
     $qr = $qrimgurl;
     $this->assign('qr', $qr);
     //查看是否收藏过
     $cstmatcclct = M('cstmatcclct');
     if (session('cstmusridss')) {
         $cstmusrid = session('cstmusridss');
         if ($cstmatcclct->where('f_cstmatcclct_cstmusrid=' . $cstmusrid . ' AND f_cstmatcclct_atcid=' . $atcid)->find()) {
             //已经收藏
             $this->assign('schzysc', '已收藏');
             $this->assign('clctcss', 'collected');
             $this->assign('heartcss', 'hearted');
         } else {
             //将要收藏
             $this->assign('schzysc', '收藏');
             $this->assign('clctcss', 'collecting');
             $this->assign('heartcss', 'hearting');
         }
     } else {
         $this->assign('schzysc', '收藏');
         $this->assign('clctcss', 'collecting');
         $this->assign('heartcss', 'hearting');
     }
     //添加评论
     $cstmcmt = M('cstmcmt');
     $cstmcmtls = $cstmcmt->join('tb_cstmusr ON f_cstmcmt_cstmusrid=cstmusrid')->join('tb_atc ON f_cstmcmt_atcid=atcid')->where('atcid=' . $atcid)->order('cstmcmttm DESC')->limit(0, 5)->select();
     $this->assign('cstmcmtls', $cstmcmtls);
     $this->assign('cstmcmtcnt', $cstmcmt->join('tb_cstmusr ON f_cstmcmt_cstmusrid=cstmusrid')->join('tb_atc ON f_cstmcmt_atcid=atcid')->where('atcid=' . $atcid)->order('cstmcmttm DESC')->count());
     //下拉评论
     //查看是否后继有人,即是否存在第11人///别用find 会出现bug 永远选第一条,很脑残
     if ($cstmcmt->join('tb_cstmusr ON f_cstmcmt_cstmusrid=cstmusrid')->where('f_cstmcmt_atcid=' . $atcid)->order('cstmcmttm ASC')->limit(5, 1)->select()) {
         $hsnxt = 'y';
     } else {
         $hsnxt = 'n';
     }
     $this->assign('hsnxt', $hsnxt);
     //记录当前页
     $this->assign('pg', 1);
     //给活动浏览页面赋值,使其和新的一样,不会因为刷新残留参数而没用//之前已经有hsnxt 和 pg搞定了
     $this->assign('executing', 'n');
     $this->assign('mo', $mo);
     $this->assign('title', '查看');
     $this->assign('theme', '查看详细');
     $this->display('view');
 }
Пример #4
0
 function gtxpg()
 {
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     $x = $_GET['x'];
     //鉴权 如果OK的就正常显示,或者出现查看神马的,否则就呵呵了,query he gtxpg两处
     $mdII = M('md');
     $mdo = $mdII->where("mdmk='Atc'")->find();
     import('@.IDTATH.IdtathAction');
     $Idtath = new IdtathAction();
     $athofn = $Idtath->identify($mdo['mdid'], $x);
     import('@.NTF.NTFAction');
     $ntf = new NTFAction();
     $ntf->setntf();
     import('@.KZMB.KZMBAction');
     $kzmb = new KZMBAction();
     $kzmb->setkzmb($mdo['mdid']);
     if ($x == 'vw') {
         $atcid = $_GET['atcid'];
         $atc = M('atc');
         $mo = $atc->join('tb_bd ON f_atc_bdid=bdid')->where("atcid=" . $atcid)->find();
         import('@.TREE.TreeAction');
         $tree = new TreeAction();
         $bd = M('bd');
         $bdls = $bd->order('bdodr ASC')->select();
         //在按照这个顺序前提下,使用tree方法就能有序的得到
         $str = $tree->findF($bdls, $mo['f_atc_bdid'], 'bdid', 'bdnm', 'bdpid');
         $this->assign('tree', $str);
         //对文章内容进行小调整
         $imgrule = '/<img.*src=(\\"|\')(.+)\\1.*>/U';
         //图片规则
         if (preg_match_all($imgrule, $mo['atcctt'], $quote)) {
             //p($quote);die;//$quote平时可以随意查看,有帮助,特别是$quoto[1]代表了啥,2代表了啥,0代表了啥
             for ($i = 0; $i < count($quote[0]); $i++) {
                 if (!preg_match("/icon_/", $quote[2][$i])) {
                     $mo['atcctt'] = str_replace($quote[0][$i], "<a href='" . $quote[2][$i] . "'>" . $quote[0][$i] . '</a>', $mo['atcctt']);
                 }
             }
         }
         $data = array('atccnt' => $mo['atccnt'] + 1);
         $atc->where('atcid=' . $mo['atcid'])->setField($data);
         $mo['atccnt'] = $mo['atccnt'] + 1;
         if ($mo['atccv'] != 'dflt') {
             $alt = $mo['atccv'];
         }
         $this->assign('alt', $alt);
         if ($mo['atccv'] == 'dflt') {
             $mo['atccv'] = '';
         }
         //获得二维码
         //首先获得服务器的广域网域名
         $sys = M('sys');
         $syso = $sys->find();
         $url = 'http://' . $syso['sysip'] . '/' . $syso['sysnm'] . '/admin.php/Atc/view/atcid/' . $atcid;
         $this->assign('url', $url);
         import('@.QR.QRAction');
         $qr = new QRAction();
         $qrimgurl = $qr->getQR($url);
         $qr = $qrimgurl;
         $this->assign('qr', $qr);
         //查看是否收藏过
         $atcclct = M('atcclct');
         if (session('usridss')) {
             $usrid = session('usridss');
             if ($atcclct->where('f_atcclct_usrid=' . $usrid . ' AND f_atcclct_atcid=' . $atcid)->find()) {
                 //已经收藏
                 $this->assign('schzysc', '已收藏:');
                 $this->assign('clctcss', 'collected');
                 $this->assign('heartcss', 'hearted');
             } else {
                 //将要收藏
                 $this->assign('schzysc', '收藏本文:');
                 $this->assign('clctcss', 'collecting');
                 $this->assign('heartcss', 'hearting');
             }
         } else {
             $this->assign('clctcss', 'collecting');
             $this->assign('heartcss', 'hearting');
         }
         //添加评论
         $cmt = M('cmt');
         $cmtls = $cmt->join('tb_usr ON f_cmt_usrid=usrid')->join('tb_atc ON f_cmt_atcid=atcid')->where('atcid=' . $atcid)->order('cmttm DESC')->limit(0, 5)->select();
         $this->assign('cmtls', $cmtls);
         $this->assign('cmtcnt', $cmt->join('tb_usr ON f_cmt_usrid=usrid')->join('tb_atc ON f_cmt_atcid=atcid')->where('atcid=' . $atcid)->order('cmttm DESC')->count());
         //下拉评论
         //查看是否后继有人,即是否存在第11人///别用find 会出现bug 永远选第一条,很脑残
         if ($cmt->join('tb_usr ON f_cmt_usrid=usrid')->where('f_cmt_atcid=' . $atcid)->order('cmttm ASC')->limit(5, 1)->select()) {
             $hsnxt = 'y';
         } else {
             $hsnxt = 'n';
         }
         $this->assign('hsnxt', $hsnxt);
         //记录当前页
         $this->assign('pg', 1);
         //给活动浏览页面赋值,使其和新的一样,不会因为刷新残留参数而没用//之前已经有hsnxt 和 pg搞定了
         $this->assign('executing', 'n');
         $this->assign('mo', $mo);
         $this->assign('title', '查看');
         $this->assign('theme', '查看详细');
         $this->assign('btnvl', '设置');
         $this->display('view');
     } else {
         if ($x == 'updt') {
             import('@.TREE.TreeAction');
             $tree = new TreeAction();
             $bd = M('bd');
             $bdls = $bd->order('bdodr ASC')->select();
             //在按照这个顺序前提下,使用tree方法就能有序的得到
             $str = $tree->unlimitedForListSLCT($bdls, 0, 'bdid', 'bdnm', 'bdpid', 'bdodr');
             $this->assign('tree', $str);
             $atcid = $_GET['atcid'];
             $atc = M('atc');
             if ($atcid == 0) {
                 $mo['atcid'] = 0;
                 $mo['atcps'] = 0;
                 $mo['atcaddtm'] = date("Y-m-d H:i:s", time());
                 $mo['atcmdftm'] = date("Y-m-d H:i:s", time());
                 $usr = M('usr');
                 $usro = $usr->where('usrid=' . session('usridss'))->find();
                 $mo['atcath'] = $usro['usrnn'];
                 $mo['atccnt'] = 0;
                 $mo['atcnw'] = 0;
                 $mo['atczn'] = 0;
                 $mo['atctc'] = 0;
                 $mo['atcvw'] = 0;
                 $mo['atczs'] = 0;
                 $mo['atccv'] = 'dflt';
                 $alt = '未设置封面';
                 $this->assign('alt', $alt);
                 $mo['atccvII'] = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADICAYAAABS39xVAAADZ0lEQVR4nO3YMXLCMBRAwdz/KByOKyRtZmLAwjb2U7bYCmE+hd5Y+rrf798ABV9nDwCwlmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYAEZggVkCBaQIVhAhmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYAEZggVkCBaQIVhAhmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYAEZggVkCBaQIVhAhmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYAEZggVkCBaQIVhAhmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYAEZggVkCBaQIVhAhmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYAEZggVkCBaQIVhAhmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYAEZggVkCBaQIVhAhmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYE3idrv9sdf60We/O+9eMxwxL9cgWBNY2pTPNurI+tFnvzvvXjMcMS/XIVgTEKxj5+U6BGsCWzf0o89Go7dl3tH/8cl5uQ7BmtC7G/fsAAgWrwjWRNZcNB8VgKXfHrn4vvIbIdchWJM6IwBb7o8EizUEa2JnHLGW3rDemfNT89IiWBM7605o7THw1XM+NS8dgjWBkePUlYK1dY1g/T+CNYHR+5+RkG2J3h53YEfPS4tgTWDrm9Sz9UesvVJgaRGsSfw+ho0ctdasX7N26fNH31l63qs59p6XJsECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyBAvIECwgQ7CADMECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyBAvIECwgQ7CADMECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyBAvIECwgQ7CADMECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyBAvIECwgQ7CADMECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyBAvIECwgQ7CADMECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyBAvIECwgQ7CADMECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyBAvIECwgQ7CADMECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyfgCjVkWTkzIm1AAAAABJRU5ErkJggg==';
                 $this->assign('title', '添加');
                 $this->assign('theme', '添加:');
                 $this->assign('btnvl', '添加');
             } else {
                 //文章的更新时间
                 $mo = $atc->join('tb_bd ON f_atc_bdid=bdid')->where("atcid=" . $atcid)->find();
                 $mo['atcmdftmorg'] = $mo['atcmdftm'];
                 $mo['atcmdftm'] = date("Y-m-d H:i:s", time());
                 if ($mo['atccv'] == 'dflt') {
                     $alt = '未设置封面';
                 } else {
                     $alt = $mo['atccv'];
                 }
                 $this->assign('alt', $alt);
                 if ($mo['atccv'] == 'dflt') {
                     $mo['atccvII'] = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAADICAYAAABS39xVAAADZ0lEQVR4nO3YMXLCMBRAwdz/KByOKyRtZmLAwjb2U7bYCmE+hd5Y+rrf798ABV9nDwCwlmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYAEZggVkCBaQIVhAhmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYAEZggVkCBaQIVhAhmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYAEZggVkCBaQIVhAhmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYAEZggVkCBaQIVhAhmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYAEZggVkCBaQIVhAhmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYAEZggVkCBaQIVhAhmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYAEZggVkCBaQIVhAhmABGYIFZAgWkCFYQIZgARmCBWQIFpAhWECGYE3idrv9sdf60We/O+9eMxwxL9cgWBNY2pTPNurI+tFnvzvvXjMcMS/XIVgTEKxj5+U6BGsCWzf0o89Go7dl3tH/8cl5uQ7BmtC7G/fsAAgWrwjWRNZcNB8VgKXfHrn4vvIbIdchWJM6IwBb7o8EizUEa2JnHLGW3rDemfNT89IiWBM7605o7THw1XM+NS8dgjWBkePUlYK1dY1g/T+CNYHR+5+RkG2J3h53YEfPS4tgTWDrm9Sz9UesvVJgaRGsSfw+ho0ctdasX7N26fNH31l63qs59p6XJsECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyBAvIECwgQ7CADMECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyBAvIECwgQ7CADMECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyBAvIECwgQ7CADMECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyBAvIECwgQ7CADMECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyBAvIECwgQ7CADMECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyBAvIECwgQ7CADMECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyBAvIECwgQ7CADMECMgQLyBAsIEOwgAzBAjIEC8gQLCBDsIAMwQIyfgCjVkWTkzIm1AAAAABJRU5ErkJggg==';
                 } else {
                     $mo['atccvII'] = $mo['atccv'];
                 }
                 $this->assign('title', '修改');
                 $this->assign('theme', '修改:');
                 $this->assign('btnvl', '修改');
             }
             $this->assign('mo', $mo);
             $this->display('update');
         }
     }
 }
Пример #5
0
 function gtxpg()
 {
     //先给hd设置好些东西,他自身是无法提取的
     import('@.SS.SSAction');
     $ss = new SSAction();
     $ss->setss();
     $x = $_GET['x'];
     if ($x == 'vw') {
         $atcid = $_GET['atcid'];
         $atc = M('atc');
         $mo = $atc->join('tb_bd ON f_atc_bdid=bdid')->where("atcid=" . $atcid)->find();
         import('@.TREE.TreeAction');
         $tree = new TreeAction();
         $bd = M('bd');
         $bdls = $bd->order('bdodr ASC')->select();
         //在按照这个顺序前提下,使用tree方法就能有序的得到
         $str = $tree->findF($bdls, $mo['f_atc_bdid'], 'bdid', 'bdnm', 'bdpid');
         $this->assign('tree', $str);
         //对文章内容进行小调整
         $imgrule = '/<img.*src=(\\"|\')(.+)\\1.*>/U';
         //图片规则
         if (preg_match_all($imgrule, $mo['atcctt'], $quote)) {
             //p($quote);die;//$quote平时可以随意查看,有帮助,特别是$quoto[1]代表了啥,2代表了啥,0代表了啥
             for ($i = 0; $i < count($quote[0]); $i++) {
                 if (!preg_match("/icon_/", $quote[2][$i])) {
                     $mo['atcctt'] = str_replace($quote[0][$i], "<a href='" . $quote[2][$i] . "'>" . $quote[0][$i] . '</a>', $mo['atcctt']);
                 }
             }
         }
         $data = array('atccnt' => $mo['atccnt'] + 1);
         $atc->where('atcid=' . $mo['atcid'])->setField($data);
         $mo['atccnt'] = $mo['atccnt'] + 1;
         if ($mo['atccv'] != 'dflt') {
             $alt = $mo['atccv'];
         }
         $this->assign('alt', $alt);
         if ($mo['atccv'] == 'dflt') {
             $mo['atccv'] = '';
         }
         //获得二维码
         //首先获得服务器的广域网域名
         $sys = M('sys');
         $syso = $sys->find();
         $url = 'http://' . $syso['sysip'] . '/' . $syso['sysnm'] . '/zsptwap.php/Atc/view/atcid/' . $atcid;
         $this->assign('url', $url);
         import('@.QR.QRAction');
         $qr = new QRAction();
         $qrimgurl = $qr->getQR($url);
         $qr = $qrimgurl;
         $this->assign('qr', $qr);
         // 			//查看是否收藏过
         // 			$atcclct=M('atcclct');
         // 			if(session('usridss')){
         // 				$usrid=session('usridss');
         // 				if($atcclct->where('f_atcclct_usrid='.$usrid.' AND f_atcclct_atcid='.$atcid)->find()){
         // 					//已经收藏
         // 					$this->assign('schzysc','已收藏:');
         // 					$this->assign('clctcss','collected');
         // 					$this->assign('heartcss','hearted');
         // 				}else{
         // 					//将要收藏
         // 					$this->assign('schzysc','收藏本文:');
         // 					$this->assign('clctcss','collecting');
         // 					$this->assign('heartcss','hearting');
         // 				}
         // 			}else{
         // 				$this->assign('clctcss','collecting');
         // 				$this->assign('heartcss','hearting');
         // 			}
         // 			//添加评论
         // 			$cmt=M('cmt');
         // 			$cmtls=$cmt->join('tb_usr ON f_cmt_usrid=usrid')->join('tb_atc ON f_cmt_atcid=atcid')->where('atcid='.$atcid)->order('cmttm DESC')->limit(0,5)->select();
         // 			$this->assign('cmtls',$cmtls);
         // 			$this->assign('cmtcnt',$cmt->join('tb_usr ON f_cmt_usrid=usrid')->join('tb_atc ON f_cmt_atcid=atcid')->where('atcid='.$atcid)->order('cmttm DESC')->count());
         // 			//下拉评论
         // 			//查看是否后继有人,即是否存在第11人///别用find 会出现bug 永远选第一条,很脑残
         // 			if($cmt->join('tb_usr ON f_cmt_usrid=usrid')->where('f_cmt_atcid='.$atcid)->order('cmttm ASC')->limit(5,1)->select()){
         // 				$hsnxt='y';
         // 			}else{
         // 				$hsnxt='n';
         // 			}
         // 			$this->assign('hsnxt',$hsnxt);
         // 			//记录当前页
         // 			$this->assign('pg',1);
         // 			//给活动浏览页面赋值,使其和新的一样,不会因为刷新残留参数而没用//之前已经有hsnxt 和 pg搞定了
         // 			$this->assign('executing','n');
         $this->assign('mo', $mo);
         $this->assign('title', '查看');
         $this->assign('theme', '查看详细');
         $this->assign('btnvl', '设置');
         $this->display('view');
     }
 }