Home Backend Development PHP Tutorial Regarding the modification of phpcms v9 voting module option sorting problem_PHP tutorial

Regarding the modification of phpcms v9 voting module option sorting problem_PHP tutorial

Jul 14, 2016 am 10:10 AM
phpcms Revise about vote sort module Options question

Regarding the modification of the phpcms v9 voting module option sorting listorder setting issue, I mainly modified three files and three places.

I think this method is enough for me, and everyone is welcome to try it out.

Mainly modify three files:

1.phpcmsmodulesvotetemplatesvote_edit.tpl.php found in

[html]

Add a piece of code at the end, a form text box about sorting


[html]
Sorting:

Sort:Save.

Found in 2.phpcmsmodulesvotevote.php


[html]
$this->db2->update_options($_POST['option']);

$this->db2->update_options($_POST['option']);Add

below


[html]
$this->db2->set_listorder($_POST['piaoshu']);

$this->db2->set_listorder($_POST['piaoshu']);Save. There is no filtering in this operation, friends can consider it.

Found in 3.phpcmsmodelvote_option_model.class.php


[html]
function set_listorder($data)
{
If(!is_array($data)) return FALSE;
foreach($data as $key=>$val)
                                                                                   $val = intval($val);
               $key = intval($key);
               $this->db->query("update $tbname set listorder='$val' where {$keyid}='$key'");
         } 
           return $this->db->affected_rows();
}  

function set_listorder($data)

{
if(!is_array($data)) return FALSE;
foreach($data as $key=>$val)
{
$val = intval($val);
$key = intval($key);
$this->db->query("update $tbname set listorder='$val' where {$keyid}='$key'");
}
Return $this->db->affected_rows();
}

was changed to

[html]
function set_listorder($data)
{
If(!is_array($data)) return FALSE;
foreach($data as $key=>$val)
                                                                                  $val = intval($val);
               $key = intval($key);
               $this->db->query("update zzhds_vote_option set listorder='$val' where optionid='$key'");
         } 
           return $this->db->affected_rows();
}  

function set_listorder($data)

{

if(!is_array($data)) return FALSE;
foreach($data as $key=>$val)
{
$val = intval($val);
$key = intval($key);
$this->db->query("update zzhds_vote_option set listorder='$val' where optionid='$key'");
}
Return $this->db->affected_rows();
}
In fact, the PC itself has a function for this operation, but it seems not to be enabled.

After making the changes, update the cache, go to the backend->vote, select your vote, and try modifying the options.


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/477594.htmlTechArticle Regarding the modification of the phpcms v9 voting module option sorting listorder setting issue, I mainly modified three files and three places. I think this method is enough for me, and everyone is welcome to try it out. ...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to change the personal name in the group on DingTalk_How to modify the personal name in the group on DingTalk How to change the personal name in the group on DingTalk_How to modify the personal name in the group on DingTalk Mar 29, 2024 pm 08:41 PM

1. First open DingTalk. 2. Open the group chat and click the three dots in the upper right corner. 3. Find my nickname in this group. 4. Click to enter to modify and save.

Can Douyin Blue V change its name? What are the steps to change the name of corporate Douyin Blue V account? Can Douyin Blue V change its name? What are the steps to change the name of corporate Douyin Blue V account? Mar 22, 2024 pm 12:51 PM

Douyin Blue V certification is the official certification of a company or brand on the Douyin platform, which helps enhance brand image and credibility. With the adjustment of corporate development strategy or the update of brand image, the company may want to change the name of Douyin Blue V certification. So, can Douyin Blue V change its name? The answer is yes. This article will introduce in detail the steps to modify the name of the enterprise Douyin Blue V account. 1. Can Douyin Blue V change its name? You can change the name of Douyin Blue V account. According to Douyin’s official regulations, corporate Blue V certified accounts can apply to change their account names after meeting certain conditions. Generally speaking, enterprises need to provide relevant supporting materials, such as business licenses, organization code certificates, etc., to prove the legality and necessity of changing the name. 2. What are the steps to modify the name of corporate Douyin Blue V account?

How to modify the address location of published products on Xianyu How to modify the address location of published products on Xianyu Mar 28, 2024 pm 03:36 PM

When publishing products on the Xianyu platform, users can customize the geographical location information of the product according to the actual situation, so that potential buyers can more accurately grasp the specific location of the product. Once the product is successfully put on the shelves, there is no need to worry if the seller's location changes. The Xianyu platform provides a flexible and convenient modification function. So when we want to modify the address of a published product, how do we modify it? This tutorial guide will provide you with a detailed step-by-step guide. I hope it can help. Everyone! How to modify the release product address in Xianyu? 1. Open Xianyu, click on what I published, select the product, and click Edit. 2. Click the positioning icon and select the address you want to set.

How to sort WPS scores How to sort WPS scores Mar 20, 2024 am 11:28 AM

In our work, we often use wps software. There are many ways to process data in wps software, and the functions are also very powerful. We often use functions to find averages, summaries, etc. It can be said that as long as The methods that can be used for statistical data have been prepared for everyone in the WPS software library. Below we will introduce the steps of how to sort the scores in WPS. After reading this, you can learn from the experience. 1. First open the table that needs to be ranked. As shown below. 2. Then enter the formula =rank(B2, B2: B5, 0), and be sure to enter 0. As shown below. 3. After entering the formula, press the F4 key on the computer keyboard. This step is to change the relative reference into an absolute reference.

How to reorder multiple columns in Power Query via drag and drop How to reorder multiple columns in Power Query via drag and drop Mar 14, 2024 am 10:55 AM

In this article, we will show you how to reorder multiple columns in PowerQuery by dragging and dropping. Often, when importing data from various sources, columns may not be in the desired order. Reordering columns not only allows you to arrange them in a logical order that suits your analysis or reporting needs, it also improves the readability of your data and speeds up tasks such as filtering, sorting, and performing calculations. How to rearrange multiple columns in Excel? There are many ways to rearrange columns in Excel. You can simply select the column header and drag it to the desired location. However, this approach can become cumbersome when dealing with large tables with many columns. To rearrange columns more efficiently, you can use the enhanced query editor. Enhancing the query

How to sort WPS tables to facilitate data statistics How to sort WPS tables to facilitate data statistics Mar 20, 2024 pm 04:31 PM

WPS is a very complete office software, including text editing, data tables, PPT presentations, PDF formats, flow charts and other functions. Among them, the ones we use most are text, tables, and demonstrations, and they are also the ones we are most familiar with. In our study work, we sometimes use WPS tables to make some data statistics. For example, the school will count the scores of each student. If we have to manually sort the scores of so many students, it will be really a headache. In fact, we don’t have to worry, because our WPS table has a sorting function to solve this problem for us. Next, let’s learn how to sort WPS together. Method steps: Step 1: First we need to open the WPS table that needs to be sorted

What framework is phpcms? What framework is phpcms? Apr 20, 2024 pm 10:51 PM

PHP CMS is a PHP-based open source content management system for managing website content. Its features include ease of use, powerful functionality, scalability, high security, and free open source. It can save time, improve website quality, enhance collaboration and reduce development costs, and is widely used in various websites such as news websites, blogs, corporate websites, e-commerce websites and community forums.

Discuz registration must-read: How to change username and password Discuz registration must-read: How to change username and password Mar 13, 2024 am 08:48 AM

Discuz registration must-read: How to change username and password, specific code examples are required Discuz is a very popular forum program, and many websites choose to use it to build their own online communities. When registering with Discuz, sometimes we need to change the username and password. This article will introduce in detail how to change the username and password in Discuz, and provide specific code examples for your reference. Modifying the user name Modifying the user name in Discuz requires database operations. First, we need

See all articles