DetroitYES
03-27-2012, 06:41 PM
I want the custom page that my product uses ( DIR /atdasd.php) to have its own mobile template as well as its default full screen display. Much the way showthread or any of the templates work in mobile.
I know that I could go into the mobile style, and reconfigure the template manually, but is there anyway to package this with the install?
The most user friendly method i have come up with is to include the mobile template in the master style and then instruct users to copy this code, and paste it into the appropriate template on the mobile style...
Is there a more streamlined way of including this? Thanks.
Edit... I've figured out how to hack this into the actual script using the 'bb_skipmobilestyle' cookie. It is not as pretty as having the mobile template stored in the mobile style, but is more user friendly...
// pre-cache templates used by all actions
if ($_COOKIE['bb_skipmobilestyle'] == 0)
{
$globaltemplates = array(
'ad_board_after_forums',
'ad_board_below_whats_going_on',
'block_html',
'atdasd_mobile',
);
}
else
{
$globaltemplates = array(
'ad_board_after_forums',
'ad_board_below_whats_going_on',
'block_html',
'ATDASD',
);
}
And a further question, can anyone explain to me why the above code works, but this will not? Am I somehow breaking the array syntax?
if ($_COOKIE['bb_skipmobilestyle'] == 0)
{
$atdasd_product_template = 'atdasd_mobile';
}
else
{
$atdasd_product_template = 'ATDASD';
}
$globaltemplates = array(
'ad_board_after_forums',
'ad_board_below_whats_going_on',
'block_html',
$atdasd_product_template,
);
I know that I could go into the mobile style, and reconfigure the template manually, but is there anyway to package this with the install?
The most user friendly method i have come up with is to include the mobile template in the master style and then instruct users to copy this code, and paste it into the appropriate template on the mobile style...
Is there a more streamlined way of including this? Thanks.
Edit... I've figured out how to hack this into the actual script using the 'bb_skipmobilestyle' cookie. It is not as pretty as having the mobile template stored in the mobile style, but is more user friendly...
// pre-cache templates used by all actions
if ($_COOKIE['bb_skipmobilestyle'] == 0)
{
$globaltemplates = array(
'ad_board_after_forums',
'ad_board_below_whats_going_on',
'block_html',
'atdasd_mobile',
);
}
else
{
$globaltemplates = array(
'ad_board_after_forums',
'ad_board_below_whats_going_on',
'block_html',
'ATDASD',
);
}
And a further question, can anyone explain to me why the above code works, but this will not? Am I somehow breaking the array syntax?
if ($_COOKIE['bb_skipmobilestyle'] == 0)
{
$atdasd_product_template = 'atdasd_mobile';
}
else
{
$atdasd_product_template = 'ATDASD';
}
$globaltemplates = array(
'ad_board_after_forums',
'ad_board_below_whats_going_on',
'block_html',
$atdasd_product_template,
);