Phpcms V9 Study Summary (Turn)

Source: Internet
Author: User
Tags pear

Transferred from: http://www.cnblogs.com/Braveliu/p/5074930.html

In the implementation of the PHPCMS Web site process, according to business needs, we encounter a lot of problems, hereby summarized as follows, so that we can refer to the study.

Brief analysis on the catalogue of "1" phpcms V9 system

Before you look at all the questions, look at the system's file directory structure, as shown in:

"2" Want to change the default template style what to do?

PHPCMS V9 The default page template in the Phpcms directory under the Templates folder. If you want to change the template, you can overwrite the default folder and the static folder, respectively, according to the file organization structure of the new template. Then to the Web background management platform, switch page style, you can see the new Page Template homepage style.

The steps for background management are as follows: set-up site management-------style configuration (toggle style, of course, style is added to the code directory by yourself)

"3" How to modify Wampserver default folder for Web pages?

Left-click and click www Directory to open the Wampserver folder (for example, C:\wamp\www) that hosts the Web page by default.

The actual work, the folder that holds the webpage may not be under the WWW directory, or the Wampserver installation of the disk character space is too small, for the future extensibility of the site to consider, want to change the actual path of the site and so on, need to modify the Wampserver default folder for the Web page. The modification steps are divided into the following sections:

1. Open the Wampserver installation directory, and then open the "script" folder inside, with notepad++ open the config.inc.php file inside, search "Wwwdir", about 61 lines found "$wwwDir = $c _installdir .‘ /www '; ", change to the directory we want to, such as change to D:\webdirectory, the corresponding code is:

1 $wwwDir = $c _installdir. ' D/webdirectory ';

2. Open the Wampserver installation directory, locate the folder (installed locally on the C Drive) C:\wamp\bin\apache\apache2.4.9\conf, open the httpd.conf file with notepad++, search for "DocumentRoot ", about 230 lines, modified to:

1 DocumentRoot "d:/webdirectory/"

Then search for "Directory", about 252 lines, modified to:

1 <directory "d:/webdirectory/" >

3. Restart all service restart all services until the icon color turns green to normal. Otherwise, first check to see if the modified directory already exists, and then check that the two steps above are correct.

4. Check the results of the changes. Then click on "www directory", you can see the folder should be opened for the directory just modified. In addition, in the browser URL bar input: http://localhost/phpcms/index.php View page Default template homepage is normal.

"3" External network access to our configured Wampserver server swollen?

After installing Wampserver and phpcms, we can access the homepage of the website in the native browser, but when we try to access the configured server through the extranet, we find that the Internet access will prompt permission not to allow. This is because the Wampserver default is to allow only 127.0.0.1 access, that is, only native access. So, how to modify it? Find C:\wamp\bin\apache\apache2.4.9\conf, with notepad++ open httpd.conf file, search "Onlineoffline", about 278 lines, shielding require local, Add as require all granted. As shown in the following:

"4" Upload file size is limited what to do?

As shown, the default single file size is 2MB. Modify the nearby configuration steps as follows:

1. Modify PHPCMS Background configuration

PHPCMS Background Management--Site Settings----Modify the attachment size to allow attachment sizes and enter values such as 10240. (Of course, this value can be any size you want)

2. Modify the php.ini file configuration

    • Open the PHP configuration file php.ini (file path:). Search for "upload_max_filesize" and change this value to 10240 (as above, the value can be changed according to your needs).
    • Continue searching for "post_max_size" in php.ini and change this value to 300000. (The maximum limit for form submissions, which is not to limit the size of individual files being uploaded, but to limit the data submitted by the entire form.) )

Note: Be sure to post_max_size >= upload_max_filesize, that is, the former must be greater than the latter. Also, be sure to restart the server after you modify it.

"5" website in the process of development, it is likely to need to modify the domain name many times, then modify the domain name should be how to set it?

The steps to modify a domain name are divided into the following:

1. Modify the/caches/configs/system.php inside all related to the domain name, the former old domain name to be modified as a new domain.

2. Background Settings-site management. Make changes to the corresponding site domain name.

3. Update the system cache. Click the "Update Cache" button in the upper-right corner of the background.

4. Switch to Content--attachment management--attachment address substitution. Replace the attachment address in bulk with the new address.

5. Switch to Content--bulk update URL. Update the address of all articles automatically.

Domain name modification, you can use the browser to access the domain name, test the effect.

Method of "6" site migration

Site migration is more important, specific can be divided into two aspects: the source site preparation content, the new site deployment tasks.

The source site preparation content, probably listed as a few points:

1. Backing Up the database

Log on to the Web site management platform, in the Database Tools bar under the Extensions menu, select the data link pool that you are using in the Select Data Link pool area, and the corresponding form file name appears below, all selected and then click Start Backup Data, and a prompt for backup success pops up after the backup completes. In this case, one (or more) SQL-formatted files will be generated in the "Caches/bakup" folder of the website.

2. Download the database

After completing the above backup, the system will automatically press the database by 2M (that is, 2048KB) to the size of the file, after the backup can click the corresponding file after the "download" connection to download the corresponding SQL format of the backup, generally there will be more than one file, note the serial number after the backup file. Of course, you can also use the FTP software to download (or copy) once.

3. Download the site template

The style and style of the website are stored in the template file, the template file is stored in "phpcms/templates", and the folder is downloaded (or copied) via FTP.

4. Download the CSS File

If the site has modified the location and effect of the template, you need to download (copy) The CSS file, the folder needs to be backed up as "statics/css".

5. Download the database configuration file

The database configuration file under the "Caches/configs" folder "Database.php", here is the name and header of the database, the format is as follows, download (or copy) after the new installation software to use.

1 <?php 2 return Array (3     ' default ' = = Array (4         ' hostname ' = ' localhost ', 5         ' port ' = 3306, 6
    ' database ' = ' phpcmsv9 ', 7         ' username ' + ' root ', 8         ' password ' = ', ' 9         ' tablepre ' = ' v9_ ', 10         ' charset ' = ' GBK ', one         ' type ' = ' mysql ', '         debug ' = ' true,13         ' pconnect ' + 0,14         ' AutoConnect ' = 015         );?>

6. Download (copy) the attachment

Phpcms V9 Default Attachment folder is "UploadFile", the original picture, uploaded files are in this folder, need to download (or copy).

The deployment task for the new site is roughly divided into several steps:

1. Install the website program

Install Phpcms V9 with the original website characters on the new website, use the database name and header when setting up the database, using the contents of (5) above.

2. Upload the source site backup data

Upload (paste) the backed up SQL file to the new Web site "caches/bakup" folder.

3. Upload the source site template

Upload (paste) the template file from the original site to the "phpcms/templates" folder.

4. Upload the source Web site CSS File

If you do not have a CSS that uses the default program, upload (paste) the backed up CSS to "statics/css"

5. Uploading Attachments

Upload (paste) the downloaded "UploadFile" folder to the new Web site root directory.

6. Recovering data

Log in to the background of the new site, select data import from the database Tools under the Extensions menu, select the Backup data to upload below, check whether it is complete, select all, and then click Recover to restore the data.

7. Update the site cache

After the data recovery, please update the whole station buffer, and then check the corresponding column data is completed.

8. Generate websites and columns and home page

After checking the settings of the website, the Web page, columns and homepage of the website can be generated.

This is the end of the site migration.

"7" Want to modify the homepage layout of the page, etc., where should I start?

In the Default/content directory, there is a index.html file, which is the home page template.

Also, in this directory, there is a header.html file, which is the head of the Web page.

In this directory, there is a footer.html file, which is the bottom of the Web page.

In the Static/css directory, there is a Web page style adjustment file, which is a variety of CSS type files.

So, what kind of style file does the Web page use specifically? You can use the browser to open the Web page, and then in the fast mode (note and IE compatibility mode difference), right-click on the "Review element", and then look at the changes in the style of the part is the CSS file control, so that the CSS file and HTML file dependencies can be found, You can then adjust the contents of the CSS file to suit your needs.

For an HTML file, refer to the "HTML5"

For CSS files, refer to the article "CSS"

"8" How to modify the logo icon of Phpcms v9 system?

Modify logo icon? First, you have to figure out how the logo is added to the website.

Anything you see is not a matter of reason, and of course, spiritual and material, like love and money. So, logo icon is no exception, you can certainly have such a picture. All right! Since there is such a picture, where do you put it? Analysis of the Phpcms v9 file directory structure, you can probably guess this picture should be placed in the \static\images directory, specifically? Search again, oh yes, she's in the V9 folder. Hmm, she silently "hide" here, play her irreplaceable role, it can be described as a profound web site, the system division of different ha.

Think again, how does the Web page apply to her? Oh, well, this has to be studied specific Web files, such as the \phpcms\templates\default\content\header.html file here, with notepad++ Open this file content, search string "logo", um, This is probably the line of code:

<div class= "logo" ><a href= "{siteurl ($siteid)}/" ></a> </div>

Someone this time brainwave, will say: "You a liar ~ I swollen do you know is this header.html file?" "asked the see around corners, asked the words of the silent choke." Who's asking? You stand out, I don't hit you. In fact, hit you because you asked the question before the feeling, I would like to strive to clarify that I am not a veritable liar.

Open the browser, enter http://localhost/phpcms/index.php carriage return, we can see the homepage page of the website, if not see, please check whether the Wampserver server on your machine has started normally. When you see the homepage and then right-click anywhere on the page, look for < review elements > lines, what? Wood to see? Really can't find it? That means your browser is currently in IE compatibility mode, please switch browser to speed mode first. About browser mode switching please ask yourself Niang, because each browser's operation seems to be different, depending on the browser you are using to switch. After switching, look for < review elements > lines, click Select, see the right side of the interface as shown:

The so-called censorship element, that is, the right side of the individual tags or blocks and so on the left side of the page element is one by one corresponding, when the mouse moves to the right of the specific block or label area, the left page will be locked to the specific element object, the entire process of performance equivalent to the role of review. OK, when the focus on the red box line, we can see the left page is selected is the system's logo icon, then look at the SRC value content, then at least one point, the name of this icon is the logo, the type of JPG, the directory is stored: \phpcms\statics\ Images\v9 Well, it also verifies that just about the logo storage location of speculation.

Next, as we already know just right to view the webpage file is index.html, God horse? You don't know that yet? Then you fold back to see the first question of this article. Now open \phpcms\templates\default\content\index.html file with notepad++, bold search "class=" logo "", eh huh? Can't find them? Can't even find it? Isn't this the page that you just reviewed? Please check again, after the check is certainly the index.html. So where is the problem? It seems to have to analyze the index.html file, wow ~ so much content, where exactly to start? A little confused. Do not worry, do not flustered, do not get lucky, since do not know from the beginning of the beginning Bai ~ Ah, this time to be calm, often especially this time only test a person can do big things. Starting with the first line, the first line reads:

{Template "content", "header"}

Oh, no! The general structure of the HTML file should be first head, then body, even if there is no head, at least the body should exist. If you do not understand this, then you will have to make a the world of my first HTML page. In the index.html search "head", Wood found, and then search "body", also wood found, it seems there is another mystery! Drink a cup of water, stretch, afternoon tea? Let me have some fruit first.

From the structure analysis of the HTML document, you have to start with the first line. Just on the road, do not understand this line of code why? Ask the Niang, do not ask Google, what era has not solved the problem! Through the network, this code is called (equivalent to the header file) root directory under the phpcms\template\content\header.html file. Oh, well, today's afternoon tea is crisp pear, the original crisp pear should be crisp, but just set up an outer bag, look at the white flawless, but the soup tasteless. When my left hand holds the big pear, the right hand gently to drag the header.html file to the notepad++ main interface to open, I just instantly tasted a bit of crisp pear crisp, suddenly, it is this head file, finally found her. When my subconscious is ready to search "class=" logo "", only to find my right hand is very awkward can not press ALT + F key at the same time, so with the right hand to take the left-handed pear, while the left hand is very proud of the skilled through the shortcut key to open the lookup form. Sure enough, see the true face, that is, when reviewing elements, when the left lock system icon, the right Tuo code (that is, the context code of the red box), exactly what we need to find.

Speaking of which, it gave me a sigh of relief. If someone now says I am a liar, I suggest you click the fork in the top right corner of the page, close this page, I really do not want to make friends with you!

Good Le ~ the ins and outs have made clear, replace the system logo icon to do it yourself ~ actually only one step: with the icon you want to change the logo.jpg replaced. Of course, in order to facilitate later, it is recommended to change the name of the original logo.jpg file to Logo_old.jpg can, really covered out later want to find another is not good to get.

"9" Phpcms V9 system database, data table structure

For this issue, see the PHPCMS v9 Data sheet structure online version

Structure and function of PHP files for "10" Phpcms V9 system

For this question, see the directory structure analysis of the PHPCMS v9 framework

"11" phpcms V9 Default template file directory structure detailed

Refer to the Phpcms v9 default template file directory structure in detail for this issue

"12" Default template details list

Can be viewed directly from the backend management system:

The operation steps are as follows:

The results are as follows:

"13" How to understand the design logic of V9 system?

From the background management system analysis of Phpcms V9, in order to study the system deeply, it must be deepened from the following contents.

First, we have to understand the station group. Please refer to "Phpcms V9 site management to achieve station group function", "using PHPCMS V9 Station Group function to establish multiple sub-stations".

Site Management Portal:

Second, we need to understand the module, see "Phpcms V9 Two development module development [360 degrees No dead ends full VERSION]"

In addition, it is the content part. Phpcms V9 is the standard MVC framework, the content part is the core data part of the website, in order to facilitate the extension and maintenance, must understand the model, the column, the attachment management.

When a new column is created, it is the model for content maintenance, Model Management:

When you want to add a new column to the page, column management:

When there is a download module, you need to maintain user-uploaded attachment items, attachment management:

Other....

"14" Phpcms V9 background of the various PHP files detailed analysis

For an analysis of the relevant content, attachment, download and so on, please see the series "Phpcms-v9 in-depth research"

"15" PC label overview

1. Introduction to PC label usage

The PC label must start with {PC} and end with {/PC}. {pc:} The colon followed by the module name. As a programmer, always feel the code is the most ground gas, please see the declaration:

{pc:content  action= "position" posid= "9" order= "id" num= "ten" cache= "3600"} {/PC}

Visible, the above is a special case of use, in fact the template is more simple:

{PC: module name/other parameter name = parameter value argument name = parameter value parameter name = parameter value} {/PC}

Of course, the failure to end with {/PC} does not cause the program to be fatal, resulting in the inability to continue running. However, there are two possible problems:

[1] When two PC tags appear in the Web page, it may make it confusing to label data that does not have a closed PC tag.

[2] in the background visual editing, there may be confusion in the structure of the Web page situation.

2. The PC tag contains two categories, namely:

2.1 Tool Classes

For a detailed description of the tool class, see the following scenarios:

[1] phpcms V9 Development Document "JSON toolbox"

[2] Phpcms v9 Development Document "XML toolbox"

[3] Phpcms v9 Development document "Get Tag"

[4] Phpcms V9 Development Document "Fragmentation toolbox"

2.2 Module Class

In Phpcms V9 we formally started using PC tags as data acquisition methods.

For a detailed description of the module classes, see the following articles:

Description of the call to PC tags in the foreground content module

"Instructions for calling the PC tag of other modules in the foreground"

"16" website SEO configuration is dry god horse?

Seo,search engine optimization, ie seo. Refers to the search engine natural ranking mechanism on the basis of the site for internal and external adjustment optimization, improve the site in search engine keywords natural rankings, to obtain more display volume, to attract more target customers Click to visit the site, so as to achieve the goal of network marketing and brand building.

"17" Other to be continued ...

Phpcms V9 Study Summary (Turn)

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.