// module "queries" // requires the library require("$z_commondir/lib/queries.php"); require("$z_commondir/lib/records.php"); require("$z_commondir/lib/relations.php"); // implement zfiles logic in the standard query pages. $zqueries_uses_zfiles = true; ?> // module "files" configuration // ------------------------------------------ // requires the library // if it hasnt already been loaded by queries.php require_once("$z_commondir/lib/files.php"); // base directory in the filesystem, // starts with slash, ends with a dir (without a slash) $zfiles_basedir = "/home/virtuals/tractortractor/backoffice/z_files"; // base url in a webbrowser // starts with http, ends with a dir (without a slash) $zfiles_baseurl = "http://backoffice.tractortractor.org/z_files"; // to secure your originals, set the publicdir to something else // then the basedir and restrict acces to the basedir. $zfiles_publicdir = $zfiles_basedir; $zfiles_publicurl = $zfiles_baseurl; // the default settings of the basedir, $zfiles_basename = "Z_BackOffice Files"; $zfiles_table = "z_intern_files"; $zfiles_iconbase = "$z_commonurl/images/icons/"; // image config $zfiles_jpegq = 100; $zfiles_scaletimout = 300; $zfiles_bicubic = true; // bicubic scaling; requires GD2.0 $zfiles_imgcfg = array(); $zfiles_imgcfg["icon"]["maxwidth"]=0; $zfiles_imgcfg["icon"]["maxheight"]=16; $zfiles_imgcfg["icon"]["crop"]=false; $zfiles_imgcfg["icon"]["enlarge"]=true; $zfiles_imgcfg["icon"]["watermark"]=false; $zfiles_imgcfg["iconthumb"]["maxwidth"]=0; $zfiles_imgcfg["iconthumb"]["maxheight"]=32; $zfiles_imgcfg["iconthumb"]["crop"]=false; $zfiles_imgcfg["iconthumb"]["enlarge"]=true; $zfiles_imgcfg["iconthumb"]["watermark"]=false; $zfiles_imgcfg["thumb"]["maxwidth"]=100; $zfiles_imgcfg["thumb"]["maxheight"]=100; $zfiles_imgcfg["thumb"]["crop"]=false; $zfiles_imgcfg["thumb"]["enlarge"]=true; $zfiles_imgcfg["thumb"]["watermark"]=false; $zfiles_imgcfg["preview"]["maxwidth"]=200; $zfiles_imgcfg["preview"]["maxheight"]=200; $zfiles_imgcfg["preview"]["crop"]=false; $zfiles_imgcfg["preview"]["enlarge"]=true; $zfiles_imgcfg["preview"]["watermark"]=false; $zfiles_imgcfg["foto_klein"]["maxwidth"]=0; $zfiles_imgcfg["foto_klein"]["maxheight"]=220; $zfiles_imgcfg["foto_klein"]["crop"]=false; $zfiles_imgcfg["foto_klein"]["enlarge"]=true; $zfiles_imgcfg["foto_klein"]["watermark"]=false; $zfiles_imgcfg["foto_pers"]["maxwidth"]=450; $zfiles_imgcfg["foto_pers"]["maxheight"]=220; $zfiles_imgcfg["foto_pers"]["crop"]=false; $zfiles_imgcfg["foto_pers"]["enlarge"]=true; $zfiles_imgcfg["foto_pers"]["watermark"]=false; $zfiles_imgcfg["250"]["maxwidth"]=250; $zfiles_imgcfg["250"]["maxheight"]=0; $zfiles_imgcfg["250"]["crop"]=false; $zfiles_imgcfg["250"]["enlarge"]=true; $zfiles_imgcfg["250"]["watermark"]=false; $zfiles_imgcfg["520"]["maxwidth"]=520; $zfiles_imgcfg["520"]["maxheight"]=0; $zfiles_imgcfg["520"]["crop"]=false; $zfiles_imgcfg["520"]["enlarge"]=true; $zfiles_imgcfg["520"]["watermark"]=false; $zfiles_imgcfg["link"]["maxwidth"]=200; $zfiles_imgcfg["link"]["maxheight"]=200; $zfiles_imgcfg["link"]["crop"]=false; $zfiles_imgcfg["link"]["enlarge"]=true; $zfiles_imgcfg["link"]["watermark"]=false; $zfiles_imgcfg["foto_pag"]["maxwidth"]=200; $zfiles_imgcfg["foto_pag"]["maxheight"]=200; $zfiles_imgcfg["foto_pag"]["crop"]=false; $zfiles_imgcfg["foto_pag"]["enlarge"]=true; $zfiles_imgcfg["foto_pag"]["watermark"]=false; $zfiles_imgcfg["large"]["maxwidth"]=800; $zfiles_imgcfg["large"]["maxheight"]=600; $zfiles_imgcfg["large"]["crop"]=false; $zfiles_imgcfg["large"]["enlarge"]=false; $zfiles_imgcfg["large"]["watermark"]=true; $zfiles_imgcfg["foto_solo"]["maxwidth"]=800; $zfiles_imgcfg["foto_solo"]["maxheight"]=600; $zfiles_imgcfg["foto_solo"]["crop"]=false; $zfiles_imgcfg["foto_solo"]["enfoto_solo"]=false; $zfiles_imgcfg["foto_solo"]["watermark"]=false; $zfiles_wmark = "$zfiles_basedir/_watermark.png"; $zfiles_wmarktrans = 70; $zfiles_wmarkv = -3; // pos: top=v; neg: bot=src_bot-v $zfiles_wmarkh = -3; // pos: left=h; neg: right=src_right-v; // the doctype is determined by the path. the // first matching regular expression is used. $zfiles_dtx = array(); $zfiles_dtx["text"] = "^.*\\.(txt|pdf|doc|rtf)$"; $zfiles_dtx["image"] = "^.*\\.(jpg|jpeg|png)$"; $zfiles_dtx["default"] = ".*"; // constructors are determined by doctype $zfiles_dtc = array(); $zfiles_dtc["default"] = "FileRecord"; $zfiles_dtc["folder"] = "FolderRecord"; $zfiles_dtc["text"] = "TextFile"; $zfiles_dtc["image"] = "ImageFile"; // mimetypes are determined by extension $zfiles_mime = array(); $zfiles_mime["txt"] = "text/plain"; $zfiles_mime["pdf"] = "application/pdf"; $zfiles_mime["doc"] = "application/ms-word"; $zfiles_mime["rtf"] = "text/rtf"; $zfiles_mime["gif"] = "image/gif"; $zfiles_mime["jpg"] = "image/jpeg"; $zfiles_mime["jpeg"] = "image/jpeg"; $zfiles_mime["png"] = "image/png"; // icons are determined by mimetype $zfiles_icons = array(); $zfiles_icons["file/missing"] = "missing"; $zfiles_icons["folder/closed"] = "zfolder.closed"; $zfiles_icons["folder/opened"] = "zfolder.open"; $zfiles_icons["folder/closed-record"] = "zfolder.closed.record"; $zfiles_icons["folder/opened-record"] = "zfolder.open.record"; $zfiles_icons["folder/closed-missing"] = "zfolder.closed.missing"; $zfiles_icons["folder/opened-missing"] = "zfolder.open.missing"; $zfiles_icons["folder/parent"] = "back"; $zfiles_icons["file"] = "unknown"; $zfiles_icons["folder"] = "folder"; $zfiles_icons["application"] = "binary"; $zfiles_icons["audio"] = "sound1"; $zfiles_icons["image"] = "image2"; $zfiles_icons["text"] = "text"; $zfiles_icons["video"] = "movie"; $zfiles_icons["application/macwriteii"] = "a"; $zfiles_icons["application/msword"] = "a"; $zfiles_icons["application/pdf"] = "pdf"; $zfiles_icons["application/postscript"] = "ps"; $zfiles_icons["application/rtf"] = "a"; $zfiles_icons["application/wordperfect5.1"] = "a"; $zfiles_icons["application/zip"] = "compressed"; $zfiles_icons["application/x-executable"] = "bomb"; $zfiles_icons["application/x-gtar"] = "compressed"; $zfiles_icons["application/x-java-applet"] = "bomb"; $zfiles_icons["application/x-kword"] = "a"; $zfiles_icons["application/x-latex"] = "tex"; $zfiles_icons["application/xml"] = "text"; $zfiles_icons["application/x-msdos-program"] = "bomb"; $zfiles_icons["application/x-shockwave-flash"] = "box2"; $zfiles_icons["application/x-stuffit"] = "compressed"; $zfiles_icons["application/x-tar"] = "compressed"; $zfiles_icons["application/x-texinfo"] = "tex"; // the entrynames below were derived from a small photoshop test // I couldn't find very explicit docs about this. // $entrynames["2#000"]="? : "; // had some info $zfiles_iptc["2#120"]="caption : caption "; $zfiles_iptc["2#122"]="caption : writer "; $zfiles_iptc["2#105"]="caption : headline "; $zfiles_iptc["2#040"]="caption : spec instr "; $zfiles_iptc["2#080"]="credits : byline "; $zfiles_iptc["2#085"]="credits : byline title "; $zfiles_iptc["2#110"]="credits : credit "; $zfiles_iptc["2#115"]="credits : source "; $zfiles_iptc["2#005"]="origin : objectname "; $zfiles_iptc["2#055"]="date : "; $zfiles_iptc["2#090"]="origin : city "; $zfiles_iptc["2#095"]="origin : province "; $zfiles_iptc["2#101"]="origin : country "; $zfiles_iptc["2#103"]="origin : transm ref "; $zfiles_iptc["2#015"]="category : "; $zfiles_iptc["2#020"]="supp cats : "; // $zfiles_iptc["2#010"]="? : "; // had some info $zfiles_iptc["2#025"]="keywords : "; $zfiles_iptc["2#116"]="copyrights: "; ?> /****************************** * dbClass Bokkiewokkie styley * For BlackBird CMS * * By: Tobias Beuving () * ********************************/ class dbClass { /* public: connection parameters */ /* Connecting, selecting database */ /* live omgeving */ var $pHost = "localhost"; var $pDatabase = "tractor"; var $pUser = "tractor"; var $pPassword = "m@n0n"; /* test omgeving */ /* var $pHost = "localhost"; var $pDatabase = "tractor"; var $pUser = "merel"; var $pPassword = "vogelnest"; */ var $pResourceLink = 0; var $pIsConnected = false; var $pOperationOutput = ""; var $pRecordsInResult = Array(); var $pNumRows = 0; function mConnect() { $tmpOutput = true; //default true, otherwise when error occurs: false $this->
"; print $this->mGetErrorInfo(); print ""; } else { $this->pError = false; while (@$tmpRecordA = mysql_fetch_array($result, MYSQL_ASSOC)) { $this->pRecordsInResult[] = $tmpRecordA; } if (strpos(strtolower($SQLIn), "select ") !== false ) { $this->pNumRows = mysql_num_rows($result); //if ($this->pNumRows) echo $SQLIn."
"; print_r($recordIn); print ""; print "Halted at key:".$key." value:"; print "
"; print_r($value); print ""; exit; } } $tmpHTML = ""; if ($recordIn == 0) { $recordIn = Array(); } $tmpSmartyO = baseClass::mGetSmarty(); foreach($recordIn AS $key=>$value) { $tmpSmartyO->assign($key, $value); } return $tmpSmartyO->fetch($templateIn); } /* function : mRenderMultiple */ /* By: Tobias Beuving */ /* function to render records with each there own template */ function mRenderMultiple($recordsIn = null,$templateIn) { if ($recordsIn == null) { $recordsIn = Array(); } $tmpHTML = ""; foreach($recordsIn AS $tmpRecord) { $tmpSmartyO = baseClass::mGetSmarty(); foreach($tmpRecord AS $key=>$value) { $tmpSmartyO->assign($key, $value); } $tmpHTML .= $tmpSmartyO->fetch($templateIn); } return $tmpHTML; } /* function : mRenderMore */ /* By: Edgar Vijgeboom */ /* function to render all records in one go to Array, use it for having more SQL records in one template */ function mRenderMore($recordsIn = null,$templateIn) { if ($recordsIn == null) { $recordsIn = Array(); } $tmpHTML = ""; $tmpSmartyO = baseClass::mGetSmarty(); $tmpSmartyO->assign("result", $recordsIn); $tmpHTML .= $tmpSmartyO->fetch($templateIn); return $tmpHTML; } /* * Creates and appends a text node with value to a DOM document * * @param $nameIn String name of the tag * @param $valueIn String value of the tag * @param $domDocIn String dom document, passed by reference * @param $nodeIn String dom-node-element, passed by reference * * @returns nothing, objects are passed by reference */ function _mCreateAndAppendTextNode(&$domDocIn, &$nodeIn, $nameIn, $valueIn) { $tmpElement = $domDocIn->createElement($nameIn); $tmpElement->appendChild($domDocIn->createTextNode($valueIn)); $nodeIn->appendChild($tmpElement); } /* function : mArrayToJSON */ /* By: Tobias Beuving */ /* maakt een JSON (Javascript object notation) string van een array */ function mArrayToJSON($tmpArrayIn) { $tmpRecords = Array(); foreach ($tmpArrayIn AS $key=>$value) { $tmpValueString = ""; if (is_array($value)) { $tmpPropertiesB = Array(); foreach ($value AS $key2=>$value2) { $tmpPropertiesB[] = '"'.$key2.'": "'.str_replace(chr(13).chr(10), '', addslashes($value2)).'"'; } $tmpValueString = "{".implode(",", $tmpPropertiesB)."}"; } else { $tmpValueString = '"'.nl2br($value).'"'; } //$tmpPropertiesA[] = '"'.$key.'": '.$tmpValueString; $tmpRecords[] = $tmpValueString; } $tmpPropertiesString = implode(",", $tmpRecords); $tmpJSON = '['. $tmpPropertiesString . ']'; return $tmpJSON; } } ?>