View file wap_snapshot/wap_common.php

File size: 1.54Kb
<?php

header("Content-type: text/vnd.wap.wml");
header("Cache-Control: no-cache");

$phpbb_root_path = "./"; //change these settings to your requirements
$phpEx = "php";
$sqlserver="localhost";
$sqlpassword="";
$database="";
$sqluser="";

$TABLE_PREFIX="phpbb_";

// this block of constants is not currently used
$ALLOW_LOGON=TRUE;
$ALLOW_POST_NEW=TRUE;
$ALLOW_POST_REPLY=TRUE;
$ALLOW_VIEW_PM=TRUE;
$ALLOW_SEND_PM=TRUE;

$NUM_NEW_POSTS = 5;
$NUM_TOPICS_LIST = 10;
$NUM_THREAD_ITEMS = 10;


$DEBUG = TRUE;




require($phpbb_root_path . 'db/mysql.'.$phpEx); //change this depending on the type of databese you are using. Check out the db abstraction files in phpbb/db/DATABASETYPE.php

function encode_ip($dotquad_ip)
{
	$ip_sep = explode('.', $dotquad_ip);
	return sprintf('%02x%02x%02x%02x', $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]);
}




function make_bbcode_uid()
{
	// Unique ID for this message..

	$uid = md5(mt_rand());
	$uid = substr($uid, 0, 10);

	return $uid;
}

function wapheader(){

  print("<?xml version='1.0'?>");
  print("<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">");
  print( "<wml>");
  return;

}

function start_card( $id, $title){
  print("<card id=\"$id\" title=\"$title\">");
  return;
}

function end_card(){
  print("</card>");
  return;
}



$db= new sql_db($sqlserver, $sqluser, $sqlpassword, $database, $persistency = true);

if(!$db->db_connect_id)
{
  die( "Could not connect to the database");
}



?>