discuz 7.2 如何新建空白页面?就需要header和footer,中间空白,

discuz 7.2 如何新建空白页面?就需要header和footer,中间空白,,第1张

先建一个1php文件,代码如下:

<

require_once 'include/commonincphp';

$navtitle = '页面名称';

$discuz_action = '1';

include template('1');

>

然后在templates\default目录下建一个1htm的模板文件和1php对应,代码:

{subtemplate header}

中间加上你自己的内容

{subtemplate footer}

然后在论坛首页找个位置链接到1php,这样就OK了,如果还有问题可以联系我,我的也是DZ72,我把我的代码发给你。

1 首先找到论坛的后台管理登录界面

2 输入账号、密码,登录后台管理系统,找到界面上的“门户”选项卡

3 点击“门户”,出现新的界面,找到刚才前台无法查看内容的频道,以及其右侧对应的“编辑”

4 点击“编辑”,进入该频道的编辑界面,通过右侧的滚动条,拉到中部,找到“启动”,下方选择为“否”,右侧说明是“选择否只有管理员可以查看该频道”

5 将“启用”下方的选择“否”改为“是”,拉到页面底部,点击“提交”,然后到论坛前台,点击“录像”频道,可以查看内容了,这样就解决了该问题。

package orgshaw;

import orgapachecommonshttpclientCookie;

import orgapachecommonshttpclientHttpClient;

import orgapachecommonshttpclientNameValuePair;

import orgapachecommonshttpclientmethodsGetMethod;

import orgapachecommonshttpclientmethodsPostMethod;

public class BaiyouBBS {

static final String LOGON_SITE = "wwwqiluyiyoucom";

static final int LOGON_PORT = 80;

public Cookie[] login(String name, String pas) {

try {

HttpClient client = new HttpClient();

clientgetHostConfiguration()setHost(LOGON_SITE, LOGON_PORT);

PostMethod post = new PostMethod("/loggingphpaction=login");

clientexecuteMethod(post);

String responseString = new String(postgetResponseBody(), "gbk");

postreleaseConnection();

String formhash = getFormHash(responseString);

Systemoutprintln(formhash);

post = new PostMethod("/loggingphpaction=login&");

NameValuePair[] params = new NameValuePair[11];

params[0] = new NameValuePair("loginfield", "username");

params[1] = new NameValuePair("username", name);

params[2] = new NameValuePair("password", pas);

params[3] = new NameValuePair("referer", "indexphp");

params[4] = new NameValuePair("questionid", "0");

params[5] = new NameValuePair("answer", "");

params[6] = new NameValuePair("cookietime", "2592000");

params[7] = new NameValuePair("formhash", formhash);

params[8] = new NameValuePair("loginmode", "");

params[9] = new NameValuePair("loginsubmit", "true");

params[10] = new NameValuePair("styleid", "");

postsetRequestBody(params);

clientexecuteMethod(post);

// responseString = new String(postgetResponseBody(), "gbk");

postreleaseConnection();

GetMethod get = new GetMethod("/indexphp");

clientexecuteMethod(get);

responseString = new String(getgetResponseBody(), "gbk");

getreleaseConnection();

Systemoutprintln(responseString);

} catch (Exception e) {

eprintStackTrace();

}

return null;

}

public String getFormHash(String htmlContent) {

try {

int start = htmlContentindexOf("name=\"formhash\"");

start = htmlContentindexOf("value=\"", start) + 7;

int end = htmlContentindexOf("\"", start);

String formhash = htmlContentsubstring(start, end);

return formhash;

} catch (RuntimeException e) {

throw e;

}

}

public static void main(String[] args) {

new BaiyouBBS()login("zzzxxxzzz", "zzzxxxzzz");

}

}

DABAN RP主题是一个优秀的主题,极致后台体验,无插件,集成会员系统
网站模板库 » discuz 7.2 如何新建空白页面?就需要header和footer,中间空白,

0条评论

发表评论

提供最优质的资源集合

立即查看 了解详情