8. Configuration

fix_code.php is a file containing a similar function to html_fix(). It strips out all non-wml syntax using preg_replace and str_replace and is called when ob_start is called. Information about this file has been included here as it should be edited further to strip out any additional content that is not required.

Brief details on how to use these files were outlined here, additional information follows.

One site serving multiple devices using one code base

  1. Upload all files
  2. Log in as an administrator and enable all the uploaded templates
  3. Make the required changes to common.inc
  4. Amend the settings.php file in sites/default directory as detailed previously

Multisites using one code base

For more information on how to set up multisites with Drupal, please visit: instructions or overview.

  1. Upload all files
  2. Log in as an administrator and enable all the uploaded templates
  3. Make the required changes to common.inc
  4. Amend the settings.php file in sites/device_name directory specifying the $or to match the device of choice 8.1

8.1 The whole detection script does not need to be included in settings.php if the device type is know. Below is an example for WAP / WML site.

<?php
DEFINE 
('DETECT_PATH''/path/to/detect_directory/'); // change to suit

$fixfile     DETECT_PATH .'fix_code.php';
drupal_set_header('Content-Type: text/vnd.wap.wml; charset=utf-8');
drupal_set_header('Vary: Accept');

    $conf['default_nodes_main'] = 2;
    
$conf['anonymous']   = 'Mobile User';
    
drupal_set_header('Content-Type: text/vnd.wap.wml, true');
    include 
$fixfile// extra file for stripping out non-wml syntax
    
ob_start('fix_code');
    
$conf['theme_custom']  = 'wap'// change to suit
    
$conf['theme_default'] = 'wap'// change to suit
    
$output '';