sorry the if statements look like:
PHP Code:
$db->hide_errors();
$ain_info = $vbulletin->db->query_first("
SELECT fh_loc_1, fh_loc_2, fh_loc_3, fh_adid_1, fh_adid_2, fh_adid_3
FROM " . TABLE_PREFIX . "adsopt AS adsopt
WHERE id = '1' ");
$db->show_errors();
if($ain_info['fh_adid_1'] != '0'){
//code for data 1
}
if($ain_info['fh_adid_2'] != '0'){
//code for data 2
}
if($ain_info['fh_adid_3'] != '0'){
//code for data 3
}
code for data is the same as what I wirte in first post something like:
PHP Code:
$ain_data = $vbulletin->db->query_first("
SELECT id, type, content
FROM " . TABLE_PREFIX . "ainadse AS ainadse
WHERE id = '1' ");
if($ain_info['fh_loc_1'] == '1'){
$vbulletin->templatecache['FORUMHOME'] = str_replace('$navbar', '$ain_tableh $ain_tablef'.'$navbar', $vbulletin->templatecache['FORUMHOME']);}
elseif($ain_info['fh_loc_1'] == '2'){
$vbulletin->templatecache['FORUMHOME'] = str_replace('$navbar', '$navbar'.'$ain_tableh $ain_tablef', $vbulletin->templatecache['FORUMHOME']);}
whereas $ain_tableh $ain_tablef fetch the templates:
PHP Code:
eval('$ain_tableh .= "' . fetch_template('ain_tableh') . '";');
eval('$ain_tablef .= "' . fetch_template('ain_tablef') . '";');
I also try using fetch_template('ain_tablef') in the str_replace command but it's the same
the template always read the last variable in the plugin no matter if there is (if)s or not
hope it's clear to find where is the problem
thanks for your response