Author Topic: Diferent templates. One for web and other for wap page  (Read 6350 times)

0 Members and 1 Guest are viewing this topic.

Offline universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Diferent templates. One for web and other for wap page
« on: March 10, 2005, 01:34:46 PM »
I was thinking, is it possible to do this:
There is a page: http://www.pramoga.net
User can access it and use. But. How can I make other template (for wap), and users may access http://www.pramoga.net
through the adress http://wap.pramoga.net. Is it clear? Hmm I think so.
In the server wap directory for the domain wap.pramoga.net is like http://www.pramoga.net/wap/

So is it possible to use my page, by changing template only for subdomain wap.pramoga.net? Thanks for the answers. :)
Again this addres?!
http://www.funny.lt

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Re: Diferent templates. One for web and other for wap page
« Reply #1 on: March 10, 2005, 01:45:38 PM »
Open global.php and search for

Code: [Select]
while ($row = $site_db->fetch_array($result)) {
  $config[$row['setting_name']] = $row['setting_value'];
}
$site_db->free_result();

Add the following below this part

Code: [Select]
if ($HTTP_SERVER_VARS['HTTP_HOST'] == 'wap.pramoga.net') {
    $config['template_dir'] = $config['template_dir'] . '_wap';
}

If you use the template pack "default", you have to create a new pack called "default_wap".
If your gallery is accessed through http://wap.pramoga.net, the pack "default_wap" is used automatically instead of "default".

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: Diferent templates. One for web and other for wap page
« Reply #2 on: March 10, 2005, 01:50:26 PM »
Okey... But now I must use redirect? Because pramoga.net/wap directory is empty.
Again this addres?!
http://www.funny.lt

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Re: Diferent templates. One for web and other for wap page
« Reply #3 on: March 10, 2005, 02:04:24 PM »
Just change your subdomain settings to point directly to the folder where 4images is installed.

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: Diferent templates. One for web and other for wap page
« Reply #4 on: March 10, 2005, 02:16:56 PM »
Thanks, I`ll try this  :)
Again this addres?!
http://www.funny.lt

Offline universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: Diferent templates. One for web and other for wap page
« Reply #5 on: March 10, 2005, 02:29:49 PM »
hmm I`m able to use only redirect, I can`t use subdomain as parked domain.
Any sugestions?
Again this addres?!
http://www.funny.lt

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Re: Diferent templates. One for web and other for wap page
« Reply #6 on: March 10, 2005, 02:39:22 PM »
On't know if it works, but try to redirect from the wap directory to your 4images directory. Creat in your wap directory a file index.php with the fllowing code:
Code: [Select]
<?php
header
('Location: http://www.pramoga.net/?wap=1');
?>
and use the following code in global.php
Code: [Select]
if (isset($HTTP_GET_VARS['wap'])) {
    $config['template_dir'] = $config['template_dir'] . '_wap';
}
« Last Edit: March 10, 2005, 02:57:39 PM by Jan »
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search

Offline universal

  • Full Member
  • ***
  • Posts: 213
    • View Profile
    • http://www.funny.lt
Re: Diferent templates. One for web and other for wap page
« Reply #7 on: March 10, 2005, 02:51:31 PM »
Pfuu... There is a little bug
Code: [Select]
if (isset($HTTP_GET_VARS['wap'])) {
    $config['template_dir'] = $config['template_dir'] . '_wap';
}

Added ' before ]

Now It works ;]
Thanks Jan!

You can try it  here: http://www.pramoga.net/?wap=1
Again this addres?!
http://www.funny.lt

Offline Jan

  • Administrator
  • 4images Guru
  • *****
  • Posts: 5.024
    • View Profile
    • 4images - Image Gallery Management System
Re: Diferent templates. One for web and other for wap page
« Reply #8 on: March 10, 2005, 02:58:19 PM »
Ah, sorry. Added it also in my original post...

Jan
Your first three "must do" before you ask a question:
1. Forum rules
2. FAQ
3. Search