The forum is here for legacy reasons. No new posts will be created. User registration is disabled! If you have any questions, please email us or check https://www.adultscriptpro.com for more details!
You are not logged in.
Pages: 1
How to change mobile link from
http://site.com/mobile/
to
http://m.site.com
Offline
Its a little complicated (i've dont it before for a few sites). I will post a howto tomorrow.
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
Erm...none yet. Will write asap. It requires a lot of modifications, need to test before.
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
In order to make m.domain.com work you need to make the following changes:
1. Copy .htaccess to the /mobile folder
2. Edit mobile/index.php and replace:
$_GET['q'] = 'mobile';
with:
if (!isset($_SERVER['HTTP_HOST']) OR $_SERVER['HTTP_HOST'] != 'm.domain.com') {
$_GET['q'] = 'mobile';
}
3. Edit mobile/mobile.php and replace:
'template_url' => BASE_URL.'/mobile/templates/'.$template,
'template_rel' => RELATIVE_URL.'/mobile/templates/'.$template
with:
'template_url' => MOBILE_URL.'/templates/'.$template,
'template_rel' => MOBILE_REL.'/templates/'.$template
also replace:
define('MOBILE_URL', BASE_URL);
define('MOBILE_REL', RELATIVE_URL);
with:
define('MOBILE_URL', 'http://m.domain.com');
define('MOBILE_REL', '');
4. Edit mobile/templates/default/community.tpl.php and replace:
<?php echo MEDIA_REL; ?>/users/<?php
with:
<?php echo USER_URL,'/';
5. Edit mobile/templates/default/extend/plugins/pagination.plugin.php and replace:
if (isset($_GET['page'])) {
return preg_replace('/page=(\w+)/i', 'page='.$page, CURRENT_URL);
} else {
return CURRENT_URL.((strpos(CURRENT_URL, '?')) ? '&' : '?').'page='.$page;
}
with:
$url = str_replace(BASE_URL, 'http://m.localhost.com', CURRENT_URL);
if (isset($_GET['page'])) {
return preg_replace('/page=(\w+)/i', 'page='.$page, $url);
} else {
return $url.((strpos($url, '?')) ? '&' : '?').'page='.$page;
}
6. Edit libraries/bootstrap.php and replace:
define('THUMB_URL', (defined('CDN_THUMB_URL')) ? CDN_THUMB_URL : MEDIA_REL.'/videos/tmb');
define('PHOTO_URL', (defined('CDN_PHOTO_URL')) ? CDN_PHOTO_URL : MEDIA_REL.'/photos');
define('MODEL_URL', (defined('CDN_MODEL_URL')) ? CDN_MODEL_URL : MEDIA_REL.'/pornstars');
define('USER_URL', (defined('CDN_USER_URL')) ? CDN_USER_URL : MEDIA_REL.'/users');
with:
if (isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == 'm.localhost.com') {
define('THUMB_URL', (defined('CDN_THUMB_URL')) ? CDN_THUMB_URL : MEDIA_URL.'/videos/tmb');
define('PHOTO_URL', (defined('CDN_PHOTO_URL')) ? CDN_PHOTO_URL : MEDIA_URL.'/photos');
define('MODEL_URL', (defined('CDN_MODEL_URL')) ? CDN_MODEL_URL : MEDIA_URL.'/pornstars');
define('USER_URL', (defined('CDN_USER_URL')) ? CDN_USER_URL : MEDIA_URL.'/users');
} else {
define('THUMB_URL', (defined('CDN_THUMB_URL')) ? CDN_THUMB_URL : MEDIA_REL.'/videos/tmb');
define('PHOTO_URL', (defined('CDN_PHOTO_URL')) ? CDN_PHOTO_URL : MEDIA_REL.'/photos');
define('MODEL_URL', (defined('CDN_MODEL_URL')) ? CDN_MODEL_URL : MEDIA_REL.'/pornstars');
define('USER_URL', (defined('CDN_USER_URL')) ? CDN_USER_URL : MEDIA_REL.'/users');
}
Thats it. Now in index.php you can redirect to http://m.domain.com when a visitor has been identified as mobile.
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
is there a way to remove the /mobile/ from the link?
Found this article how mobile link should be,
Great news is that you can maintain the desktop path which they were initially loading, and dynamically send them to the mobile site’s version using the {path} parameter. For example, in the mobile site URL you could enter http://m.example.com/{path} and the desktop site path which the user came from would be maintained in the mobile site URL. In the previous example, if a mobile user viewed http://www.example.com/article.html they would then be redirected to http://m.example.com/article.html.
I think mobile should be separated from the main script and can be installed at m.site.com subdomain. As the premium plugin.
Last edited by Eri (2014-01-09 11:25:59)
Offline
The best way to have mobile is responsive design, however we dont have that yet (no script out there has it yet). Only next version we will have it. The /mobile/ is not included in the URL, unless it is entered in the browser url bar. It can be disabled if you want (and it will return 404).
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
In order to make m.domain.com work you need to make the following changes:
1. Copy .htaccess to the /mobile folder
2. Edit mobile/index.php and replace:$_GET['q'] = 'mobile';
with:
if (!isset($_SERVER['HTTP_HOST']) OR $_SERVER['HTTP_HOST'] != 'm.domain.com') { $_GET['q'] = 'mobile'; }
3. Edit mobile/mobile.php and replace:
'template_url' => BASE_URL.'/mobile/templates/'.$template, 'template_rel' => RELATIVE_URL.'/mobile/templates/'.$template
with:
'template_url' => MOBILE_URL.'/templates/'.$template, 'template_rel' => MOBILE_REL.'/templates/'.$template
also replace:
define('MOBILE_URL', BASE_URL); define('MOBILE_REL', RELATIVE_URL);
with:
define('MOBILE_URL', 'http://m.domain.com'); define('MOBILE_REL', '');
4. Edit mobile/templates/default/community.tpl.php and replace:
<?php echo MEDIA_REL; ?>/users/<?php
with:
<?php echo USER_URL,'/';
5. Edit mobile/templates/default/extend/plugins/pagination.plugin.php and replace:
if (isset($_GET['page'])) { return preg_replace('/page=(\w+)/i', 'page='.$page, CURRENT_URL); } else { return CURRENT_URL.((strpos(CURRENT_URL, '?')) ? '&' : '?').'page='.$page; }
with:
$url = str_replace(BASE_URL, 'http://m.localhost.com', CURRENT_URL); if (isset($_GET['page'])) { return preg_replace('/page=(\w+)/i', 'page='.$page, $url); } else { return $url.((strpos($url, '?')) ? '&' : '?').'page='.$page; }
6. Edit libraries/bootstrap.php and replace:
define('THUMB_URL', (defined('CDN_THUMB_URL')) ? CDN_THUMB_URL : MEDIA_REL.'/videos/tmb'); define('PHOTO_URL', (defined('CDN_PHOTO_URL')) ? CDN_PHOTO_URL : MEDIA_REL.'/photos'); define('MODEL_URL', (defined('CDN_MODEL_URL')) ? CDN_MODEL_URL : MEDIA_REL.'/pornstars'); define('USER_URL', (defined('CDN_USER_URL')) ? CDN_USER_URL : MEDIA_REL.'/users');
with:
if (isset($_SERVER['HTTP_HOST']) && $_SERVER['HTTP_HOST'] == 'm.localhost.com') { define('THUMB_URL', (defined('CDN_THUMB_URL')) ? CDN_THUMB_URL : MEDIA_URL.'/videos/tmb'); define('PHOTO_URL', (defined('CDN_PHOTO_URL')) ? CDN_PHOTO_URL : MEDIA_URL.'/photos'); define('MODEL_URL', (defined('CDN_MODEL_URL')) ? CDN_MODEL_URL : MEDIA_URL.'/pornstars'); define('USER_URL', (defined('CDN_USER_URL')) ? CDN_USER_URL : MEDIA_URL.'/users'); } else { define('THUMB_URL', (defined('CDN_THUMB_URL')) ? CDN_THUMB_URL : MEDIA_REL.'/videos/tmb'); define('PHOTO_URL', (defined('CDN_PHOTO_URL')) ? CDN_PHOTO_URL : MEDIA_REL.'/photos'); define('MODEL_URL', (defined('CDN_MODEL_URL')) ? CDN_MODEL_URL : MEDIA_REL.'/pornstars'); define('USER_URL', (defined('CDN_USER_URL')) ? CDN_USER_URL : MEDIA_REL.'/users'); }
Thats it. Now in index.php you can redirect to http://m.domain.com when a visitor has been identified as mobile.
I followed this but not getting m.domain.com
Offline
Hmmm...it should have worked, it works for me and also for Eri. I can check if you want.
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
Yeah, i double check, i must not get the .htaccess part, copy the one from plublic_html to mobile/
my template looks messed up lol
i sent you the access.
Offline
Ok. I will check.
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
Any update
Offline
None yet. Will check ASAP.
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
Any feedback on the issue?
Offline
I checked, but you didnt have the subdomain setup. I will check again today.
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
Okay, so step 1 should be create a subdomain
I will do that an see what happens.
Offline
My mobile template look messed up after doing step 3.
3. Edit mobile/mobile.php and replace:
'template_url' => BASE_URL.'/mobile/templates/'.$template,
'template_rel' => RELATIVE_URL.'/mobile/templates/'.$template
with:
'template_url' => MOBILE_URL.'/templates/'.$template,
'template_rel' => MOBILE_REL.'/templates/'.$template
also replace:
define('MOBILE_URL', BASE_URL);
define('MOBILE_REL', RELATIVE_URL);
with:
define('MOBILE_URL', 'http://m.domain.com');
define('MOBILE_REL', '');
Offline
You need to finish all steps and then test. BACKUP BACKUP BACKUP!
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
I reverse this to the original and now the template looks normal.
3. Edit mobile/mobile.php and replace:
'template_url' => BASE_URL.'/mobile/templates/'.$template,
'template_rel' => RELATIVE_URL.'/mobile/templates/'.$template
with:
'template_url' => MOBILE_URL.'/templates/'.$template,
'template_rel' => MOBILE_REL.'/templates/'.$template
Offline
Is the subdomain pointed to /where/asp/is/installed/mobile?
Adult Scripts: Adult Script Pro - Adult Search Script
Adult Advertising/Traffic: Plug Rush - EXOClick - PopAds
Offline
If i remember correctly, when i point it to /mobile/ it wouldn't show thumbs, so i changed that to /installed/ then thumbs worked properly. Basically i kept the same root as main config.
Offline
Personally, I go for the suggestion by symtab before
I install the script to another directory using the same database as www.domain.com and point m.domain.com to this new installation.
This works quite well for me.
Offline
Pages: 1