蜘蛛建站系统使用说明
本系统采用Java+MySQL进行开发,具有较好的跨平台特性,可在Windows、Linux、Mac等平台上较好的运行。考虑到一般用户使用Windows Server较多,此安装说明则以Windows为例,其他操作系统可参照此教程进行。
一、安装蜘蛛建站系统
在安装之前首先保证您的服务器或空间已安装好Tomcat、MySQL数据库及JDK,建议Tomcat版本为8.0,MySQL数据库版本为5.6以上,JDK版本为1.8。如果服务器上不具有Tomcat、MySQL及JDK,请先安装这三款环境软件。
1、解压蜘蛛建站系统安装文件解压到Tomcat的webapp目录
2、将安装目录下的run.sql文件导入到MySQL数据库。
3、修改/WEB-INF/classes/db.properties文件,该文件为数据库配置文件。
①、将jdbc.url对应的值改为你的数据库连接地址及数据库名称。
②、将jdbc.user对应的值改为你的数据库登陆用户名。
③、将jdbc.password对应的值改为你的数据库登陆密码。
④、修改完成后保存。
完成以上3步后系统已安装完毕,启动Tomcat服务即可访问网站。
二、模板设置及标签调用
系统后台可为每个栏目,每个栏目所拥有的文章单独设置模板,若设置的模板不存在,系统会自动采用默认模板。
蜘蛛建站系统模板标签一共9个,分别为:bannerList,type,typeList,typeListSons,typePosition,article,articleList,articleListByBeginAndSize,friendLinks。
调用这9个标签前,请在模板的“<html>”前引入标签库。
如:
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="cdar" uri="http://www.cdarkj.com" %>
<html><head></head><body></body><html>
1、bannerList标签
①、说明:该标签用于调用后台上传的Banner图。
②、 标签参数:
参数名 | 描述 | 类型 | 是否必需 | 默认值 |
titles | 后台Banner图标题,如果该参数为空,将获取后台上传的所有Banner图 | String | 否 | 无 |
③、 例:
<cdar:bannerList titles='banner1,banner2,banner3'>
<div class="bd">
<c:forEach items="${banners}" var="item">
<c:if test="${item.imgUrl!=null and item.imgUrl!=''}">
<div>
<c:choose>
<c:when test="${item.url!=null and item.url!=''}">
<a href="${item.url}">
<img class="full" src="${item.imgUrl}">
</a>
</c:when>
<c:otherwise>
<img class="full" src="${item.imgUrl}">
</c:otherwise>
</c:choose>
</div>
</c:if>
</c:forEach>
</div>
</cdar:bannerList>
2、type标签
①、说明:调用单个栏目。
②、 标签参数:
参数名 | 描述 | 类型 | 是否必需 | 默认值 |
typeCode | 后台的栏目编号 | String | 是 | 无 |
③、 例:
<cdar:type typeCode="134134">
<c:if test="${type!=null}">
<a href="/type/${type.code}.html">
${type.title}
</a>
</c:if>
</cdar:type>
3、typeList标签
①、说明:调用多个栏目。
②、 标签参数:
参数名 | 描述 | 类型 | 是否必需 | 默认值 |
typeCodes | 后台的栏目编号 | String | 是 | 无 |
③、 例:
<cdar:typeList typeCodes="3227,2411,4647,7305,1648,4524">
<c:forEach items="${types}" var="item">
<a class="nav" href="/type/${item.typeCode}.html">
${item.title}
</a>
</c:forEach>
</cdar:typeList>
4、typeListSons标签
①、说明:调用指定父栏目的子栏目。
②、 标签参数:
参数名 | 描述 | 类型 | 是否必需 | 默认值 |
typeCode | 后台的父栏目编号 | String | 是 | 无 |
beginRow | 子栏目的起始位置 | int | 否 | 0 |
size | 要调用的子栏目数量 | int | 否 | 10 |
noSonDisplayBrother | 如果没有子栏目,显示兄弟栏目 | boolean | 否 | false |
③、 例:
<cdar:typeListSons typeCode="3227">
<c:forEach items="${types}" var="item">
<a class="nav" href="/type/${item.typeCode}.html">
${item.title}
</a>
</c:forEach>
</cdar:typeListSons>
5、typePosition标签
①、说明:显示栏目、文章页的当前位置,如: 首页 >开发手册。
②、 标签参数:
参数名 | 描述 | 类型 | 是否必需 | 默认值 |
typeCode | 后台的栏目编号 | String | 是 | 无 |
③、 例:
<a href="/">首页</a> <cdar:typePosition typeCode="${type.typeCode}"> <c:forEach items="${types}" var="item"> <a href="/type/${item.typeCode}.html">>${item.title}</a> </c:forEach> </cdar:typePosition>
6、articleList标签
①、说明:调用指定栏目的文章。
②、 标签参数:
参数名 | 描述 | 类型 | 是否必需 | 默认值 |
typeCode | 后台栏目的编号 | String | 是 | 无 |
title | 文章标题包含的部分文字 | String | 否 | 无 |
childrenType | 是否包含子栏目的文章 | boolean | 否 | false |
asc | 文章发布时间排序规则,true:先发布的排在前,false:最新发布的排在前 | boolean | 否 | false |
needImg | 只显示有缩略图的文章 | boolean | 否 | false |
pageNo | 分页的起始页号,即显示第几页 | int | 否 | 1 |
pageSize | 分页的页面大小,即显示几篇文章 | int | 否 | 10 |
paginationSize | 文章列表页中显示分页的按钮数 | int | 否 | 无 |
③、 例:
<cdar:articleList typeCode="${type.typeCode}" pageNo="${pageNo}" pageSize="${pageSize}"
paginationSize="4">
<div >
<div >
<div >
<c:forEach items="${articles}" var="item">
<div class="list">
<div class="textWrap">
<a class="title" href="/article/${item.code}.html">${item.title}
</a>
<div class="description text">
<a href="/article/${item.code}.html">
${item.description}
</a>
<a class="detail" href="/article/${item.code}.html">【详情】</a>
</div>
</div>
</div>
</c:forEach>
</div>
</div>
</div>
<div >
<div >
<div >
<div class="pagesWrap">
<div class="pages">
<ul class="ul">
<c:forEach items="${displayPages}" var="item">
<li <c:if test="${item.pageNo==pageNo}">class="thisclass" </c:if> ><a
href="/type/${nameCode}.html?pageNo=${item.pageNo}&pageSize=${pageSize}">${item.text}</a>
</li>
</c:forEach>
<div class="clearfix"></div>
</ul>
</div>
</div>
</div>
</div>
</div>
</cdar:articleList>
7、articleListByBeginAndSize标签
①、说明:调用指定栏目的文章。
②、 标签参数:
参数名 | 描述 | 类型 | 是否必需 | 默认值 |
typeCode | 后台栏目的编号 | String | 是 | 无 |
title | 文章标题包含的部分文字 | String | 否 | 无 |
childrenType | 是否包含子栏目的文章 | boolean | 否 | false |
asc | 文章发布时间排序规则,true:先发布的排在前,false:最新发布的排在前 | boolean | 否 | false |
needImg | 只显示有缩略图的文章 | boolean | 否 | false |
beginRow | 从递几篇文章开始显示 | int | 否 | 1 |
size | 显示的文章数量 | int | 否 | 10 |
③、 例:
<cdar:articleListByBeginAndSize typeCode="32864" beginRow="1" size="50" childrenType="true">
<c:forEach items="${articles}" var="item">
<a href="/article/${item.code}.html">${item.title}</a>
</c:forEach>
</cdar:articleListByBeginAndSize>
8、article标签
①、说明:调用特定的文章。
②、 标签参数:
参数名 | 描述 | 类型 | 是否必需 | 默认值 |
code | 后台特定文章的编号 | String | 是 | 无 |
③、 例:
<cdar:article code="123435">
<c:if test="article!=null">
<a href="/article/${article.code}.html">
${article.title}
</a>
</c:if>
</cdar:article>
9、friendLinks标签
①、说明:调用后台添加的友情链接。
②、 标签参数:
参数名 | 描述 | 类型 | 是否必需 | 默认值 |
title | 后台友情链接的标题包含的文字 | String | 否 | 无 |
pageNo | 分页编号 | int | 否 | 1 |
pageSize | 分页大小 | int | 否 | 10 |
needImg | 是否只显示有图片的友情链接 | boolean | 否 | false |
asc | 按后台设置的友情链接序号进行排序,true:升序,false:降序 | boolean | 否 | true |
③、 例:
<cdar:friendLinks pageNo="1" pageSize="6"> <c:if test="${friendLinks.size()>0}"> 友情链接: <c:forEach items="${friendLinks}" var="item"> <a class="friendLink" target="_blank" href="${item.url}">${item.title}</a> </c:forEach> </c:if> </cdar:friendLinks>