本文整理汇总了PHP中category::getarcishtml方法的典型用法代码示例。如果您正苦于以下问题:PHP category::getarcishtml方法的具体用法?PHP category::getarcishtml怎么用?PHP category::getarcishtml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类category
的用法示例。
在下文中一共展示了category::getarcishtml方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete_before
function delete_before($id) {
$arc = new archive();
$info = $arc->getrow($id);
$attachment = new attachment();
$res = $attachment->getrows(array("aid"=>$id));
if(is_array($res) && !empty($res)){
foreach($res as $v){
@unlink($v['path']);
}
}
if(category::getarcishtml($info)) {
$path=ROOT.preg_replace("%".THIS_URL."[\\/]%",'',archive::url($info));
if(file_exists($path)) unlink($path);
}
}
示例2: make_show_action
function make_show_action() {
header('Cache-control: private, must-revalidate');
@set_time_limit(0);
$submit = front::post('submit') ? front::post('submit') : front::get('submit');
if (!$submit)
return;
chkpw('cache_content');
//time::start();
$post = front::$post + front::$get;
unset($post['submit']);
$c_url = preg_replace('#&make_page=(\d+)#', '', $_SERVER['QUERY_STRING']);
$c_url = preg_replace('#&aid_start=(\d+)#', '', $c_url);
$c_url = preg_replace('#&aid_end=(\d+)#', '', $c_url);
$c_url = preg_replace('#&catid=(\d+)#', '', $c_url);
$c_url = preg_replace('#&submit=(\d+)#', '', $c_url);
$c_url = 'index.php?' . $c_url;
$c_url.='&submit=1';
$category = category::getInstance(); //实例化栏目类
if ($post['aid_start']) {
$aid_start = $post['aid_start'];
$aid_end = $post['aid_end'];
$where = "aid>=$aid_start and aid<=$aid_end AND checked=1 AND (ishtml IS NULL OR ishtml!=2)";
$c_url.='&aid_start=' . $aid_start . '&aid_end=' . $aid_end;
} elseif (isset($post['catid'])) {
$catid = $post['catid'];
$categories = $category->sons($catid);
$categories[] = $catid;
$categories = implode(',', $categories);
$where = "catid in(" . $categories . ') and checked=1 AND (ishtml IS NULL OR ishtml!=2)';
$c_url.='&catid=' . $catid;
}else
return;
$case = 'archive';
$act = 'show';
$_GET = array('case' => $case, 'act' => $act);
$front = new front();
front::$admin = false;
front::$html = true;
front::$rewrite = false;
$case = $case . '_act';
$case = new $case();
$case->init();
$method = $act . '_action';
//$time_start = time::getTime();
$archive = new archive(); //实例化文章类
if (config::get('group_on')) { //启用分组生成
$make_page = $post['make_page'] == '' ? 1 : $post['make_page'];
$archive->getrows($where);
$archive_num = $archive->record_count;
$group_count = config::get('group_count');
$make_page_num = ceil($archive_num / $group_count);
$totalpage = (($make_page - 1) * $group_count) . ',' . $group_count;
$c_url.='&make_page=' . ($make_page + 1);
} else {
$totalpage = "";
}
$archives = $archive->getrows($where, $totalpage, '1'); //取到要生成的所有文章
$cpage = 0;
foreach ($archives as $arc) {
if (!category::getarcishtml($arc)) //如果文章设置不生成则跳过
continue;
if($arc['linkto']){ //如果有跳转连接则跳过生成
continue;
}
$case->view->archive = $arc;
front::$get['aid'] = $case->view->aid = $case->view->archive['aid'];
$case->view->catid = $case->view->archive['catid'];
$case->view->topid = category::gettopparent($case->view->catid);
$case->view->parentid = $category->getparent($case->view->catid);
$template = $case->view->archive['template'];
$content = $case->view->archive['content'];
$case->view->categories = category::getpositionlink2($case->view->catid);
//关键字连接
$linkword = new linkword();
$linkwords = $linkword->getrows(null, 1000, 'linkorder desc');
foreach ($linkwords as $linkword) {
if (trim($linkword['linkurl']) && !preg_match('%^http://$%', trim($linkword['linkurl']))) {
$linkword['linktimes'] = (int) $linkword['linktimes'];
$link = "<a href='$linkword[linkurl]' target='_blank'>$linkword[linkword]</a>";
} else {
$link = "<a href='" . url('archive/search/keyword/' . urlencode($linkword['linkword'])) . "' target='_blank'>$linkword[linkword]</a>";
}
if (isset($link)) {
$content = preg_replace("%(?!\"]*>)$linkword[linkword](?!\s*\")%i", "\\1$link\\2", $content, $linkword['linktimes']);
}
unset($link);
}
//相关文章
$case->view->likenews = $case->getLike($case->view->archive['tag'], $case->view->archive['keyword']);
//.........这里部分代码省略.........
示例3: show_action
//.........这里部分代码省略.........
$this->view->archive['special'] = null;
if ($this->view->archive['spid']) {
$spurl = special::url($this->view->archive['spid'],special::getishtml($this->view->archive['spid']));
$sptitle = special::gettitle($this->view->archive['spid']);
$this->view->archive['special'] = "<a href='$spurl' target='_blank'>$sptitle</a> ";
}
$this->view->archive['type'] = null;
if ($this->view->archive['typeid']) {
$typeurl = type::url($this->view->archive['typeid'],1);
$typetitle = type::name($this->view->archive['typeid']);
$this->view->archive['type'] = "<a href='$typeurl' target='_blank'>$typetitle</a> ";
}
$this->view->archive['area'] = null;
$this->view->archive['area'] = area::getpositonhtml($this->view->archive['province_id'], $this->view->archive['city_id'], $this->view->archive['section_id']);
$this->view->archive['content'] = $content;
$aid = front::$get['aid'];
$catid = $this->view->catid;
if(!$this->view->archive['showform']) {
$this->getshowform($catid);
}else if($this->view->archive['showform'] && $this->view->archive['showform'] == '1') {
$this->showform = 1;
}else {
$this->showform = $this->view->archive['showform'];
}
if(preg_match('/^my_/is',$this->showform)) {
$this->view->archive['showform'] = $this->showform;
$o_table = new defind($this->showform);
front::$get['form'] = $this->showform;
$this->view->primary_key = $o_table->primary_key;
$field = $o_table->getFields();
$fieldlimit = $o_table->getcols('user_modify');
helper::filterField($field,$fieldlimit);
$this->view->field = $field;
}else {
$this->view->archive['showform'] = '';
}
$str = "";
cb_data($this->view->archive);
foreach( $this->view->archive as $key => $value){
if(!preg_match('/^my/',$key) || !$value)
continue;
$category = category::getInstance();
$sonids = $category->sons(setting::$var['archive'][$key]['catid']);
if(setting::$var['archive'][$key]['catid'] != $this->view->archive['catid'] && !in_array($this->view->archive['catid'],$sonids) && (setting::$var['archive'][$key]['catid'])){
unset($this->view->field[$key]);
continue;
}
$str .= '<p> '.setting::$var['archive'][$key]['cname'].':'. $value.'</p>';
}
$this->view->archive['my_fields'] = $str;
$sql1 = "SELECT aid,title,catid FROM `{$this->archive->name}` WHERE catid = '$catid' AND aid > '$aid' ORDER BY aid ASC LIMIT 0,1";
$sql2 = "SELECT aid,title,catid FROM `{$this->archive->name}` WHERE catid = '$catid' AND aid < '$aid' ORDER BY aid DESC LIMIT 0,1";
$n = $this->archive->rec_query_one($sql1);
$p = $this->archive->rec_query_one($sql2);
$this->view->archive['p'] = $p;
$this->view->archive['n'] = $n;
$this->view->archive['p']['url'] = archive::url($p);
$this->view->archive['n']['url'] = archive::url($n);
$this->view->archive['strgrade'] = archive::getgrade($this->view->archive['grade']);
$prices = getPrices($this->view->archive['attr2']);
$this->view->archive['attr2'] = $prices['price'];
$this->view->archive['oldprice'] = $prices['oldprice'];
$this->view->groupname = $prices['groupname'];
//$this->view->archive['pics'] = unserialize($this->view->archive['pics']);
if(is_array($this->view->archive['pics']) && !empty($this->view->archive['pics'])){
foreach ($this->view->archive['pics'] as $k => $v){
if(strtolower(substr($v,0,7)) == 'http://'){
$this->view->archive['pics'][$k] = $v;
}else{
$this->view->archive['pics'][$k] = $v;
}
}
}
//$this->view->archive['pics'] = unserialize($this->view->archive['pics']);
//var_dump($this->view->archive);
if (front::get('t') == 'wap') {
$tpl = category::gettemplate($this->view->catid, 'showtemplatewap');
if(!$tpl) $tpl = 'wap/show.html';
$this->out($tpl);
return;
}
if ($template && file_exists(TEMPLATE . '/' . $this->view->_style . '/' . $template))
$this->out($template);
else {
$tpl = category::gettemplate($this->view->catid, 'showtemplate');
if (category::getarcishtml($this->view->archive)) {
$path = ROOT . archive::url($this->view->archive);
if (!preg_match('/\.[a-zA-Z]+$/', $path))
$path = rtrim(rtrim($path, '/'), '\\') . '/index.html';
$this->cache_path = $path;
}
$this->out($tpl);
}
}
示例4: url
static function url($info,$page=null,$relative=false) {
if ($info['linkto']) return $info['linkto'];
if(front::$get['t'] == 'wap'){
if (config::get('wap_html_prefix')){
$html_prefix='/'.trim(config::get('wap_html_prefix'),'/');
}
if(front::$rewrite){
if (!$page){
return config::get('site_url').'show_wap_'.$info['aid'].'.htm';
}else{
return config::get('site_url').'show_wap_'.$info['aid'].'_'.$page.'.htm';
}
}
$type=category::getInstance();
if($info['iswaphtml'] == 2){
return url::create('archive/show/t/wap/aid/'.$info['aid']);
}
if (!category::getarciswaphtml($info)){
if ($page){
return url::create('archive/show/t/wap/aid/'.$info['aid'].'/page/'.$page);
}else{
return url::create('archive/show/t/wap/aid/'.$info['aid']);
}
}else {
if ($info['htmlrule']){
$rule=$info['htmlrule'];
}else{
$rule=category::gethtmlrule($info['catid'],'showhtmlrule');
}
$rule=str_replace('{$caturl}',$type->htmlpath($info['catid']),$rule);
$rule=str_replace('{$dir}',$type->category[$info['catid']]['htmldir'],$rule);
$rule=str_replace('{$catid}',$info['catid'],$rule);
$rule=str_replace('{$aid}',$info['aid'],$rule);
if ($page){
$rule=str_replace('{$page}',$page,$rule);
}else{
$rule=preg_replace('/\(.*?\)/','',$rule);
$rule=str_replace('_{$page}','',$rule);
}
$rule=preg_replace('/[\(\)]/','',$rule);
$rule=preg_replace('%[\\/]index\.htm1%','',$rule);
$rule=rtrim($rule,'/');
$rule=trim($rule,'\\');
if ($relative) return $html_prefix.'/'.$rule;
return config::get('base_url').$html_prefix.'/'.$rule;
}
}
if (config::get('html_prefix')) $html_prefix='/'.trim(config::get('html_prefix'),'/');
$type=category::getInstance();
if($info['ishtml'] == 2){
return url::create('archive/show/aid/'.$info['aid']);
}
if (!category::getarcishtml($info) ||front::$rewrite) if ($page) return url::create('archive/show/aid/'.$info['aid'].'/page/'.$page);
else return url::create('archive/show/aid/'.$info['aid']);
else {
if ($info['htmlrule']) $rule=$info['htmlrule'];
else $rule=category::gethtmlrule($info['catid'],'showhtmlrule');
$rule=str_replace('{$caturl}',$type->htmlpath($info['catid']),$rule);
$rule=str_replace('{$dir}',$type->category[$info['catid']]['htmldir'],$rule);
$rule=str_replace('{$catid}',$info['catid'],$rule);
$rule=str_replace('{$aid}',$info['aid'],$rule);
if ($page){
$rule=str_replace('{$page}',$page,$rule);
}else{
$rule=preg_replace('/\(.*?\)/','',$rule);
$rule=str_replace('_{$page}','',$rule);
}
$rule=preg_replace('/[\(\)]/','',$rule);
$rule=preg_replace('%[\\/]index\.htm1%','',$rule);
$rule=rtrim($rule,'/');
$rule=trim($rule,'\\');
if ($relative) return $html_prefix.'/'.$rule;
return config::get('base_url').$html_prefix.'/'.$rule;
}
}