PDA

View Full Version : Ahead-of-time Mobile Version Upgrade



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

Milea Ionut
January 28, 2013, 08:31 PM
Hi,

This is a very good update! I have an issue:

I can't find this file: /includes/classes/reefless.inc.php I have only reefless.class.php

Is ok to change this file? I ask because the code that you mention are present in this file.

Raivo Vaikla
January 28, 2013, 11:17 PM
I can't find this file: /includes/classes/reefless.inc.php I have only reefless.class.php


I think it's a typo: all files in /classes directory should have .class instead of .inc

I have another issue: I'm using a subdirectory for mobile template - tradehorses.com/m - and it redirects me to tradehorses.com/m/m when I navigate to home page... please advise!

Raivo Vaikla
January 29, 2013, 12:48 AM
5. open the file /includes/classes/rlMobile.inc.php
and find the code (line~ 200):


$poss = strpos($request, '/');

and replace with:


$poss = strpos(rtrim($request, '/'), '/');



ok.. I don't know if it's the right way to do it but If I don't replace the line above with your suggested line then my home page redirect issue would be fixed.......

Regards,
R.

John
January 29, 2013, 03:31 AM
I can't find this file: /includes/classes/reefless.inc.php I have only reefless.class.php

Yes Milea, it mistook with the file name, the correct one is reefless.class.php

John

Vincent Kelly
January 29, 2013, 12:20 PM
I've updated mobile version and made all suggested changes but not getting any options when logged into Account Area can someone help me with this

ATServiceSRL
January 29, 2013, 04:24 PM
Work fine with Explorer. Some problems with Firefox and Chrome...

Milea Ionut
January 29, 2013, 04:32 PM
I have done but i see that now are some problems with image upload on desktop version.

Viktor
January 31, 2013, 06:32 AM
Hello All,

some people found 1 error on add listing page with locked categories. I have fixed it and show here:

go to ftp://templates>>your_mobile_template>>tpl>>controllers>>add_listing.tpl


find javascript function:



var mobileTreeLoadLevel = function(tpl, callback, section){
$('div.tree select').unbind('change').change(function(){
/* clear next already created dropdowns */
$(this).find('option:selected').attr('selected', 'selected');
$(this).nextAll().remove();

/* run xajax function */
if ( $(this).find('option:selected').attr('id') )
{
var id = parseInt($(this).find('option:selected').attr('id' ).split('_')[2]);
if ( !section )
{
var set_section = $(this).attr('class').split('_')[1];
}
else
{
var set_section = $(this).attr('class') ? $(this).attr('class').split('_')[1] : section;
}
xajax_getCatLevel(id, false, tpl, callback, '', set_section);
}

/* next button handler */
var disabled = $(this).find('option:selected').attr('class');
if ( disabled == 'disabled' )
{
$(this).parent().next().fadeOut();
}
else
{
$(this).parent().next().fadeIn();
$(this).parent().next().attr('href', $(this).val());
}
});
};


and replace to:



var mobileTreeLoadLevel = function(tpl, callback, section){
$('div.tree select').unbind('change').change(function(){
/* clear next already created dropdowns */
$(this).find('option:selected').attr('selected', 'selected');
$(this).nextAll().remove();

/* run xajax function */
if ( $(this).find('option:selected').attr('id') )
{
var id = parseInt($(this).find('option:selected').attr('id' ).split('_')[2]);
if ( !section )
{
var set_section = $(this).attr('class').replace('section_', '');
}
else
{
var set_section = $(this).attr('class') ? $(this).attr('class').replace('section_', '') : section;
}
xajax_getCatLevel(id, false, tpl, callback, '', set_section);
}

/* next button handler */
if ( $(this).find('option:selected').hasClass('disabled ') )
{
$(this).parent().next().fadeOut();
}
else
{
$(this).parent().next().fadeIn();
$(this).parent().next().attr('href', $(this).val());
}
});
};


save and check.

Meng Kim
February 3, 2013, 12:06 PM
Dear All,

I have a problem with the upload image in desktop version :

1 - The auto upload doesn't work
2 - Select many files in 1 time, there is no any images display ...

is any meet also the same problem and could you please share the solution ?

Thanks.

Milea Ionut
February 3, 2013, 12:27 PM
Dear All,

I have a problem with the upload image in desktop version :

1 - The auto upload doesn't work
2 - Select many files in 1 time, there is no any images display ...

is any meet also the same problem and could you please share the solution ?

Thanks.
Same issue here!

Viktor
February 4, 2013, 04:12 AM
Hello All,

I have found problem with upload photos after upgrade mobile version:

go to ftp://libs>>upload>>account.php

find code:


$listing_id = is_numeric(strpos($_SERVER['HTTP_REFERER'], $add_photo_path)) ? (int)$_SESSION['add_photo']['listing_id'] : (int)$_SESSION['add_listing']['listing_id'];

and replace to:


$listing_id = is_numeric(strpos($_SERVER['HTTP_REFERER'], $add_photo_path)) && $_SESSION['add_photo']['listing_id'] ? (int)$_SESSION['add_photo']['listing_id'] : (int)$_SESSION['add_listing']['listing_id'];

Deonald Tinambunan
February 6, 2013, 04:05 PM
I have do this but still not work. Still can't upload pictures as user or from admin area.


Hello All,

I have found problem with upload photos after upgrade mobile version:

go to ftp://libs>>upload>>account.php

find code:


$listing_id = is_numeric(strpos($_SERVER['HTTP_REFERER'], $add_photo_path)) ? (int)$_SESSION['add_photo']['listing_id'] : (int)$_SESSION['add_listing']['listing_id'];

and replace to:


$listing_id = is_numeric(strpos($_SERVER['HTTP_REFERER'], $add_photo_path)) && $_SESSION['add_photo']['listing_id'] ? (int)$_SESSION['add_photo']['listing_id'] : (int)$_SESSION['add_listing']['listing_id'];

John
February 12, 2013, 08:14 AM
Hello Deonald,
I have tested pictures upload in admin panel on your website and it works properly for me,
could you explain me in detail what exactly wrong with it? Post here or PM me.

John

Deonald Tinambunan
February 13, 2013, 05:12 PM
Hi John,
Already fix. I sent a ticket few days ago and fixed by Curtis.


Hello Deonald,
I have tested pictures upload in admin panel on your website and it works properly for me,
could you explain me in detail what exactly wrong with it? Post here or PM me.

John

Raymond Yip
March 5, 2013, 09:12 PM
Once I uploaded the pictures, I can no longer remove them. I can't even remove them from the admin. Have anyone had a solution to this?

Raymond Yip
March 5, 2013, 09:43 PM
Another minor bug is that the thumbnail won't work if you upload the image after you mark the item as sold.

Viktor
March 6, 2013, 03:31 AM
Hello Raymond Yip,

Would you please send me ftp access details in my PM I will check it and solve and then write where was a problem.

Viktor
March 12, 2013, 03:47 AM
Hello Raymond,

I have found the problem,

Some times hosting closed on server function DELETE for REQUEST_METHOD function and script cannot delete images. I have changed it to POST and now all ok.

autocy
March 26, 2013, 06:30 PM
Guys,
How did you solve the error with uploading pictures in desktop version?

Viktor
March 27, 2013, 03:26 AM
Hello,

Would you please send me ftp access details in PM I will check and solve it on your site.
Yes we solved it but may be 2-3 different things that's why I need ftp.

Viktor
June 4, 2013, 06:11 AM
All problems with upload images were solved.
If anybody has problem with upload images send me ftp access to my PM and I will solve it. ;)

Hareesh Ghanta
June 4, 2013, 11:11 AM
Hi Viktor,
I do have the same image upload issue.My website is http://getrent.in Hope you have login credentials with you.
I am not sure why i am not able to PM anyone.
thank you.

Regards
hareesh

Giuseppe Zappala
June 4, 2013, 03:43 PM
Hi all, with the mobile version for iphone sign in with facebook button does not work.
To you it work?
Thanks in advance

Dale Balla
June 5, 2013, 12:50 AM
I have the same problem now, I have put in a request for a support ticket, but not heard anything yet. Thanks

Viktor
June 5, 2013, 05:09 AM
Hello Hareesh Ghanta,

I have implemented new version of the image uploader and it's working good for me. Please check it again,

Nguyen Dat tai
June 9, 2013, 01:46 AM
Hello John,

Why can't I rename mobile_default folder?

Thanks!

Steffen Buschkemper
June 9, 2013, 02:02 AM
Hello Nquyen,

You can rename the mobile_default folder to
X stands for your definition..

mobile_XXXXXXX

Best regards
Steffen

Nguyen Dat tai
June 9, 2013, 11:45 PM
Hello Steffen Buschkemper,

No problem, I only want to create a new mobile template from the mobile_default template.

When will a new version of Flynax software be released?


Best regards
Nguyen Dat Tai

Chris Brown
August 13, 2013, 04:44 PM
Hi

I recently updated the mobile version. But seem to have lost the ability to upload images on the pc/desktop version of the website. Any help would be great

Nguyen Dat tai
September 12, 2013, 01:33 PM
How to know my mobile version?

Viktor
September 26, 2013, 09:37 AM
Hello Nguyen Dat tai,

If you can login and registration on your mobile version and can add new listings you have latest version but if you can browse listings it's old version.