Discuz the implementation principle of DIY function?

Source: Internet
Author: User
Who can generally say that discuz in the implementation of the principle of DIY, I have seen a day did not find the clue!!!


Reply to discussion (solution)

Make each control a drag, the root of your position, save the style, use the call style

Make each control a drag, the root of your position, save the style, when using the call style is not to meet the following requirements:
1, the static page must be modifiable it?
2, to DIY position is fixed, so it is not very limited?
3, each frame has its own ID, according to this ID call style?
4. Is this drag-and-drop implemented via JavaScript? Through jquery?

Put a link to see it?

Put a link to see it? http://www.discuz.net/
"DIY" link in upper right corner after login

The principle of implementation is to replace the div specified in the label () of the page with the contents of the database by using the Javascrip and PHP's mash-up . Create a cache file. The ID of the page is recorded in the database (the actual page does not exist) template name DIY ID and a number of their own. CSS styles are cached. The CSS is updated once in the background and the contents of the CSS are read in the database, and the files are generated so that they can be div+css.

That's good upstairs.

See source
Common_diy.js

Method for extending string: Property2js
Defines a function stylecss, and expands some methods for STYLECSS
Defines a JSON object util
An anonymous function is defined, which contains several methods, in which the drag and DIY methods are more important.



Portal_diy.js

Defines a drag object.
Defines a DIY object: Var spacediy, and executes the method Spacediy.init (1);

Please refer to the Discuz official documentation for the section on drag-and-drop modules!

  • 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.