本文整理汇总了PHP中nextGUID函数的典型用法代码示例。如果您正苦于以下问题:PHP nextGUID函数的具体用法?PHP nextGUID怎么用?PHP nextGUID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了nextGUID函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: syncVariations
/**
* syncronize variations with entered data to the database.
* The configuration for this function must be set manually.
* I.E. there must be the $oid-Variable set and there must(!)
* be also the global vars content_variations_VARIATION_ID_XX
* and content_MODULE_ID
* set which are automatically set by the SelectMultiple2Input.
*/
function syncVariations()
{
global $db, $oid, $content_MODULE_ID;
$module = value("content_MODULE_ID", "NUMERIC");
if ($module == "0") {
$module = $content_MODULE_ID;
}
includePGNSource($module);
//delete all variations first.
$del = "UPDATE content_variations SET DELETED=1 WHERE CID = {$oid}";
$query = new query($db, $del);
// get list of variations
$variations = createNameValueArray("variations", "NAME", "VARIATION_ID", "DELETED=0");
for ($i = 0; $i < count($variations); $i++) {
$id = $variations[$i][1];
if (value("content_variations_VARIATION_ID_" . $id) != "0") {
// create or restore variation
// check, if variations already exists and is set to deleted.
$sql = "SELECT COUNT(CID) AS ANZ FROM content_variations WHERE CID = {$oid} AND VARIATION_ID = {$id}";
$query = new query($db, $sql);
$query->getrow();
$amount = $query->field("ANZ");
if ($amount > 0) {
$sql = "UPDATE content_variations SET DELETED=0 WHERE CID = {$oid} AND VARIATION_ID = {$id}";
} else {
$fk = nextGUID();
$sql = "INSERT INTO content_variations (CID, VARIATION_ID, FK_ID, DELETED) VALUES ( {$oid}, {$id}, {$fk}, 0)";
$PGNRef = createPGNRef($module, $fk);
$PGNRef->sync();
}
$query = new query($db, $sql);
}
}
}
示例2: createImageFromFile
/**
* Create a image from a file. Do not add the file to the object library
* @param string Path to the source file
* @param string Description Text for ALT-Tag
* @param string Copright text for the image
* @param string Variation-ID of the image
*/
function createImageFromFile($sourceFile, $alt = "", $copyright = "", $variation = 1, $categoryId = 1)
{
global $c, $db;
$id = nextGUID();
$info = pathinfo($sourceFile);
$extension = $info["extension"];
$extension2 = strtoupper($extension);
$name = parseSQL($info["basename"]);
if ($extension2 == "JPG" || $extension2 == "GIF" || $extension2 == "PNG") {
$size = getimagesize($sourceFile);
$width = $size[0];
$height = $size[1];
copy($sourceFile, $c["devfilespath"] . $id . "." . $extension);
$thumb = new Img2Thumb($c["devfilespath"] . $id . "." . $extension, 120, 120, $c["devfilespath"] . "t" . $id);
$sql = "INSERT INTO pgn_image (FKID, FILENAME, ALT, COPYRIGHT, WIDTH, HEIGHT) VALUES ";
$sql .= "({$id}, '{$id}.{$extension}', '{$alt}', '{$copyright}', {$width}, {$height})";
$query = new query($db, $sql);
$query->free();
// Create Library Entry for this image
$cid = nextGUID();
$imageModule = getDBCell("modules", "MODULE_ID", "MODULE_NAME='Image'");
$sql = "INSERT INTO content (CID, MODULE_ID, NAME, CATEGORY_ID, MT_ID) VALUES ";
$sql .= "({$cid}, {$imageModule}, '{$name}', {$categoryId}, 0)";
$query = new query($db, $sql);
$query->free();
$sql = "INSERT INTO content_variations (CID, VARIATION_ID, FK_ID) VALUES ";
$sql .= "({$cid}, {$variation}, {$id})";
$query = new query($db, $sql);
$query->free();
return $cid;
} else {
return null;
}
}
示例3: registration
/**
* Specifies information for installation and deinstallation of the plugin.
*/
function registration() {
global $auth;
// Authentification is require_onced for changing system configuration. Do not change.
if ($auth->checkPermission("ADMINISTRATOR")) {
// parent registration function for initializing. Do not change.
Plugin::registration();
// Name of the Plugin. The name will be displayed in the WCMS for selection
$this->name = "Google Maps API";
// A short description, what the Plugin is for.
$this->description = "Google Maps API";
// Version of the plugin. Use integer numbers only. Is important for future releases.
$this->version = 1;
/**** do not change from this point ****/
$mtid = nextGUID(); // getting next GUID.
//del1
// SQL for creating the tables in the database. Do not call, if you do not need any tables in the database
// SQL for deleting the tables from the database.
/**** change nothing beyond this point ****/
global $source, $classname; // the source path has to be provided by the calling template
$modId = nextGUID();
$this->installHandler->addDBAction("INSERT INTO modules (MODULE_ID, MODULE_NAME, DESCRIPTION, VERSION, MT_ID, CLASS, SOURCE, MODULE_TYPE_ID) VALUES ($modId, '$this->name', '$this->description', $this->version, $mtid, '$classname', '$source', 3)");
}
}
示例4: createSitepageMaster
/**
* Create a new Page Template
* @param string Name
* @param string Description
* @param string Filename of the template
* @param string Template
* @param integer GUID of Cluster Template
* @param integer Id of Type (1=singlepage, 2=multipage)
* @param integer OPtional key to use.
*/
function createSitepageMaster($name, $description, $templatePath, $template, $clt, $type, $id = null)
{
global $db, $c, $errors;
if ($id == null) {
$id = nextGUID();
}
$name = makeCopyName("sitepage_master", "NAME", parseSQL($name), "VERSION=0 AND DELETED=0");
$description = parseSQL($description);
$filename = substr($templatePath, 0, strcspn($templatePath, "."));
$filesuffix = $templatePath = substr($templatePath, strcspn($templatePath, ".") + 1);
$templatePath = makeUniqueFilename($c["devpath"], parseSQL($filename), $filesuffix);
$fp = @fopen($c["devpath"] . $templatePath, "w+");
if ($fp != "") {
@fwrite($fp, $template);
@fclose($fp);
} else {
$errors .= "--Could not write spm: " . $templatePath;
}
$sql = "INSERT INTO sitepage_master (SPM_ID, NAME, DESCRIPTION, TEMPLATE_PATH, CLT_ID, SPMTYPE_ID) VALUES ";
$sql .= "({$id}, '{$name}', '{$description}', '{$templatePath}', {$clt}, {$type})";
$query = new query($db, $sql);
$query->free();
$variations = createDBCArray("variations", "VARIATION_ID", "1");
for ($i = 0; $i < count($variations); $i++) {
$sql = "INSERT INTO sitepage_variations (SPM_ID, VARIATION_ID) VALUES ( {$id}, " . $variations[$i] . ")";
$query = new query($db, $sql);
$query->free();
}
return $id;
}
示例5: registration
/**
* Specifies information for installation and deinstallation of the plugin.
*/
function registration() {
global $auth;
// Authentification is require_onced for changing system configuration. Do not change.
if ($auth->checkPermission("ADMINISTRATOR")) {
// parent registration function for initializing. Do not change.
Plugin::registration();
// Name of the Plugin. The name will be displayed in the WCMS for selection
$this->name = "PagingLinks";
// A short description, what the Plugin is for.
$this->description = "Add previous page - next page links to the website.";
// Version of the plugin. Use integer numbers only. Is important for future releases.
$this->version = 1;
// Every module can have its own and individual META-Data in NX. The following Handler is
// for creating a META-Data-Template and for assigning it to the Plugin.
// IF you do not want to declare an individual META-Scheme, then set $mtid=0 and delete
// everything between del1 and /del1!
/**** change nothing beyond this point ****/
global $source, $classname; // the source path has to be provided by the calling template
$modId = nextGUID();
$mtid = nextGUID();
$this->installHandler->addDBAction("INSERT INTO modules (MODULE_ID, MODULE_NAME, DESCRIPTION, VERSION, MT_ID, CLASS, SOURCE, MODULE_TYPE_ID) VALUES ($modId, '$this->name', '$this->description', $this->version, $mtid, '$classname', '$source', $this->pluginType)");
}
}
示例6: process
/**
* save the changes...
*/
function process()
{
global $errors, $selected, $create, $sitepage_CLNID, $cluster_node_NAME, $db, $oid, $sid, $clt;
$this->check();
if ($selected != "0" && $sitepage_CLNID != "0" && $sitepage_CLNID != "") {
$mid = getVar("mid");
$sql = "UPDATE sitepage SET CLNID = {$sitepage_CLNID} WHERE SPID = {$oid}";
$query = new query($db, $sql);
$query->free();
// reload page, now in editing mode...
global $db;
$db->close();
header("Location: sitepagebrowser.php?sid={$sid}&mid={$mid}&action=editobject&go=update&oid={$oid}");
exit;
} else {
if ($create != "0" && $errors == "") {
$mid = getVar("mid");
$nextId = nextGUID();
$sql = "INSERT INTO cluster_node (CLNID, CLT_ID, NAME, DELETED) VALUES({$nextId}, {$clt}, '{$cluster_node_NAME}', 0)";
$query = new query($db, $sql);
$sql = "UPDATE sitepage SET CLNID = {$nextId} WHERE SPID = {$oid}";
$query = new query($db, $sql);
$query->free();
$backup = $oid;
$oid = $nextId;
syncClusterVariations();
$oid = $backup;
global $db;
$db->close();
header("Location: sitepagebrowser.php?sid={$sid}&mid={$mid}&action=editobject&go=update&oid={$oid}");
exit;
}
}
}
示例7: createRole
/**
* Creates a role
*
* @param string NAme of the role to create
* @param string Description of the role to create
*/
function createRole($roleName, $roleDescription) {
if (getDBCell("roles", "ROLE_ID", "UPPER(ROLE_NAME) = UPPER('$roleName')") == "") {
global $db;
$guid = nextGUID();
$sql = "INSERT INTO roles (ROLE_ID, ROLE_NAME, DESCRIPTION) VALUES($guid, '$roleName', '$roleDescription')";
$query = new query($db, $sql);
$query->free();
}
}
示例8: syncLanguages
function syncLanguages() {
global $db, $auth;
$variations = createDBCArray('variations', 'VARIATION_ID');
// enable languages in all templates
$spms = createDBCArray('sitepage_master', 'SPM_ID', 'VERSION=0');
for ($i=0; $i<count($spms); $i++) {
for ($j=0; $j<count($variations); $j++) {
$check = getDBCell("sitepage_variations", "VARIATION_ID", "SPM_ID=".$spms[$i]." AND VARIATION_ID=".$variations[$j]);
if ($check=="") {
$update = new query($db, 'INSERT INTO sitepage_variations (SPM_ID, VARIATION_ID) VALUES ('.$spms[$i].','.$variations[$j].')');
}
}
}
// enable languages for all contents
$cids = createDBCArray("content", "CID", "VERSION=0");
for ($i=0; $i<count($cids); $i++) {
$module = getDBCell("content", "MODULE_ID", "CID=".$cids[$i]);
for ($j=0; $j<count($variations); $j++) {
$check = getDBCell("content_variations", "VARIATION_ID", "CID=".$cids[$i]." AND VARIATION_ID=".$variations[$j]);
if ($check=="") {
$fk = nextGUID();
$sql = "INSERT INTO content_variations (CID, VARIATION_ID, FK_ID, DELETED) VALUES ( $cids[$i], $variations[$j], $fk, 0)";
$PGNRef = createPGNRef($module, $fk);
$PGNRef->sync();
$update = new query($db, $sql);
}
}
}
// enable languages for all clusters
$clnids = createDBCArray('cluster_node', 'CLNID', 'VERSION=0 AND DELETED=0');
for ($i=0; $i<count($clnids); $i++) {
for ($j=0; $j<count($variations); $j++) {
$check = getDBCell("cluster_variations", 'VARIATION_ID', 'CLNID='.$clnids[$i].' AND VARIATION_ID='.$variations[$j]);
if ($check=="") {
$fk = nextGUID();
$sql = "INSERT INTO cluster_variations (CLNID, VARIATION_ID, CLID, DELETED,CREATED_AT, CREATE_USER ) VALUES ( $clnids[$i], $variations[$j], $fk, 0, NOW()+0, '".$auth->userName."')";
$update = new query($db, $sql);
syncCluster($fk);
}
}
}
// enable languages for all menutexts
$spids = createDBCArray("sitepage", "SPID", "VERSION=0 AND DELETED=0");
for ($i=0; $i<count($spids); $i++) {
for ($j=0; $j<count($variations); $j++) {
$check = getDBCell("sitepage_names", "VARIATION_ID", "VARIATION_ID= $variations[$j] AND SPID=$spids[$i]");
if ($check =="") {
$update = new query($db, 'INSERT INTO sitepage_names (SPID,VARIATION_ID,NAME,HELP,DELETED,VERSION) VALUES ('.$spids[$i].','.$variations[$j].',"","",0,0)');
}
}
}
}
示例9: registration
/**
* Specifies information for installation and deinstallation of the plugin.
*/
function registration() {
global $auth;
$this->name = "BulkImage";
$this->description = "System-Extensions for importing images in archives.";
$this->version = 1;
if ($auth->checkPermission("ADMINISTRATOR")) {
Plugin::registration();
global $source, $classname; // the source path has to be provided by the calling template
$modId = nextGUID();
$this->installHandler->addDBAction("INSERT INTO modules (MODULE_ID, MODULE_NAME, DESCRIPTION, VERSION, MT_ID, CLASS, SOURCE, MODULE_TYPE_ID) VALUES ($modId, '$this->name', '$this->description', $this->version, 0, '$classname', '$source', 3);");
}
}
示例10: registration
/**
* Specifies information for installation and deinstallation of the plugin.
*/
function registration() {
global $auth;
if ($auth->checkPermission("ADMINISTRATOR")) {
Plugin::registration();
$this->name = "CMS";
$this->description = "CDS-API-Extension for creating, launching and editing Clusters.";
$this->version = 1;
$mtid = nextGUID(); // getting next GUID.
global $source, $classname; // the source path has to be provided by the calling template
$modId = nextGUID();
$this->installHandler->addDBAction("INSERT INTO modules (MODULE_ID, MODULE_NAME, DESCRIPTION, VERSION, MT_ID, CLASS, SOURCE, MODULE_TYPE_ID) VALUES ($modId, '$this->name', '$this->description', $this->version, $mtid, '$classname', '$source', 3)");
}
}
示例11: registration
/**
* Specifies information for installation and deinstallation of the plugin.
*/
function registration() {
global $auth;
if ($auth->checkPermission("ADMINISTRATOR")) {
Plugin::registration();
$this->name = "E-Mail Obfuscator";
$this->description = "Filters email-addresses form texts and recodes them to avoid spidering";
$this->version = 1;
$mtid = nextGUID(); // getting next GUID.
global $source, $classname; // the source path has to be provided by the calling template
$modId = nextGUID();
$this->installHandler->addDBAction("INSERT INTO modules (MODULE_ID, MODULE_NAME, DESCRIPTION, VERSION, MT_ID, CLASS, SOURCE, MODULE_TYPE_ID) VALUES ($modId, '$this->name', '$this->description', $this->version, $mtid, '$classname', '$source', 4)");
}
}
示例12: registration
/**
* Specifies information for installation and deinstallation of the plugin.
*/
function registration() {
global $auth;
if ($auth->checkPermission("ADMINISTRATOR")) {
Plugin::registration();
$this->name = "Rate";
$this->description = "CDS-API-Extension for rating items.";
$this->version = 1;
$mtid = nextGUID(); // getting next GUID.
$this->installHandler->addDBAction("CREATE TABLE `pgn_rating` ( `RATINGID` bigint(20) NOT NULL auto_increment, `SOURCEID` bigint(20) NOT NULL default '0', `VOTE` tinyint(4) NOT NULL default '0', `COMMENT` text NOT NULL, `timestamp` timestamp(14) NOT NULL, PSEUDO varchar(64) null, EMail varchar(128) null, Published tinyint(1) not null default 0, PRIMARY KEY (`RATINGID`)) TYPE=MyISAM AUTO_INCREMENT=1 ;");
$this->uninstallHandler->addDBAction("DROP TABLE `pgn_rating`");
global $source, $classname; // the source path has to be provided by the calling template
$modId = nextGUID();
$this->installHandler->addDBAction("INSERT INTO modules (MODULE_ID, MODULE_NAME, DESCRIPTION, VERSION, MT_ID, CLASS, SOURCE, MODULE_TYPE_ID) VALUES ($modId, '$this->name', '$this->description', $this->version, $mtid, '$classname', '$source', 3)");
}
}
示例13: execute
/**
* generates and executes the Insert-Statement towards the database.
*/
function execute() {
global $db, $errors, $temp_oid, $form;
if ($this->pkval == "") {
$nextId = nextGUID();
$temp_oid = $nextId;
$keys = "($this->pk";
$vals = "($nextId";
$commaflag = true;
} else {
addInsert($this->table, $this->pk, $this->pkval, $this->pkdatatype);
$keys = "(";
$vals = "(";
$commaflag = false;
}
$str = "INSERT INTO $this->table ";
for ($i = 0; $i < $this->counter; $i++) {
if ($commaflag) {
$keys .= ", ";
$vals .= ", ";
}
$keys .= $this->columns[$i];
$vals .= $this->values[$i];
$commaflag = true;
}
$str .= $keys . ") VALUES " . $vals . ")";
global $debug;
if ($debug == true)
echo "SQL: $str <br>";
$query = new query($db, $str);
if (trim($db->error()) != "0:")
$errors .= "-DBInsert";
return $nextId;
}
示例14: registration
/**
* Specifies information for installation and deinstallation of the plugin.
*/
function registration() {
global $auth;
$this->name = "Calendar";
$this->description = "CDS-API-Extension for creating calendars.";
$this->version = 1;
if ($auth->checkPermission("ADMINISTRATOR")) {
Plugin::registration();
$mtid = nextGUID(); // getting next GUID.
$this->installHandler->addDBAction("CREATE TABLE `pgn_cal_appointment` ( `APID` bigint(20) NOT NULL default '0', `CALID` bigint(20) NOT NULL default '0', `CATID` bigint(20) NOT NULL default '0', `TITLE` varchar(255) NOT NULL default '', `DESCRIPTION` longtext default NULL, `STARTDATE` date NOT NULL default '0000-00-00', `STARTTIME` time NOT NULL default '00:00:00', `ENDDATE` date NOT NULL default '0000-00-00', `ENDTIME` time NOT NULL default '00:00:00', `IMAGE` bigint(20) default NULL, `LINK` bigint(20) default NULL, `VERSION` tinyint(4) NOT NULL default '0', PRIMARY KEY (`APID`)) TYPE=MyISAM;");
$this->installHandler->addDBAction("CREATE TABLE `pgn_cal_calendars` ( `CALID` bigint(20) NOT NULL default '0', `NAME` varchar(64) NOT NULL default '', PRIMARY KEY (`CALID`), UNIQUE KEY `NAME` (`NAME`)) TYPE=MyISAM;");
$this->installHandler->addDBAction("CREATE TABLE `pgn_cal_categories` ( `CATID` bigint(20) NOT NULL default '0', `CALID` bigint(20) NOT NULL default '0', `NAME` varchar(64) NOT NULL default '', `DESCRIPTION` varchar(255) default NULL, `COLOR` varchar(8) NOT NULL default '#ffffff', PRIMARY KEY (`CATID`)) TYPE=MyISAM;");
$id1 = nextGUID();
$this->installHandler->addDBAction("INSERT INTO `pgn_cal_calendars` (`CALID`, `NAME`) VALUES (".$id1.", 'My Calendar');");
$this->installHandler->addDBAction("INSERT INTO `pgn_cal_categories` (`CATID`, `CALID`, `NAME`, `DESCRIPTION`, `COLOR`) VALUES (".nextGUID().", $id1, 'Event', 'Events are public. All visitors are welcome.', '#f0f0f0');");
$this->uninstallHandler->addDBAction("DROP TABLE `pgn_cal_categories`");
$this->uninstallHandler->addDBAction("DROP TABLE `pgn_cal_calendars`");
$this->uninstallHandler->addDBAction("DROP TABLE `pgn_cal_appointment`");
$this->uninstallHandler->addDBAction("DELETE FROM temp_vars WHERE NAME='calsel'");
global $source, $classname; // the source path has to be provided by the calling template
$modId = nextGUID();
$this->installHandler->addDBAction("INSERT INTO modules (MODULE_ID, MODULE_NAME, DESCRIPTION, VERSION, MT_ID, CLASS, SOURCE, MODULE_TYPE_ID) VALUES ($modId, '$this->name', '$this->description', $this->version, $mtid, '$classname', '$source', 3);");
}
}
示例15: translateXmlGUID
/**
* Translate an old into a new GUID
* @param integer old GUID
* @param boolean set AntiCycle
*/
function translateXmlGUID($oldId)
{
global $db, $provider, $c;
if ($oldId < 1000) {
// System data.
$out = $oldId;
} else {
if (strtoupper($provider) == strtoupper($c["provider"])) {
// own data.
$out = $oldId;
} else {
$provider = strtoupper(parseSQL($provider));
resetDBCache();
$out = getDBCell("syndication", "OUT_ID", "IN_ID = {$oldId} AND PROVIDER = '{$provider}'");
if ($out == "") {
$out = nextGUID();
$sql = "INSERT INTO syndication (IN_ID, OUT_ID, PROVIDER) VALUES ({$oldId}, {$out}, '{$provider}')";
$query = new query($db, $sql);
$query->free();
}
}
}
return $out;
}