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
, , 1315 ℃

Super simple zblog calls the code $categorysbyorder of all categories on the website

The previous blog bar has shared the code that zblog calls the background classification management of all categories through the GetCategoryList function. Today, the blog bar shares the other code that calls all categories, $categorysbyorder. The main difference between the two codes is that the latter cannot set parameters, while the former can add various parameters as needed, such as classification sorting. Use the example to use {foreach $categorysbyorder as $cat} {$cat ->Name} {/foreach} in the front-end template to use function boke8_getC in include
, 1046 ℃

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

It is limited to function parameters. It is impossible to call the list of popular, popular reviews or random articles by using the GetList function before zblog php 1.7. The GetArticleList function is usually used to call the custom sorting list. However, after the update of zblog php 1.7, the GetList function has added many important parameters, such as where custom, order_custom, etc., so that you can easily call popular articles A list of popular articles or random articles. 1.7 GetList function in new version: syntax $result=GetList (array ('count '=
, , 806 ℃
 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 call, but the naming of the modules is quite arbitrary (default sidebar, sidebar 2, sidebar 3,..., sidebar 9). If the topic calls different sidebar modules on different pages without explanation, It is not convenient to test or view the code one by one. Fortunately, zblog has an interface to modify the module name. You can customize the sidebar name. The code is also quite simple
1048 ℃

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, previous blogs have shared the "Zblog php article friendly time display format of X minutes, X hours, X days, X years ago, etc." Code of. 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
, 980 ℃
 Zblog realizes the code of sharing articles to Weibo, WeChat, QQ space and adding tutorials

Zblog realizes the code of sharing articles to Weibo, WeChat, QQ space and adding tutorials

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 to Z-Blog articles

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, and divides the interfaces into management page output classes, takeover system method classes, magic method classes There are several types of foreground page output, 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
, , 2304 ℃

Zblog built-in thumbnail clipping function code $article ->How to use Thumbs

For most zblog topics or plug-ins, there are two most common ways to extract thumbnails: one is to match the first image in the article content as a thumbnail through regular expressions, and the other is to add fields that set thumbnails specifically. Since zblog version 1.7, zblog has built in a Thumb basic class, which can be simply understood as a built-in thumbnail function. Through the thumbnail function of content, you can quickly obtain thumbnails, support external link pictures, and can cut, thumbnail, cache, etc. the extracted pictures, without generating redundant data records. Delete the cache file and access it again to regenerate, Very powerful and convenient. Prompt: It may not support the security chain with parameters or pseudo static security
, 2213 ℃

The function zbp_is_mobile() used by zblog to determine whether a visitor is a mobile device

Blog Bar has shared the method of zblog to determine whether the device accessing the website is a mobile device. The function code is from the wp_is_mobile() function of Wordpress. Recently, it was found that zblog php version 1.7.2+starts with the built-in function zbp_is_mobile() to determine whether the device accessing the website is a mobile device. The implementation principle of the zbp_is_mobile() function is not very different from the previously shared code, The user agent is also obtained to determine whether it is a mobile terminal. However, because zblog has built-in functions, one function code can be added less during application development. Function Original
, 1828 ℃

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
, 1550 ℃

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...)
, , 1199 ℃

Zblog judges whether the device accessing the website is a mobile device

When developing zblog, if you need to detect whether visitors are using mobile devices or PCs, you can use HTTP_USER_AGENT. HTTP_USER_AGENT can obtain the operating system (including version number), browser (including version number) and other information used by website visitors, If you want to know whether the visitor is using a mobile phone or a computer, you can judge the operating system or browser. (More...)
, 1611 ℃