Dedecms plugin development tutorial, dedecms plugin tutorial _ PHP Tutorial

Source: Internet
Author: User
Dedecms plugin development tutorial, dedecms plugin tutorial. Dedecms plug-in development tutorial, dedecms plug-in tutorial this is a very simple plug-in instance. with this plug-in, you can know how to develop a plug-in, how to set its structure, and data dedecms plug-in development tutorial, dedecms plugin tutorial

This is a simple plug-in instance. with this plug-in, you can know how to develop a plug-in, how to set its structure, database, background, and so on.
File structure:
The enroll. php file is in the plus file.
The enroll.htm file is in the templets/plus folder.
The adenroll. php file is in the dede folder.
Under the dede/templet folder of the adenroll.html file
SQL file:

Create table if not exists 'dede _ Enroll' ('id' int (4) not null auto_increment, 'name' varchar (20) not null, 'mail' varchar (30) not null, 'tag' tinyint (1) not null default '0', primary key ('id') ENGINE = InnoDB default charset = utf8 AUTO_INCREMENT = 1; insert into 'dede _ plus '('aid', 'plusname', 'menustring', 'mainurl', 'write', 'isshow ', 'filelist') VALUES (30, 'register online ','
 ', '', 'G1000', 1 ,'');

For convenience, I have set two fields, name and email tag, to indicate whether admission 1 is admission.
The first insert statement is added to the background management.
The second insert statement is added to the foreground navigation bar.

Enroll. php

 ExecuteNoneQuery2 ($ SQL); // execute a statement to return the impact value if ($ affected) {ShowMsg ('registered successfully',-1 );}} else {$ pv-> SetTemplet (DEDETEMPLATE. '/plus/enroll.htm'); // set the template $ pv-> Display (); // Display Page}?>

Enroll.htm

  {Dede: global. pai_webname/}-online registration 
 Script {Dede: include filename = "../default/head.htm "/}
  
 
 
ExecuteNoneQuery ("update cms_enroll set 'tag' = 1 where id = '$ _ GET [id]'"); ShowMsg ('admission successfully', 'adenroll. php ');} if ($ _ GET ['action'] = 'nopass ') {$ db-> ExecuteNoneQuery ("update cms_enroll set 'tag' = 0 where id = '$ _ GET [id]'"); ShowMsg ('cancel admission ', 'adenroll. php ');} if ($ _ GET ['action'] = 'delete ') {$ db-> ExecuteNoneQuery ("delete from cms_enroll where id = '$ _ GET [id]'"); ShowMsg ('deleted successfully', 'adenroll. php ') ;}} else {$ dl = new D AtaListCP (); $ dl-> pageSize = 10; // 10 items are displayed on each page. $ dl-> SetTemplate ('. /templets/adenroll.htm '); // load the template $ SQL = "select * from cms_enroll"; $ dl-> SetSource ($ SQL ); // The executed SQL statement cannot be reversed with $ dl-> SetTemplate $ dl-> Display (); // Display Page}?>

Adenroll.html

  Online registration management 
     
 
  {Dede: datalist} 
   {/Dede: datalist} 
  
Name Email Status Operation
{Dede: field. name /} {Dede: field. mail /} {Dede: if field. tag = 0} not admitted {else} accepted {/dede: if} [Admission] | [fail] | [delete]

{Dede: pagelist listitem = "info, index, end, pre, next, pageno" listsize = "5 "/}


Is there a lightweight Forum plug-in for Zhimeng? I haven't found myself on the Internet for a long time. I can't develop any thanks.

No. you can use dz for Forum integration. For problems with dream weaving, you can go to Baidu to search for the dream weaving administrator's house. There are many tutorials on dream weaving.

How to develop dedecms plug-ins? How is the development process?

Dede help page. Bbs.dedecms.com/136294.html this page contains detailed instructions, you can download a product manual to have a look, the manual below is a secondary development. But it depends on how you develop it.
 

This is a simple plug-in instance. with this plug-in, you can know how to develop a plug-in, how to set its structure, data...

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.