โดย putcharaporn_tan » 21/10/2015 5:32 pm
โค้ด: เลือกทั้งหมด
public function base() {
global $config,$db;
$joomla_url = $config['joomla_host'];
$joomla_host = $config['joomla_host'];
$joomla_username = $config['joomla_username'];
$joomla_pass = $config['joomla_pass'];
$joomla_dbname = $config['joomla_dbname'];
$db = new $sql_db();
$db->sql_connect($joomla_host,$joomla_username,$joomla_pass,$joomla_dbname ,'');
print_r( $connect); exit;
if ($config['status'] == 1) {
$joomla_url = $config['joomla_url'];
$joomla_pf = $config['joomla_prefix'];
$img = $img_alt = $img_width = $img_height = '';
if (!empty($joomla_url) && !empty($joomla_pf)) {
$sql = 'SELECT id,name,params,publish_down
FROM ' . $joomla_pf . '_banners ORDER BY RAND()';
$result = $db->sql_query_limit($sql, 0, 1);
while ($row = $db->sql_fetchrow($result)) {
$params = $row['params'];
$params_url = json_decode($params);
$img = $params_url->imageurl;
$img_alt = $params_url->alt;
$img_width = $params_url->width;
$img_height = $params_url->height;
}
}
}
$this->template->assign_vars(array(
'IMG' => $img,
'IMG_ALT' => $img_alt,
'IMG_WIDTH' => $img_width,
'IMG_HEIGHT' => $img_height,
'JOOMLA_URL' => $joomla_url,
));
return $this->helper->render('main.html');
}
}
[code] public function base() {
global $config,$db;
$joomla_url = $config['joomla_host'];
$joomla_host = $config['joomla_host'];
$joomla_username = $config['joomla_username'];
$joomla_pass = $config['joomla_pass'];
$joomla_dbname = $config['joomla_dbname'];
$db = new $sql_db();
$db->sql_connect($joomla_host,$joomla_username,$joomla_pass,$joomla_dbname ,'');
print_r( $connect); exit;
if ($config['status'] == 1) {
$joomla_url = $config['joomla_url'];
$joomla_pf = $config['joomla_prefix'];
$img = $img_alt = $img_width = $img_height = '';
if (!empty($joomla_url) && !empty($joomla_pf)) {
$sql = 'SELECT id,name,params,publish_down
FROM ' . $joomla_pf . '_banners ORDER BY RAND()';
$result = $db->sql_query_limit($sql, 0, 1);
while ($row = $db->sql_fetchrow($result)) {
$params = $row['params'];
$params_url = json_decode($params);
$img = $params_url->imageurl;
$img_alt = $params_url->alt;
$img_width = $params_url->width;
$img_height = $params_url->height;
}
}
}
$this->template->assign_vars(array(
'IMG' => $img,
'IMG_ALT' => $img_alt,
'IMG_WIDTH' => $img_width,
'IMG_HEIGHT' => $img_height,
'JOOMLA_URL' => $joomla_url,
));
return $this->helper->render('main.html');
}
}
[/code]