Dedecms Plugin development tutorial, dedecms plugin Tutorial _php Tutorial

Source: Internet
Author: User

Dedecms Plugin development tutorial, Dedecms plugin Tutorial


This is a very simple plug-in instance, through this plugin, you can know how to develop a plug-in, it is how the structure is set, database, backstage and so on.
File structure:
enroll.php file under the plus file
enroll.htm files under the Templets/plus folder
adenroll.php files under the Dede folder
adenroll.html Files under Dede/templet folder
SQL file:

CREATE TABLE IF not EXISTS ' dede_enroll ' (' id ' int (4) is not NULL auto_increment, ' name ' varchar () ' is not null ', ' Mail ' varchar (3 0) Not NULL, ' tag ' tinyint (1) is not null default ' 0 ', PRIMARY KEY (' id ')) engine=innodb default Charset=utf8 auto_increment=1 INSERT into ' dede_plus ' (' aid ', ' plusname ', ' menustring ', ' Mainurl ', ' writer ', ' isshow ', ' filelist ') VALUES (30, ' online registration ', ' ', ', '
 g1000 ', 1, '); 
  

Here are the instructions for easy I set up two fields name and mailbox Tag field is indicated whether admission 1 for 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);//Executes a statement that returns an impact value if ($affected) {showmsg (' Registration successful ',-1);}} else{$PV->settemplet (dedetemplate. ' /plus/enroll.htm ');//Set Template $PV->display ();//Display page}?>

Enroll.htm

  <title>{dede:global.cfg_webname/}-Online Registration</title> 
 
  
    {Dede:include filename= ". /default/head.htm "/}
  
 
 
executenonequery ("Update cms_enroll set ' tag ' =1 where id= ' $_get[id] '); ShowMsg (' Admission success ', ' 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 (' Delete succeeded ', ' adenroll.php '); }}else{$dl = new Datalistcp (); $dl->pagesize = 10;//shows 10 $dl->settemplate ('./templets/adenroll.htm ') per page;//Load Template $ Sql= "SELECT * from Cms_enroll"; $dl->setsource ($sql);//Execute SQL cannot be reversed with $dl->settemplate $dl->display ();//Display page}?>

adenroll.html

  Online Registration Management 
 
     
 
  
   {Dede:datalist} 
    {/dede:datalist} 
   
name e-Mail Status Operation
{dede:field.name/} {dede:field.mail/}

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


A lightweight forum plugin for weaving dreams? I've been searching the internet for a long time and I haven't found myself. Now I can't develop a credit.

No, the forum you use DZ Bar, integrated together. The problem of weaving dream can go to Baidu to search the home of the Dream manager, there are many weaving dream aspects of the tutorial.

DEDECMS plug-in how to develop? How to develop a process?

There are some of the Dede help pages. Bbs.dedecms.com/136294.html This page contains detailed instructions, you can download a product manual to see, the manual below is two times developed. But this still depends on how you want to develop.

http://www.bkjia.com/PHPjc/893874.html www.bkjia.com true http://www.bkjia.com/PHPjc/893874.html techarticle dedecms Plugin Development tutorial, Dedecms plugin Tutorial This is a very simple plug-in instance, through this plugin, you can know how to develop a plug-in, it is how the structure is set, 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.