Просмотр файла src/centerPoint.php

Размер файла: 6.77Kb
<?php
/*
* Harris WapChat
*
* http://www.successkid.com
*
* Harris WapChat is a wap chat application for personal and corporate used.
* Visit {@link http://www.successkid.com} for more info.
* Copyright (C) 2005 Harris Yusuf Arifin
* 
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* 
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
* 
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
* @author		Harris Yusuf Arifin <[email protected]>
* @copyright	Copyright 2005, Harris Yusuf Arifin
*
* Please support this software by send DONATION to E-GOLD account :
* E-gold Number : 827550
* E-gold Name 	 : earthweb egold
*/

	session_start();
	include("constant.php");
	include("$sysFileDir".FILE_OPEN_DATABASE);
	include("$sysFileDir".FILE_FUNCTIONS);
	include("$sysFileDir".FILE_DISPLAY_MODUL);
	if ($sesPathLang == "") {
		$sesPathLang = "en";
	} 
	include($sysFileDir."langtxt/lang-".$sesPathLang.".php");
	
	
	if (($c) && ($sesUsername))
	{
		if (strpos($c,"?") === false) 
		{
			$sesChoice = $c;
		}
		else 
		{
			$qmpos = strpos($c,"?");
			$sesChoice = (int) substr($c,0,$qmpos);
		}

		

		switch($sesChoice)
		{
			case CHOICE_ROOM_DELETE_CONFIRM:
			$idroom = $_REQUEST['id'];
			include(FILE_CHAT_ROOM_DELETE_CONFIRM);
			break;
			
			case CHOICE_ROOM_AD_GOTO_VIEW:
			$adid		= $_REQUEST['id'];
			include(FILE_CHAT_AD_VIEW);
			break;
			
			case CHOICE_AD_EDIT_SAVE:
			$adname		= $_REQUEST['a'];
			$adtext		= $_REQUEST['b'];
			$adid		= $_REQUEST['d'];
			$adwrap		= $_REQUEST['g'];
			include(FILE_CHAT_AD_EDIT_SAVE);
			break;
			
			case CHOICE_CONVERSATION_GOTO_FORWARD:
			include(FILE_CHAT_FORWARD);
			break;
			
			case CHOICE_ROOM_AD_EDITTEXT:
			$adid=$_REQUEST['id'];
			$idroom = $_REQUEST['roomid'];
			include(FILE_CHAT_AD_GOTO_EDTTEXT);
			break;
		

			case CHOICE_ROOM_AD_GOTO_DEACTIVE:
			$adid=$_REQUEST['id'];
			include(FILE_CHAT_AD_GOTO_DEACTIVATED);
			break;
		
			case CHOICE_ROOM_AD_GOTO_SETDEFAULT:
			$adid=$_REQUEST['id'];
			$idroom = $_REQUEST['roomid'];
			$adtype = $_REQUEST['type'];
			include(FILE_CHAT_AD_GOTO_SETDEFAULT);
			break;
			
			case CHOICE_ADV_DISP_ROOM:
			$sesVarNavigation = $_REQUEST['k'];
			include(FILE_CHAT_AD_DISP_ROOM);
			break;
			
			case CHOICE_ROOM_AD_GOTO_DELETE:
			$adid = $_REQUEST['id'];
			include(FILE_CHAT_AD_DELETE);
			break;
						
			case CHOICE_AD_DISP_AD_OPTIONS:
			$sesVarNavigation = $_REQUEST['k'];
			$adid = $_REQUEST['id'];
			$idroom = $_REQUEST['roomid'];
			$adtype = $_REQUEST['type'];
			include(FILE_CHAT_AD_DISP_AD_OPTIONS);
			break;
			
			
			case CHOICE_AD_DISP_AD:
			$idroom = $_REQUEST['roomid'];
			$idad	=	$_REQUEST['id'];
			$adtype	=	$_REQUEST['id'];
			include(FILE_CHAT_AD_DISP_AD);
			break;			
			
			case CHOICE_AD_CREATE_SAVE:
			$adname		= $_REQUEST['adn'];
			$adtext		= $_REQUEST['atx'];
			$adtype		= $_REQUEST['adType'];
			$adactive	= $_REQUEST['adActive'];	
			$adwrap		= $_REQUEST['adWrap'];
			$adroom		= $_REQUEST['roomid'];
			include(FILE_CHAT_ADCREATE_SAVE);
			break;
			
			case CHOICE_ADV_CREATE:
			include(FILE_CHAT_ADCREATE);
			break;
			
			case CHOICE_ADV_EDIT:
			$idroom = $_REQUEST['roomid'];
			include(FILE_CHAT_ADEDIT);
			break;
	
			case CHOICE_ROOM_GOTO_CHANGE_ROOM:
			$sesDestID="PUBLIC";
			$msg="019|".$sesUsername." ".$txt_exitsroom;
			insertMsgPublic($sesUsername,$sesDestID,$sesRoomID,$msg,$sesCobID);
			delMsg($sesUsername,$sesCobID);
			include(FILE_CHAT_ROOM);
			break;
			
			case CHOICE_ROOM_RESULT_MEMBER:
			$txtMember = $_REQUEST['sr'];	
			if ($txtMember == "sr=") {
			$mbr="";
			} else {
				if (strpos($txtMember,"sr=") > 0 ) {
						$mbr=substr($txtMember,strpos($txtMember,"sr=")+3);
					} else {
						$mbr=$txtMember;
					}
			}
			$sesVarNavigation = $_REQUEST['k'];
			include(FILE_RESULT_MEMBER);
			break;
		
			case CHOICE_ROOM_GOTO_SEARCH_MEMBER:
			include(FILE_SEARCH_MEMBER);
			break;
			
			case CHOICE_ROOM_GOTO_OPTIONS:
			include(FILE_ROOM_OPTIONS);
			break;
			
			case CHOICE_CONVERSATION_REFRESH:
			include(FILE_ROOM_ENTER);
			break;
			
			case CHOICE_ROOM_GOTO_WRITE:
			$setPub=$_REQUEST['pub'];
			if ($_REQUEST['pub'] == '1') {
				$sesDestID="PUBLIC";
			} else {
				$sesDestID=$_REQUEST['destid'];
				$sesTo = $sesDestID;
			}
			include(FILE_CHAT_ROOM_WRITE);		
			break;
			
			case CHOICE_ROOM_GOTO_VIEW_MEMBER:
			$sesVarNavigation = $_REQUEST['k'];
			include(FILE_CHAT_ROOM_VIEW_MEMBER);		
			break;
			
			case CHOICE_ROOM_SEND_MSG:
			$msg = $_REQUEST['msg'];
			$sesDestID = $_REQUEST['dest'];
			if ($sesDestID === "PUBLIC") {
				insertMsgPublic($sesUsername,$sesDestID,$sesRoomID,$msg,$sesCobID);
			} else {
				insertMsgPrivate($sesUsername,$sesDestID,$sesRoomID,$msg,$sesCobID);
			}
			include(FILE_ROOM_ENTER);		
			break;
			
			case CHOICE_GOTO_ROOM;
			$sesVarNavigation = $_REQUEST['k'];
			include(FILE_CHAT_ROOM);		
			break;
			
			case CHOICE_ROOM_CREATE;
			include(FILE_CREATE_ROOM);		
			break;
								
			case CHOICE_ROOM_CREATE_SAVE;
			$txtroom = $_REQUEST['cr'];	
			if ($txtroom === "cr=") {
			$theroom="";
			} else {
				if (strpos($txtroom,"cr=") > 0 ) {
						$theroom=substr($txtroom,strpos($txtroom,"cr=")+3);
					} else {
						$theroom=$txtroom;
					}
			}
			include(FILE_CREATE_ROOM_SAVE);		
			break;
			
			case CHOICE_ROOM_GOTO_EXIT:
			$sesDestID="PUBLIC";
			$msg="019|".$sesUsername." ".$txt_exitsroom;
			insertMsgPublic($sesUsername,$sesDestID,$sesRoomID,$msg,$sesCobID);
			$tmp_user = $sesUsername;
			$tmp_PathBrowser = $sesPathBrowser;
			$tmp_PathLang	 = $sesPathLang;
			$tmp_FileCobrander	= $sesFileCobrander;
			$tmp_CobName	= $sesCobName;
			$tmp_Charset = $sesCharset;
			delMsg($sesUsername,$sesCobID);
			@session_unset();
			@session_destroy();
			$sesPathLang = $tmp_PathLang;
			$sesCharset  = $tmp_Charset;
			include(FILE_CHAT_PAGELOGOUT);
			//header("location:http:../".$tmp_filecob);
			break;
			
					
			case CHOICE_ROOM_DISPROOM:
			$sesVarNavigation = $_REQUEST['k'];
			include(FILE_ROOM_DISP);
			break;
			
			
			case CHOICE_ROOM_DELETE:
			$idroom=$_REQUEST['id'];
			include(FILE_ROOM_DELETE);	
			break;
			
			case CHOICE_ROOM_ENTER:
			$setStart = $_REQUEST['g'];
			$sesRoomID = $_REQUEST['id'];
			$sesRoomName= selectRoom($sesRoomID,$sesCobID);
			include(FILE_ROOM_ENTER);
			break;
			
			default:
			exit;
		}

	}
	else
	{
	exit;
		
	}
include(FILE_CLOSE_DATABASE);
?>