Empire Cms template production calling forum post tutorial
Usually you can call forum posts using the forum’s calling post JS, but today we are going to explain how to use tags to call forum posts in the Empire CMS template production, because tags are more flexible.
Note: discuz here supports X3.1, and the test on the homepage of the webmaster zone is correct. The webmaster zone uses method 2, which is the
method 1 of smart tag call:
The forum data call is realized through the combination of ecmsinfo tag and SQL call.
Usage points:
1. Use the ecmsinfo tag; (Click here to view the ecmsinfo tag usage tutorial)
Tag syntax: [ecmsinfo] column ID, number of items displayed, Number of title interceptions, whether to display the column name, operation type, template ID, and only display pictures with titles [/ecmsinfo]
2. Use the "query by sql" operation type in the tag;
tag The "column ID" in the parameters is a SQL statement; the "operation type" is "24".
3. Make a display style template
Use "[!--title--]" in the tag template to indicate the post title; "[!--id--]" indicates the post ID.
Tag syntax example:
[ecmsinfo]'select post title field as title, post ID field as id from post data table order by sort field desc limit number of calls', 0, number of words for title interception, 0, 24, template ID, 0[/ecmsinfo]
For example: (call the latest 10 posts in the forum)
DISCUZ forum: [ecmsinfo]'select subject as title,tid as id from pre_forum_thread order by tid desc limit 10',0,30,0,24,1,0[/ecmsinfo]
PHPWIND Forum:[ecmsinfo]'select subject as title,tid as id from pw_threads order by tid desc limit 10',0,30,0,24,1,0[/ecmsinfo]
(Note: If the forum and the empire CMS are installed in different databases, "post Data table" is represented by "database.data table", such as "discuzdb.cdb_threads".)
·Example: calling DISCUZ forum post
Calling DISCUZ forum post tag syntax:
[ecmsinfo]'select subject as title,tid as id from pre_forum_thread order by tid desc limit 10',0,30,0,24,7,0[/ecmsinfo]
Call post The number of subtitles is 10; the number of intercepted post titles is 30 characters; use the template with tag template ID=7. (Note: If you change the database prefix, please make corresponding changes.)
Create a display style template:
Log in to the backend->"Template Management"->"Add Label Template" , add two label templates, "Display one row and one column" and "Display multiple columns in one row".
After the addition is completed, return to the "Tag Template" management and you will see the two tags we just added. (www.zzarea.com website construction)
Now we modify the homepage template:
Log in to the backend->"Template Management"->"Public Template"->"Modify the homepage template ", copy the template content to Dreamweaver for editing, and add a label for calling forum posts in the template, as shown below:
(Note: "where fid=section ID" means calling posts by forum section.)
After modifying the homepage template, copy the template code content to the background homepage template text box, and then click Modify.
After modifying the homepage template, we click "Preview" to view the modified homepage effect. Hey, have all the forum posts been moved to the Empire CMS?
Other instructions: The SQL statement in the example above is to call new posts in forums and sections. You can also call popular posts, highlight posts, etc., just change the sorting and conditions of the SQL statement. There are more applications, such as calling relevant forum posts in the information page, calling other system data, etc.
Method 2: Use the smart tag [e: loop] to call the forum post
Call the latest post of Discuz: pre_ is the table prefix of discuz
<table width="100%" border="0" cellspacing="1" cellpadding="3"> [e:loop={"select tid,subject from pre_forum_thread order by tid desc limit 10",10,24,0}] <tr><td> <a href="http://bbs.zzarea.com/viewthread.php?tid=<?=$bqr[tid]?>" target="_blank"><?=$bqr[subject]?></a> </td></tr> [/e:loop] </table>
Call the latest post of PHPwind Sub: pw_ is the table prefix of phpwind
<table width="100%" border="0" cellspacing="1" cellpadding="3"> [e:loop={"select tid,subject from pw_threads order by tid desc limit 10",10,24,0}] <tr><td> <a href="/bbs/read.php?tid=<?=$bqr[tid]?>" target="_blank"><?=$bqr[subject]?></a> </td></tr> [/e:loop] </table>
The above is the detailed content of Empire Cms template production calling forum post tutorial. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The discuz forum is an online forum software, also known as BBS. It is a program system used to establish forum communities on the Internet. Zhiyo's powerful forum software can help users build a professional and complete forum community, and can implement a variety of functions, such as building user registration, logging in, viewing topics, publishing posts, making comments, setting up moderators, etc. Allow users to easily manage and maintain the forum community.

Discuz forum permission management: Read the permission setting guide In Discuz forum management, permission setting is a crucial part. Among them, the setting of reading permissions is particularly important, as it determines the scope of content that different users can see in the forum. This article will introduce in detail the reading permission settings of the Discuz forum and how to flexibly configure it for different needs. 1. Basic concepts of reading permissions In the Discuz forum, reading permissions mainly include the following concepts that need to be understood: Default reading permissions: Default after new user registration

PHP forums include: 1. PHP Forum, the forum section of the PHP official website, which is an important platform for communication among PHP developers; 2. phphub, a well-known PHP technology community in China and one of the largest PHP technology forums in China; 3. Laracasts, an online learning platform for the Laravel framework; 4. Reddit PHP, a world-renowned social news aggregation website; 5. SitePoint, a comprehensive technology community that provides everything from web design to development.

Lin Feng Social Forum Mini Program | H5 Forum | App Forum is a front-end and back-end separated social forum Q&A post/BBS project developed by java+vue+uniapp, including forum graphic posts, videos, circles, IM private chat, WeChat payment, and paid posts. , points check-in, wallet recharge and other forum mini-program forum app complete functions.

In the Discuz forum system, user login problems are one of the common problems faced by users. Problems such as failed logins, inability to remember passwords, and inability to use third-party logins often trouble users and affect user experience. This article will introduce you to some methods to solve Discuz login problems and help you browse the forum easily. Login failure problem resolution: Login failure is one of the most common problems. To solve the problem of failed login, first carefully check whether the entered username and password are correct and make sure there are no input errors. If you confirm that the input is correct, but still

Discuz Forum Hot Post Setting Guide With the rapid development of the Internet, the forum, as an important online community platform, plays an important role in connecting users, sharing information and exchanging opinions. In the Discuz forum, hot posts are one of the important ways to attract users and increase forum activity. By setting hot posts, administrators can display high-quality content at the top, stimulate users to participate in discussions, and increase the exposure and click-through rate of posts. This article will introduce how to set up the hot post function in the Discuz forum and provide specific code examples.

Detailed explanation of how to modify the avatar in the Discuz forum. In the Discuz forum, the avatar is an important part of the user's profile, which can help users show their personality and characteristics. By default, the Discuz forum provides some avatars for users to choose from, but sometimes users want to use avatars designed by themselves or found from external websites. This article will introduce in detail how to modify the avatar in the Discuz forum and provide specific code examples. Step 1: Log in to the Discuz backend management interface. First, you need to log in to

Discuz Forum Introduction and Usage Guide With the development of the Internet, forums have become an important platform for many people to communicate and share information. Among them, Discuz is one of the most popular forum systems in China. It is famous for its rich functions and ease of use. This article will introduce the basic features of the Discuz forum, how to use the forum system to post, reply, etc., and provide some specific code examples to help readers better master related skills. 1. Basic features of Discuz forum and rich functions: Discussion on Discuz
