phpcms 2008网站建设常用代码收集
碎片:
文章摘要: {str_cut($r[description],xx,'...')}
文章网址: {$r[url]}
文章标题: {$r[title]} {str_cut($r[title],44,'')}
文章时间:{date('Y-m-d', $r[updatetime])}
模板路径:{SKIN_PATH}
调用头部页面 :{template 'phpcms','header'}
商务通链接网址:/swt/go.php?from=xxx
设定域名:
栏目名称:{$catname}
栏目+列表当前位置:{catpos($catid)}
文章页面当前位置:{catpos($r['catid'])}
tag_标签内容列表
select * from `phpcms_content` a,`phpcms_content_tag` k where a.contentid=k.contentid and a.status=99 and k.tag='$tag' order by a.contentid desc
===============================================
category.html常用标签:
==============================================
调用栏目网址:{$CATEGORY[$catid][url]} {$CATEGORY[112][url]}
调用栏目名称:{$CATEGORY[$catid][catname]} {$CATEGORY[112][catname]}
调用热点文章(按每月点击次数排序):
{get sql=" SELECT a.* FROM `phpcms_content` a, `phpcms_content_count` p WHERE a.contentid=p.contentid AND a.status=99 ORDER BY p.hits_month DESC limit 2,5" }
调用分类ID为36的一条新闻文章1条:
{get sql="select * from `phpcms_content` where status=99 and catid=36 ORDER BY updatetime DESC limit 0,1"}
调用某个栏目下的普通文章5条,并分页显示:
{get sql="select * from `phpcms_content` where status=99 and catid=80 ORDER BY updatetime DESC" rows="5" page="$pages"}
调用缩略图文章1条:
{get sql="select title,url,thumb,description from `phpcms_content` where status=99 and thumb!='' and catid=xxxx ORDER BY updatetime DESC limit 0,1" } {$r[thumb]}
--------------------------------------------------
index.html常用标签:
----------------------------------------------------
友情链接:
{get sql="select * from `phpcms_link`where passed=1 order by listorder"}
链接网址: {$r[url]}
链接名:{$r[name]}
幻灯片:
{get sql="SELECT a.title,a.url,a.thumb FROM `phpcms_content` a, `phpcms_content_position` p WHERE a.contentid=p.contentid AND p.posid=2 AND a.status=99 AND `thumb`!='' ORDER BY a.contentid DESC"}
linkarr[{$n}] = "{$r[url]}";
picarr[{$n}] = "{$r[thumb]}";
网站热门关键词:
{get sql="select tag,hits from phpcms_keyword order by listorder desc,hits desc" rows="10"}
{$r[tag]}
{$r[hits]}
{/get}
获取父栏目下的子级栏目:
{get sql="select * from `phpcms_category` where parentid =$catid order by listorder"}
{get sql="select * from `phpcms_content` where status=99 and catid = $r[catid] ORDER BY updatetime DESC" rows="4" return="ar"}
栏目链接网址 {$ar[url]}
栏目名称 {$ar[catname]}
{/get}
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
list.html 常用标签:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
当前栏目文章每页分10条的分页代码
{get sql="select * from `phpcms_content` where catid = $catid and status=99 order by updatetime desc" rows="10" page="$pages" }
分页:{$pages}
推荐阅读;首页推荐posid=1 首页焦点posid=2 首页头条posid=3 列表页推荐posid=4 内容页推荐posid=5
{get sql="SELECT a.* FROM `phpcms_content` a, `phpcms_content_position` p WHERE a.contentid=p.contentid AND p.posid=1 AND a.status=99 AND a.catid=39 order by updatetime desc" rows="1"}
{/get}
4、自定义返回变量,示例(调用栏目ID为1通过审核的10条信息,标题长度不超过25个汉字,显示更新日期,返回变量为 $v):
{get sql="select * from phpcms_content where catid=1 and status=99 order by updatetime desc" rows="10" return="v"}标题:{str_cut($v[title], 50)} URL:{$v[url]} 更新日期:{date('Y-m-d', $v[updatetime])} {/get}
5、调用同一帐号下的其他数据库,示例(调用数据库为bbs,分类ID为1的10个最新主题,主题长度不超过25个汉字,显示更新日期):{get dbname="bbs" sql="select * from cdb_threads where fid=1 order by dateline desc" rows="10"}主题:{str_cut($r[subject], 50)} URL:http://bbs.phpcms.cn/viewthread.php?tid={$r[tid]} 更新日期:{date('Y-m-d', $r[dateline])} {/get}
6、调用外部数据,示例(调用数据源为bbs,分类ID为1的10个最新主题,主题长度不超过25个汉字,显示更新日期):{get dbsource="bbs" sql="select * from cdb_threads where fid=1 order by dateline desc" rows="10"}主题:{str_cut($r[subject], 50)} URL:http://bbs.phpcms.cn/viewthread.php?tid={$r[tid]} 更新日期:{date('Y-m-d', $r[dateline])} {/get}
7、调用ecshop数据,示例(调用数据源为ecshop,调用产品库中最新的5个产品):{get dbsource="ecshop" sql="SELECT `goods_id`,`goods_name`,`goods_thumb` FROM `ecs_goods` ORDER BY `goods_id` DESC" rows="5" }产品ID:{$r[goods_id]} 名称:{$r[goods_name]} 产品图片:{$r[goods_thumb]} {/get}
获取当前大栏目 下的各个小栏目的文章;
{get sql="select * from `phpcms_content` where status=99 and catid in($arrchildid1) ORDER BY inputtime asc" rows="1"}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
show.html页面标签:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
文章标题:{if $titleintact}{$titleintact}{else}{$title}{/if}
文章来源:{$copyfrom}
文章作者:{$author}
更新时间:{date('Y-m-d', $r[updatetime])}
文章内容:{$content}
上一篇:
{get sql="SELECT * FROM `phpcms_content` WHERE `contentid` {$r[title]}
下一篇:
{get sql="SELECT * FROM `phpcms_content` WHERE `contentid` > '$contentid' and status = 99 ORDER BY inputtime DESC" rows="1"}
{$r[title]}
相关文章:
{get sql="select * from `phpcms_content` where status=99 and catid=$catid ORDER BY updatetime DESC limit 0,10"}
本文标签/关键字:
{get sql="SELECT p.tag FROM `phpcms_content` a, `phpcms_content_tag` p WHERE a.contentid=p.contentid AND a.status=99 order by updatetime desc" rows="1"}

What’s still popular is the ease of use, flexibility and a strong ecosystem. 1) Ease of use and simple syntax make it the first choice for beginners. 2) Closely integrated with web development, excellent interaction with HTTP requests and database. 3) The huge ecosystem provides a wealth of tools and libraries. 4) Active community and open source nature adapts them to new needs and technology trends.

PHP and Python are both high-level programming languages that are widely used in web development, data processing and automation tasks. 1.PHP is often used to build dynamic websites and content management systems, while Python is often used to build web frameworks and data science. 2.PHP uses echo to output content, Python uses print. 3. Both support object-oriented programming, but the syntax and keywords are different. 4. PHP supports weak type conversion, while Python is more stringent. 5. PHP performance optimization includes using OPcache and asynchronous programming, while Python uses cProfile and asynchronous programming.

PHP is mainly procedural programming, but also supports object-oriented programming (OOP); Python supports a variety of paradigms, including OOP, functional and procedural programming. PHP is suitable for web development, and Python is suitable for a variety of applications such as data analysis and machine learning.

PHP originated in 1994 and was developed by RasmusLerdorf. It was originally used to track website visitors and gradually evolved into a server-side scripting language and was widely used in web development. Python was developed by Guidovan Rossum in the late 1980s and was first released in 1991. It emphasizes code readability and simplicity, and is suitable for scientific computing, data analysis and other fields.

PHP is suitable for web development and rapid prototyping, and Python is suitable for data science and machine learning. 1.PHP is used for dynamic web development, with simple syntax and suitable for rapid development. 2. Python has concise syntax, is suitable for multiple fields, and has a strong library ecosystem.

PHP remains important in the modernization process because it supports a large number of websites and applications and adapts to development needs through frameworks. 1.PHP7 improves performance and introduces new features. 2. Modern frameworks such as Laravel, Symfony and CodeIgniter simplify development and improve code quality. 3. Performance optimization and best practices further improve application efficiency.

PHPhassignificantlyimpactedwebdevelopmentandextendsbeyondit.1)ItpowersmajorplatformslikeWordPressandexcelsindatabaseinteractions.2)PHP'sadaptabilityallowsittoscaleforlargeapplicationsusingframeworkslikeLaravel.3)Beyondweb,PHPisusedincommand-linescrip

PHP type prompts to improve code quality and readability. 1) Scalar type tips: Since PHP7.0, basic data types are allowed to be specified in function parameters, such as int, float, etc. 2) Return type prompt: Ensure the consistency of the function return value type. 3) Union type prompt: Since PHP8.0, multiple types are allowed to be specified in function parameters or return values. 4) Nullable type prompt: Allows to include null values and handle functions that may return null values.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Dreamweaver Mac version
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

WebStorm Mac version
Useful JavaScript development tools