PHP source code encryption tool SourceCop

PHP developers who are always reluctant to publish the source code of their products developed. SourceCop for PHP platform is a Windows application, you can use it to encrypt your PHP source code, released the product there is no worry about them.

 

09225546 GoQZ PHP源码加密工具 SourceCop

 

SourceCop for PHP using a special encryption encrypt your PHP source code. It is encrypted using almost no one source can be decrypted. In addition, you can also limit the PHP script code to run in encrypted IP or expiry of the time limit specified set of script code.

View encryption effect: http://www.sourcecop.com/sample_codeSC.htm

 

 

Resolve installation of WordPress theme or plugin automatic upgrade must enter FTP account and password issues

VPS After installing WordPress, in the background automatically upgrade or update, delete theme or plugin, if prompted to enter FTP account information, but even if we have correctly entered the FTP user name and password can not be upgraded, this is a server-side permissions problem, not the user’s problem. If you are an administrator, also encountered this problem (novice) provides several methods for your reference below:
First, if you are using virtual host

Method 1. You can add the following code in wp-config.php:

1
2
3
define("FS_METHOD", "direct");
define("FS_CHMOD_DIR", 0777);
define("FS_CHMOD_FILE", 0777);

Method 2, copy the following code to wp-config.php in?> Before

1
2
3
if(is_admin()) 
{ add_filter('filesystem_method', create_function('$a', 'return "direct";' ));
define( 'FS_CHMOD_DIR', 0751 ); }

Method 3, after modifying the FTP-related information, a copy of the code to wp-config.php?> Before

1
2
3
4
//*added ftp login credentials to avoid the annoying prompt asking for login info every time I wanted to upgrade a plugin* 
define('FTP_HOST', 'ftp.yoursite.com'); 
define('FTP_USER', 'Your_FTP_Username'); 
define('FTP_PASS', 'Your_FTP_password'); //*If you can use a SSL connection set this to true* define('FTP_SSL', true);

Second, if you are using a standalone server or VPS, you can modify the site directory properties:

1
2
chmod -R 755 /home/wwwroot
chown -R www /home/wwwroot

In fact, the emergence of this problem is Apache / Nginx as a non-executive capacity as owner of the file.

Solution:
Suppose your wordpress installation directory is / home / wwwroot / wordpress
carried out:

1
chown -R www /home/wwwroot/wordpress

Execute the above command can be the case under the / home / wwwroot / wordpress master of all files to www,

“Www” into your own ftp user name, “/ home / wwwroot / wordpress” WordPress installation into your own head.

This can be resolved automatically update must fill FTP problems.

note:
1. Must be the WordPress files uploaded to space later this command is executed, the order can not be reversed;

2. After you are finished adding virtual hosts must also upload files to the WordPress program space and then execute the command to be effective!

If the emergence of this issue, not only can not install the plug background or theme in the WordPress ftp directory also can not upload files.

Original video: PHPnow local build WordPress video tutorial

1. First from http://www.phpnow.org/download.html download the latest version of PHPnow.

Installation and use

After extracting the implementation of Setup.cmd, according to the prompt, the program will call Init.cmd initialization.
Init.cmd is automatically renamed to Init.cm_ after a successful initialization.

If necessary, rename Init.cmd to reinitialize. Reinitialization does not lose site data, just configuration resets.

PnCp.cmd is the PHPnow control panel. Most of the features are implemented above.

PnCmds directory there are some commonly used cmd script to control the operation of the program. You can create shortcuts to your desktop or other location.

2. From http://cn.wordpress.org/ download WordPress program, install WordPress

 

Original HD video download:

PHPnow local set up WordPress

Starting as a novice, I do not know how to set up WordPress locally, have always been uploading space browsing, it’s trouble, then found a nice build tool PHPnow, installation is also very convenient.

First of all, tell us what PHPnow is:

Win32 Apache + PHP + MySQL environment green free packages.
Simple to install, fast to build PHP environment to support virtual hosts. PnCp.cmd that came with the control panel helps you quickly configure your kit, very easy to use.

PHPnow is green, unpacked perform Setup.cmd initialization, you can get a PHP + MySQL environment.
And then you can install Discuz!, PHPWind, DeDe, WordPress and other procedures.

Supports virtual hosts: convenient Web hosting management
Backup configuration file: feel free to try to modify the configuration file and restore the configuration
Virtual host agent: can coexist with IIS (different port, Pan-resolution proxy)
Plug-in support: ASP.NET | JSP (look for the best solution)

First of all, download the latest version from http://www.phpnow.org/download.html PHPnow. PHPnow there are two packages, one is exe self-extracting version (recommended, according to the version), and the other is pure 7z archives (no exe self-extracting).

The following describes the self-extracting version: the implementation of PHPnow-1.4.x.exe

2. completion of the automatic decompression, automatically initializes Init.cmd action (during the firewall prompts may appear, allow)

3.Init.cmd ten seconds to complete. When fully completed, it will automatically open the default page (if not, try to manually open http://127.0.0.1)

Lecture 5, Make the Blog index.php file

After a few lectures in front of the study, we have learned the footer.php, header.php, style.css basic knowledge. Today to talk about the most important document index.php. In index.php the main thing is to remove the article-related information, which is the subject of the page information. We have mentioned in header.php this document, but also wrote two lines of code. Next, we rewrite the following code, and explain the use of the template function.

<?php get_header(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class=”post” id=”post-<?php the_ID(); ?>”>
<h2><a class=”title” href=”<?php the_permalink() ?>” rel=”bookmark”><?php
the_title(); ?></a></h2>
<div class=”info”>
<span class=”date”><?php the_time() ?></span>
<?php if ($options[‘author’]) : ?><span class=”author”><?php
the_author_posts_link(); ?></span><?php endif; ?>
<?php edit_post_link(‘edit’, ‘<span class=”editpost”>’, ‘</span>’); ?>
<span class=”comments”><?php comments_popup_link(‘no comment’,’1 comment’, ‘%
comments’, ‘Comments off’); ?></span>
<div class=”fixed”></div>
</div>


<div class=”content”>
<?php the_content(‘read more’); ?>
</div>
<div class=”under”>
<span class=”categories”>Categories</span><span><?php the_category(‘, ‘); ?></span>
<span class=”tags”>tags: </span><span><?php the_tags(”, ‘, ‘, ”); ?></span>
</div></div>
<?php endwhile; else : ?>
<div class=”errorbox”>
没有任何文章
</div>

<?php endif; ?>
<div id=”pagenavi”>
<?php if(function_exists(‘wp_pagenavi’)) : ?>
<?php wp_pagenavi() ?>
<?php else : ?>
<span class=”newer”><?php previous_posts_link(‘上一页’); ?></span>
<span class=”older”><?php next_posts_link(‘下一页’); ?></span>
<?php endif; ?>
</div>
<?php get_footer() ?>

Please note that the quotation marks, which should be English half-width.
These codes are not some eye-candy, ah, it does not matter, we slowly to analysis.

(1)get_header (), get_footer () function

Remember the first two speakers we do header.php and footer.php file, the role of these two functions is the introduction of these two files, the equivalent of php in the include function, so that we can in the same page In the header and footer are displayed. This can also be seen the importance of index.php, he directs the other files. Similar to these two functions are get_siderbar () function, this function is to contain siderbar.php file, the contents of this file we will explain in the follow-up courses.

(2)have_posts (), the_post () function

Have_posts () role is to interpret the blog is not published articles, usually used for conditional judgment, the_post () role is to conduct a database query, the article related to the data query, so that we can in the follow-up code Using the relevant function of the information output to the page, the general usage is like the above:

<?php If(have_posts()):while(have_posts()):the_post();?>

Here is a loop to remove the article-related information

<?php endwhile;?>
<?php else:?>

Here is if there is no article, then display the information here.

<?php endif;?>

Note that if here and behind the use of a colon is not a semicolon, if mistakenly written semicolon can not achieve the desired function friends.

(3)the_ID() the_permalink() the_title() the_time() the_content(‘read more’)

Note: These five functions can only be used in WordPress loops, they are not global functions.

The_ID()

作用是取得每次循环的编号,输出的结果post-数字编号

The_permalink()

The role is to obtain a permanent link to the article. This function takes no arguments to get a link to an article in the current loop, or you can pass in an id number so that you can get a link to the article for that id. Functions are defined in:

/wordpress/wp-includes/link-template.php -> line 9

The_title()

Get the title of the article, the function of the complete list of parameters the_title ($ before = “, $ after =”, $ echo = true)

$ Before refers to the title of the article in front of the content to be displayed, $ after refers to the title of the article said after the content to be displayed.

$ Echo true value that shows the title of the article, to return to false article title. The function is defined in:

/latest/wordpress/wp-includes/post-template.php -> line 35

The_time()

The_time () is used to get and display the current article published time, the function can be followed with the control of the date or time format parameters, commonly used parameters are as follows:

If <? Php the_time ( ‘F j, Y’);?> Call the form of display: June 13, 2009 (English state display June 13, 2009);

If <? Php the_time ( ‘g: i a’);?> Call the form of display: 7: 09 pm (English state display 7:09 pm);

Such as <? Php the_time ( ‘G: i’);?> Calling the form of the show: 19: 09.
In fact, in addition to using the_time () function, WordPress also provides a similar function

The get_the_time () function. The function does not have the display function of the_time () function, the other functions are identical. use

Get_the_time () function, if you want to get the time displayed, you need to use a dedicated statement.

Here, we take this opportunity to briefly understand the time format in WordPress. In WordPress, the following characters are usually used to control the time format:

L, F, j, S, Y, G, g, i, a and so on, the detailed meaning is as follows:

L (lowercase L) is used to display the name of each day of the week, such as Saturday, or in English show Saturday;

F is used to display month names, such as June, or June;

J used to display a day in January, such as 13;

Y is used to display the year as a four-digit number, y for the last two digits, such as 2009 or 09;

G, g, i, a and other four characters are usually used in combination, as in the previous example, there are two forms:

G: i a displays the time in the form of 7:09 pm or 7:09 pm;

G: i displays the time in the form of a 24-hour period in the form of 19:09.

S is usually followed by j to indicate whether an English suffix (st, nd, th, etc.) is added after the day of January.

The_content ()

The contents of the article, this can take a parameter, the_content ( “more”), the role is in the article if <! – more->, it automatically truncated display more connections, you can view the details.

(4)the_category (), the_tags () function

The_category () to obtain the list of articles belonging to the article, you can use the_category ( ‘|’), if we have a WordPress WordPress theme WordPress plug-ins then the three directory is displayed like this:

WordPress Theme | WordPress Plugin, ‘|’ is the delimiter between adjacent directories, which can be separated according to their own needs using different symbols, by default, separated by spaces. The_tags () Gets the label the article belongs to. $ Before = The content displayed before the tag, the $ sep separator, and the content after the $ after tag. $ Before = $ tag = ‘, $ sep =’;

 

Lecture 4: Make footer.php of your Blog

Last time, we talked about how to make the header part of WordPress theme, so far, our theme directory should have style.css, header.php, index.php these basic documents, today we talk about footer.php production .

Footer.php is responsible for the bottom part of the page, this part generally contains the contents of the main copyright information, statistical code, the record information (at home) and so on. Now we are in the wpc-tomheng directory in the establishment of a footer.php file. inside

Write the following code:

<div id=”footer”>
<div ><a href=”<?php bloginfo(‘url’); ?>”><?php bloginfo(‘name’);?>Powered by </a><a
href=””>WordPress</a></div>
<div >
<div class=”tongji”>在这里可以加入你的统计代码</div>
<div class=”beian”>这里是您的备案信息</div>
<div ><?php echo get_num_queries();?>querys in <?php echo timer_stop() ;?>seconds</div>
</div>
<?php wp_footer(); ?>
</body>
</html>

Now open the browser should be able to see the relevant information. It is very simple, it is easy, it is fun.

Bloginfo () function Needless to say, if you do not understand it, then please see our last talk.

(1)The get_num_queries () function

The function (without any parameters) is the role of WordPress from initialization to the function call so far, a total of how many times sql query.

(2)The timer_stop () function

This is to obtain the current running time, you can generally measure the time of the WordPress query. This function is defined in: /wordpress/wp-settings.php -> line 162 Interested friends can look at.

(3) The WP_footer () function

WP_footer () is a hook function of WordPress, used in plug-in development in the function. Coupled with this function is its own theme support plug-in development, at the same time and more in line with norms.

Today, these functions are relatively simple There is no complex parameter options, relatively simple, these functions as long as they know their role, specifically used where to look at their own design friends.

 

Lecture 6 sidebar.php Production Process

On the one we learned the production of index.php, this is more important, if you do not understand the place, back

The first to take a closer look at the contents of our tutorial, we must put the code in index.php understand clearly. Today we take a look
Sidebar.php production.

First of all, we need to add get_sidebar () function in index.php to introduce this file. Open the index.php file, Get_footer () function in front of the get_sidebar () function can be friends.

Next in the sidebar.php write the following code:

<Div id = “sidebar”>
<Ul>
<Li>
<? Php get_search_form ();?>
</ Li>
</ Ul>
<Ul role = “navigation”>
<? Php wp_list_pages ( ‘title_li = <h2>’. ‘Pages’. ‘</ H2>’);?>
<Li> <h2> Archives </ h2>
<Ul>
<? Php wp_get_archives ( ‘type = monthly’);?>
</ Ul>
</ Li>
<? Php wp_list_categories ( ‘show_count = 1 & title_li = <h2>’. ‘Categories’. ‘</ H2>’);?>
</ Ul>
<Ul>
<? Php if (is_home () || is_page ()) {?>
<Li> <h2> Meta </ h2>
<Ul>
<? Php wp_register ();?>
<Li> <? Php wp_loginout ();?> </ Li>

</ Ul>
</ Li>
<? Php}?>
</ Ul>
</ Div>

Now you can open the browser to see what the code is done. Here we look at the role of the function inside

What is it and how to use it.

(1) get_search_form () function

The function of this function is the real search box. After this function call can be displayed directly with a complete function of the search
Box, we do not have to write any additional code. This is the charm of WordPress, he gave us some very useful letters
Loaded function, thus reducing the burden on our development, you can focus on the theme of the design.

(2) wp_list_pages (), wp_list_categories () function

Wp_list_pages ()

This function displays all the pages within the WordPress blog as hyperlinks to the page name, and is often used to create top navigation
Page, or to modify the sidebar.

(Such as wp_list_pages ( ‘title_li = & sort_column = menu_order & include = 12,25,38,57 & depth = 1 &’)

The meaning of each parameter is as follows:

Title_li = used to set up a display of all the pages of a general name; behind no parameter value, that does not show the name;

Sort_column = menu_order used to set the display order of the page, according to WP background set the page order

Display, other commonly used sequence settings may also include post_title, post_date, ID and so on;

Include = 12,25,38,57 that only show the ID value of these four pages; we can also use the exclude to

Exclude pages with corresponding IDs;

Depth = 1 that only shows the parent page, all sub-pages are not displayed; other values also include the default 0, that display

All pages (sub-pages are indented); – 1 shows all pages (no indentation of sub-pages);

In addition, the function may also use the attributes include link_before and link_after, used to set the display page link

Before and after the characters.

Wp_list_categories ()

Wp_list_categories () function is used to obtain the classification of blog posts information, and can be set by the appropriate function parameters,
Will be displayed. The function of the parameters and wp_get_archives () function similar to the need to use the & link, on a single lead

The number ( ‘) is passed as a string. Shaped as wp_get_archives ( ‘orderby = name & order = ASC &
Show_count = 1 & use_desc_for_title = 1 & feed = Subscribe & exclude = 2,5 & number = 10 ‘)

The meaning of each parameter is as follows:

Orderby = name that the classification in accordance with the name of the alphabetical order display classification information, you can name for ID and so on;

Order = ASC indicates that the classification information in ascending order according to the name of the classification, ASC will be changed to DESC

sequence;

Show_count = 1 Shows the number of articles belonging to the category after each category name;

Use_desc_for_title = 1 Use the description information for this category to add a title attribute for each category name hyperlink;

Feed = Subscriptions: Add a hyperlink called “Subscriptions” next to each category to provide an RSS feed for that category;

Exclude = 2,5 in the classification shown in the removal of ID 2 and 5 categories; can also include = 2,5 said that the show only ID
2 and 5;

Number = 10 indicates that only the first 10 categories are displayed.
(3) is_home (), is_page () function

Is_home () is used to determine whether the currently displayed blog page is the first page, returns a Bool value. If it is in the first
Page, returns TRUE; otherwise, returns FALSE.

This function is used to control the display of the blog sidebar, often using the following snippet:

<? Php
If (is_home ()) {
// This is the content that should be displayed on the blog home page
} Else {
// This is the content that should be displayed on the non-blog homepage
}}
?>

Is_page () function to determine whether the current display of the contents of the blog is a separate page (page), is the establishment of the page in the background

It also returns a Bool value. We can in the template through the function to determine whether the current is a separate page,
So as to decide whether to display the published article for the current time and so on.

Similar functions are:

Is_paged () is_single () is_tag () is_category () is_archive

(4) wp_register (), wp_loginout () function

Wp_register () gets the link to the login background, wp_loginout () gets the link to log out.

Up to now, a basic wordpress theme has taken shape. This set of theme tutorials also come to an end, hope big

Home will be harvested from.

Lecture 3: Creating a Blog Header

Through the last talk about the WordPress theme we know the two main documents are style.css and index.php, they are the most basic, but only they are obviously not perfect, although you can write all the features To index.php, but this does not meet the WordPress theme of the specification, this will learn how to follow the norms to create their own themes.

From the above icon we can see that a basic WordPress page is composed of four parts (header.php,
Index.php, footer.php, sidebar.php), they are responsible for different parts of the WordPress blog page. We will explain the following four courses in the production of these documents, today we have to look at how to make header.php file

(1) First, we write the index.php following a few simple functions, these functions do not explain the time, so when we talk about index.php file will be explained.

The code is as follows

<?php get_header()?>
<?php get_footer()?>

(2) and then in the wpc-tomheng directory to create a header.php file.

Write the following code:

<!DOCTYPE html PUBLIC ”-//W3C//DTD XHTML 1.0
Transitional//EN” ”http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title> <?php bloginfo(‘name’); ?></title>
<linkrel=”stylesheet” href=”<?php bloginfo(’stylesheet_url’); ?>” type=”text/css” media=”screen”
/>
</head>
<body>
<div >
<h1><a href=”<?php echo get_option(‘home’); ?>/”><?php bloginfo(‘name’); ?></a></h1>
<div class=”description”><?php bloginfo(‘description’); ?></div>
</div>
</body>

(3) open the browser to view the theme is not able to see the name of the blog shows there are descriptions. Well, this is the template function of the credit, and here we look at how this is achieved.

Description:
First, bloginfo () template function

Bloginfo () is a template function, through which we can call your blog-related information, we used header.php four times this function, remove the three main data: blog name bloginfo ( ‘name’), The style file bloginfo ( ‘stylesheet_url’), blog description bloginfo ( ‘description’).

There are two points to be noted:

1) Bloginfo () function with the output function, that he is not to return data, but directly to the data output to the browser.

2) Boginfo () output different data through the parameter configuration to achieve. Bloginfo () function of the common configuration parameters

Second, get_option () function

Here we use this function to get the address of the blog link, this function needs to pay attention to his return is a url address variable, so if you want to display on the page then need to add echo function in front of him. Of course, we should also add some styles, but this is beyond the scope of our tutorial, here I just explain to you how to use these template functions and theme production of basic methods, Knowledge, coupled with a wealth of creativity in order to achieve a beautiful theme, which depends on your CSS knowledge base and design capabilities and these are not included in the content of our tutorial (perhaps after wpc will provide the relevant tutorial, pay close attention)

(2) open the browser to view the theme is not able to see the blog shows the name of the description of it. Well, this is the template function of the credit, and here we look at how this is achieved.