织梦(Dedecms)建站教程
1织梦官网下载模板http://www.dedecms.com/
2.打开模板目录下的:uploads(把里面的内容复制到phpstudy-www的目录下)
3.修改phpstudy(网站的目录位置),打开localhost/install网站安装模板
4.采集网站 用小白兔软件 采集文件放在templets下(可以用别的网站采集软件,可以私聊免费给)
5.登录后台 更改系统基本参数(采集的文件夹名————更新主页模板、更新主页html
6.修改index.htm的js\\css\\image等文件位置(用织梦标签改)
{dede:global.cfg_templets_skin/}/static/
4.登陆后台,采集数据(注意查看采集网站的代码格式:utf8)
采集时要注意与后面调用的网站内容相匹配
5.采集成功后,导出数据
6.运用软件采集网站(改主页后缀名:index.html—-index.htm),查看网站,可能有些图片,没有采集过来,手动采集。这个查看代码快捷键:ctrl+u
7.栏目管理—批量增加顶级栏目
7,采集好的网站放到WWW目录下
8.修改dede后台默认目录—然后生成
9.修改index.htm的代码目录(包括js\\图片\\css)注意:目录位置错误ctrl+h
10.把网站头部、脚部,分别用head.htm\\footer.htm,调用出来
11.网站首页完整调用
12.修改头部导航栏(注意首页不是栏目)最好使用网站第一个ul替换
13.轮播图替换
1.在dede后台新建模型
2.栏目应用模型(属性隐藏),为了好看,在目录下新建article_article.htm
3.打开WWW下的目标目录下的include/extend.fun.php(打开文件后按E快速查找)
复制代码:
if(!function_exists(\’GetImgUrl\’))
{
function GetImgUrl($fieldname, $ftype = 1)
{
if($fieldname != \’\’)
{
$dtp = new DedeTagParse();
$dtp->LoadSource($fieldname);
if(is_array($dtp->CTags))
{
foreach($dtp->CTags as $ctag)
{
if($ctag->GetName() == \’img\’)
{
$width = $ctag->GetAtt(\’width\’);
$height = $ctag->GetAtt(\’height\’);
$imgurl = trim($ctag->GetInnerText());
$img = \’\’;
if($imgurl != \’\’)
{
if($ftype == 1)
{
$img .= $imgurl;
}
else
{
$img .= \'<img src=\”\’ . $imgurl . \’\” width=\”\’ . $width . \’\” height=\”\’ . $height . \’\” />\’;
}
}
}
}
}
$dtp->Clear();
return $img;
}
}
}
在ul里面更改dede轮播图路径、链接地址等
{dede:arclist typeid=13 row=5 orderby=\’pubdate\’ channelid=\’17\’ addfields=\’ljdz,lbt\’}
<li><a href=\”[field:ljdz/]\” target=\”_blank\”>(调用相应的栏目ID)
<img src=\”[field:lbt function=GetImgUrl(@me)/]\” width=\”1000\” height=\”350\”></a></li>
{/dede:arclist}
channelid=\’17\’ addfields=\’ljdz,lbt\’:这个是新建的模型ID和定义的名字
14.内容更改
需要更改3级(调用相应的栏目ID)
代码:
<div class=\”sy fl\”>
<div class=\”rdxw fl\”>
<div class=\”title fl\”><h3>{dede:type typeid=\’12\’}<a href=\'[field:typeurl/]\’>[field:typename/]</a>{/dede:type}</h3>{dede:type typeid=\’12\’ }<a href=\”[field:typeurl/]\” class=\”more\”>{/dede:type}<img src=\”{dede:global.cfg_templets_skin/}/static/picture/more.jpg\”></a></div>
<div class=\”rdxw-list fl\”>
{dede:arclist typeid=14 row=1 flag=\’h\’ orderby=\’pubdate\’ type=\’image\’ infolen=20 }
<div class=\”rdxw-first fl\”>
<a href=\”[field:arcurl/]\”>
<div class=\”rdxw-pic fl\”><img src=\”[field:picname/]\” style=\”max-width:180px;max-height:120px;min-width:180px;min-height:120px;\”></div>
<div class=\”rdxw-txt fl\”>
<h3>[field:title/]</h3>
<p>[field:info/]<span>[详细]</span></p>
</div>
</a>
</div>
{/dede:arclist}
<ul>
{dede:arclist typeid=14 row=5 infolen=20 orderby=\’pubdate\’ }
<li> <a href=\”[field:arcurl/]\”>[field:title/]</a><i>[field:pubdate function=MyDate(\’m-d\’,@me)/]</i> </li>
{/dede:arclist}
</ul>
第一级为:指定栏目名和链接
{dede:type typeid=\’3\’}<a href=\'[field:typeurl/]\’>[field:typename/]</a>{/dede:type}
第二级为:文章内容调用(注意文章类型为头条,调用文档带图片)
第三级为:文章内容调用(注意标题字数)
个人笔记,仅供参考使用
php手把手教你做网站(一)php的安装
如果你是一名初学者,或者没有什么经验的开发人员,相信做的这份教程应该会对你有所帮助,使你的水平得到提升。
这里教大家使用php7.4+mysql8.0.27+jquery+iis+layui+thinkphp6搭建自己的网站
环境搭建:
我是在iis运行的php,如果想省事可以直接安装xampp,作为开发人员不同的环境都是要安装的,只要严格区分了大小写,php在不同平台运行是没有什么问题的,在这里向大家介绍iis运行php
我下载的是VC15 x64 Non Thread Safe,解压以后找到php.ini-development 改为php.ini,然后打开配置该文件
1、找到date.timezone = 去掉前边的“;” 后边= PRC 或者Asia/Shanghai;
2、找到session.save_path 去掉;=\”E:\\xampp\\tmp\” 路径自己填写注意格式;
3、short_open_tag = Off 默认是不支持短标签的,<?php ?> 要先支持<??>,这里改成on;
4、找到extension=bz2 extension=curl extension=gd2 extension=mbstring extension=mysqli extension=exif extension=openssl extension=pdo_mysql extension=sockets extension=xmlrpc去掉前边的分号
5、打开iis 新建站点,点击该站点
如图找到处理映射程序
图1 点击新建站点,会出现处理映射程序
双击点开,找到右侧出现的添加模块映射,出现如图的添加
图2 添加模块映射
1的位置必须填写*.php;
2模块选择FastCgiMoule,这里可能会出现没有这个选项的情况,应该是安装iis的时候,没有勾选CGI,需要再次安装,如果安装成功会出现图1中CGI图标;
3的可执行文件选择你php的目录,右下角有个选择默认是选择dll,我们选择exe ,文件选项中会出现php-cgi.exe,双击选择即可;
4的名称可以随便填写,还是尽可能避免使用中文,可以写php的版本;
接下来直接确定,确定完成添加。
点开新建站点的默认文档,查看是否有index.php如果没有点击右侧的添加,该名称会作为php网站的首页文件使用。
测试:
在站点根目录下新建index.php 代码如下:
<?php
echo phpinfo();
?>
网址使用127.0.0.1 或者localhost ,如果显示php的信息说明环境安装成功!
我们可以通过修改web.config来修改iis的配置;
1、使用php的版本
<handlers>
<add name=\”php7.4\” path=\”*.php\” verb=\”*\” modules=\”FastCgiModule\” scriptProcessor=\”E:\\php-7.4\\php-cgi.exe\” resourceType=\”Unspecified\” />
</handlers>
这里对应的是添加模块映射。
2、IIS URL重写
<rule name=\”tags\” stopProcessing=\”true\”>
<match url=\”tags/(.*)$\” />
<action type=\”Rewrite\” url=\”index.php/tags/index/c/{R:1}\” />
</rule>
<rule name=\”OrgPage\” stopProcessing=\”true\”>
<match url=\”^((?!public).*?)$\” />
<conditions logicalGrouping=\”MatchAll\”>
<add input=\”{HTTP_HOST}\” pattern=\”^(.*)$\” />
<add input=\”{REQUEST_FILENAME}\” matchType=\”IsFile\” negate=\”true\” />
<add input=\”{REQUEST_FILENAME}\” matchType=\”IsDirectory\” negate=\”true\” />
</conditions>
<action type=\”Rewrite\” url=\”index.php/{R:1}\” />
</rule>
要注意顺序,name是不相同的,复制的时候注意改下name
3、文件夹下禁止脚本运行
在该文件夹下放入web.config,代码如下:
<?xml version=\”1.0\” encoding=\”UTF-8\”?>
<configuration>
<system.webServer>
<handlers accessPolicy=\”Read\” />
</system.webServer>
</configuration>
本文作者及来源:Renderbus瑞云渲染农场https://www.renderbus.com
文章为作者独立观点不代本网立场,未经允许不得转载。