批量替换德语图片地址

hotfix/远程访问多媒体中心
尹诚诚 8 years ago
parent 253b70d7e9
commit 6285a968dc

@ -192,6 +192,48 @@ class Welcome extends CI_Controller {
->set_content_type('application/json')
->set_output(json_encode($obj));
}
//批量替换二级域名如图片或者data域名
function replace_hostname($topnum){
$data=array();
$find_host='http://bilder.chinarundreisen.com/';
$new_host='//bilder.chinarundreisen.com/';
$data['all_information'] = $this->Information_model->search_all_text($find_host,$topnum);
if($data['all_information']){
foreach($data['all_information'] as $item){
echo $item->ic_url.'<br/>';
$item->ic_content=str_replace($find_host, $new_host,$item->ic_content);
$this->InfoContents_model->Update(
$item->ic_id,
$item->ic_url,
$item->ic_url_title,
$item->ic_type,
$item->ic_title,
$item->ic_content,
$item->ic_summary,
$item->ic_seo_title,
$item->ic_seo_description,
$item->ic_seo_keywords,
$item->ic_show_bread_crumbs,
$item->ic_status,
$item->ic_template,
$item->ic_photo,
$item->ic_photo_width,
$item->ic_photo_height,
$item->ic_recommend_tours,
$item->ic_recommend_packages,
$item->ic_ht_area_id,
$item->ic_ht_area_type,
$item->ic_ht_product_id,
$item->ic_ht_product_type,
$item->ic_author
);
}
}else{
echo 'all done';
}
}
private function check_url($subject) {
$result = $subject;

@ -57,9 +57,9 @@ class Information_model extends CI_Model {
return $this->GetList();
}
function search_all_text($keyword) {
function search_all_text($keyword,$topnum=24) {
$this->init();
$this->topNum = 24;
$this->topNum = $topnum;
$sql_keyword = '%' . $this->HT->escape_like_str($keyword) . '%';
$this->search = " AND ic_content like N'$sql_keyword' ";
return $this->GetList();

Loading…
Cancel
Save