我们的网站上有一个包含
的脚本_BASEURL_
但我们需要将其更改为https(安全),因此我们将代码更改为:
https://www.domain.com/
然而我们现在得到白屏。如果有人可以提供帮助,下面是代码。
public function getSlideshow() {
$id_shop = (int)Context::getContext()->shop->id;
$id_lang = (int)$this->context->language->id;
$sql = 'SELECT * FROM `' . _DB_PREFIX_ . 'pos_sequence` ps
LEFT JOIN `' . _DB_PREFIX_ . 'pos_sequence_lang` psl ON ps.id_pos_sequence = psl.id_pos_sequence
LEFT JOIN `' . _DB_PREFIX_ . 'pos_sequence_shop` s ON ps.id_pos_sequence = s.id_pos_sequence
WHERE s.`id_shop` ='.$id_shop.'
AND psl.`id_lang` ='.$id_lang.'
AND ps.`active` =1
ORDER BY `porder` ASC';
$slides = Db::getInstance()->ExecuteS($sql);
if(is_array($slides)){
$limit = 0;
$arraySlides = array();
foreach($slides as $key => $slideArray) {
//echo "<pre>"; print_r($slideArray);
$newSlide = array();
foreach($slideArray as $k => $v) {
if($k=='bgimage' ){
$v = https://www.domain.com/.'modules/possequence/images/bgimage_'.$slideArray['id_pos_sequence'].'.jpg';
}
if($k=='image' ){
$v = https://www.domain.com/.'modules/possequence/images/image_'.$slideArray['id_pos_sequence'].'.jpg';
}
if($k=='image2' ){
$v = https://www.domain.com/.'modules/possequence/images/image2_'.$slideArray['id_pos_sequence'].'.jpg';
}
$newSlide[$k] = $v;
}
$arraySlides[$key] = $newSlide;
}
}
return $arraySlides;
}
我们改变的部分是&#34; bgimage&#34; - &#34;图像&#34;和&#34; image2&#34;。
答案 0 :(得分:1)
你错过了某些行的开场报价......
if($k=='bgimage') {
$v = 'https://www.domain.com/modules/possequence/images/bgimage_'.$slideArray['id_pos_sequence'].'.jpg';
}
if($k=='image') {
$v = 'https://www.domain.com/modules/possequence/images/image_'.$slideArray['id_pos_sequence'].'.jpg';
}
if($k=='image2') {
$v = 'https://www.domain.com/modules/possequence/images/image2_'.$slideArray['id_pos_sequence'].'.jpg';
}
编辑:再次阅读您的问题之后,您可能实际上可能只是在代码中的某处更新_BASEURL_
常量。避免头痛,只需搜索设置的位置(看起来像这样):
define('_BASEURL_', 'http://domain.com');
如果你在那里更新它,它将节省你必须找到它需要在你的代码中更改的所有pleaces。
答案 1 :(得分:0)
您的PHP代码无效,因此解析器会因错误而停止。由于您的服务器设置为不在前端显示错误(这很好),您只需获得一个白页。您应该能够在Web服务器的日志中找到错误消息。
将https://www.domain.com/的三个出现用单引号括起来,如下所示:
$v = 'https://www.domain.com/'.'modules/possequence/images/bgimage_'.$slideArray['id_pos_sequence'].'.jpg';
或者只是将该部分放入现有的字符串中:
$v = 'https://www.domain.com/modules/possequence/images/bgimage_'.$slideArray['id_pos_sequence'].'.jpg';