PHPCMS Two-time development notes

Source: Internet
Author: User

Phpcms Two development Notes

--soulsjie

Build a new site as an example to download the new Phpcms and explain how to use the PHPCMS for two development

First, download and install Phpcms

http://www.phpcms.cn/index.php?m=content&c=index&a=show&catid=19&id=51

After the download is complete, in the Web site root directory (take Phpstudy as an example root directory for WWW) to create our web site folder such as: Phpcmsstudy, unzip the downloaded Phpcms file, will unzip the file under the Install_ Copy all content from the package folder to the Phpcmsstudy folder, open the browser access http://localhost:9999/phpcmsstudy to install

Choose to install the new PHPCMS

Set up a database account, password, and administrator account and password

Installation Complete

Login background

Second, create a template

At this point, there is only one default template in the PHPCMS system. We need to create a new template for our website, the following steps are simple and quick:

Create a folder under the Web site root directory (WWW) \phpcmsstudy\phpcms\templates\ directory MyWeb (this folder is used to store templates for my web pages) and will templates\default\ Copy all content under the MyWeb folder

In phpcms background, the interface-----"template style will be added to a new template, rename it to" my page "

Set up------Site Administration--------Add a site

At this point our website template even if the new success

Third, new site

Prepare: Create a new MyWeb folder under the \phpcmsstudy\html\ folder

Set up------Site Administration-----In the background of phpcms add a site

Set the basic configuration as follows:

Choose a template style: my page

Click OK to complete the new site

Iv. Build Site Home

Refresh Interface Select "My Web Site"

Click Generate Home Page

Visit the site homepage

The homepage interface is as follows:

If you do not see the contents of the homepage when you click on the site homepage, check that the site domain name in the site settings is consistent with the directory

Five, modify the template for two times development

Modifying the template for my pages requires only the following files to be modified

Www\phpcmsstudy\phpcms\templates\myweb\content\

1. The homepage of the website mainly contains

1.1 header.html (Head of template homepage)

1.2 index.html (contents of template homepage)

1.3 footer.html (bottom of template homepage)

2. Column Home

Category.html

3. Articles List page

List.html

4. Article content page

Show.html

六、二次 development of commonly used labels

{The path to the Css_path}css file

{The path to the Js_path}js file

{Img_path} path to picture file

Get column name: {$CATEGORYS [654][catname]}

6.1 Obtain the column name and the article list according to CATID:

<div class= "Tongzhigongao" >

{pc:content action= "lists" catid= "654" order= "id DESC" num= "8"}

<ul class= "List" >

{Loop $data $k $v}

<li> <a href= "{$v [url]}" title= "{$v [title]}" target= "_blank" {title_style ($v [style])}>{str_cut ($v [ Title],}</a></li>

{/loop}

</ul>

{/PC}

</div>

6.2 Focus Chart Recommendations:

<div class= "Focuspic" >

{pc:content action= "position" posid= "1" order= "Listorder DESC" thumb= "1" num= "5"}

<div class= "Content" id= "Main-slide" >

<div class= "Changediv" >

{Loop $data $r}

<a href= "{$r [' url ']}" title= "{str_cut ($r [' title '],30)}" ></a>

{/loop}

</div>

</div>

{/PC}

</div>

6.3 Picture News Carousel

<div class= "Tongzhigongao" >

<div id= "video" class= "video" >

<div class= "slidebox-01" >

<ul class= "slidepic-01" >

{pc:content action= "lists" catid= "676" order= "UpdateTime DESC" moreinfo=1 thumb= "1" num= "3" return= "info"}

{Loop $info $v}

<li>

<span><a href= "{$v [' url ']}" target= "_blank" >{str_cut ($v [' title '],50)}</a></span>

<a href= "{$v [' url ']}" ></a>

</li>

{/loop}

{/PC}

</ul>

<div class= "slidebtn-01" >

<ul>

<li class= "Current" >1</li>

<li>2</li>

<li>3</li>

</ul>

</div>

</div>

<script type= "Text/javascript" >

$ (function () {

Picture tumbling around

var size = $ ('. Slidebtn-01>ul>li '). length;

var frist = 0;

var datetime;

$ ('. slidebtn-01 li '). MouseOver (function () {

Frist = $ ('. slidebtn-01 li '). index (this);

Showpic (frist);

}). eq (0). MouseOver ();

$ ('. slidebox-01 '). Hover (function () {

Clearinterval (datetime);

},function () {

datetime = SetInterval (function () {

Showpic (Frist)

frist++;

if (frist==size) {

frist=0;

}

},3000);

}). Trigger (' MouseLeave ');

function Showpic (frist) {

var imgheight = $ ('. slidebox-01 '). width ();

$ ('. slidepic-01 '). Stop (True,false). Animate ({left:-imgheight*frist},600)

$ ('. slidebtn-01 li '). Removeclass (' current '). EQ (frist), addclass (' current ');

};

});

</script>

</div>

</div>

Vii. folder description

Templates for sites under the Phpcms\templates folder

CSS, JS, pictures and other contents of the website under Statics folder

UploadFile folder to store uploaded files

HTML folder to store static HTML files generated by each site

Caches folder to store individual configuration files

20170625 Soulsjie Finishing

PHPCMS Two-time development notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.