The method of not displaying top articles in the main loop of zblog home page and list page

When you use zblog to build a website, you may have such a demand: the website has many articles on top, but you don't want to call the display on the home page or the list page, because the top articles mechanism is always displayed at the front of the list, and the newly published articles are displayed behind the top articles, which will lead to the latest articles can't be accessed by readers in time. The method of not displaying top articles on the home page and the list page is also very simple. You only need to select $article In IsTop judgment, remove the code that calls the top article. Operation method: 1. Edit the homepage or list page template of your own theme. The homepage template is usually an index.php file. Different themes of the list template will differ. For details, you can edit the corresponding categories in the background to view the
Blog News 1159 ℃

Implementation tutorial code of how to use random pictures to make article thumbnails for zblog

For a long time, for article thumbnails, the general calling logic of most Z-Blog PHP themes is: first, get the first picture of the article content. If there is no picture in the article content, call a fixed default picture stored in the theme directory. This thumbnail call method is also suitable for most types of websites, but some websites are mainly text based, with few pictures, which will result in a large number of default thumbnails and poor visual experience. To avoid this problem, the plug-in method can use the plug-in that automatically generates random pictures. For example, the zblog plug-in introduced in zblog article Automatic Generation of Random Pictures Plugin zltheme_Figure earlier in the blog bar can
Zblog Tutorial 361 ℃

Zblog changes the list of page entries The first/last/next/end symbol is text

Z-Blog uses the {template: pagebar} to call the page turning bar, which uses the ‹, ‹, ›, ›› symbols to represent the first page, the previous page, the next page, and the last page respectively. What if you don't want to use symbols to directly display Chinese? You can try to use the flip bar source code to modify or modify global variables, and the method is simple. Operation method: 1. Edit the include.php file of the current theme, find the ActivePlugin_ theme ID function, and add the following code $zbp ->lang ['msg '] ['first_button']='home page'$ zbp->lang['...
Zblog Tutorial 1022 ℃

Full code of zblog custom article list page paging bar component

When developing zblog topics, the page turning bar of the article list page is habitually called with {template: pagebar}. This tag is used to call the pagebar.php template under the theme template directory. If the template does not exist for the theme used, the default pagebar.php template will be called. If you want to customize the page turning HTML code slightly, You can extract the code and put it on your own topic. Operating steps: 1. Create a php file in the template/directory of the current theme, named pagebar.php, and add the following code to the
Zblog Tutorial 1022 ℃

Method code for adding custom database tables in zblog

In the development of zblog topics or plug-in applications, it is inevitable that there will be a need to add new database tables. Adding new tables manually in the database will have little impact on self use applications, but it is not friendly for charging applications for many users. Therefore, it is necessary to automatically create corresponding database tables through code at the time of application startup. The following is a tutorial of Zblog php on user-defined database tables, which is transferred from the Z-Blog official library Wiki and uses the favorite article function as an example. It introduces table creation, addition, deletion, modification and query in more detail. Tip: This tutorial code only verifies the MySQL database, and the rest needs to be verified by yourself. Tutorial of Creating Tables Declare and Define Data Table Structure function
Zblog Tutorial 1890 ℃

Zblog Add Theme or Plug in Multi language Pack Load Code LoadLanguage

When developing zblog themes or plug-ins, some fixed words (such as navigation menu, search or submission) on the web page, whether in Chinese or English, are usually written directly on the template file. This will lead to the need to translate words one file at a time when using this application as a website in different languages, which is obviously inconvenient. In fact, in the new version of zblog php 1.4+, it is convenient to introduce language packs for themes or plug-ins, so as to add multilingual support to developed applications. The function code that provides language packs is LoadLanguage. Load the language pack code global $zbp// Note that $zbp ->LoadLang
Zblog Tutorial 1343 ℃

Zblog uses the new version GetList function to call the list of popular/popular reviews/random articles

Limited to function parameters, the GetList function cannot be used to call popular, popular or random article lists before zblog php 1.7. The GetArticleList function is usually used to call custom sort lists, but after zblog php 1.7 is updated, GetList function adds where_custom Order_custom and other important parameters, so that you can easily call the list of popular articles, hot reviews or random articles. 1.7 GetList function in new version: syntax $result=GetList (array ('count '=
Zblog Tutorial 829 ℃
 Name of sidebar module in background module management of zblog customized renaming website

Name of sidebar module in background module management of zblog customized renaming website

Many zblog topics are designed with sidebars and call the sidebar module managed by the background module, Zblog has nine built-in sidebar modules for free calling, but the naming of the modules is quite arbitrary (default sidebar, sidebar 2, sidebar 3,..., sidebar 9). If the theme calls different sidebar modules on different pages without explanation, it is obviously inconvenient to test or view the code one by one. not so bad, Zblog has an interface to modify the module name. You can customize the name of the sidebar. The code is also quite simple
Zblog Tutorial 1069 ℃

How many hours ago or days ago does zblog modify the code within 30 days

The publishing time format of zblog topic calls is generally MM/DD/YYYY, but some users think that using the publishing time format of "how many seconds ago", "how many minutes ago", "how many hours ago" or "how many days ago" will be more friendly to SEO. For this reason, the previous blogs have shared the "zblog php article" friendly time display format of X minutes X hours X days X years ago, etc. Now there is a new demand, that is, to use a friendly time format within the specified number of days of the publication of the article. If the number of days exceeds the specified number, the normal time format of year, month and day will be used. So let's share the relevant implementation code again. Function code: function boke8_net_a
Zblog Tutorial 1000 ℃
 Zblog enables sharing articles to Weibo, WeChat QQ space code and add tutorial

Zblog enables sharing articles to Weibo, WeChat QQ space code and add tutorial

At present, the once popular domestic third-party community sharing tools have basically stopped serving, such as Baidu Share. At present, only bshare seems to be accessible on the website, but it has also stopped maintaining, and the sharing tools can hardly be used normally. What if you really need to add the article sharing function? You can apply for the api interface of relevant websites to develop, or use the relevant URL sharing link to add your own. The following blog will sort out to add Sina Weibo QQ Space and WeChat
Zblog Tutorial 1188 ℃

Summary list of common system interfaces for php version zblog theme plug-in development

In the development of zblog topics or zblog plug-ins, some functional modules cannot avoid calling relevant zblog system interfaces. Therefore, in order to meet various extension requirements, Z-Blog PHP provides a series of plug-in interfaces for developers to use. On the whole, the interfaces are divided into management page output classes, takeover system method classes, magic method classes, and foreground page output classes, which can be selected and called according to different needs. Interface Classification Description Management Page Output Class This type of interface is generally used to add buttons or extend options in the existing management page in the background. There are two positions for taking over system methods
Zblog Tutorial 2336 ℃

The built-in function code used by zblog to determine whether a plug-in is installed and enabled

When developing zblog topics, we occasionally encounter a function that depends on a plug-in. For example, most topics of the image upload function rely on the Ueditor editor, which exists in the form of a plug-in in zblog and can be deleted by users. If it is deleted, it will affect the failure of the theme image upload function, Therefore, it is necessary to judge whether the plug-in is installed in the topic, so as to prompt the user to install or give a different setting scheme. Related functions in zblog are used to determine whether a plug-in is installed. $zbp ->LoadApp ('plugin ','plugin ID') ->is used in zblog to
Zblog Tutorial 1566 ℃

Zblog Generate Classification Select drop-down selection form function OutputOptionItemsOfCategories ()

OutputOptionItemsOfCategories() is a built-in function of zblog. The path of the function is zb_system/function/c_system_admin_function.php. This function can generate a select drop-down form with "L" to identify the hierarchical relationship between categories. It is a common function for background management functions of zblog topics or plug-in applications. (More...)
Zblog Tutorial 1215 ℃