About how to set listorder in the option sorting of the phpcms v9 voting module, the younger brother changed three files in three places.
I think this method is enough. You are welcome to make a brick.
Modify three files:
1. Found in phpcms \ modules \ vote \ templates \ vote_edit.tpl.php
[Html]
<Input type = "text" name = "option [<? Php echo $ option ['optionid']?>] "Size =" 40 "require =" true "value =" <? Php echo $ option ['option'];?> "/>
<Input type = "text" name = "option [<? Php echo $ option ['optionid']?>] "Size =" 40 "require =" true "value =" <? Php echo $ option ['option'];?> "/> Add a piece of code to the end of the text box for sorting forms
[Html]
Sort: <input type = "text" value = "<? Php echo $ option ['storder'];?> "Name =" piaoshu [<? Php echo $ option ['optionid']?>] ">
Sort: <input type = "text" value = "<? Php echo $ option ['storder'];?> "Name =" piaoshu [<? Php echo $ option ['optionid']?>] "> Save.
2. Found in phpcms \ modules \ vote. php
[Html]
$ This-> db2-> update_options ($ _ POST ['option']);
$ This-> db2-> update_options ($ _ POST ['option']); add
[Html]
$ This-> db2-> set_listorder ($ _ POST ['piaoshu']);
$ This-> db2-> set_listorder ($ _ POST ['piaoshu']); save. This operation is not filtered. You can consider it.
3. Found in phpcms \ model \ vote_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 ();
}
Modify
[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 the function for this operation, but it does not seem to have been enabled.
After the change, update the cache. Go to the backend and select your vote in the voting area. Modify the options and try again.