1. 程式人生 > >phpcms更新所有欄目為生成HTML設定,內容頁生成靜態

phpcms更新所有欄目為生成HTML設定,內容頁生成靜態

模型對應的表名在這個表中:mx_model

UPDATE mx_category SET setting = REPLACE(setting, "'ishtml' => '0'", "'ishtml' => '1'"); 

UPDATE mx_category SET setting = REPLACE(setting, "'content_ishtml' => '0'", "'content_ishtml' => '1'"); 
注意比對,將不同的引數都替換過來。感覺這種儲存資料的方法比較麻煩。。

array (
  'workflowid' => '',
  'ishtml' => '1',
  'content_ishtml' => '1',
  'create_to_html_root' => '0',
  'template_list' => 'default',
  'category_template' => '',
  'list_template' => 'list_product',
  'show_template' => 'show_product',
  'meta_title' => '',
  'meta_keywords' => '',
  'meta_description' => '',
  'presentpoint' => '1',
  'defaultchargepoint' => '0',
  'paytype' => '0',
  'repeatchargedays' => '1',
  'category_ruleid' => '6',
  'show_ruleid' => '16',
)



array (
  'workflowid' => '',
  'ishtml' => '1',
  'content_ishtml' => '1',
  'create_to_html_root' => '0',
  'template_list' => 'default',
  'category_template' => 'category',
  'list_template' => 'list',
  'show_template' => 'show',
  'meta_title' => '',
  'meta_keywords' => '',
  'meta_description' => '',
  'presentpoint' => '1',
  'defaultchargepoint' => '0',
  'paytype' => '0',
  'repeatchargedays' => '1',
  'category_ruleid' => '1',
  'show_ruleid' => '11',
)



好像這樣就可以了。

如果還是不行的話,就把表mx_category的url欄位都清空。再後臺-》內容-》內容相關設定-》管理欄目-》更新欄目快取,最後再更新下所有欄目就行了。

我是除錯的這個檔案\phpcms\modules\admin\category.php

edit()方法

或者 :

方法:private function repair(

                    //if($catid == 15 || $catid == 16){
                        //echo $url.'==========';
                    //}
                    //if($catid == 16) exit;

內容頁生成靜態,需要指定模板,如表:mx_news_data中的template欄位

PHPCMS內容頁模板是可以任意指定的,這點和DEDECMS不同,DEDECMS中內容模板是跟隨欄目指定的。

注意更新連結:

    批量更新欄目頁
    生成首頁
    批量更新URL
    批量更新內容頁