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
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
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 articlesA list of popular articles or random articles.1.7 GetList function in new version: syntax $result=GetList (array ('count '=
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
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
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
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 classesThere 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
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
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
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
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...)
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...)
The code previously shared by the Blog Bar to obtain the number of articles published on the zblog website in 24 hours calls the number of articles published within 24 hours before the current time, while the code shared today counts the number of articles published on the same day, that is, the number of articles published between 0:00 and 24:00 every day.(More...)
The WP Ban plug-in can implement the WordPress plug-in that blocks certain designated IP access websites.When a user in the forbidden IP range tries to access the website, the foreground will display a customized message of forbidden access
The mzablog theme is a set of zblog blog themes with white as the main body and blue as the embellishment.The theme is the structure layout of the left and right columns, the layout of the image text list, the responsive structure, and the design of the carousel map, recommended articles, popular articles, hot reviews
The [Comments] on the background of the WordPress website can be viewed by other roles such as contributors, in addition to the administrator. This is obviously unreasonable and will reveal the privacy of comment users, because who has comments in addition to comments
The unreasonable permission setting of website files on the server is one of the reasons why the website was breached (hacked). Therefore, for the security of the website, it is recommended to set the permissions of website files. The following is a copy of the official Z-Blog blog "ZB File Permission Security..."