Zencart National ranking and extension of Chinese names

Source: Internet
Author: User

The ultimate effect is as above

Specific steps:

1. Manually or SQL Modify data table, add 2 fields

ALTER TABLE ADD VARCHAR  - NULL DEFAULT "' ADD int (One notNULLDEFAULT'0';

2. Modify the admin/countries.php file, add the form Insert editing function, a total of 7, here ignore the specific code.

3. After that, two functions to get the country drop-down list are modified (one for the foreground background)

#includes/functions/functions_lookups.php

  functionZen_get_countries ($countries _id= ",$with _iso_codes=false) {    Global $db; $countries _array=Array(); if(Zen_not_null ($countries _id)) {~~    } Else {      $countries= "Select countries_id, Countries_name, COUNTRIES_NAME_CN from" . Table_countries. "ORDER by order_by, Countries_name"; $countries _values=$db->execute ($countries);  while(!$countries _values-EOF) {        $countries _array[] =Array(' countries_id ' =$countries _values->fields[' countries_id '], ' countries_name ' =$countries _values->fields[' Countries_name ']. "-".$countries _values->fields[' COUNTRIES_NAME_CN ']); $countries _values-MoveNext (); }    }    return $countries _array; }

#admin/includes/functions/general.php

  functionZen_get_countries ($default= ' ') {    Global $db; $countries _array=Array(); if($default) {      $countries _array[] =Array(' id ' = ' = ', ' text ' = =$default); }    $countries=$db->execute ("Select countries_id, Countries_name,countries_name_cn from" . Table_countries. "ORDER by order_by, Countries_name");  while(!$countries-EOF) {      $countries _array[] =Array(' id ' = =$countries->fields[' countries_id '], ' text ' = =$countries->fields[' Countries_name ']. "-".$countries->fields[' COUNTRIES_NAME_CN ']); $countries-MoveNext (); }    return $countries _array; }

Final effect

Background functions are not modified if they are not specifically required.

   

Zencart National ranking and extension of Chinese names

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.