/** * @Title: getNoticeList * @Description: todo(获取公司公告新闻) * @return string|multitype: * @author 杨东 * @date 2013-7-4 下午5:52:32 * @throws */ public function getNoticeList() { $file = UPLOAD_PATH . "tml_news.htm"; //filemtime($file)<time()-3600*24 if (filemtime($file) < time() - 3600 * 24) { $url = "http://www.966580.com/?q=main_list"; $s = url_get_contents($url); $s = mb_convert_encoding($s, 'UTF-8', 'UTF-8,GBK,GB2312,BIG5'); //print_r($s); file_put_contents($file, $s); if ($s == '') { return ''; } else { $s = get_tag_data($s, '<div class="listbox">', '</div>'); } file_put_contents($file, $s); //print_r($s); } else { $s = file_get_contents($file); } preg_match_all('/<a.*?(?: |\\t|\\r|\\n)?href=[\'"]?(.+?)[\'"]?(?:(?: |\\t|\\r|\\n)+.*?)?>(.+?)<\\/a.*?>/sim', $s, $m); preg_match_all("/<font.*?>(.+?)<\\/font.*?>/", $s, $m1); /*preg_match_all('/<span.*?>(.+?)<\/span.*?>/',$s,$m1);*/ $list = array(); foreach ($m[1] as $key => $val) { $list[$key]['url'] = "http://www.966580.com/" . $val; //$list[$key]['url']="http://www.966580.com/".$val; $list[$key]['title'] = $m[2][$key]; //$list[$key]['date']=$m1[0][$key]; //$list[$key]['date']=$m1[1][$key]; if ($key == 7) { break; } } return $list; }
function get_tag_cloud() { $min_font_size = 14; $max_font_size = 18; $tags = get_tag_data(); $minimum_count = min(array_values($tags)); $maximum_count = max(array_values($tags)); $spread = $maximum_count - $minimum_count; if ($spread == 0) { $spread = 1; } $cloud_html = ''; $cloud_tags = array(); // create an array to hold tag code foreach ($tags as $tag => $count) { $size = $min_font_size + ($count - $minimum_count) * ($max_font_size - $min_font_size) / $spread; $cloud_tags[] = '<nobr><a style="font-size: ' . floor($size) . 'px' . '" class="tag_cloud" href="' . $base_URL . 'tag/' . $tag . '" title="\'' . $tag . '\' returned a count of ' . $count . '">' . htmlspecialchars(stripslashes($tag)) . '</a> <span style="padding-right: 10px; color: #999999">×' . $count . '</span></nobr>'; } $cloud_html = join("\n", $cloud_tags) . "\n"; return $cloud_html; }
function get_tag_cloud() { global $vbulletin; // Default font sizes $min_font_size = 13; $max_font_size = 26; // Pull in tag data $tags = get_tag_data(); if ($tags) { $minimum_count = min(array_values($tags)); $maximum_count = max(array_values($tags)); $spread = $maximum_count - $minimum_count; if ($spread == 0) { $spread = 1; } $cloud_html = ''; $cloud_tags = array(); // create an array to hold tag code $url = $vbulletin->options['bburl'] . '/goldbrick.php?do=' . $vbulletin->session->vars['sessionurl'] . "search&id="; foreach ($tags as $tag => $count) { $size = $min_font_size + ($count - $minimum_count) * ($max_font_size - $min_font_size) / $spread; $cloud_tags[] = '<a style="font-size: ' . floor($size) . 'px' . '" class="tag_cloud" href="' . $url . $tag . '" title="\'' . $tag . '\' returned a count of ' . $count . '">' . htmlspecialchars(stripslashes($tag)) . '</a>'; } $cloud_html = join("\n", $cloud_tags) . "\n"; return $cloud_html; } else { return false; } }
echo $i; ?> </a> <?php } } ?> </div> <div class="clear blank10"></div> <?php } ?> <!--文章内容分页 end--> <!--标签关键字 begin--> <?php if ($kws = get_tag_data($keywords)) { ?> <div class="articlekey"><strong>TAG:</strong> <?php if (is_array($kws)) { $count = count($kws); foreach ($kws as $t) { ?> <a href="<?php echo tag_url($t); ?> "><?php echo $t; ?> </a> <?php
function get_tag_cloud() { // Default font sizes $min_font_size = 12; $max_font_size = 30; // Pull in tag data $tags = get_tag_data(); if ($tags) { $minimum_count = min(array_values($tags)); $maximum_count = max(array_values($tags)); $spread = $maximum_count - $minimum_count; if ($spread == 0) { $spread = 1; } $cloud_html = ''; $cloud_tags = array(); // create an array to hold tag code foreach ($tags as $tag => $count) { $size = $min_font_size + ($count - $minimum_count) * ($max_font_size - $min_font_size) / $spread; $cloud_tags[] = '<a style="font-size: ' . floor($size) . 'px' . '" class="tag_cloud" href="http://www.google.com/search?q=' . $tag . '" title="\'' . $tag . '\' returned a count of ' . $count . '">' . htmlspecialchars(stripslashes($tag)) . '</a>'; } $cloud_html = join("\n", $cloud_tags) . "\n"; return $cloud_html; } else { return false; } }
function get_163_content($str) { return get_tag_data($str, '<div id="endText">', '</div>'); }