Easy modification of website name-light E-commerce system (enterprise entry level B2C website), E-commerce system B2C

Source: Internet
Author: User

Easy modification of website name-light E-commerce system (enterprise entry level B2C website), E-commerce system B2C

By modifying the website name, the system can be customized to any user, satisfying the user's feeling. This is a very clever and useful small function.

The procedure is as follows:

Introduce permission judgment (the Administrator has the permission to modify the website name)

<Chtml> <Bag id = sys> <we name = NodeID> a0 </we> </Bag> <! -- Topic node --> </chtml> <chtml file = "base/ac/checkAcl.htm"/> <! -- Import the permission check file -->
Read the website name file

<file id=site act=read method=str name=title>site/res/site_name.txt</file>
Determine permissions and decide not to display the "save" Function

<If x = "@ {sys: canDo}"> <div align = right x = true> <a href = "javascript: doSubmit ()" title = "Save the current modification! "> [Save] </a> </div> </if>
Submit the website name form
<Form action = "site_edit.chtml" method = post id = save name = save> <tr height = "28" class = bg0> <th width = "80" valign = "middle"> website name </td> <input name = "title" value = "@ {site: title} "size =" @ {int: @ {length: @ {site: title }}+ 12} "/> </td> </tr> </form>
Submit Time and Space Value Verification
DoSubmit = function () {var saves = document. forms ['save']; if (saves ['title']. value = "") {alert ("name cannot be blank! "); Return;} saves. submit ();}
Effect

Complete code

<Html> <title> modify website name: @ {site: title} </title> <link href = "@ {sys: path} base/css/system.css "rel =" stylesheet "type =" text/css "> <Script src =" @ {sys: path} base/js/AjaxBase. js "> </Script> <BODY leftMargin =" 0 "topMargin =" 0 "scroll =" no "MARGINWIDTH =" 0 "MARGINHEIGHT =" 0 "> <TABLE cellSpacing = 0 cellPadding = 0 width = "100%" border = 0> <TR vAlign = top> <TD style = "BACKGROUND-REPEAT: repeat-x "background =" @ {sys: path} images/Title2.g If "> <TABLE cellSpacing = 0 cellPadding = 0 width =" 100% "border = 0> <TR vAlign = top> <TD height = 32 style =" BACKGROUND-REPEAT: no-repeat "noWrap width =" 100% "class =" GAP1 "> <P style =" MARGIN-LEFT: 2px; MARGIN-RIGHT: 3px ">  modify site name: @ {site: title }</P> </TD> </TR> </TABLE> </TD> <TD width = 10 class = "GAP1">  </TD> <chtml> <Bag id = sys> <we name = NodeID> a0 </we> </Bag> <! -- Topic node --> </chtml> <chtml file = "base/ac/checkAcl.htm"/> <! -- Introduce the permission check file --> <TD style = "BACKGROUND-REPEAT: repeat-x" vAlign = bottom width = "100%" background = "@ {sys: path} images/Title4.gif "> <chtml> <file id = site act = read method = str name = title> site/res/site_name.txt </file> <if x = "@ {sys: canDo} "> <div align = right x = true> <a href =" javascript: doSubmit () "title =" Save the current modification! "> [Save] </a> </div> </if> </chtml> </TD> </TR> </TABLE> <table width =" 99%" cellpadding = "0" cellspacing = "0" border = "1" bordercolor = "# b4b4b4" align = center> <form action = "site_edit.chtml" method = post id = save name = save> <tr height = "28" class = bg0> <th width = "80" valign = "middle"> website name </td> <input name =" title "value =" @ {site: title} "size =" @ {int: @ {length: @ {site: title }}+ 12} "/> </td> </tr> </form> </table> <br> </BODY> (File: base/access/site_edit.html) in
Light open e-commerce system (enterprise entry level B2C website)In the base/access/directory

Save the website name after submission

<! -- Permission judgment --> <if x = "@ {sys: canDo}" else = 1> <we x = true>... </we> <script> alert ("You do not have permission! "); History. back (); </script> </if>
Save the website name
<file value="@{pPage:title}">site/res/site_name.txt</file>
Save and return
<to>@{sys:face}base/access/site_edit.html</to>

Complete code

<Html> <chtml> <Bag id = sys> <we name = NodeID> a0 </we> </Bag> </chtml> <! -- Topic node --> <chtml file = "base/ac/checkAcl.htm"/> <! -- Import the permission check file --> <chtml> <! -- Permission judgment --> <if x = "@ {sys: canDo}" else = 1> <we x = true> <file value = "@ {pPage: title} "> site/res/site_name.txt </file> <to >@{ sys: face} base/access/site_edit.html </to> </we> <script> alert ("You do not have permission! "); History. back (); </script> </if> </chtml> 

(File: base/access/site_edit.chtml) inLight open e-commerce system (enterprise entry level B2C website)In the base/access/directory


You can test it.

Download Easy Do IT resources

Development Instance:Light B2C e-commerce websites, Free download: http://download.csdn.net/detail/tx18/8818883

The light-Open Platform will occasionally upgrade to provide more powerful and Easy functions for you. Please note thatDownload the latest version


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.