Home page >> Related Tutorials >>Body

ZBLOGPHP article adds custom fields and hides them in page management

Author: A little Jack    Time: 2022-09-08 12:27:43    Browse: 1600   

Dunga: When using zblog, you may want to add a custom field to an article, such as adding an attribute of the article, adding an identifier, and setting whether the article is original or reproduced. Let's take a look at the specific operations.

1、 Hanging interface

Find and modify the include.php file under the current theme, search for the ActivePlugin_ field, and add the following code accordingly:

 Function ActivePlugin_Theme ID (){     global $zbp; Add_Filter_Plugin ('Filter_Plugin_Edit_Response5 ',' Topic ID_custom '); }

In fact, it is mainly to add Add_Filter_Plugin ('Filter_Plugin_Edit_Response5 ',' Topic ID_custom '); After successfully adding this line of code, add the following code:

 Function Topic ID_custom(){     global $zbp,$article;   Echo '<label class="editinputname">Source of the article</label><input type="text" name="meta_laiyuan" value="'. htmlspecialchars ($article ->Methods ->laiyuan). '"/>';   } //Modify lai yuan

Call method:

 <p>Source: {$article. Metas. laiyuan}</p>

Now we can add custom fields to the article page, but there will be a problem that this addition will also appear in the page management, but usually only the article page will be added. How can we hide it in a single page?

In fact, it is very simple. Just make a judgment. The code is as follows:

Hello, you need to log in to our account to view the hidden content, please first Sign in To view!

Ok, this is the end of the tutorial.


Text label: ZBLOG   PHP   Custom Field   Mask page  
 A little Jack

A little Jack https://lkba.cn

The blogger focuses on Z-Blog website construction, website optimization, computer troubleshooting, reinstallation, optimization, maintenance system, etc., QQ/WX: 2126245521 (please specify the purpose)

Related articles

Previous:

Next:

No comment for this article - Welcome

 Please fill in the verification code

Processed : 0.068 SQL : 25