本文整理汇总了PHP中tag::urls方法的典型用法代码示例。如果您正苦于以下问题:PHP tag::urls方法的具体用法?PHP tag::urls怎么用?PHP tag::urls使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tag
的用法示例。
在下文中一共展示了tag::urls方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: trim
function show_action() {
if (!front::get('aid'))
front::$get['aid'] = front::get('id');
front::check_type(front::$get['aid']);
$this->view->aid = trim(front::get('aid'));
$this->view->archive = archive::getInstance()->getrow(front::get('aid'));
$this->view->categorys = category::getpositionlink2($this->view->archive['catid']);
if (!is_array($this->view->archive))
$this->out('message/error.html');
if ($this->view->archive['checked'] < 1)
exit(lang('未审核!<a href="'.front::$from.'">返回</a>'));
if (!rank::arcget(front::get('aid'), $this->view->usergroupid)) {
$this->out('message/error.html');
}
$this->view->catid = $this->view->archive['catid'];
$this->view->topid = category::gettopparent($this->view->catid);
$this->view->parentid = $this->category->getparent($this->view->catid);
if (!rank::catget($this->view->catid, $this->view->usergroupid))
$this->out('message/error.html');
if (!isset($this->category->category[$this->view->catid]) ||
!isset($this->category->category[$this->view->topid])) {
}
$template = @$this->view->archive['template'];
$linkword = new linkword();
$linkwords = $linkword->getrows(null, 1000, 'linkorder desc');
$content = $this->view->archive['content'];
$contents = preg_split('%<div style="page-break-after(.*?)</div>%si', $content);
if ($contents) {
$this->view->pages = count($contents);
front::$record_count = $this->view->pages * config::get('list_pagesize');
$content = $contents[$this->view->page - 1];
}
//$content = preg_replace("/(<a(.*))(>)(.*)(<)(\/a>)/isU", '\\1-]-\\4-[-\\6', $content);
foreach ($linkwords as $linkword) {
$linkword['linktimes'] = (int) $linkword['linktimes'];
if (trim($linkword['linkurl']) && !preg_match('%^http://$%', trim($linkword['linkurl']))) {
$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>";
}
$content = _keylinks($content,$linkword['linkword'],$link,$linkword['linktimes']);
}
$this->view->likenews = $this->getLike($this->view->archive['tag'], $this->view->archive['keyword']);
$taghtml = '';
$tag_table = new tag();
foreach ($tag_table->urls($this->view->archive['tag']) as $tag => $url) {
$taghtml.="<a href='$url' target='_blank'>$tag</a> ";
}
$this->view->archive['tag'] = $taghtml;
$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'])){
//.........这里部分代码省略.........
示例2: header
//.........这里部分代码省略.........
//关键字连接
$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']);
//内容分页
$contents = preg_split('%<div style="page-break-after(.*?)</div>%si', $content);
if (!empty($contents)) {
$case->view->pages = count($contents);
front::$record_count = $case->view->pages * config::get('list_pagesize');
$case->view->pages = count($contents);
} else {
$case->view->pages = 1;
}
//标签连接
$taghtml = '';
$tag_table = new tag();
foreach ($tag_table->urls($case->view->archive['tag']) as $tag => $url) {
$taghtml.="<a href='$url' target='_blank'>$tag</a> ";
}
$case->view->archive['tag'] = $taghtml;
//专题连接
$case->view->archive['special'] = null;
if ($case->view->archive['spid']) {
$spurl = special::url($case->view->archive['spid'],special::getishtml($case->view->archive['spid']));
$sptitle = special::gettitle($case->view->archive['spid']);
$case->view->archive['special'] = "<a href='$spurl' target='_blank'>$sptitle</a> ";
}
//分类连接
$case->view->archive['type'] = null;
if ($case->view->archive['typeid']) {
$typeurl = type::url($case->view->archive['typeid'],1);
$typetitle = type::name($case->view->archive['typeid']);
$case->view->archive['type'] = "<a href='$typeurl' target='_blank'>$typetitle</a> ";
}
//地区连接
$case->view->archive['area'] = null;
$case->view->archive['area'] = area::getpositonhtml($case->view->archive['province_id'], $case->view->archive['city_id'], $case->view->archive['section_id']);
//$arc = $case->view->archive;
for ($c = 1; $c <= $case->view->pages; $c++) {
front::$get['page'] = $c;
$case->view->page = $c;
if (!empty($contents)) {
$content = $contents[$c - 1];
}
$case->view->archive['content'] = $content;