自己设计的风格网站 怎么做成DEDECMS的模板?

自己设计的风格网站 怎么做成DEDECMS的模板?,第1张

利用模板。目前PHP的模板可以说是很多了,有功能强大的smarty,还有简单易用的smarttemplate等。它们每一种模板,都有一个获取输出内容的函数。我们生成静态页面的方法,就是利用了这个函数。用这个方法的优点是,代码比较清晰,可读性好。

这里我用smarty做例子,说明如何生成静态页:

<php

require("smarty/Smartyclassphp");

$t = new Smarty;

$t->assign("title","Hello World!");

$content = $t->fetch("templates/indexhtm");

//这里的 fetch() 就是获取输出内容的函数,现在$content变量里面,就是要显示的内容了

$fp = fopen("archives/2005/05/19/0001html", "w");

fwrite($fp, $content);

fclose($fp);

>

Hi,可以使用dedecms后台的单页面做

我把源码贴给你吧

这是txt版本的,

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

{dede:channel type='top' row='13'}[field:typeurl/]

{/dede:channel}{dede:channel type='son' row='10' typeid='1'}[field:typeurl/]

{/dede:channel}{dede:channel type='son' row='10' typeid='2' }[field:typeurl/]

{/dede:channel}{dede:channel type='son' row='10' typeid='3' }[field:typeurl/]

{/dede:channel}{dede:channel type='son' row='10' typeid='19' }[field:typeurl/]

{/dede:channel}{dede:channel type='son' row='10' typeid='15' }[field:typeurl/]

{/dede:channel}{dede:channel type='son' row='10' typeid='4' }[field:typeurl/]

{/dede:channel}{dede:channel type='son' row='10' typeid='5' }[field:typeurl/]

{/dede:channel}{dede:arclist row='3000' typeid='1' orderby='pubdate'}

[field:arcurl/]

{/dede:arclist}{dede:arclist row='3000' typeid='2' orderby='pubdate'}

[field:arcurl/]

{/dede:arclist}{dede:arclist row='3000' typeid='3' orderby='pubdate'}

[field:arcurl/]

{/dede:arclist}{dede:arclist row='3000' typeid='5' orderby='pubdate'}

[field:arcurl/]

{/dede:arclist}{dede:arclist row='3000' typeid='19' orderby='pubdate'}

[field:arcurl/]

{/dede:arclist}{dede:arclist row='3000' typeid='4' orderby='pubdate'}

[field:arcurl/]

{/dede:arclist}

这是xml版本的

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

<xml version="10" encoding="gb2312">

<xml-stylesheet type="text/xsl" href="sitemapxsl">

<urlset xmlns="

<url>

<loc>

<priority>10</priority>

<lastmod>{dede:php} $_date = date('Y-m-d',time());

echo $_date;

{/dede:php}</lastmod>

<changefreq>Always</changefreq>

</url>

{dede:channelartlist row='13'}

<url>

<loc>{dede:field name='typeurl'/}</loc>

<priority>10</priority>

<lastmod>{dede:php} $_date = date('Y-m-d',time());

echo $_date;

{/dede:php}</lastmod>

<changefreq>Always</changefreq>

</url>

{/dede:channelartlist}

{dede:channelartlist type='son' row='10' typeid='1'}

<url>

<loc>{dede:field name='typeurl'/}</loc>

<priority>10</priority>

<lastmod>{dede:php} $_date = date('Y-m-d',time());

echo $_date;

{/dede:php}</lastmod>

<changefreq>Always</changefreq>

</url>

{/dede:channelartlist}

{dede:channelartlist type='son' row='10' typeid='2' }

<url>

<loc>{dede:field name='typeurl'/}</loc>

<priority>10</priority>

<lastmod>{dede:php} $_date = date('Y-m-d',time());

echo $_date;

{/dede:php}</lastmod>

<changefreq>Always</changefreq>

</url>

{/dede:channelartlist}

{dede:channelartlist type='son' row='10' typeid='3' }

<url>

<loc>{dede:field name='typeurl'/}</loc>

<priority>10</priority>

<lastmod>{dede:php} $_date = date('Y-m-d',time());

echo $_date;

{/dede:php}</lastmod>

<changefreq>Always</changefreq>

</url>

{/dede:channelartlist}

{dede:channelartlist type='son' row='10' typeid='19' }

<url>

<loc>{dede:field name='typeurl'/}</loc>

<priority>10</priority>

<lastmod>{dede:php} $_date = date('Y-m-d',time());

echo $_date;

{/dede:php}</lastmod>

<changefreq>Always</changefreq>

</url>

{/dede:channelartlist}

{dede:channelartlist type='son' row='10' typeid='15' }

<url>

<loc>{dede:field name='typeurl'/}</loc>

<priority>10</priority>

<lastmod>{dede:php} $_date = date('Y-m-d',time());

echo $_date;

{/dede:php}</lastmod>

<changefreq>Always</changefreq>

</url>

{/dede:channelartlist}

{dede:channelartlist type='son' row='10' typeid='4' }

<url>

<loc>{dede:field name='typeurl'/}</loc>

<priority>10</priority>

<lastmod>{dede:php} $_date = date('Y-m-d',time());

echo $_date;

{/dede:php}</lastmod>

<changefreq>Always</changefreq>

</url>

{/dede:channelartlist}

{dede:channelartlist type='son' row='10' typeid='5' }

<url>

<loc>{dede:field name='typeurl'/}</loc>

<priority>10</priority>

<lastmod>{dede:php} $_date = date('Y-m-d',time());

echo $_date;

{/dede:php}</lastmod>

<changefreq>Always</changefreq>

</url>

{/dede:channelartlist}

{dede:arclist row='3000' typeid='1' orderby='pubdate'}

<url>

<loc>[field:arcurl/]</loc>

<priority>08</priority>

<lastmod>[field:pubdate function=mydate('Y-m-d',@me)/]</lastmod>

<changefreq>daily</changefreq>

</url>

{/dede:arclist}

{dede:arclist row='3000' typeid='2' orderby='pubdate'}

<url>

<loc>[field:arcurl/]</loc>

<priority>08</priority>

<lastmod>[field:pubdate function=mydate('Y-m-d',@me)/]</lastmod>

<changefreq>daily</changefreq>

</url>

{/dede:arclist}

{dede:arclist row='3000' typeid='3' orderby='pubdate'}

<url>

<loc>[field:arcurl/]</loc>

<priority>08</priority>

<lastmod>[field:pubdate function=mydate('Y-m-d',@me)/]</lastmod>

<changefreq>daily</changefreq>

</url>

{/dede:arclist}

{dede:arclist row='3000' typeid='5' orderby='pubdate'}

<url>

<loc>[field:arcurl/]</loc>

<priority>08</priority>

<lastmod>[field:pubdate function=mydate('Y-m-d',@me)/]</lastmod>

<changefreq>daily</changefreq>

</url>

{/dede:arclist}

{dede:arclist row='3000' typeid='19' orderby='pubdate'}

<url>

<loc>[field:arcurl/]</loc>

<priority>08</priority>

<lastmod>[field:pubdate function=mydate('Y-m-d',@me)/]</lastmod>

<changefreq>daily</changefreq>

</url>

{/dede:arclist}

{dede:arclist row='3000' typeid='4' orderby='pubdate'}

<url>

<loc>[field:arcurl/]</loc>

<priority>08</priority>

<lastmod>[field:pubdate function=mydate('Y-m-d',@me)/]</lastmod>

<changefreq>daily</changefreq>

</url>

{/dede:arclist}

{dede:arclist row='3000' typeid='15' orderby='pubdate'}

<url>

<loc>[field:arcurl/]</loc>

<priority>08</priority>

<lastmod>[field:pubdate function=mydate('Y-m-d',@me)/]</lastmod>

<changefreq>daily</changefreq>

</url>

{/dede:arclist}

</urlset>

HTML的版本

<!doctype html>

<html lang="zh-cn">

<head>

<meta charset="gb2312">

<title>{dede:globalcfg_webname/}</title>

<meta name="keywords" content="{dede:globalcfg_keywords/}" />

<meta name="description" content="{dede:globalcfg_description/}" />

<meta name="Author" content="杨雨">

<meta name="Copyright" content="http://itbyccom">

</head>

<body>

<h1><a title="{dede:globalcfg_webname/}" href="

{dede:globalcfg_webname/}</a></h1>

<nav>

{dede:channelartlist }

<ul onmouseover="ShowMenuDd(this)" class="repeatItem">

<li><a title="{dede:field name='typename'/}" href="{dede:field name='typeurl'/}">{dede:field name='typename'/}</a></li>

<li><ol>{dede:sql sql='Select from `dede_arctype` where reid=~id~ ORDER BY id'}

<li>

<a class="link" href="[field:typedir function="cn_substr(@me,200,9) " /]">[field:typename/]</a>

</li>

{/dede:sql}</ol></li>

</ul>

{/dede:channelartlist}

</nav>

<div>

<ol>{dede:arclist orderby='pubdate' row=100000 }

<li>

<a title="[field:fulltitle/]" href="[field:arcurl/]">[field:fulltitle/]</a>

<time>[field:pubdate function=MyDate('y-m-d',@me)/]</time>

</li>{/dede:arclist}

</ol>

</div>

</body>

</html>

做模版文件只需要修改以下几个文件就可以了

indexhtm、list_articlehtm、article_articlehtm文件

修改好后,把templets--->default中的文件覆盖掉就可以了

我也是半路出家的,如果想用DEDECMS做网站,你可以参考以下几个步骤:

第一,你可以先下载一个服务器软件,在你的电脑里安装,这样的话,暂时就不用买空间和域名了。服务器软件可以到这里下载:http://phpnoworg/ 点那个最新版的最新版本:PHPnow 155_1 ,里面有安装说明,根据安装说明安装好

第二,好了,如果你现在安装好了服务器,你就有本地空间和本地域名和数据库了,这时候你就要到DEDECMS里下载最新版的程序了。可以到这里下载:http://wwwdedecmscom/products/dedecms/downloads/ 点那个最新版的:DedeCMS V56正式版 根据dedecms的说明在刚才安装好的服务器里安装好这个dedecms程序。

第三,安装好DEDECMS之后,你就要登录程序的后台,在栏目里添加你想要栏目,添加完栏目之后,再在相对应发布你想要的文档内容,最后你就在左边的生成里,点生成主页、栏目、和文档。这样你就可以打开主页,可以看到你发布的内容了。

第四、可以根据自己的需要对、程序作修改。一般都用PS软件,程序修改用一个dreamwaver就行了。dreamwaver就要是用来修改风格文件。

第五、弄熟悉之后,你可以尝试去仿制别人的网站,又或者根据自己需要自己设计。

最后,如果有问题或者想学的话,我这里有一套DEDECMS的教学,从菜鸟到大师的教程。可以发邮件索取。邮箱系:sujian919#qqcom(将#换成@)下面这个就是我用DEDECMS做的网站,仿制别人的。很简单

刚帮你看了一下。wwwabccom/about 这种其实是这种wwwabccom/about/indexhtml如果你想做成这种wwwabccom/abouthtml很简单。只需要在后台。栏目管理,栏目修改。常规选项里面有个默认页的名称。默认是indexhtml你修改成abouthtml。更多dedecms问题可以http:qinzicecom

qinzicecom

你在这里提问我将为你解答。一般简单问题就百度。难的有针对性的我会在论坛给你解答

DABAN RP主题是一个优秀的主题,极致后台体验,无插件,集成会员系统
网站模板库 » 自己设计的风格网站 怎么做成DEDECMS的模板?

0条评论

发表评论

提供最优质的资源集合

立即查看 了解详情