Category Archives: Games

PHP scripts for phMapDB

phMapDB is a script mainly used for gaming resource sites. If the game allows players to make maps, this is a good way to display maps on your site. No more adding maps the old fashion way, the one of a kind script is here :). I has lots of features for a script that’s just starting out, including map uploading, multiple administrators with permissions, unlimited games and game types. It also features my work in progress template system, so if you want to change the look and don’t know some PHP it’s easy to edit the layout with some simple html knowledge.

 

<?
/*
//================================================================================
* phphq.Net Custom PHP Scripts *
//================================================================================
:- Script Name: phMapDB
:- Version: 1.0b (Beta)
:- Release Date: Oct. 23 2004.
:- Author: Scott L. aka. Panther <scott@phphq.net> http://www.phphq.net
:- Copyright (c) 2004 All Rights Reserved
:-
:- This script is freeware. Permission is granted to copy and distribute this
:- program so long as it is not modified in any way and no fees are exchanged.
:- All copyright text must remain visible and unmodified.
//================================================================================
*/

require_once("./conf.php");

If($glbl[set_allow_rate]) {
If($_POST['dorate']) {
$mapid=intval($_POST['mid']);
$score=intval($_POST['rate']);
If(($mapid) AND ($score) AND ($score<=5)) {
If(!$ph->getrows("SELECT * FROM phmapdb_maps WHERE mid='$mapid' AND mlstrip='".$_SERVER['REMOTE_ADDR']."' LIMIT 1") AND (!$_COOKIE['r$mapid'])) {

$ph->query("UPDATE phmapdb_maps SET mlstrip='".$_SERVER['REMOTE_ADDR']."', mrates=mrates+$score, mvotes=mvotes+1 WHERE mid='$mapid' LIMIT 1");
setcookie("r$mapid",True,time()+87925445);
}
}
header("Location: ".self(true,true));
exit;
}
}

eval("output(\"".get_template("header.html")."\");");
eval("output(\"".get_template("main_table_start.html")."\");");
$self=self(true);
eval("output(\"".get_template("main_header.html")."\");");

//######################################VIEW/SEARCH MAPS#############################
If(($glbl[view]=="maps") OR ($glbl[view]=="search")) {

$max=intval($_GET['max']);
$order=$_GET['order'];
$acdc=$_GET['acdc'];
$game=intval($_GET['game']);
$type=intval($_GET['type']);
$search=$_GET['search'];
$pages="";

If(empty($game)) {
disp_msg("No game selected, please go back and select a game!",true);
}


$query=$ph->query("SELECT tid,tname FROM phmapdb_types WHERE tgames LIKE '%|$game%|'");
while($result=$ph->fetch($query)) {
$type_temp[$result[tid]]=$result[tname];
}
$ph->free($query);

$query=$ph->query("SELECT id,gname FROM phmapdb_games");
while($result=$ph->fetch($query)) {
$game_temp[$result[id]]=$result[gname];
}
$ph->free($query);



If(empty($type)) {
$type="0";
}

If(empty($max)) {
$max=10;
}    Elseif($max<5) {
$limit=5;
}    Elseif($max > 20) {
$limit=20;
} Else {
$max=$max;
}

$valid=array("mauthor","mhits","mrating","mid");
If((!in_array($order,$valid)) OR empty($order)) {
$order="mid";
}

$valid=array("ASC","DESC");
If((!in_array($acdc,$valid)) OR (empty($acdc))) {
$acdc="ASC";
}

If($glbl[view]=="search") {

$string=$_GET['string'];


$extra_query=" AND mtypes LIKE '|%$type%|' ";

If($search=="auth") { //Searching the author

$total_maps=$ph->getrows("SELECT mid FROM phmapdb_maps WHERE mapprove='1' AND mgame='$game' AND mauthor LIKE '%$string%' $extra_query");
$pages=split_pages(self(true,true),$total_maps,$max);
$query=$ph->query("SELECT * FROM phmapdb_maps WHERE mapprove='1' AND mgame='$game' AND mauthor LIKE '%$string%' $extra_query ORDER BY $order $acdc LIMIT $glbl[start],$max");

} Elseif($search=="des") { //Searching the description

$total_maps=$ph->getrows("SELECT mid FROM phmapdb_maps WHERE mapprove='1' AND mgame='$game' AND mdesc LIKE '%$string%' $extra_query");
$pages=split_pages(self(true,true),$total_maps,$max);
$query=$ph->query("SELECT * FROM phmapdb_maps WHERE mapprove='1' AND mgame='$game' AND mdesc LIKE '%$string%' $extra_query ORDER BY $order $acdc LIMIT $glbl[start],$max");

} Elseif($search=="name") { //Searching the map name

$total_maps=$ph->getrows("SELECT mid FROM phmapdb_maps WHERE mapprove='1' AND mgame='$game' AND mname LIKE '%$string%' $extra_query");
$pages=split_pages(self(true,true),$total_maps,$max);
$query=$ph->query("SELECT * FROM phmapdb_maps WHERE mapprove='1' AND mgame='$game' AND mname LIKE '%$string%' $extra_query ORDER BY $order $acdc LIMIT $glbl[start],$max");

} Else { //Not in anything specific

$total_maps=$ph->getrows("SELECT mid FROM phmapdb_maps WHERE mapprove='1' AND mgame='$game' AND (mauthor LIKE '%$string%' OR mname LIKE '%$string%' OR mdesc LIKE '%$string%') $extra_query");
$pages=split_pages(self(true,true),$total_maps,$max);
$query=$ph->query("SELECT * FROM phmapdb_maps WHERE mapprove='1' AND mgame='$game' AND (mauthor LIKE '%$string%' OR mname LIKE '%$string%' OR mdesc LIKE '%$string%') $extra_query ORDER BY $order $acdc LIMIT $glbl[start],$max");

}

} Else {

$total_maps=$ph->getrows("SELECT mid FROM phmapdb_maps WHERE mapprove='1' AND mgame='$game' AND mtypes LIKE '%|$type|%'");
$pages=split_pages(self(true,true),$total_maps,$max);
$query=$ph->query("SELECT * FROM phmapdb_maps WHERE mapprove='1' AND mgame='$game' AND mtypes LIKE '%|$type|%' ORDER BY $order $acdc LIMIT $glbl[start],$max");

}
$query_search=$ph->query("SELECT * FROM phmapdb_types WHERE tgames LIKE '%|$game|%'");
$types="<option value=\"0\">All Maps</option>";

while($result=$ph->fetch($query_search)) {
$types.="<option value=\"".intval($result[tid])."\"";
If($type==$result[tid]) {
$types.=" selected";
}

$types.=">".html($result[tname])."</option>";
}
$ph->free($query_search);

$search_form="<option value=\"\"";If($search==""){$search_form.=" selected";}$search_form.=">Anything</option>";
$search_form.="<option value=\"auth\"";If($search=="auth"){$search_form.=" selected";}$search_form.=">Author</option>";
$search_form.="<option value=\"des\"";If($search=="des"){$search_form.=" selected";}$search_form.=">Description</option>";
$search_form.="<option value=\"name\"";If($search=="name"){$search_form.=" selected";}$search_form.=">Map Name</option>";

eval("output(\"".get_template("search_form.html")."\");");

$order_form_search="<option value=\"mauthor\"";If($order=="mauthor"){$order_form_search.=" selected";}$order_form_search.=">Author</option>";
$order_form_search.="<option value=\"mhits\"";If($order=="mhits"){$order_form_search.=" selected";}$order_form_search.=">Hits</option>";
$order_form_search.="<option value=\"mrating\"";If($order=="mrating"){$order_form_search.=" selected";}$order_form_search.=">Rating</option>";
$order_form_search.="<option value=\"mid\"";If($order=="mid"){$order_form_search.=" selected";}$order_form_search.=">Date</option>";

$order_form_acdc="<option value=\"ASC\"";If($acdc=="ASC"){$order_form_acdc.=" selected";}$order_form_acdc.=">Ascending</option>";
$order_form_acdc.="<option value=\"DESC\"";If($acdc=="DESC"){$order_form_acdc.=" selected";}$order_form_acdc.=">Descending</option>";

eval("output(\"".get_template("maps_order_form.html")."\");");

$extra="";

If($glbl[view]=="search") {

If(empty($total_maps)) {
$extra="Please try again!";
}

If(trim($string)=="") {
$string="Nothing";
}

eval("output(\"".get_template("search_num_results.html")."\");");

} Else {

If(empty($total_maps)) {
$extra="Please try another type!";
}

eval("output(\"".get_template("maps_num_results.html")."\");");

}

If(!empty($total_maps)) {

If($pages) {
eval("output(\"".get_template("maps_pages.html")."\");");
}

while($result=$ph->fetch($query)) {
display_maps($result,"maps_bit");
}
$ph->free($query);

}

//######################################SELECT GAME TYPE#############################
} Else {

eval("output(\"".get_template("games_select_start.html")."\");");

$query=$ph->query("SELECT * FROM phmapdb_games");
while($result=$ph->fetch($query)) {

$gamename=html($result[gname]);

eval("output(\"".get_template("games_bit_start.html")."\");");

$query2=$ph->query("SELECT * FROM phmapdb_types WHERE tgames LIKE '|%".intval($result[id])."%|'");
while($result2=$ph->fetch($query2)) {
@extract($result2);

$url=self(true);
$id=intval($result[id]);
$tid=intval($tid);
$typename=html($tname);

eval("output(\"".get_template("types_bit.html")."\");");

}
$ph->free($query2);

eval("output(\"".get_template("games_bit_end.html")."\");");

}
$ph->free($query);
eval("output(\"".get_template("games_select_end.html")."\");");

}

eval("output(\"".get_template("main_table_end.html")."\");");
eval("output(\"".get_template("footer.html")."\");");

$ph->disconnect();
?>

PHP Game Studio – Game Creation Software Scripts

Have you ever wanted to Create your Own Computer Game but don’t know Where to Start? Well if you answered Yes, Then Game Studio is for You,   Game Studio is an Advanced, Cross Platform Game Creation Software that allows you to develop Commercial Quality Computer Games Without the Need to know any advanced programming languages. It was Written and Developed For Non-Programmers and for people with programming skills with it’s built in ” C ” Like Programming Scripting Language Even Programmers can cut their time in half by using Game Studio.  With Game Studio theres NO Need to know any complex Programming even beginner Computer Users can Create their own Computer Games.

 

 

<?php

/**
V4.61 24 Feb 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.

Set tabs to 4 for best viewing.

*/

// security - hide paths
if (!defined('ADODB_DIR')) die();

class ADODB2_db2 extends ADODB_DataDict {

var $databaseType = 'db2';
var $seqField = false;

function ActualType($meta)
{
switch($meta) {
case 'C': return 'VARCHAR';
case 'XL': return 'CLOB';
case 'X': return 'VARCHAR(3600)';

case 'C2': return 'VARCHAR'; // up to 32K
case 'X2': return 'VARCHAR(3600)'; // up to 32000, but default page size too small

case 'B': return 'BLOB';

case 'D': return 'DATE';
case 'T': return 'TIMESTAMP';

case 'L': return 'SMALLINT';
case 'I': return 'INTEGER';
case 'I1': return 'SMALLINT';
case 'I2': return 'SMALLINT';
case 'I4': return 'INTEGER';
case 'I8': return 'BIGINT';

case 'F': return 'DOUBLE';
case 'N': return 'DECIMAL';
default:
return $meta;
}
}

// return string must begin with space
function _CreateSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint)
{
$suffix = '';
if ($fautoinc) return ' GENERATED ALWAYS AS IDENTITY'; # as identity start with
if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault";
if ($fnotnull) $suffix .= ' NOT NULL';
if ($fconstraint) $suffix .= ' '.$fconstraint;
return $suffix;
}

function AlterColumnSQL($tabname, $flds)
{
if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
return array();
}


function DropColumnSQL($tabname, $flds)
{
if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
return array();
}


function xChangeTableSQL($tablename, $flds, $tableoptions = false)
{

/**
Allow basic table changes to DB2 databases
DB2 will fatally reject changes to non character columns

*/


$validTypes = array("CHAR","VARC");
$invalidTypes = array("BIGI","BLOB","CLOB","DATE", "DECI","DOUB", "INTE", "REAL","SMAL", "TIME");
// check table exists
$cols = &amp;$this->MetaColumns($tablename);
if ( empty($cols)) {
return $this->CreateTableSQL($tablename, $flds, $tableoptions);
}

// already exists, alter table instead
list($lines,$pkey) = $this->_GenFields($flds);
$alter = 'ALTER TABLE ' . $this->TableName($tablename);
$sql = array();

foreach ( $lines as $id => $v ) {
if ( isset($cols[$id]) &amp;&amp; is_object($cols[$id]) ) {
/**
If the first field of $v is the fieldname, and
the second is the field type/size, we assume its an
attempt to modify the column size, so check that it is allowed
$v can have an indeterminate number of blanks between the
fields, so account for that too
*/

$vargs = explode(' ' , $v);
// assume that $vargs[0] is the field name.
$i=0;
// Find the next non-blank value;
for ($i=1;$i<sizeof($vargs);$i++)
if ($vargs[$i] != '')
break;

// if $vargs[$i] is one of the following, we are trying to change the
// size of the field, if not allowed, simply ignore the request.
if (in_array(substr($vargs[$i],0,4),$invalidTypes))
continue;
// insert the appropriate DB2 syntax
if (in_array(substr($vargs[$i],0,4),$validTypes)) {
array_splice($vargs,$i,0,array('SET','DATA','TYPE'));
}

// Now Look for the NOT NULL statement as this is not allowed in
// the ALTER table statement. If it is in there, remove it
if (in_array('NOT',$vargs) &amp;&amp; in_array('NULL',$vargs)) {
for ($i=1;$i<sizeof($vargs);$i++)
if ($vargs[$i] == 'NOT')
break;
array_splice($vargs,$i,2,'');
}
$v = implode(' ',$vargs);
$sql[] = $alter . $this->alterCol . ' ' . $v;
} else {
$sql[] = $alter . $this->addCol . ' ' . $v;
}
}

return $sql;
}

}


?>

&amp;nbsp;


PHP Premium PH Arcade Software Games

Ph Arcade is powerful arcade flash game software. In no time you can have a flash, games website of your own. It offers support and we are sure to be available and won’t leave you in the dark. The script gets better and better as updates are available for the premium script. The files of the script are very clean and optimized pretty well for SEO. Its also easy to install. Your arcade will have a full admin panel so you can easily add in your description and metatag, add games, make categories, make your own pages, add sitewide links, add custom pages, turn on/off the ads, force signups and much more. In the front end it has many features. Visitors can register, make comments on the games, tell a friend, embedding code, full screen, rating system, a profile system, and much more.

 

 

<?php

/**
V4.61 24 Feb 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.

Set tabs to 4 for best viewing.

*/


// security - hide paths
if (!defined('ADODB_DIR')) die();

class ADODB2_postgres extends ADODB_DataDict {

var $databaseType = 'postgres';
var $seqField = false;
var $seqPrefix = 'SEQ_';
var $addCol = ' ADD COLUMN';
var $quote = '"';
var $renameTable = 'ALTER TABLE %s RENAME TO %s'; // at least since 7.1

function MetaType($t,$len=-1,$fieldobj=false)
{
if (is_object($t)) {
$fieldobj = $t;
$t = $fieldobj->type;
$len = $fieldobj->max_length;
}
$is_serial = is_object($fieldobj) &amp;&amp; $fieldobj->primary_key &amp;&amp; $fieldobj->unique &amp;&amp;
$fieldobj->has_default &amp;&amp; substr($fieldobj->default_value,0,8) == 'nextval(';

switch (strtoupper($t)) {
case 'INTERVAL':
case 'CHAR':
case 'CHARACTER':
case 'VARCHAR':
case 'NAME':
case 'BPCHAR':
if ($len <= $this->blobSize) return 'C';

case 'TEXT':
return 'X';

case 'IMAGE': // user defined type
case 'BLOB': // user defined type
case 'BIT':    // This is a bit string, not a single bit, so don't return 'L'
case 'VARBIT':
case 'BYTEA':
return 'B';

case 'BOOL':
case 'BOOLEAN':
return 'L';

case 'DATE':
return 'D';

case 'TIME':
case 'DATETIME':
case 'TIMESTAMP':
case 'TIMESTAMPTZ':
return 'T';

case 'INTEGER': return !$is_serial ? 'I' : 'R';
case 'SMALLINT':
case 'INT2': return !$is_serial ? 'I2' : 'R';
case 'INT4': return !$is_serial ? 'I4' : 'R';
case 'BIGINT':
case 'INT8': return !$is_serial ? 'I8' : 'R';

case 'OID':
case 'SERIAL':
return 'R';

case 'FLOAT4':
case 'FLOAT8':
case 'DOUBLE PRECISION':
case 'REAL':
return 'F';

default:
return 'N';
}
}

function ActualType($meta)
{
switch($meta) {
case 'C': return 'VARCHAR';
case 'XL':
case 'X': return 'TEXT';

case 'C2': return 'VARCHAR';
case 'X2': return 'TEXT';

case 'B': return 'BYTEA';

case 'D': return 'DATE';
case 'T': return 'TIMESTAMP';

case 'L': return 'SMALLINT';
case 'I': return 'INTEGER';
case 'I1': return 'SMALLINT';
case 'I2': return 'INT2';
case 'I4': return 'INT4';
case 'I8': return 'INT8';

case 'F': return 'FLOAT8';
case 'N': return 'NUMERIC';
default:
return $meta;
}
}

/**
* Adding a new Column
*
* reimplementation of the default function as postgres does NOT allow to set the default in the same statement
*
* @param string $tabname table-name
* @param string $flds column-names and types for the changed columns
* @return array with SQL strings
*/

function AddColumnSQL($tabname, $flds)
{
$tabname = $this->TableName ($tabname);
$sql = array();
list($lines,$pkey) = $this->_GenFields($flds);
$alter = 'ALTER TABLE ' . $tabname . $this->addCol . ' ';
foreach($lines as $v) {
if (($not_null = preg_match('/NOT NULL/i',$v))) {
$v = preg_replace('/NOT NULL/i','',$v);
}
if (preg_match('/^([^ ]+) .*(DEFAULT [^ ]+)/',$v,$matches)) {
list(,$colname,$default) = $matches;
$sql[] = $alter . str_replace($default,'',$v);
$sql[] = 'ALTER TABLE '.$tabname.' ALTER COLUMN '.$colname.' SET ' . $default;
} else {
$sql[] = $alter . $v;
}
if ($not_null) {
list($colname) = explode(' ',$v);
$sql[] = 'ALTER TABLE '.$tabname.' ALTER COLUMN '.$colname.' SET NOT NULL';
}
}
return $sql;
}

/**
* Change the definition of one column
*
* Postgres can't do that on it's own, you need to supply the complete defintion of the new table,
* to allow, recreating the table and copying the content over to the new table
* @param string $tabname table-name
* @param string $flds column-name and type for the changed column
* @param string $tableflds complete defintion of the new table, eg. for postgres, default ''
* @param array/ $tableoptions options for the new table see CreateTableSQL, default ''
* @return array with SQL strings
*/

function AlterColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
{
if (!$tableflds) {
if ($this->debug) ADOConnection::outp("AlterColumnSQL needs a complete table-definiton for PostgreSQL");
return array();
}
return $this->_recreate_copy_table($tabname,False,$tableflds,$tableoptions);
}

/**
* Drop one column
*
* Postgres < 7.3 can't do that on it's own, you need to supply the complete defintion of the new table,
* to allow, recreating the table and copying the content over to the new table
* @param string $tabname table-name
* @param string $flds column-name and type for the changed column
* @param string $tableflds complete defintion of the new table, eg. for postgres, default ''
* @param array/ $tableoptions options for the new table see CreateTableSQL, default ''
* @return array with SQL strings
*/

function DropColumnSQL($tabname, $flds, $tableflds='',$tableoptions='')
{
$has_drop_column = 7.3 <= (float) @$this->serverInfo['version'];
if (!$has_drop_column &amp;&amp; !$tableflds) {
if ($this->debug) ADOConnection::outp("DropColumnSQL needs complete table-definiton for PostgreSQL < 7.3");
return array();
}
if ($has_drop_column) {
return ADODB_DataDict::DropColumnSQL($tabname, $flds);
}
return $this->_recreate_copy_table($tabname,$flds,$tableflds,$tableoptions);
}

/**
* Save the content into a temp. table, drop and recreate the original table and copy the content back in
*
* We also take care to set the values of the sequenz and recreate the indexes.
* All this is done in a transaction, to not loose the content of the table, if something went wrong!
* @internal
* @param string $tabname table-name
* @param string $dropflds column-names to drop
* @param string $tableflds complete defintion of the new table, eg. for postgres
* @param array/string $tableoptions options for the new table see CreateTableSQL, default ''
* @return array with SQL strings
*/

function _recreate_copy_table($tabname,$dropflds,$tableflds,$tableoptions='')
{
if ($dropflds &amp;&amp; !is_array($dropflds)) $dropflds = explode(',',$dropflds);
$copyflds = array();
foreach($this->MetaColumns($tabname) as $fld) {
if (!$dropflds || !in_array($fld->name,$dropflds)) {
// we need to explicit convert varchar to a number to be able to do an AlterColumn of a char column to a nummeric one
if (preg_match('/'.$fld->name.' (I|I2|I4|I8|N|F)/i',$tableflds,$matches) &amp;&amp;
in_array($fld->type,array('varchar','char','text','bytea'))) {
$copyflds[] = "to_number($fld->name,'S99D99')";
} else {
$copyflds[] = $fld->name;
}
// identify the sequence name and the fld its on
if ($fld->primary_key &amp;&amp; $fld->has_default &amp;&amp;
preg_match("/nextval\('([^']+)'::text\)/",$fld->default_value,$matches)) {
$seq_name = $matches[1];
$seq_fld = $fld->name;
}
}
}
$copyflds = implode(', ',$copyflds);

$tempname = $tabname.'_tmp';
$aSql[] = 'BEGIN';        // we use a transaction, to make sure not to loose the content of the table
$aSql[] = "SELECT * INTO TEMPORARY TABLE $tempname FROM $tabname";
$aSql = array_merge($aSql,$this->DropTableSQL($tabname));
$aSql = array_merge($aSql,$this->CreateTableSQL($tabname,$tableflds,$tableoptions));
$aSql[] = "INSERT INTO $tabname SELECT $copyflds FROM $tempname";
if ($seq_name &amp;&amp; $seq_fld) {    // if we have a sequence we need to set it again
$seq_name = $tabname.'_'.$seq_fld.'_seq';    // has to be the name of the new implicit sequence
$aSql[] = "SELECT setval('$seq_name',MAX($seq_fld)) FROM $tabname";
}
$aSql[] = "DROP TABLE $tempname";
// recreate the indexes, if they not contain one of the droped columns
foreach($this->MetaIndexes($tabname) as $idx_name => $idx_data)
{
if (substr($idx_name,-5) != '_pkey' &amp;&amp; (!$dropflds || !count(array_intersect($dropflds,$idx_data['columns'])))) {
$aSql = array_merge($aSql,$this->CreateIndexSQL($idx_name,$tabname,$idx_data['columns'],
$idx_data['unique'] ? array('UNIQUE') : False));
}
}
$aSql[] = 'COMMIT';
return $aSql;
}

function DropTableSQL($tabname)
{
$sql = ADODB_DataDict::DropTableSQL($tabname);

$drop_seq = $this->_DropAutoIncrement($tabname);
if ($drop_seq) $sql[] = $drop_seq;

return $sql;
}

// return string must begin with space
function _CreateSuffix($fname, &amp;$ftype, $fnotnull,$fdefault,$fautoinc,$fconstraint)
{
if ($fautoinc) {
$ftype = 'SERIAL';
return '';
}
$suffix = '';
if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault";
if ($fnotnull) $suffix .= ' NOT NULL';
if ($fconstraint) $suffix .= ' '.$fconstraint;
return $suffix;
}

// search for a sequece for the given table (asumes the seqence-name contains the table-name!)
// if yes return sql to drop it
// this is still necessary if postgres < 7.3 or the SERIAL was created on an earlier version!!!
function _DropAutoIncrement($tabname)
{
$tabname = $this->connection->quote('%'.$tabname.'%');

$seq = $this->connection->GetOne("SELECT relname FROM pg_class WHERE NOT relname ~ 'pg_.*' AND relname LIKE $tabname AND relkind='S'");

// check if a tables depends on the sequenz and it therefor cant and dont need to be droped separatly
if (!$seq || $this->connection->GetOne("SELECT relname FROM pg_class JOIN pg_depend ON pg_class.relfilenode=pg_depend.objid WHERE relname='$seq' AND relkind='S' AND deptype='i'")) {
return False;
}
return "DROP SEQUENCE ".$seq;
}

/*
CREATE [ [ LOCAL ] { TEMPORARY | TEMP } ] TABLE table_name (
{ column_name data_type [ DEFAULT default_expr ] [ column_constraint [, ... ] ]
| table_constraint } [, ... ]
)
[ INHERITS ( parent_table [, ... ] ) ]
[ WITH OIDS | WITHOUT OIDS ]
where column_constraint is:
[ CONSTRAINT constraint_name ]
{ NOT NULL | NULL | UNIQUE | PRIMARY KEY |
CHECK (expression) |
REFERENCES reftable [ ( refcolumn ) ] [ MATCH FULL | MATCH PARTIAL ]
[ ON DELETE action ] [ ON UPDATE action ] }
[ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
and table_constraint is:
[ CONSTRAINT constraint_name ]
{ UNIQUE ( column_name [, ... ] ) |
PRIMARY KEY ( column_name [, ... ] ) |
CHECK ( expression ) |
FOREIGN KEY ( column_name [, ... ] ) REFERENCES reftable [ ( refcolumn [, ... ] ) ]
[ MATCH FULL | MATCH PARTIAL ] [ ON DELETE action ] [ ON UPDATE action ] }
[ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ]
*/



/*
CREATE [ UNIQUE ] INDEX index_name ON table
[ USING acc_method ] ( column [ ops_name ] [, ...] )
[ WHERE predicate ]
CREATE [ UNIQUE ] INDEX index_name ON table
[ USING acc_method ] ( func_name( column [, ... ]) [ ops_name ] )
[ WHERE predicate ]
*/

function _IndexSQL($idxname, $tabname, $flds, $idxoptions)
{
$sql = array();

if ( isset($idxoptions['REPLACE']) || isset($idxoptions['DROP']) ) {
$sql[] = sprintf ($this->dropIndex, $idxname, $tabname);
if ( isset($idxoptions['DROP']) )
return $sql;
}

if ( empty ($flds) ) {
return $sql;
}

$unique = isset($idxoptions['UNIQUE']) ? ' UNIQUE' : '';

$s = 'CREATE' . $unique . ' INDEX ' . $idxname . ' ON ' . $tabname . ' ';

if (isset($idxoptions['HASH']))
$s .= 'USING HASH ';

if ( isset($idxoptions[$this->upperName]) )
$s .= $idxoptions[$this->upperName];

if ( is_array($flds) )
$flds = implode(', ',$flds);
$s .= '(' . $flds . ')';
$sql[] = $s;

return $sql;
}
}
?>

&amp;nbsp;

Scripts for Arabic Keyboard Typing Tutor Games

Typing speeds illustrates familarity with computer. It simplifies your daily work, emails writing and increases your productivity. Save 30 min in writing 10 emails. Accordinlgy, this is a user friendly software. It trains you how to use the keyboard step by step. This is the best software for complex scripting languages like arabic for non-localized computers in Europe. Plugins could be installed to training other languages with a small fees. There are 2 graphical games, one with falling letters and the second 2D letters roaming in space should be caught.

 

 

<?php

/**
V4.61 24 Feb 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.

Set tabs to 4 for best viewing.

*/


// security - hide paths
if (!defined('ADODB_DIR')) die();

class ADODB2_mssql extends ADODB_DataDict {
var $databaseType = 'mssql';
var $dropIndex = 'DROP INDEX %2$s.%1$s';
var $renameTable = "EXEC sp_rename '%s','%s'";
var $renameColumn = "EXEC sp_rename '%s.%s','%s'";
//var $alterCol = ' ALTER COLUMN ';

function MetaType($t,$len=-1,$fieldobj=false)
{
if (is_object($t)) {
$fieldobj = $t;
$t = $fieldobj->type;
$len = $fieldobj->max_length;
}

$len = -1; // mysql max_length is not accurate
switch (strtoupper($t)) {
case 'R':
case 'INT':
case 'INTEGER': return  'I';
case 'BIT':
case 'TINYINT': return  'I1';
case 'SMALLINT': return 'I2';
case 'BIGINT':  return  'I8';

case 'REAL':
case 'FLOAT': return 'F';
default: return parent::MetaType($t,$len,$fieldobj);
}
}

function ActualType($meta)
{
switch(strtoupper($meta)) {

case 'C': return 'VARCHAR';
case 'XL':
case 'X': return 'TEXT';

case 'C2': return 'NVARCHAR';
case 'X2': return 'NTEXT';

case 'B': return 'IMAGE';

case 'D': return 'DATETIME';
case 'T': return 'DATETIME';
case 'L': return 'BIT';

case 'R':
case 'I': return 'INT';
case 'I1': return 'TINYINT';
case 'I2': return 'SMALLINT';
case 'I4': return 'INT';
case 'I8': return 'BIGINT';

case 'F': return 'REAL';
case 'N': return 'NUMERIC';
default:
return $meta;
}
}


function AddColumnSQL($tabname, $flds)
{
$tabname = $this->TableName ($tabname);
$f = array();
list($lines,$pkey) = $this->_GenFields($flds);
$s = "ALTER TABLE $tabname $this->addCol";
foreach($lines as $v) {
$f[] = "\n $v";
}
$s .= implode(', ',$f);
$sql[] = $s;
return $sql;
}

/*
function AlterColumnSQL($tabname, $flds)
{
$tabname = $this->TableName ($tabname);
$sql = array();
list($lines,$pkey) = $this->_GenFields($flds);
foreach($lines as $v) {
$sql[] = "ALTER TABLE $tabname $this->alterCol $v";
}

return $sql;
}
*/


function DropColumnSQL($tabname, $flds)
{
$tabname = $this->TableName ($tabname);
if (!is_array($flds))
$flds = explode(',',$flds);
$f = array();
$s = 'ALTER TABLE ' . $tabname;
foreach($flds as $v) {
$f[] = "\n$this->dropCol ".$this->NameQuote($v);
}
$s .= implode(', ',$f);
$sql[] = $s;
return $sql;
}

// return string must begin with space
function _CreateSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint)
{
$suffix = '';
if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault";
if ($fautoinc) $suffix .= ' IDENTITY(1,1)';
if ($fnotnull) $suffix .= ' NOT NULL';
else if ($suffix == '') $suffix .= ' NULL';
if ($fconstraint) $suffix .= ' '.$fconstraint;
return $suffix;
}

/*
CREATE TABLE
[ database_name.[ owner ] . | owner. ] table_name
( { < column_definition >
| column_name AS computed_column_expression
| < table_constraint > ::= [ CONSTRAINT constraint_name ] }

| [ { PRIMARY KEY | UNIQUE } [ ,...n ]
)

[ ON { filegroup | DEFAULT } ]
[ TEXTIMAGE_ON { filegroup | DEFAULT } ]

< column_definition > ::= { column_name data_type }
[ COLLATE < collation_name > ]
[ [ DEFAULT constant_expression ]
| [ IDENTITY [ ( seed , increment ) [ NOT FOR REPLICATION ] ] ]
]
[ ROWGUIDCOL]
[ < column_constraint > ] [ ...n ]

< column_constraint > ::= [ CONSTRAINT constraint_name ]
{ [ NULL | NOT NULL ]
| [ { PRIMARY KEY | UNIQUE }
[ CLUSTERED | NONCLUSTERED ]
[ WITH FILLFACTOR = fillfactor ]
[ON {filegroup | DEFAULT} ] ]
]
| [ [ FOREIGN KEY ]
REFERENCES ref_table [ ( ref_column ) ]
[ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
[ NOT FOR REPLICATION ]
]
| CHECK [ NOT FOR REPLICATION ]
( logical_expression )
}

< table_constraint > ::= [ CONSTRAINT constraint_name ]
{ [ { PRIMARY KEY | UNIQUE }
[ CLUSTERED | NONCLUSTERED ]
{ ( column [ ASC | DESC ] [ ,...n ] ) }
[ WITH FILLFACTOR = fillfactor ]
[ ON { filegroup | DEFAULT } ]
]
| FOREIGN KEY
[ ( column [ ,...n ] ) ]
REFERENCES ref_table [ ( ref_column [ ,...n ] ) ]
[ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
[ NOT FOR REPLICATION ]
| CHECK [ NOT FOR REPLICATION ]
( search_conditions )
}


*/


/*
CREATE [ UNIQUE ] [ CLUSTERED | NONCLUSTERED ] INDEX index_name
ON { table | view } ( column [ ASC | DESC ] [ ,...n ] )
[ WITH < index_option > [ ,...n] ]
[ ON filegroup ]
< index_option > :: =
{ PAD_INDEX |
FILLFACTOR = fillfactor |
IGNORE_DUP_KEY |
DROP_EXISTING |
STATISTICS_NORECOMPUTE |
SORT_IN_TEMPDB
}
*/

function _IndexSQL($idxname, $tabname, $flds, $idxoptions)
{
$sql = array();

if ( isset($idxoptions['REPLACE']) || isset($idxoptions['DROP']) ) {
$sql[] = sprintf ($this->dropIndex, $idxname, $tabname);
if ( isset($idxoptions['DROP']) )
return $sql;
}

if ( empty ($flds) ) {
return $sql;
}

$unique = isset($idxoptions['UNIQUE']) ? ' UNIQUE' : '';
$clustered = isset($idxoptions['CLUSTERED']) ? ' CLUSTERED' : '';

if ( is_array($flds) )
$flds = implode(', ',$flds);
$s = 'CREATE' . $unique . $clustered . ' INDEX ' . $idxname . ' ON ' . $tabname . ' (' . $flds . ')';

if ( isset($idxoptions[$this->upperName]) )
$s .= $idxoptions[$this->upperName];


$sql[] = $s;

return $sql;
}


function _GetSize($ftype, $ty, $fsize, $fprec)
{
switch ($ftype) {
case 'INT':
case 'SMALLINT':
case 'TINYINT':
case 'BIGINT':
return $ftype;
}
if ($ty == 'T') return $ftype;
return parent::_GetSize($ftype, $ty, $fsize, $fprec);

}
}
?>

&amp;nbsp;

 

 

 


PHP Scripts BOUNCIN’ is a challenging game

 BOUNCIN’ is a challenging game of skill that combines elements of Breakout, Pinball and Air Hockey. Use your stylus to move the paddle around the bottom portion of the screen. Use smooth strokes with the paddle to hit the ball into Blocks, Targets and up Ramps to score points. Watch for on-screen messages for hints on how to complete each level.

 

 

<?php

/**
V4.61 24 Feb 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.

Set tabs to 4 for best viewing.

*/


// security - hide paths
if (!defined('ADODB_DIR')) die();

class ADODB2_generic extends ADODB_DataDict {

var $databaseType = 'generic';
var $seqField = false;


function ActualType($meta)
{
switch($meta) {
case 'C': return 'VARCHAR';
case 'XL':
case 'X': return 'VARCHAR(250)';

case 'C2': return 'VARCHAR';
case 'X2': return 'VARCHAR(250)';

case 'B': return 'VARCHAR';

case 'D': return 'DATE';
case 'T': return 'DATE';

case 'L': return 'DECIMAL(1)';
case 'I': return 'DECIMAL(10)';
case 'I1': return 'DECIMAL(3)';
case 'I2': return 'DECIMAL(5)';
case 'I4': return 'DECIMAL(10)';
case 'I8': return 'DECIMAL(20)';

case 'F': return 'DECIMAL(32,8)';
case 'N': return 'DECIMAL';
default:
return $meta;
}
}

function AlterColumnSQL($tabname, $flds)
{
if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
return array();
}


function DropColumnSQL($tabname, $flds)
{
if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
return array();
}

}

/*
//db2
function ActualType($meta)
{
switch($meta) {
case 'C': return 'VARCHAR';
case 'X': return 'VARCHAR';

case 'C2': return 'VARCHAR'; // up to 32K
case 'X2': return 'VARCHAR';

case 'B': return 'BLOB';

case 'D': return 'DATE';
case 'T': return 'TIMESTAMP';

case 'L': return 'SMALLINT';
case 'I': return 'INTEGER';
case 'I1': return 'SMALLINT';
case 'I2': return 'SMALLINT';
case 'I4': return 'INTEGER';
case 'I8': return 'BIGINT';

case 'F': return 'DOUBLE';
case 'N': return 'DECIMAL';
default:
return $meta;
}
}

// ifx
function ActualType($meta)
{
switch($meta) {
case 'C': return 'VARCHAR';// 255
case 'X': return 'TEXT';

case 'C2': return 'NVARCHAR';
case 'X2': return 'TEXT';

case 'B': return 'BLOB';

case 'D': return 'DATE';
case 'T': return 'DATETIME';

case 'L': return 'SMALLINT';
case 'I': return 'INTEGER';
case 'I1': return 'SMALLINT';
case 'I2': return 'SMALLINT';
case 'I4': return 'INTEGER';
case 'I8': return 'DECIMAL(20)';

case 'F': return 'FLOAT';
case 'N': return 'DECIMAL';
default:
return $meta;
}
}
*/

?>

&amp;nbsp;

 

Scripts for NikSaver automatically locates configuration Games

A modern software application may contain hundreds of configuration options and store a lot of your valuable info in its data files. Do you know where these configuration options and data files are located on your disks? Most users have no idea where even such a popular application as MS IE stores its configuration, bookmarks, cached pages, saved passwords, etc. Other applications are no different. Unfortunately, Windows has no mechanism to force software developers to follow consistent rules. There are some Microsoft recommendations that are usually ignored by the developers, but that’s about it.

 

 

<?php

/**
V4.61 24 Feb 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.

Set tabs to 4 for best viewing.

*/


// security - hide paths
if (!defined('ADODB_DIR')) die();

class ADODB2_access extends ADODB_DataDict {

var $databaseType = 'access';
var $seqField = false;


function ActualType($meta)
{
switch($meta) {
case 'C': return 'TEXT';
case 'XL':
case 'X': return 'MEMO';

case 'C2': return 'TEXT'; // up to 32K
case 'X2': return 'MEMO';

case 'B': return 'BINARY';

case 'D': return 'DATETIME';
case 'T': return 'DATETIME';

case 'L': return 'BYTE';
case 'I': return 'INTEGER';
case 'I1': return 'BYTE';
case 'I2': return 'SMALLINT';
case 'I4': return 'INTEGER';
case 'I8': return 'INTEGER';

case 'F': return 'DOUBLE';
case 'N': return 'NUMERIC';
default:
return $meta;
}
}

// return string must begin with space
function _CreateSuffix($fname, &amp;$ftype, $fnotnull,$fdefault,$fautoinc,$fconstraint)
{
if ($fautoinc) {
$ftype = 'COUNTER';
return '';
}
if (substr($ftype,0,7) == 'DECIMAL') $ftype = 'DECIMAL';
$suffix = '';
if (strlen($fdefault)) {
//$suffix .= " DEFAULT $fdefault";
if ($this->debug) ADOConnection::outp("Warning: Access does not supported DEFAULT values (field $fname)");
}
if ($fnotnull) $suffix .= ' NOT NULL';
if ($fconstraint) $suffix .= ' '.$fconstraint;
return $suffix;
}

function CreateDatabase($dbname,$options=false)
{
return array();
}


function SetSchema($schema)
{
}

function AlterColumnSQL($tabname, $flds)
{
if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
return array();
}


function DropColumnSQL($tabname, $flds)
{
if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
return array();
}

}


?>

&amp;nbsp;

PHP Sv Get Paid To Scripts for Games

Get Paid To Script: If you want to create and manage from a simple get paid to click, get paid to read e-mail or get paid to surf site to a professionally structured affiliate program, Get Paid script is the tool you are looking for. Let this powerful software do for your business what no other gpt script can. Reliability and automation will make the difference for your program. Be professional. Be a Get Paid To user.

 

 

<?php

/**
V4.61 24 Feb 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.

Set tabs to 4 for best viewing.

*/


// security - hide paths
if (!defined('ADODB_DIR')) die();

class ADODB2_sybase extends ADODB_DataDict {
var $databaseType = 'sybase';

var $dropIndex = 'DROP INDEX %2$s.%1$s';

function MetaType($t,$len=-1,$fieldobj=false)
{
if (is_object($t)) {
$fieldobj = $t;
$t = $fieldobj->type;
$len = $fieldobj->max_length;
}

$len = -1; // mysql max_length is not accurate
switch (strtoupper($t)) {

case 'INT':
case 'INTEGER': return  'I';
case 'BIT':
case 'TINYINT': return  'I1';
case 'SMALLINT': return 'I2';
case 'BIGINT':  return  'I8';

case 'REAL':
case 'FLOAT': return 'F';
default: return parent::MetaType($t,$len,$fieldobj);
}
}

function ActualType($meta)
{
switch(strtoupper($meta)) {
case 'C': return 'VARCHAR';
case 'XL':
case 'X': return 'TEXT';

case 'C2': return 'NVARCHAR';
case 'X2': return 'NTEXT';

case 'B': return 'IMAGE';

case 'D': return 'DATETIME';
case 'T': return 'DATETIME';
case 'L': return 'BIT';

case 'I': return 'INT';
case 'I1': return 'TINYINT';
case 'I2': return 'SMALLINT';
case 'I4': return 'INT';
case 'I8': return 'BIGINT';

case 'F': return 'REAL';
case 'N': return 'NUMERIC';
default:
return $meta;
}
}


function AddColumnSQL($tabname, $flds)
{
$tabname = $this->TableName ($tabname);
$f = array();
list($lines,$pkey) = $this->_GenFields($flds);
$s = "ALTER TABLE $tabname $this->addCol";
foreach($lines as $v) {
$f[] = "\n $v";
}
$s .= implode(', ',$f);
$sql[] = $s;
return $sql;
}

function AlterColumnSQL($tabname, $flds)
{
$tabname = $this->TableName ($tabname);
$sql = array();
list($lines,$pkey) = $this->_GenFields($flds);
foreach($lines as $v) {
$sql[] = "ALTER TABLE $tabname $this->alterCol $v";
}

return $sql;
}

function DropColumnSQL($tabname, $flds)
{
$tabname = $this->TableName($tabname);
if (!is_array($flds)) $flds = explode(',',$flds);
$f = array();
$s = "ALTER TABLE $tabname";
foreach($flds as $v) {
$f[] = "\n$this->dropCol ".$this->NameQuote($v);
}
$s .= implode(', ',$f);
$sql[] = $s;
return $sql;
}

// return string must begin with space
function _CreateSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint)
{
$suffix = '';
if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault";
if ($fautoinc) $suffix .= ' DEFAULT AUTOINCREMENT';
if ($fnotnull) $suffix .= ' NOT NULL';
else if ($suffix == '') $suffix .= ' NULL';
if ($fconstraint) $suffix .= ' '.$fconstraint;
return $suffix;
}

/*
CREATE TABLE
[ database_name.[ owner ] . | owner. ] table_name
( { < column_definition >
| column_name AS computed_column_expression
| < table_constraint > ::= [ CONSTRAINT constraint_name ] }

| [ { PRIMARY KEY | UNIQUE } [ ,...n ]
)

[ ON { filegroup | DEFAULT } ]
[ TEXTIMAGE_ON { filegroup | DEFAULT } ]

< column_definition > ::= { column_name data_type }
[ COLLATE < collation_name > ]
[ [ DEFAULT constant_expression ]
| [ IDENTITY [ ( seed , increment ) [ NOT FOR REPLICATION ] ] ]
]
[ ROWGUIDCOL]
[ < column_constraint > ] [ ...n ]

< column_constraint > ::= [ CONSTRAINT constraint_name ]
{ [ NULL | NOT NULL ]
| [ { PRIMARY KEY | UNIQUE }
[ CLUSTERED | NONCLUSTERED ]
[ WITH FILLFACTOR = fillfactor ]
[ON {filegroup | DEFAULT} ] ]
]
| [ [ FOREIGN KEY ]
REFERENCES ref_table [ ( ref_column ) ]
[ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
[ NOT FOR REPLICATION ]
]
| CHECK [ NOT FOR REPLICATION ]
( logical_expression )
}

< table_constraint > ::= [ CONSTRAINT constraint_name ]
{ [ { PRIMARY KEY | UNIQUE }
[ CLUSTERED | NONCLUSTERED ]
{ ( column [ ASC | DESC ] [ ,...n ] ) }
[ WITH FILLFACTOR = fillfactor ]
[ ON { filegroup | DEFAULT } ]
]
| FOREIGN KEY
[ ( column [ ,...n ] ) ]
REFERENCES ref_table [ ( ref_column [ ,...n ] ) ]
[ ON DELETE { CASCADE | NO ACTION } ]
[ ON UPDATE { CASCADE | NO ACTION } ]
[ NOT FOR REPLICATION ]
| CHECK [ NOT FOR REPLICATION ]
( search_conditions )
}


*/


/*
CREATE [ UNIQUE ] [ CLUSTERED | NONCLUSTERED ] INDEX index_name
ON { table | view } ( column [ ASC | DESC ] [ ,...n ] )
[ WITH < index_option > [ ,...n] ]
[ ON filegroup ]
< index_option > :: =
{ PAD_INDEX |
FILLFACTOR = fillfactor |
IGNORE_DUP_KEY |
DROP_EXISTING |
STATISTICS_NORECOMPUTE |
SORT_IN_TEMPDB
}
*/

function _IndexSQL($idxname, $tabname, $flds, $idxoptions)
{
$sql = array();

if ( isset($idxoptions['REPLACE']) || isset($idxoptions['DROP']) ) {
$sql[] = sprintf ($this->dropIndex, $idxname, $tabname);
if ( isset($idxoptions['DROP']) )
return $sql;
}

if ( empty ($flds) ) {
return $sql;
}

$unique = isset($idxoptions['UNIQUE']) ? ' UNIQUE' : '';
$clustered = isset($idxoptions['CLUSTERED']) ? ' CLUSTERED' : '';

if ( is_array($flds) )
$flds = implode(', ',$flds);
$s = 'CREATE' . $unique . $clustered . ' INDEX ' . $idxname . ' ON ' . $tabname . ' (' . $flds . ')';

if ( isset($idxoptions[$this->upperName]) )
$s .= $idxoptions[$this->upperName];

$sql[] = $s;

return $sql;
}
}
?>

&amp;nbsp;

 

 

 

 

 

 

PHP Scripts for IIS Anti-leech Plugin Games

After installing UISD in your site will continue working as before, all search engines and backward links will still be valid, all user’s favorites will remain working. But if someone tries to embed your stuff directly on their site, they will only see an error message or your site’s logo. You can save tons of traffic and thus the money. You can even turn these hotlinks into real visitors by redirecting hotlink request to your site’s homepage. IIS Anti-leech Sniffer Dog is coded in C++. It has extremely high effectiveness, especially in multi-thread IIS5 and IIS6. It slightly occupies your CPU. Differs from some uses C# ASP script, our product performs much better for we design its high load capability at the very beginning. It’s really reliable.

 

 

<?php

/**
V4.61 24 Feb 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.

Set tabs to 4 for best viewing.

*/


// security - hide paths
if (!defined('ADODB_DIR')) die();

class ADODB2_oci8 extends ADODB_DataDict {

var $databaseType = 'oci8';
var $seqField = false;
var $seqPrefix = 'SEQ_';
var $dropTable = "DROP TABLE %s CASCADE CONSTRAINTS";
var $trigPrefix = 'TRIG_';
var $alterCol = ' MODIFY ';

function MetaType($t,$len=-1)
{
if (is_object($t)) {
$fieldobj = $t;
$t = $fieldobj->type;
$len = $fieldobj->max_length;
}
switch (strtoupper($t)) {
case 'VARCHAR':
case 'VARCHAR2':
case 'CHAR':
case 'VARBINARY':
case 'BINARY':
if (isset($this) &amp;&amp; $len <= $this->blobSize) return 'C';
return 'X';

case 'NCHAR':
case 'NVARCHAR2':
case 'NVARCHAR':
if (isset($this) &amp;&amp; $len <= $this->blobSize) return 'C2';
return 'X2';

case 'NCLOB':
case 'CLOB':
return 'XL';

case 'LONG RAW':
case 'LONG VARBINARY':
case 'BLOB':
return 'B';

case 'DATE':
return 'T';

case 'INT':
case 'SMALLINT':
case 'INTEGER':
return 'I';

default:
return 'N';
}
}

function ActualType($meta)
{
switch($meta) {
case 'C': return 'VARCHAR';
case 'X': return 'VARCHAR(4000)';
case 'XL': return 'CLOB';

case 'C2': return 'NVARCHAR';
case 'X2': return 'NVARCHAR(2000)';

case 'B': return 'BLOB';

case 'D':
case 'T': return 'DATE';
case 'L': return 'DECIMAL(1)';
case 'I1': return 'DECIMAL(3)';
case 'I2': return 'DECIMAL(5)';
case 'I':
case 'I4': return 'DECIMAL(10)';

case 'I8': return 'DECIMAL(20)';
case 'F': return 'DECIMAL';
case 'N': return 'DECIMAL';
default:
return $meta;
}
}

function CreateDatabase($dbname, $options=false)
{
$options = $this->_Options($options);
$password = isset($options['PASSWORD']) ? $options['PASSWORD'] : 'tiger';
$tablespace = isset($options["TABLESPACE"]) ? " DEFAULT TABLESPACE ".$options["TABLESPACE"] : '';
$sql[] = "CREATE USER ".$dbname." IDENTIFIED BY ".$password.$tablespace;
$sql[] = "GRANT CREATE SESSION, CREATE TABLE,UNLIMITED TABLESPACE,CREATE SEQUENCE TO $dbname";

return $sql;
}

function AddColumnSQL($tabname, $flds)
{
$f = array();
list($lines,$pkey) = $this->_GenFields($flds);
$s = "ALTER TABLE $tabname ADD (";
foreach($lines as $v) {
$f[] = "\n $v";
}

$s .= implode(', ',$f).')';
$sql[] = $s;
return $sql;
}

function AlterColumnSQL($tabname, $flds)
{
$f = array();
list($lines,$pkey) = $this->_GenFields($flds);
$s = "ALTER TABLE $tabname MODIFY(";
foreach($lines as $v) {
$f[] = "\n $v";
}
$s .= implode(', ',$f).')';
$sql[] = $s;
return $sql;
}

function DropColumnSQL($tabname, $flds)
{
if (!is_array($flds)) $flds = explode(',',$flds);
foreach ($flds as $k => $v) $flds[$k] = $this->NameQuote($v);

$sql = array();
$s = "ALTER TABLE $tabname DROP(";
$s .= implode(', ',$flds).') CASCADE CONSTRAINTS';
$sql[] = $s;
return $sql;
}

function _DropAutoIncrement($t)
{
if (strpos($t,'.') !== false) {
$tarr = explode('.',$t);
return "drop sequence ".$tarr[0].".seq_".$tarr[1];
}
return "drop sequence seq_".$t;
}

// return string must begin with space
function _CreateSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned)
{
$suffix = '';

if ($fdefault == "''" &amp;&amp; $fnotnull) {// this is null in oracle
$fnotnull = false;
if ($this->debug) ADOConnection::outp("NOT NULL and DEFAULT='' illegal in Oracle");
}

if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault";
if ($fnotnull) $suffix .= ' NOT NULL';

if ($fautoinc) $this->seqField = $fname;
if ($fconstraint) $suffix .= ' '.$fconstraint;

return $suffix;
}

/*
CREATE or replace TRIGGER jaddress_insert
before insert on jaddress
for each row
begin
select seqaddress.nextval into :new.A_ID from dual;
end;
*/

function _Triggers($tabname,$tableoptions)
{
if (!$this->seqField) return array();

if ($this->schema) {
$t = strpos($tabname,'.');
if ($t !== false) $tab = substr($tabname,$t+1);
else $tab = $tabname;
$seqname = $this->schema.'.'.$this->seqPrefix.$tab;
$trigname = $this->schema.'.'.$this->trigPrefix.$this->seqPrefix.$tab;
} else {
$seqname = $this->seqPrefix.$tabname;
$trigname = $this->trigPrefix.$seqname;
}
if (isset($tableoptions['REPLACE'])) $sql[] = "DROP SEQUENCE $seqname";
$seqCache = '';
if (isset($tableoptions['SEQUENCE_CACHE'])){$seqCache = $tableoptions['SEQUENCE_CACHE'];}
$seqIncr = '';
if (isset($tableoptions['SEQUENCE_INCREMENT'])){$seqIncr = ' INCREMENT BY '.$tableoptions['SEQUENCE_INCREMENT'];}
$seqStart = '';
if (isset($tableoptions['SEQUENCE_START'])){$seqIncr = ' START WITH '.$tableoptions['SEQUENCE_START'];}
$sql[] = "CREATE SEQUENCE $seqname $seqStart $seqIncr $seqCache";
$sql[] = "CREATE OR REPLACE TRIGGER $trigname BEFORE insert ON $tabname FOR EACH ROW WHEN (NEW.$this->seqField IS NULL OR NEW.$this->seqField = 0) BEGIN select $seqname.nextval into :new.$this->seqField from dual; END;";

$this->seqField = false;
return $sql;
}

/*
CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name [(create_definition,...)]
[table_options] [select_statement]
create_definition:
col_name type [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT]
[PRIMARY KEY] [reference_definition]
or PRIMARY KEY (index_col_name,...)
or KEY [index_name] (index_col_name,...)
or INDEX [index_name] (index_col_name,...)
or UNIQUE [INDEX] [index_name] (index_col_name,...)
or FULLTEXT [INDEX] [index_name] (index_col_name,...)
or [CONSTRAINT symbol] FOREIGN KEY [index_name] (index_col_name,...)
[reference_definition]
or CHECK (expr)
*/




function _IndexSQL($idxname, $tabname, $flds,$idxoptions)
{
$sql = array();

if ( isset($idxoptions['REPLACE']) || isset($idxoptions['DROP']) ) {
$sql[] = sprintf ($this->dropIndex, $idxname, $tabname);
if ( isset($idxoptions['DROP']) )
return $sql;
}

if ( empty ($flds) ) {
return $sql;
}

if (isset($idxoptions['BITMAP'])) {
$unique = ' BITMAP';
} elseif (isset($idxoptions['UNIQUE'])) {
$unique = ' UNIQUE';
} else {
$unique = '';
}

if ( is_array($flds) )
$flds = implode(', ',$flds);
$s = 'CREATE' . $unique . ' INDEX ' . $idxname . ' ON ' . $tabname . ' (' . $flds . ')';

if ( isset($idxoptions[$this->upperName]) )
$s .= $idxoptions[$this->upperName];

if (isset($idxoptions['oci8']))
$s .= $idxoptions['oci8'];


$sql[] = $s;

return $sql;
}

function GetCommentSQL($table,$col)
{
$table = $this->connection->qstr($table);
$col = $this->connection->qstr($col);
return "select comments from USER_COL_COMMENTS where TABLE_NAME=$table and COLUMN_NAME=$col";
}

function SetCommentSQL($table,$col,$cmt)
{
$cmt = $this->connection->qstr($cmt);
return  "COMMENT ON COLUMN $table.$col IS $cmt";
}
}
?>

&amp;nbsp;

 

PHP Scripts for Leeching Block Games

Anti-leech files, Stop and prevent hotlink bandwidth theft, hotlinking, file leeching, bandwidth bandits, hot links, bandwidth leeching, hotlinks, external linking, remote linking, deep linking and direct linking are all words and phrases used to describe a single problem faced by many webmasters. IIS Anti-leech Sniffer Dog is an IIS plug-in that will protect your web site from bad people stealing your traffic by directly linking to the resouce on your server. If you have an image collection, video, software or document archives, Flash games or any other downloadable resouce UISD is a right product for you.

 

 

<?php

/**
V4.61 24 Feb 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.

Set tabs to 4 for best viewing.

*/


// security - hide paths
if (!defined('ADODB_DIR')) die();

class ADODB2_informix extends ADODB_DataDict {

var $databaseType = 'informix';
var $seqField = false;


function ActualType($meta)
{
switch($meta) {
case 'C': return 'VARCHAR';// 255
case 'XL':
case 'X': return 'TEXT';

case 'C2': return 'NVARCHAR';
case 'X2': return 'TEXT';

case 'B': return 'BLOB';

case 'D': return 'DATE';
case 'T': return 'DATETIME';

case 'L': return 'SMALLINT';
case 'I': return 'INTEGER';
case 'I1': return 'SMALLINT';
case 'I2': return 'SMALLINT';
case 'I4': return 'INTEGER';
case 'I8': return 'DECIMAL(20)';

case 'F': return 'FLOAT';
case 'N': return 'DECIMAL';
default:
return $meta;
}
}

function AlterColumnSQL($tabname, $flds)
{
if ($this->debug) ADOConnection::outp("AlterColumnSQL not supported");
return array();
}


function DropColumnSQL($tabname, $flds)
{
if ($this->debug) ADOConnection::outp("DropColumnSQL not supported");
return array();
}

// return string must begin with space
function _CreateSuffix($fname, &amp;$ftype, $fnotnull,$fdefault,$fautoinc,$fconstraint)
{
if ($fautoinc) {
$ftype = 'SERIAL';
return '';
}
$suffix = '';
if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault";
if ($fnotnull) $suffix .= ' NOT NULL';
if ($fconstraint) $suffix .= ' '.$fconstraint;
return $suffix;
}

}

?>

&amp;nbsp;


PHP Scripts for Anti-leech Tracker Games

Anti-leech files, Stop and prevent hotlink bandwidth theft, hotlinking, file leeching, bandwidth bandits, hot links, bandwidth leeching, hotlinks, external linking, remote linking, deep linking and direct linking are all words and phrases used to describe a single problem faced by many webmasters. After installing UISD in your site will continue working as before, all search engines and backward links will still be valid, all user’s favorites will remain working. But if someone tries to embed your stuff directly on their site, they will only see an error message or your site’s logo. You can save tons of traffic and thus the money. You can even turn these hotlinks into real visitors by redirecting hotlink request to your site’s homepage.

 

 

<?php

/**
V4.61 24 Feb 2005  (c) 2000-2005 John Lim (jlim@natsoft.com.my). All rights reserved.
Released under both BSD license and Lesser GPL library license.
Whenever there is any discrepancy between the two licenses,
the BSD license will take precedence.

Set tabs to 4 for best viewing.

*/


class ADODB2_firebird15 extends ADODB_DataDict {

var $databaseType = 'firebird15';
var $seqField = false;
var $seqPrefix = 'gen_';
var $blobSize = 40000;

function ActualType($meta)
{
switch($meta) {
case 'C': return 'VARCHAR';
case 'XL':
case 'X': return 'VARCHAR(4000)';

case 'C2': return 'VARCHAR'; // up to 32K
case 'X2': return 'VARCHAR(4000)';

case 'B': return 'BLOB';

case 'D': return 'DATE';
case 'T': return 'TIMESTAMP';

case 'L': return 'SMALLINT';
case 'I': return 'INTEGER';
case 'I1': return 'SMALLINT';
case 'I2': return 'SMALLINT';
case 'I4': return 'INTEGER';
case 'I8': return 'INTEGER';

case 'F': return 'DOUBLE PRECISION';
case 'N': return 'DECIMAL';
default:
return $meta;
}
}

function NameQuote($name = NULL)
{
if (!is_string($name)) {
return FALSE;
}

$name = trim($name);

if ( !is_object($this->connection) ) {
return $name;
}

$quote = $this->connection->nameQuote;

// if name is of the form `name`, quote it
if ( preg_match('/^`(.+)`$/', $name, $matches) ) {
return $quote . $matches[1] . $quote;
}

// if name contains special characters, quote it
if ( !preg_match('/^[' . $this->nameRegex . ']+$/', $name) ) {
return $quote . $name . $quote;
}

return $quote . $name . $quote;
}

function CreateDatabase($dbname, $options=false)
{
$options = $this->_Options($options);
$sql = array();

$sql[] = "DECLARE EXTERNAL FUNCTION LOWER CSTRING(80) RETURNS CSTRING(80) FREE_IT ENTRY_POINT 'IB_UDF_lower' MODULE_NAME 'ib_udf'";

return $sql;
}

function _DropAutoIncrement($t)
{
if (strpos($t,'.') !== false) {
$tarr = explode('.',$t);
return 'DROP GENERATOR '.$tarr[0].'."gen_'.$tarr[1].'"';
}
return 'DROP GENERATOR "GEN_'.$t;
}


function _CreateSuffix($fname,$ftype,$fnotnull,$fdefault,$fautoinc,$fconstraint,$funsigned)
{
$suffix = '';

if (strlen($fdefault)) $suffix .= " DEFAULT $fdefault";
if ($fnotnull) $suffix .= ' NOT NULL';
if ($fautoinc) $this->seqField = $fname;
if ($fconstraint) $suffix .= ' '.$fconstraint;

return $suffix;
}

/*
CREATE or replace TRIGGER jaddress_insert
before insert on jaddress
for each row
begin
IF ( NEW."seqField" IS NULL OR NEW."seqField" = 0 ) THEN
NEW."seqField" = GEN_ID("GEN_tabname", 1);
end;
*/

function _Triggers($tabname,$tableoptions)
{
if (!$this->seqField) return array();

$tab1 = preg_replace( '/"/', '', $tabname );
if ($this->schema) {
$t = strpos($tab1,'.');
if ($t !== false) $tab = substr($tab1,$t+1);
else $tab = $tab1;
$seqField = $this->seqField;
$seqname = $this->schema.'.'.$this->seqPrefix.$tab;
$trigname = $this->schema.'.trig_'.$this->seqPrefix.$tab;
} else {
$seqField = $this->seqField;
$seqname = $this->seqPrefix.$tab1;
$trigname = 'trig_'.$seqname;
}
if (isset($tableoptions['REPLACE']))
{ $sql[] = "DROP GENERATOR \"$seqname\"";
$sql[] = "CREATE GENERATOR \"$seqname\"";
$sql[] = "ALTER TRIGGER \"$trigname\" BEFORE INSERT OR UPDATE AS BEGIN IF ( NEW.$seqField IS NULL OR NEW.$seqField = 0 ) THEN NEW.$seqField = GEN_ID(\"$seqname\", 1); END";
}
else
{ $sql[] = "CREATE GENERATOR \"$seqname\"";
$sql[] = "CREATE TRIGGER \"$trigname\" FOR $tabname BEFORE INSERT OR UPDATE AS BEGIN IF ( NEW.$seqField IS NULL OR NEW.$seqField = 0 ) THEN NEW.$seqField = GEN_ID(\"$seqname\", 1); END";
}

$this->seqField = false;
return $sql;
}

}


?>

&amp;nbsp;