"localhost", "baza" => "stanpol", "user" => "stanpol", "pass" => "Rhocsharuf", "pref" => "AL_" ); ?> "ALib CYMES", "home" => "http://www.adesign.8p.pl", "firm" => "Andy Design", "auth" => "Andrzej Kidaj", "mail" => "andrzej.kidaj@gmail.com", "vers" => "1.1", "date" => "Lublin 2010" ); $aUserRola=Array( "0" => "SuperAdmin", "1" => "Admin", "2" => "Redaktor", "3" => "Subskrybent" ); $aUserStatus=Array( "0" => "Nieaktywny", "1" => "Aktywny", "2" => "Zablokowany" ); $aDataTyp=Array( "menu" => 1, // MENU "page" => 2, // STRONA "news" => 3, // NEWS, BLOG "link" => 4, // LINK "gall" => 5, // GALERIA "file" => 6, // PLIKI "tags" => 7, // TAGI "kate" => 8, // KATEGORIE NEWSOW "comm" => 9 // KOMENTARZE OD USEROW ); $aModuleList=Array(); // Tablica danych ekstra pól dla NEWS i PAGES $aGalInfo=Array("pre" => "th_", "bgcolor" => "2453b3", "big" => Array(700,500), "small" => Array(96,96)); $MNamePL1=Array("styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"); $MNamePL2=Array("stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","września","października","listopada","grudnia"); $DNamePL=Array("niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota","niedziela"); $MNameEN=Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); $DNameEN=Array("Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"); ?>StatSql=$sqlparam; $this->LinkID=mysql_connect($this->StatSql["host"],$this->StatSql["user"],$this->StatSql["pass"]) or $this->HaltMsg("Nie można się połączyć z bazą danych."); $resu=mysql_select_db($this->StatSql["baza"],$this->LinkID); if ($resu==FALSE) $this->HaltMsg("Nie można otworzyć bazy danych."); } function Close() { mysql_close($this->LinkID); } function In($arg) { $buf=""; $pre=" IN ("; if(!is_array($arg)) return ""; foreach ($arg AS $elem) { $buf.=$pre."'$elem'"; $pre=", "; } return ($buf=="")? "" : $buf.")"; } function MakeWar($arg,$sp) { $buf=""; $pre=""; if(!is_array($arg)) return ""; foreach ($arg AS $elem) { $buf.=$pre."$elem"; $pre=" $sp "; } return ($buf=="")? "" : $buf; } function ListTables() { return mysql_list_tables($this->StatSql["baza"]); } function TableName($res,$id) { return mysql_tablename($res,$id); } function ShowColumns($name) { return $this->Query("SHOW COLUMNS FROM $name"); } function HaltMsg($msg) { die("

Błąd: $msg

"); } function Count($res) { return ($res)? mysql_numrows($res) : 0;} function Query($query="") { mysql_query("SET NAMES latin2"); mysql_query("SET CHARACTER SET latin2"); if ($query=="") return 0; $qid = mysql_query($query,$this->LinkID); $this->Errno = mysql_errno(); $this->Error = mysql_error(); return $qid; } function MakeRec($table) { // UTWORZENIE REKORDU W TABLICY $cnt=$this->Count($this->ShowColumns($table)); $kol=""; for ($i=1;$i<$cnt;$i++) { $kol.="\"\""; if ($i<($cnt-1)) $kol.=","; } $this->Query("INSERT INTO $table VALUES (NULL,$kol)"); return mysql_insert_id(); } function NextRecord($res) { if (!$res) return 0; $rec = mysql_fetch_array($res); $this->Errno = mysql_errno(); $this->Error = mysql_error(); return $rec; } function GetRecords($res) { if (!$this->Count($res)) return NULL; while($rc=$this->NextRecord($res)) $ret[]=$rc; return $ret; } function Create($table,$pola) { $res=$this->Query("SHOW TABLE STATUS LIKE \"$table\""); if (!$this->Count($res)) return $this->Query("CREATE TABLE $table ($pola)"); } function Select($table,$pola="*",$where="",$order="") { $where=($where)? "WHERE $where" : ""; $order=($order)? "ORDER BY $order" : ""; return $this->Query("SELECT $pola FROM $table $where $order"); } function Update($table,$pola="",$where="") { if ($pola=="") return 0; $where=($where)? "WHERE $where" : ""; return $this->Query("UPDATE $table SET $pola $where"); } function Delete($table,$where="") { $where=($where)? "WHERE $where" : ""; return $this->Query("DELETE FROM $table $where"); } function Truncate($table) { // CZYSZCZENIE CAŁEJ TABLICY return $this->Query("TRUNCATE $table"); } } ?>