<?php
/**
* Z-Blog with PHP
* @author
* @copyright (C) RainbowSoft Studio
* @version 2.0 2013-06-14
*/
################################################################################################################
function GetPost($idorname, $option = null) {
global $zbp;
if (!is_array($option)) {
$option = array();
}
if (!isset($option['only_article']))
$option['only_article'] = false;
if (!isset($option['only_page']))
$option['only_page'] = false;
if(is_string($idorname)){
$w[] = array('array', array(array('log_Alias', $idorname), array('log_Title', $idorname)));
if($option['only_article']==true){
$w[]=array('=','log_Type','0');
}
elseif($option['only_page']==true){
$w[]=array('=','log_Type','1');
}
$articles = $zbp->GetPostList('*', $w, null, 1, null);
if (count($articles) == 0) {
return new Post;
}
return $articles[0];
}
if(is_integer($idorname)){
return $zbp->GetPostByID($idorname);
}
}
function GetList($count = 10, $cate = null, $auth = null, $date = null, $tags = null, $search = null, $option = null) {
global $zbp;
if (!is_array($option)) {
$option = array();
}
if (!isset($option['only_ontop']))
$option['only_ontop'] = false;
if (!isset($option['only_not_ontop']))
$option['only_not_ontop'] = false;
if (!isset($option['has_subcate']))
$option['has_subcate'] = false;
if (!isset($option['is_related']))
$option['is_related'] = false;
if ($option['is_related']) {
$at = $zbp->GetPostByID($option['is_related']);
$tags = $at->Tags;
if (!$tags)
return array();
$count = $count + 1;
}
if ($option['only_ontop'] == true) {
$w[] = array('=', 'log_IsTop', 0);
} elseif ($option['only_not_ontop'] == true) {
$w[] = array('=', 'log_IsTop', 1);
}
$w = array();
$w[] = array('=', 'log_Status', 0);
$articles = array();
if ($cate) {
$category = new Category;
$category = $zbp->GetCategoryByID($cate);
if ($category->ID > 0) {
if (!$option['has_subcate']) {
$w[] = array('=', 'log_CateID', $category->ID);
} else {
$arysubcate = array();
$arysubcate[] = array('log_CateID', $category->ID);
foreach ($zbp->categorys[$category->ID]->SubCategorys as $subcate) {
$arysubcate[] = array('log_CateID', $subcate->ID);
}
$w[] = array('array', $arysubcate);
}
}
}
if ($auth) {
$author = new Member;
$author = $zbp->GetMemberByID($auth);
if ($author->ID > 0) {
$w[] = array('=', 'log_AuthorID', $author->ID);
}
}
if ($date) {
$datetime = strtotime($date);
if ($datetime) {
$datetitle = str_replace(array('%y%', '%m%'), array(date('Y', $datetime), date('n', $datetime)), $zbp->lang['msg']['year_month']);
$w[] = array('BETWEEN', 'log_PostTime', $datetime, strtotime('+1 month', $datetime));
}
}
if ($tags) {
$tag = new Tag;
if (is_array($tags)) {
$ta = array();
foreach ($tags as $t) {
$ta[] = array('log_Tag', '%{' . $t->ID . '}%');
}
$w[] = array('array_like', $ta);
unset($ta);
} else {
if (is_int($tags)) {
$tag = $zbp->GetTagByID($tags);
} else {
$tag = $zbp->GetTagByAliasOrName($tags);
}
if ($tag->ID > 0) {
$w[] = array('LIKE', 'log_Tag', '%{' . $tag->ID . '}%');
}
}
}
if ($search) {
$w[] = array('search', 'log_Content', 'log_Intro', 'log_Title', $search);
}
$articles = $zbp->GetArticleList('*', $w, array('log_PostTime' => 'DESC'), $count, null, false);
if ($option['is_related']) {
foreach ($articles as $k => $a) {
if ($a->ID == $option['is_related'])
unset($articles[$k]);
}
if (count($articles) == $count)
$articles = array_pop($articles);
}
return $articles;
}
################################################################################################################
function VerifyLogin() {
global $zbp;
if (isset($zbp->membersbyname[GetVars('username', 'POST')])) {
if ($zbp->Verify_MD5(GetVars('username', 'POST'), GetVars('password', 'POST'))) {
$un = GetVars('username', 'POST');
$ps = md5($zbp->user->Password . $zbp->guid);
if (GetVars('savedate') == 0) {
setcookie("username", $un, 0, $zbp->cookiespath);
setcookie("password", $ps, 0, $zbp->cookiespath);
} else {
setcookie("username", $un, time() + 3600 * 24 * GetVars('savedate', 'POST'), $zbp->cookiespath);
setcookie("password", $ps, time() + 3600 * 24 * GetVars('savedate', 'POST'), $zbp->cookiespath);
}
return true;
} else {
$zbp->ShowError(8, __FILE__, __LINE__);
}
} else {
$zbp->ShowError(8, __FILE__, __LINE__);
}
}
function Logout() {
global $zbp;
setcookie('username', '', time() - 3600, $zbp->cookiespath);
setcookie('password', '', time() - 3600, $zbp->cookiespath);
}
################################################################################################################
function ViewAuto($inpurl) {
global $zbp;
if ($zbp->option['ZC_STATIC_MODE'] == 'ACTIVE') {
$zbp->ShowError(2, __FILE__, __LINE__);
return null;
}
$url=GetValueInArray(explode('?',$inpurl),'0');
if($zbp->cookiespath === substr($url, 0 , strlen($zbp->cookiespath)))
$url = substr($url, strlen($zbp->cookiespath));
if (isset($_SERVER['SERVER_SOFTWARE'])) {
if ((strpos($_SERVER['SERVER_SOFTWARE'], 'Microsoft-IIS') !== false) && (isset($_GET['rewrite']) == true)){
//iis+httpd.ini下如果存在真实文件
$realurl = $zbp->path . urldecode($url);
if(is_readable($realurl)&&is_file($realurl)){
die(file_get_contents($realurl));
}
unset($realurl);
}
}
$url = urldecode($url);
$r = UrlRule::Rewrite_url($zbp->option['ZC_INDEX_REGEX'], 'index');
$m = array();
if (preg_match($r, $url, $m) == 1) {
ViewList($m[1], null, null, null, null, true);
return null;
}
$r = UrlRule::Rewrite_url($zbp->option['ZC_DATE_REGEX'], 'date');
$m = array();
if (preg_match($r, $url, $m) == 1) {
ViewList($m[2], null, null, $m[1], null, true);
return null;
}
$r = UrlRule::Rewrite_url($zbp->option['ZC_AUTHOR_REGEX'], 'auth');
$m = array();
if (preg_match($r, $url, $m) == 1) {
ViewList($m[2], null, $m[1], null, null, true);
return null;
}
$r = UrlRule::Rewrite_url($zbp->option['ZC_TAGS_REGEX'], 'tags');
$m = array();
if (preg_match($r, $url, $m) == 1) {
ViewList($m[2], null, null, null, $m[1], true);
return null;
}
$r = UrlRule::Rewrite_url($zbp->option['ZC_CATEGORY_REGEX'], 'cate');
$m = array();
if (preg_match($r, $url, $m) == 1) {
$result = ViewList($m[2], $m[1], null, null, null, true);
if ($result <> ZC_REWRITE_GO_ON)
return null;
}
$r = UrlRule::Rewrite_url($zbp->option['ZC_ARTICLE_REGEX'], 'article');
$m = array();
if (preg_match($r, $url, $m) == 1) {
if (strpos($zbp->option['ZC_ARTICLE_REGEX'], '{%id%}') !== false) {
$result = ViewPost($m[1], null, true);
} else {
$result = ViewPost(null, $m[1], true);
}
if ($result == ZC_REWRITE_GO_ON)
$zbp->ShowError(2, __FILE__, __LINE__);
return null;
}
$r = UrlRule::Rewrite_url($zbp->option['ZC_PAGE_REGEX'], 'page');
$m = array();
if (preg_match($r, $url, $m) == 1) {
if (strpos($zbp->option['ZC_PAGE_REGEX'], '{%id%}') !== false) {
$result = ViewPost($m[1], null, true);
} else {
$result = ViewPost(null, $m[1], true);
}
if ($result == ZC_REWRITE_GO_ON)
$zbp->ShowError(2, __FILE__, __LINE__);
return null;
}
if($url==''||$url=='index.php'){
return ViewList(null,null,null,null,null);
}
foreach ($GLOBALS['Filter_Plugin_ViewAuto_End'] as $fpname => &$fpsignal) {
$fpreturn = $fpname($url);
if ($fpsignal == PLUGIN_EXITSIGNAL_RETURN) {
return $fpreturn;
}
}
$zbp->ShowError(2, __FILE__, __LINE__);
}
function ViewList($page, $cate, $auth, $date, $tags, $isrewrite = false) {
globa
没有合适的资源?快使用搜索试试~ 我知道了~
基于PHP的Z-BlogPHP博客系统forSAE版修正版源码.zip
共744个文件
php:293个
png:272个
gif:62个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 144 浏览量
2023-08-30
00:46:04
上传
评论
收藏 2.35MB ZIP 举报
温馨提示
基于PHP的Z-BlogPHP博客系统forSAE版修正版源码.zip
资源推荐
资源详情
资源评论
收起资源包目录
基于PHP的Z-BlogPHP博客系统forSAE版修正版源码.zip (744个子文件)
base.css 64KB
ueditor.css 43KB
jquery-ui.custom.css 28KB
grey.css 20KB
blue.css 20KB
admin2.css 17KB
html5css3.css 15KB
default.css 13KB
default.css 12KB
style.css 10KB
shCoreDefault.pack.css 7KB
shCoreDefault.css 7KB
codemirror.css 5KB
video.css 4KB
scrawl.css 4KB
image.css 3KB
attachment.css 3KB
admin.css 2KB
evol.colorpicker.css 2KB
admin3.css 2KB
jquery.bettertip.css 2KB
music.css 2KB
dialogbase.css 2KB
fix-ie.css 1KB
fix-ie.css 1KB
edittable.css 1KB
emotion.css 780B
style.css 413B
iframe.css 42B
wface.gif 49KB
jxface2.gif 40KB
yface.gif 28KB
bface.gif 27KB
icons.gif 20KB
tface.gif 19KB
fface.gif 18KB
cface.gif 8KB
loading.gif 6KB
icons-all.gif 4KB
zblog.gif 2KB
Angry.gif 2KB
Faint.gif 2KB
Love.gif 2KB
Music.gif 2KB
Cry.gif 2KB
Adore.gif 2KB
Sad.gif 2KB
Cool.gif 2KB
Sleep.gif 2KB
Grimace.gif 2KB
Misdoubt.gif 2KB
Nothing_to_say.gif 2KB
Smile.gif 2KB
Effort.gif 2KB
Shame.gif 2KB
videologo.gif 2KB
After_boom.gif 1KB
cancelbutton.gif 1KB
loading.gif 1KB
button-bg.gif 1KB
lock.gif 1KB
word.gif 1019B
icon_doc.gif 1012B
icon_psd.gif 1009B
icon_rar.gif 1007B
icon_xls.gif 1005B
icon_ppt.gif 1001B
icon_mv.gif 1001B
icon_pdf.gif 996B
icon_mp3.gif 986B
icon_txt.gif 970B
loader.gif 958B
icon_exe.gif 949B
icon_chm.gif 923B
cursor_v.gif 370B
cursor_h.gif 253B
anchor.gif 184B
menu-leaf.gif 175B
menu-leaf.gif 175B
pointblue.gif 149B
pointgray.gif 149B
pointblue.gif 144B
pointblue.gif 144B
highlighted.gif 111B
unhighlighted.gif 111B
artikel.gif 69B
pagebreak.gif 54B
bg-left.gif 51B
none.gif 43B
spacer.gif 43B
0.gif 43B
style.css.html 10KB
thanks.html 5KB
error.html 3KB
main.html 675B
include.html 195B
index.html 1B
index.html 1B
index.html 1B
index.html 1B
共 744 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
易小侠
- 粉丝: 6506
- 资源: 9万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功