diff --git a/admin/theme.php b/admin/theme.php index 0037001..b770572 100644 --- a/admin/theme.php +++ b/admin/theme.php @@ -7,8 +7,14 @@ function theme($theme,$str){ if(!empty($arr[$str])){ return strip_tags($arr[$str]); } + else if($str =='theme_version'){ + return '未知'; + } + else if($str =='theme_name'){ + return $theme; + } else{ - return 'unknown'; + return false; } } $set=isset($_GET['set'])?$_GET['set']:null; @@ -25,7 +31,7 @@ if(!empty($set)) {
-

主题设置 更多主题 >>

+

主题设置 更多主题 >>

@@ -45,13 +51,21 @@ if(!empty($set)) { foreach($themes as $theme) { $theme = str_replace($theme_path ,"" , $theme); echo''; - echo ''; + + echo ''; echo ''; - echo ''; if($conf['template'] == $theme) { echo ''; } else { diff --git a/include/function.php b/include/function.php index 6f0b89d..f8e1b87 100644 --- a/include/function.php +++ b/include/function.php @@ -21,6 +21,29 @@ function checkmobile() { return false; } } +//判断蜘蛛 +function is_spider(){ + $userAgent = strtolower($_SERVER['HTTP_USER_AGENT']); + $spiders = array( + 'Googlebot', + 'Baiduspider', + 'Yahoo! Slurp', + 'YodaoBot', + 'msnbot', + '360Spider', + 'spider', + 'Spider' + //这里可以加入更多的蜘蛛标示 + ); + foreach ($spiders as $spider) { + $spider = strtolower($spider); + if (strpos($userAgent, $spider) !== false) { + return true; + } + } + return false; +} + function daddslashes($string) { if(is_array($string)) { foreach($string as $key => $val) { @@ -295,4 +318,14 @@ function ins_link($name, $url, $icon, $group_id, $status){ return false; } } +function theme_file($file){ + global $conf; + $theme = ROOT.'template/'.$conf['template'].'/'.$file; + if(file_exists($theme)){ + return $theme; + } + else{ + return 'template/'.$file; + } +} ?> \ No newline at end of file diff --git a/include/updbase.php b/include/updbase.php index 5ecc127..64dacf7 100644 --- a/include/updbase.php +++ b/include/updbase.php @@ -47,6 +47,9 @@ if($sqlvn < 10205) { if($sqlvn < 10300) { $version = 'v1.3.0'; } +if($sqlvn < 10304) { + $version = 'v1.3.4'; +} $sql=explode(';',$sql); for ($i=0;$i \ No newline at end of file diff --git a/site/baidu_api.php b/site/baidu_api.php new file mode 100644 index 0000000..a6c1699 --- /dev/null +++ b/site/baidu_api.php @@ -0,0 +1,48 @@ +query("SELECT `id` FROM `lylme_links` WHERE `link_pwd` = 0"); +while ( $site = $DB->fetch($sites)) { + $url = siteurl().'/site-'.$site['id'].'.html'; + array_push($urls,$url); +} +$ch = curl_init(); +$options = array( + CURLOPT_URL => $api, + CURLOPT_POST => true, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_POSTFIELDS => implode("\n", $urls), + CURLOPT_HTTPHEADER => array('Content-Type: text/html'), +); +curl_setopt_array($ch, $options); + +$results = curl_exec($ch); +$httpCode = curl_getinfo($ch,CURLINFO_HTTP_CODE); + +echo $results; +if($httpCode == 200){ + $result = json_decode($results,true); + echo('

>>>>>>Successful

+ 本次推送:'.count($urls).'条
+ 成功推送:'.$result['success'].'条
+ --------------------------------------
'. + implode("
", $urls)); + } +else { + echo('

推送失败
帮助

'); +} +?> \ No newline at end of file diff --git a/site/index.php b/site/index.php new file mode 100644 index 0000000..37d5cb2 --- /dev/null +++ b/site/index.php @@ -0,0 +1,39 @@ +query("select * from lylme_links where id='$id' limit 1"); +$site = $DB->fetch($sites); +if (empty($site["icon"])) { + $site["icon"] = '< img src="/assets/img/default-icon.png" alt="' . $site["name"] . '" />'; +} else if (!preg_match("/^'; +} else { + $site["icon"] = $site["icon"]; +} +if(empty($DB->num_rows($sites)) || $site['link_pwd']!=0){ + include(theme_file('404.php')); //页面不存在 + exit(); +} +else { + $groups = $DB->query("select `group_name`,`group_icon` from lylme_groups where group_id=".$site['group_id']." limit 1"); + $group = $DB->fetch($groups); + print_r($site); + //include(theme_file('site.php')); + + // $pv =$site['link_pv']+1; + // $DB->query("UPDATE `lylme_links` SET `link_pv` = '".$pv."' WHERE `lylme_links`.`id` = $id;"); + exit(); +} + +/** + * 变量说明 + * $groups['group_name'] 所在分组名称 + * $groups['group_icon'] 所在分组图标 + * $site['id'] 链接ID + * $site['name'] 链接名称 + * $site['url'] 链接地址 + * $site['PS'] 链接描述 + **/ +?> + + diff --git a/site/sitemap.php b/site/sitemap.php new file mode 100644 index 0000000..f2d8c6e --- /dev/null +++ b/site/sitemap.php @@ -0,0 +1,35 @@ +'."\n".''."\n"; +?> + + + + daily + 1.0 + + + + -01 + monthly + 0.9 + + + + -01 + monthly + 0.9 + + query("SELECT `id` FROM `lylme_links` WHERE `link_pwd` = 0"); + while ( $site = $DB->fetch($sites)) { ?> + + + -01 + monthly + 0.8 + + + \ No newline at end of file diff --git a/site/template/404.php b/site/template/404.php new file mode 100644 index 0000000..f5d2b59 --- /dev/null +++ b/site/template/404.php @@ -0,0 +1,31 @@ + + + + + + +404 - 页面不存在 + + + + +
+
+
+

404

+

抱歉,页面不存在!

+ 返回首页 +
+
+
+ + + diff --git a/site/template/site.php b/site/template/site.php new file mode 100644 index 0000000..92adee6 --- /dev/null +++ b/site/template/site.php @@ -0,0 +1,38 @@ + + + + <?php echo $site['name'] . " - " .explode("-", $conf['title'])[0];?> + + + 已收录站点:" /> + + + + + + + +
+'. $site["name"].' +

分类:'.$group['group_name'].'

+

浏览量:'.$pv.'

+'; +echo "

返回 访问

"; +?> + + +
+ + \ No newline at end of file diff --git a/site/伪静态文件/.htaccess b/site/伪静态文件/.htaccess new file mode 100644 index 0000000..0e0dc70 --- /dev/null +++ b/site/伪静态文件/.htaccess @@ -0,0 +1,4 @@ +RewriteEngine On +#RewriteBase / +RewriteRule ^site-(\d+)\.html$ /site/index.php?id=$1 +RewriteRule ^/sitemap.xml$ /site/sitemap.php \ No newline at end of file diff --git a/site/伪静态文件/nginx.txt b/site/伪静态文件/nginx.txt new file mode 100644 index 0000000..fca3a87 --- /dev/null +++ b/site/伪静态文件/nginx.txt @@ -0,0 +1,2 @@ +rewrite ^/site-(\d+)\.html$ /site/index.php?id=$1; +rewrite ^/sitemap.xml$ /site/sitemap.php; \ No newline at end of file

'.theme($theme,"theme_name").'

版本:'.theme($theme,"theme_version").'

'.theme($theme,"theme_explain").'

'.theme($theme,"theme_explain").'

'; + if(theme($theme,"theme_course")){ + echo ' 主题教程'; + } + echo'

'.theme($theme,"author_name").'

'; - if(!empty(theme($theme,"author_link"))){ + if(theme($theme,"author_link")){ echo ' 作者主页'; } + echo '
'; + if(theme($theme,"theme_demo")){ + echo '

在线演示

'; + } echo '

在线演示

当前使用