John
January 28, 2013, 11:13 AM
Good day,
We've finished development of the new mobile version, which is part of the next version of Flynax Software - 4.2.0,
but in view of numerous requests we got from our Customers we decided to release it earlier.
In general the new mobile version is just updated mobile template and some changed in the script program core.
Note: Although updating the mobile version is simple but we recommend backing up your site just in case.
Follow the instructions below to update your mobile version based on the default mobile template - mobile_default:
1. Rename the directory of your mobile template on your server, for example, to old_mobile_default (for backup purposes)
2. Download an updated template (v.4.2.0)* of the mobile version from www.flynax.com > customer area > downloads > templates
3. Upload the new template to the /template directory on your server
Note: If your current mobile template was modified then you will have to merge modified files
of the previous template with those of the new one.
4. Remove all the files from the directory: /tmp/mCompile
Then you will need to make some changes to the source code:
1. open the file /includes/classes/reefless.class.php
and find the code (line~ 145):
function redirect( $vars = null, $target = false )
{
if ( !$vars && !$target )
return false;
if ( $target )
{
header( "Location: " . $target );
exit;
}
and replace with:
function redirect( $vars = null, $target = false )
{
if ( !$vars && !$target )
return false;
if ( $target )
{
$target = defined('RL_MOBILE') && RL_MOBILE ? str_replace(SEO_BASE, RL_MOBILE_URL, $target) : $target;
header( "Location: " . $target );
exit;
}
find the code (line~ 155): ADDED at 12 Feb
$request_url = RL_URL_HOME . $request_url;
and replace with:
$desktop_base = defined('REALM') ? RL_URL_HOME : SEO_BASE;
$base = defined('RL_MOBILE') && RL_MOBILE ? preg_replace('/('. RL_LANG_CODE .'\/)$/', '', RL_MOBILE_URL) : $desktop_base;
$request_url = $base . $request_url;
find the code (line~ 200):
function refresh()
{
$addUrl = str_replace( RL_DIR, '', $_SERVER['REQUEST_URI']);
$addUrl = trim($addUrl, '/');
$refresh = RL_URL_HOME . $addUrl;
header( "Location: " . $refresh );
exit;
}
and replace with:
function refresh()
{
$addUrl = str_replace( RL_DIR, '', $_SERVER['REQUEST_URI']);
$addUrl = trim($addUrl, '/');
$refresh = defined('RL_MOBILE') && RL_MOBILE ? RL_MOBILE_URL : RL_URL_HOME;
$refresh .= $addUrl;
header( "Location: " . $refresh );
exit;
}
2. open the file /includes/classes/rlAccounts.inc.php
and find the code (line~ 685):
$tmp_seo_base = $rlMobile -> isMobile ? str_replace(RL_URL_HOME, rtrim(RL_MOBILE_URL, 'index.php'), $tmp_seo_base) : $tmp_seo_base;
and replace with:
$tmp_seo_base = $rlMobile -> isMobile ? str_replace(RL_URL_HOME, rtrim(RL_MOBILE_HOME, 'index.php'), $tmp_seo_base) : $tmp_seo_base;
3. open the file /includes/classes/rlCategories.inc.php
and find the code (line~ 455):
function ajaxGetCatLevel( $category_id, $type = false, $tpl = false, $function = false, $postfix = false )
{
global $_response, $rlSmarty, $rlListingTypes, $account_info;
and replace with:
function ajaxGetCatLevel( $category_id, $type = false, $tpl = false, $function = false, $postfix = false, $section_key = false )
{
global $_response, $rlSmarty, $rlListingTypes, $account_info, $lang;
find the code (line~ 455):
$postfix = $postfix ? '_'. $postfix : '';
$_response -> script("xajaxFix = $('#tree_cat_{$category_id}{$postfix}').find('inpu t').attr('checked');");
$_response -> append("tree_cat_{$category_id}{$postfix}", 'innerHTML', $rlSmarty -> fetch( $file, null, null, false ));
$_response -> script("
$('#tree_cat_{$category_id}{$postfix}>ul').fadeIn('normal');
$('#tree_cat_{$category_id}{$postfix}>img').addClass('opened');
$('#tree_cat_{$category_id}{$postfix}>span.tree_loader').fadeOut(function(){
$(this).hide();
});
if ( xajaxFix == 'checked' )
{
$('#tree_cat_{$category_id}{$postfix}>label>input').attr('checked', true);
}
flynax.treeLoadLevel('{$tpl}', '{$function}');
");
and replace with:
/* mobile version */
if ( defined('RL_MOBILE') && RL_MOBILE )
{
$_response -> append("type_section_{$section_key}", 'innerHTML', $rlSmarty -> fetch( $file, null, null, false ));
$_response -> script("
mobileTreeLoadLevel('{$tpl}', '{$function}', '{$section_key}');
$('#type_section_{$section_key} select:last').css({backgroundColor: '#fdfb75'}).animate({backgroundColor: 'white'}, 1000);
");
}
/* desktop version */
else
{
$postfix = $postfix ? '_'. $postfix : '';
$_response -> script("xajaxFix = $('#tree_cat_{$category_id}{$postfix}').find('inpu t').attr('checked');");
$_response -> append("tree_cat_{$category_id}{$postfix}", 'innerHTML', $rlSmarty -> fetch( $file, null, null, false ));
$_response -> script("
$('#tree_cat_{$category_id}{$postfix}>ul').fadeIn('normal');
$('#tree_cat_{$category_id}{$postfix}>img').addClass('opened');
$('#tree_cat_{$category_id}{$postfix}>span.tree_loader').fadeOut(function(){
$(this).hide();
});
if ( xajaxFix == 'checked' )
{
$('#tree_cat_{$category_id}{$postfix}>label>input').attr('checked', true);
}
flynax.treeLoadLevel('{$tpl}', '{$function}');
");
}
4. open the file /includes/classes/rlCommon.inc.php
and find the code (line~ 185):
global $rlSmarty, $fields, $main_menu, $tpl_settings, $account_info, $deny_pages, $config, $rlMobile;
and replace with:
global $rlSmarty, $fields, $main_menu, $tpl_settings, $account_info, $deny_pages, $config, $rlMobile, $account_menu;
find the code (line~ 210):
/* generate footer menu */
if ( in_array(7, explode(',', $value['Menus'])) )
{
$footer_menu[] = $value;
}
and ADD the following code after code above:
/* generate account menu */
if ( in_array(2, explode(',', $value['Menus']))
&& (!in_array($account_info['Type_ID'], explode(',', $value['Deny'])) || !$account_info['Type_ID'])
&& (!in_array($value['Key'], $deny_pages) || !$deny_pages)
&& (defined('IS_LOGIN') && IS_LOGIN)
)
{
$account_menu[] = $value;
}
5. open the file /includes/classes/rlMobile.inc.php
and find the code (line~ 200):
/* mobile mode redirect */
if ( $config['mobile_location_name'] )
{
$request = trim($_SERVER['REQUEST_URI'], '/');
$poss = strpos($request, '/');
if ( $poss )
{
$request = substr($request, 0, $poss);
}
if ( $config['mobile_location_type'] == 'subdomain' && $rlValid -> getDomain(SEO_BASE) == $_SERVER['HTTP_HOST'] )
{
$this -> redirect(null, $urlHome);
}
elseif ( $config['mobile_location_type'] == 'subdirectory' && $config['mobile_location_name'] != $request )
{
$this -> redirect(null, $urlHome);
}
}
and replace with:
/* mobile mode redirect */
if ( $config['mobile_location_name'] )
{
$request = ltrim($_SERVER['REQUEST_URI'], '/');
$poss = strpos(rtrim($request, '/'), '/');
if ( $poss )
{
$sub_directory = substr($request, 0, $poss);
}
$redirect = $urlHome . $request;
if ( $config['mobile_location_type'] == 'subdomain' && $rlValid -> getDomain(SEO_BASE) == $_SERVER['HTTP_HOST'] )
{
$this -> redirect(null, $redirect);
}
elseif ( $config['mobile_location_type'] == 'subdirectory' && $config['mobile_location_name'] != $sub_directory )
{
$this -> redirect(null, $redirect);
}
}
6. Unzip and upload the files from jquery.zip (see below) to the directory: /libs/jquery/
The new mobile version uses an updated system of photo uploading; so, you will need to update it in the source code as well:
(Skip the following steps if you use Escort script)
1. Go to your server to /libs/upload/ and remove all the files in the directory;
2. Upload the files from the upload.zip to the directory: /libs/upload/;
3. Upload the photo_manager.tpl file from photo_manager.zip to /templates/DESKTOP_TEMPLATE/tpl/blocks/ directory on your server;
4. Upload the admin/photo_manager.tpl file from photo_manager.zip to /admin/tpl/blocks/ directory on your server;
5. Add the following css styles to the /admin/css/style.css and /templates/DESKTOP_TEMPLATE/css/style.css:
.fade
{
opacity: 0;
-webkit-transition: opacity 0.15s linear;
-moz-transition: opacity 0.15s linear;
-o-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
}
.fade.in
{
opacity: 1;
}
Congratulations! You've updated your mobile version to the latest one!
If you have any difficulty updating your mobile version or after updating it you can report issues in this thread
or submit a ticket (https://support.flynax.com/tickets/index.php?_m=tickets&_a=submit) to our Tech Department.
*The new mobile version is part of a new version of Flynax Software, which is to come soon.
*The changes suggested bu Viktor below already added to the mobile templates available in Flynax Download area.
John
We've finished development of the new mobile version, which is part of the next version of Flynax Software - 4.2.0,
but in view of numerous requests we got from our Customers we decided to release it earlier.
In general the new mobile version is just updated mobile template and some changed in the script program core.
Note: Although updating the mobile version is simple but we recommend backing up your site just in case.
Follow the instructions below to update your mobile version based on the default mobile template - mobile_default:
1. Rename the directory of your mobile template on your server, for example, to old_mobile_default (for backup purposes)
2. Download an updated template (v.4.2.0)* of the mobile version from www.flynax.com > customer area > downloads > templates
3. Upload the new template to the /template directory on your server
Note: If your current mobile template was modified then you will have to merge modified files
of the previous template with those of the new one.
4. Remove all the files from the directory: /tmp/mCompile
Then you will need to make some changes to the source code:
1. open the file /includes/classes/reefless.class.php
and find the code (line~ 145):
function redirect( $vars = null, $target = false )
{
if ( !$vars && !$target )
return false;
if ( $target )
{
header( "Location: " . $target );
exit;
}
and replace with:
function redirect( $vars = null, $target = false )
{
if ( !$vars && !$target )
return false;
if ( $target )
{
$target = defined('RL_MOBILE') && RL_MOBILE ? str_replace(SEO_BASE, RL_MOBILE_URL, $target) : $target;
header( "Location: " . $target );
exit;
}
find the code (line~ 155): ADDED at 12 Feb
$request_url = RL_URL_HOME . $request_url;
and replace with:
$desktop_base = defined('REALM') ? RL_URL_HOME : SEO_BASE;
$base = defined('RL_MOBILE') && RL_MOBILE ? preg_replace('/('. RL_LANG_CODE .'\/)$/', '', RL_MOBILE_URL) : $desktop_base;
$request_url = $base . $request_url;
find the code (line~ 200):
function refresh()
{
$addUrl = str_replace( RL_DIR, '', $_SERVER['REQUEST_URI']);
$addUrl = trim($addUrl, '/');
$refresh = RL_URL_HOME . $addUrl;
header( "Location: " . $refresh );
exit;
}
and replace with:
function refresh()
{
$addUrl = str_replace( RL_DIR, '', $_SERVER['REQUEST_URI']);
$addUrl = trim($addUrl, '/');
$refresh = defined('RL_MOBILE') && RL_MOBILE ? RL_MOBILE_URL : RL_URL_HOME;
$refresh .= $addUrl;
header( "Location: " . $refresh );
exit;
}
2. open the file /includes/classes/rlAccounts.inc.php
and find the code (line~ 685):
$tmp_seo_base = $rlMobile -> isMobile ? str_replace(RL_URL_HOME, rtrim(RL_MOBILE_URL, 'index.php'), $tmp_seo_base) : $tmp_seo_base;
and replace with:
$tmp_seo_base = $rlMobile -> isMobile ? str_replace(RL_URL_HOME, rtrim(RL_MOBILE_HOME, 'index.php'), $tmp_seo_base) : $tmp_seo_base;
3. open the file /includes/classes/rlCategories.inc.php
and find the code (line~ 455):
function ajaxGetCatLevel( $category_id, $type = false, $tpl = false, $function = false, $postfix = false )
{
global $_response, $rlSmarty, $rlListingTypes, $account_info;
and replace with:
function ajaxGetCatLevel( $category_id, $type = false, $tpl = false, $function = false, $postfix = false, $section_key = false )
{
global $_response, $rlSmarty, $rlListingTypes, $account_info, $lang;
find the code (line~ 455):
$postfix = $postfix ? '_'. $postfix : '';
$_response -> script("xajaxFix = $('#tree_cat_{$category_id}{$postfix}').find('inpu t').attr('checked');");
$_response -> append("tree_cat_{$category_id}{$postfix}", 'innerHTML', $rlSmarty -> fetch( $file, null, null, false ));
$_response -> script("
$('#tree_cat_{$category_id}{$postfix}>ul').fadeIn('normal');
$('#tree_cat_{$category_id}{$postfix}>img').addClass('opened');
$('#tree_cat_{$category_id}{$postfix}>span.tree_loader').fadeOut(function(){
$(this).hide();
});
if ( xajaxFix == 'checked' )
{
$('#tree_cat_{$category_id}{$postfix}>label>input').attr('checked', true);
}
flynax.treeLoadLevel('{$tpl}', '{$function}');
");
and replace with:
/* mobile version */
if ( defined('RL_MOBILE') && RL_MOBILE )
{
$_response -> append("type_section_{$section_key}", 'innerHTML', $rlSmarty -> fetch( $file, null, null, false ));
$_response -> script("
mobileTreeLoadLevel('{$tpl}', '{$function}', '{$section_key}');
$('#type_section_{$section_key} select:last').css({backgroundColor: '#fdfb75'}).animate({backgroundColor: 'white'}, 1000);
");
}
/* desktop version */
else
{
$postfix = $postfix ? '_'. $postfix : '';
$_response -> script("xajaxFix = $('#tree_cat_{$category_id}{$postfix}').find('inpu t').attr('checked');");
$_response -> append("tree_cat_{$category_id}{$postfix}", 'innerHTML', $rlSmarty -> fetch( $file, null, null, false ));
$_response -> script("
$('#tree_cat_{$category_id}{$postfix}>ul').fadeIn('normal');
$('#tree_cat_{$category_id}{$postfix}>img').addClass('opened');
$('#tree_cat_{$category_id}{$postfix}>span.tree_loader').fadeOut(function(){
$(this).hide();
});
if ( xajaxFix == 'checked' )
{
$('#tree_cat_{$category_id}{$postfix}>label>input').attr('checked', true);
}
flynax.treeLoadLevel('{$tpl}', '{$function}');
");
}
4. open the file /includes/classes/rlCommon.inc.php
and find the code (line~ 185):
global $rlSmarty, $fields, $main_menu, $tpl_settings, $account_info, $deny_pages, $config, $rlMobile;
and replace with:
global $rlSmarty, $fields, $main_menu, $tpl_settings, $account_info, $deny_pages, $config, $rlMobile, $account_menu;
find the code (line~ 210):
/* generate footer menu */
if ( in_array(7, explode(',', $value['Menus'])) )
{
$footer_menu[] = $value;
}
and ADD the following code after code above:
/* generate account menu */
if ( in_array(2, explode(',', $value['Menus']))
&& (!in_array($account_info['Type_ID'], explode(',', $value['Deny'])) || !$account_info['Type_ID'])
&& (!in_array($value['Key'], $deny_pages) || !$deny_pages)
&& (defined('IS_LOGIN') && IS_LOGIN)
)
{
$account_menu[] = $value;
}
5. open the file /includes/classes/rlMobile.inc.php
and find the code (line~ 200):
/* mobile mode redirect */
if ( $config['mobile_location_name'] )
{
$request = trim($_SERVER['REQUEST_URI'], '/');
$poss = strpos($request, '/');
if ( $poss )
{
$request = substr($request, 0, $poss);
}
if ( $config['mobile_location_type'] == 'subdomain' && $rlValid -> getDomain(SEO_BASE) == $_SERVER['HTTP_HOST'] )
{
$this -> redirect(null, $urlHome);
}
elseif ( $config['mobile_location_type'] == 'subdirectory' && $config['mobile_location_name'] != $request )
{
$this -> redirect(null, $urlHome);
}
}
and replace with:
/* mobile mode redirect */
if ( $config['mobile_location_name'] )
{
$request = ltrim($_SERVER['REQUEST_URI'], '/');
$poss = strpos(rtrim($request, '/'), '/');
if ( $poss )
{
$sub_directory = substr($request, 0, $poss);
}
$redirect = $urlHome . $request;
if ( $config['mobile_location_type'] == 'subdomain' && $rlValid -> getDomain(SEO_BASE) == $_SERVER['HTTP_HOST'] )
{
$this -> redirect(null, $redirect);
}
elseif ( $config['mobile_location_type'] == 'subdirectory' && $config['mobile_location_name'] != $sub_directory )
{
$this -> redirect(null, $redirect);
}
}
6. Unzip and upload the files from jquery.zip (see below) to the directory: /libs/jquery/
The new mobile version uses an updated system of photo uploading; so, you will need to update it in the source code as well:
(Skip the following steps if you use Escort script)
1. Go to your server to /libs/upload/ and remove all the files in the directory;
2. Upload the files from the upload.zip to the directory: /libs/upload/;
3. Upload the photo_manager.tpl file from photo_manager.zip to /templates/DESKTOP_TEMPLATE/tpl/blocks/ directory on your server;
4. Upload the admin/photo_manager.tpl file from photo_manager.zip to /admin/tpl/blocks/ directory on your server;
5. Add the following css styles to the /admin/css/style.css and /templates/DESKTOP_TEMPLATE/css/style.css:
.fade
{
opacity: 0;
-webkit-transition: opacity 0.15s linear;
-moz-transition: opacity 0.15s linear;
-o-transition: opacity 0.15s linear;
transition: opacity 0.15s linear;
}
.fade.in
{
opacity: 1;
}
Congratulations! You've updated your mobile version to the latest one!
If you have any difficulty updating your mobile version or after updating it you can report issues in this thread
or submit a ticket (https://support.flynax.com/tickets/index.php?_m=tickets&_a=submit) to our Tech Department.
*The new mobile version is part of a new version of Flynax Software, which is to come soon.
*The changes suggested bu Viktor below already added to the mobile templates available in Flynax Download area.
John