How to transform Discuz's portal list to make it simple and atmospheric

Source: Internet
Author: User
Keywords Portal Discuz

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

In the Chinese Internet, perhaps the practitioner does not know the name of Disucz, because it does a very good open source construction software, and therefore run in the domestic Web server. Speaking of it everyone may be the biggest impression is to do community forums, in fact, this product includes a lot of modules, and our most commonly used BBS is only part of it, the same truth, the portal is one of the modules.

Perhaps in the country also has many excellent open source CMS to build the station system, but because DZ aggregates a lot of modules, and each module of the mutual integration technology costs will be very low, so there are many webmaster want to directly use this program to solve their own problems, that is, all use this set of procedures to build problems. But at this time, we may all have feelings, in fact, the essence of DZ is the forum part of it, and other modules is perfunctory, especially the portal part even in its official no exact entrance. Therefore, we also know that the default portal template is not updated for a long time, and the default is indeed a little on the table, such as today to tell you the list of portals, I will be through an example I did before to share the transformation process it, after the realization is the following look, next I will explain the basic ideas.

  

First, the design of a good style does not write good HTML and CSS, of course, this is also the simplest part. This point I believe that as long as you know how to do the site's friends will, or even directly copy those more excellent site of the front-end code, which is called The imitation of a part of the station. Of course, I suggest that you design a layout, which is more personalized, and what you want to do is what kind of.

Second, invoke the dynamic parameter. The first step we've done is just a static page, and we're definitely going to need to get the content moving, and these parameters are just some of the dynamic variables inside DZ. For example, the release date of the article variable is $value[dateline], the address of the article is $article_url, of course, these parameters as long as the reference to the default template can be. Here again there will be a problem, perhaps everyone will need to add the default template on this page does not have, and in the default template other pages have. Is it possible to copy the corresponding parameters of the other pages yourself? Definitely not, DZ is a set of more complex systems, different pages of many parameters are not universal, so need to part of the two development. For example, as the list shown above needs to add the number of views and comments that are not available, you need to add some functional statements in the relevant functions, such as the list of related functions stored in the

/source/module/portal/portal_list.php

Add a statement to enable a generic variable in the middle of the custom function category_get_list

$article _count = c::t (' Portal_article_count ')->fetch ($value [' aid ']); if ($article _count) $value = Array_merge ($article _count, $value);

This simple two-time development allows you to use $value[commentnum on the Portal's list page to invoke comments and browse by $value[viewnum; Of course, some other features are similar, of course, you need to have a certain PHP base.

Third, optimize performance. As in the form of this kind of graphic list, we can't have a single page list containing only 35 data records, generally we have nearly 20 data on a single page, but there is a problem, when the user first open the list when the data volume will be particularly large. For example, on 20 data, each 40KB image, the picture size in the light list has 800KB, so it must not be too fast to open. Here we need to perform the appropriate performance optimization, such as a split-screen loading, and use of jquery and Ajax technology can be implemented, such as jquery plug-in lazy load can achieve the picture of the split-screen loading, of course, how to use the Internet has a lot of related tutorials. Here I have to suggest that jquery will default to DZ JS, because DZ variable is the beginning of the $, and jquery is also using $ so there will be conflicts. The solution is also very simple, jQuery library does not change, only in the reference time to change it, you can give a variable such as var JQ = Jquery.noconflict (), and then use this variable JQ instead of the $ in the reference to resolve the conflict.

The above is a simple example to share, I hope to help. In fact, the contents of the above also prompted a number of questions, it is best to master some basic knowledge, while not indiscriminately add some code, such as a lot of webmasters do not even know that jquery will conflict with DZ, and online download special effects added in the site, so no problem is strange!

This article source: http://logozhizuowang.com/read-htm-tid-210230.html (by the Logo production net original, reprint please specify the source!)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.