コード例 #1
0
ファイル: admin_categories.php プロジェクト: hongz1125/devil
    echo label(array('type' => 'input', 'alang' => 'category_title_displayorder_title', 'name' => 'displayorder', 'size' => '10', 'value' => $thevalue['displayorder']));
    echo label(array('type' => 'table-end'));
    echo label(array('type' => 'div-end'));
    echo label(array('type' => 'eval', 'text' => '<br><center>'));
    echo label(array('type' => 'button-submit', 'name' => 'thevaluesubmit', 'value' => $alang['common_submit']));
    echo label(array('type' => 'button-reset', 'name' => 'thevaluereset', 'value' => $alang['common_reset']));
    echo label(array('type' => 'eval', 'text' => '</center>'));
    echo '<input name="catid" type="hidden" value="' . $thevalue['catid'] . '" />';
    echo '<input name="upid" type="hidden" value="' . $thevalue['upid'] . '" />';
    echo '<input name="type" type="hidden" value="' . $thevalue['type'] . '" />';
    echo '<input name="valuesubmit" type="hidden" value="yes" />';
    echo label(array('type' => 'form-end'));
}
if (is_array($bbsvalue) && $bbsvalue) {
    $blocktype = 'bbsthread';
    $stylearr = getstyle($blocktype);
    if (!empty($bbsvalue['blocktext'])) {
        $theblcokvalue = unserialize($bbsvalue['blocktext']);
    } else {
        $theblcokvalue = array('cachetime' => '900', 'start' => '0', 'limit' => '10', 'bbsurltype' => 'site');
    }
    $cachetimearr = array('' => $alang['block_cachetime_null'], '900' => $alang['block_cachetime_900'], '1800' => $alang['block_cachetime_1800'], '3600' => $alang['block_cachetime_3600'], '7200' => $alang['block_cachetime_7200'], '43200' => $alang['block_cachetime_43200'], '86400' => $alang['block_cachetime_86400']);
    include_once S_ROOT . './admin/include/admin_blocks_' . $blocktype . '.inc.php';
    //COMMON
    $blockarr['cache'] = array('cachetime' => array('type' => 'select-input', 'alang' => 'block_title_cachetime', 'options' => $cachetimearr, 'size' => '10', 'width' => '30%'));
    $blockarr['template'] = array('tpl' => array('type' => 'select-div-preview', 'alang' => 'block_title_skinid', 'options' => $stylearr));
    $blockmodelarr = array('1' => $alang['block_model_1'], '2' => $alang['block_model_2']);
    $bbsmodelarr = array('0' => $alang['category_bbsmode_0'], '1' => $alang['category_bbsmode_1']);
    echo '
	<script language="javascript">
	<!--
コード例 #2
0
ファイル: template.php プロジェクト: sdgdsffdsfff/crm
 function getdata($sqlstr, $code)
 {
     global $db;
     $sort_list = $db->getlist($sqlstr);
     foreach ($sort_list as $list) {
         preg_match_all('/<luocms([\\s\\S]*?)>([\\s\\S]*?)<\\/luocms>/', $code, $block_list);
         $hreftemp = $block_list[2][0];
         $formtemp = $block_list[1][0];
         $hreftempnew = $hreftemp;
         preg_match_all('/src=(\\")(.*?)(\\")/', $formtemp, $srclist);
         //得到是哪个表的内容
         $src_temp = $srclist[2][0];
         preg_match_all('/src=(\\")(.*?)(\\")/', $hreftemp, $srclist);
         //要生成的缩略图的部分
         $s_pic_temp = $srclist[2][0];
         //echo $s_pic_temp;
         preg_match_all('/\\[(.*?)\\swidth=(\'|\\")(.*?)(\'|\\")\\sheight=(\'|\\")(.*?)(\'|\\")\\]/', $s_pic_temp, $picturex);
         //生成缩略图并替换标签
         $pxMax = count($picturex[0]);
         //echo $pxMax;
         for ($p = 0; $p < $pxMax; $p++) {
             $pp = $picturex[1][$p];
             //echo $picturex[0][$p];
             $ppw = $picturex[3][$p];
             $pph = $picturex[6][$p];
             $p_picture = $this->get_content_row($list['id'], 'picture');
             if (!empty($ppw) && !empty($pph)) {
                 $img_ext = strrchr($p_picture, '.');
                 $p_smallpic = substr($p_picture, 0, strlen($p_picture) - strlen($img_ext)) . "_s" . $img_ext;
                 if (!file_exists($p_smallpic)) {
                     $temp = new CreatMiniature();
                     $temp->SetVar($p_picture, $img_ext);
                     $temp->BackFill('./' . $p_smallpic, $ppw, $pph, "255", "255", "255");
                 }
                 $temp_img = "../" . $p_smallpic;
             } else {
                 $temp_img = "../" . $p_picture;
             }
             //echo $picturex[0][$p];
             $hreftempnew = str_replace($picturex[0][$p], $temp_img, $hreftempnew);
         }
         preg_match_all('/\\[luo\\.(.*?)\\]/', $hreftemp, $tName);
         //处理截取字符标签[luo.cotnent len='180']
         $tArrMax = count($tName[0]);
         for ($k = 0; $k < $tArrMax; $k++) {
             $t1 = strtolower($tName[0][$k]);
             // 属性名称[luo.title]
             $t2 = strtolower($tName[1][$k]);
             //字段名title
             preg_match_all('/(.*?)x\\slen=(\'|\\")(.*?)(\'|\\")/', $t2, $titlex);
             $txArrMax = count($titlex[0]);
             for ($w = 0; $w < $txArrMax; $w++) {
                 $ttr = $titlex[1][$w];
                 $tx = $titlex[0][$w];
                 $txx = "[luo." . $tx . "]";
                 $len = $titlex[3][$w];
                 $temp_c_value = get_html_replace($list[$ttr]);
                 $temp_sub_str = utf_substr(htmlspecialchars(strip_tags(stripslashes($temp_c_value))), $len);
                 $temp_sub_str_ext = strlen($list[$ttr]) > $len ? $temp_sub_str . "..." : $temp_sub_str;
                 $hreftempnew = str_replace($txx, $temp_sub_str_ext, $hreftempnew);
             }
             switch ($t2) {
                 //替换内容标签[luo.*]
                 case "url":
                     //链接
                     switch ($src_temp) {
                         //根据当前表名用不同的链接地址
                         case "content":
                             //内容表
                             $urltemp = $this->get_tpl_name($this->getclassid($list['id']), 'templateview') . "_" . $list['id'] . $GLOBALS[rewriteext];
                             $hreftempnew = str_replace($t1, $urltemp, $hreftempnew);
                             break;
                         case "link":
                             //友情链接表
                             $urltemp = $list['url'];
                             $hreftempnew = str_replace($t1, $urltemp, $hreftempnew);
                             break;
                     }
                     break;
                 case "classurl":
                     //导航类别中地址
                     $urltemp = $this->get_tpl_name($list['id'], 'template') . "-" . $list['id'] . $GLOBALS[rewriteext];
                     $hreftempnew = str_replace($t1, $urltemp, $hreftempnew);
                     break;
                 case "content":
                     //内容
                     $hreftempnew = str_replace($t1, strip_tags(stripslashes($list[$t2])), $hreftempnew);
                     break;
                 case "contentc":
                     //显示单条内容时不用去除样式
                     $hreftempnew = str_replace($t1, stripslashes($list["content"]), $hreftempnew);
                     break;
                 case "title":
                     //标题
                     $title = getstyle("content", $list['id'], $list['title']);
                     $hreftempnew = str_replace($t1, $title, $hreftempnew);
                     break;
                 case "picture":
                     //原始大小图片
                     $hreftempnew = str_replace($t1, '../' . $this->get_content_row($list['id'], 'picture'), $hreftempnew);
                     break;
                 case "replay":
                     //留言板的回复
                     $temp_replay = empty($list['replay']) ? "" : "<div class='reply'><div class='gly'><b>管理员回复:</b>" . $list['replaytime'] . "</div><div class='gly_content'>" . $list['replay'] . "</div></div>";
                     $hreftempnew = str_replace($t1, $temp_replay, $hreftempnew);
                     break;
                 default:
                     //其它,直接显示字段所对应的内容[luo.name]等
                     $hreftempnew = str_replace($t1, $list[$t2], $hreftempnew);
                     break;
             }
         }
         $str_temp .= $hreftempnew;
     }
     return $str_temp;
 }