關於phpcms v9投票模組選項排序問題修改_PHP教程

來源:互聯網
上載者:User
關於phpcms v9投票模組選項排序listorder設定問題修改,小弟主要修改了三個檔案三處地方。

此方法我覺得自己已經夠用,歡迎大家來拍磚。

主要修改三個檔案:

1.phpcms\modules\vote\templates\vote_edit.tpl.php中找到

[html]

在後面添加一段代碼,有關排序的表單文字框


[html]
排序:

排序:儲存。

2.phpcms\modules\vote\vote.php中找到


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

$this->db2->update_options($_POST['option']);在下面加上


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

$this->db2->set_listorder($_POST['piaoshu']);儲存。本次操作沒有過濾,朋友們可以考慮一下。

3.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();
}

修改成


[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();
}
其實pc本身有這個操作的函數,不過好像沒啟用。

改完之後更新一下緩衝,進後台->投票中選擇您的投票,修改選項試下吧。


http://www.bkjia.com/PHPjc/477594.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/477594.htmlTechArticle關於phpcms v9投票模組選項排序listorder設定問題修改,小弟主要修改了三個檔案三處地方。 此方法我覺得自己已經夠用,歡迎大家來拍磚。...

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    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.