当前位置: 首页>>代码示例>>PHP>>正文


PHP createDBCArray函数代码示例

本文整理汇总了PHP中createDBCArray函数的典型用法代码示例。如果您正苦于以下问题:PHP createDBCArray函数的具体用法?PHP createDBCArray怎么用?PHP createDBCArray使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了createDBCArray函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 /**
  * Perform the export.
  */
 function execute()
 {
     global $errors, $lang, $sid;
     $minus = 0;
     $pages = createDBCArray("sitepage", "SPID", "MENU_ID = " . $this->menuId);
     for ($i = 0; $i < count($pages); $i++) {
         $cluster = getDBCell("sitepage", "CLNID", "SPID=" . $pages[$i]);
         $articles = countRows("channel_articles", "ARTICLE_ID", "ARTICLE_ID=" . $cluster);
         if ($articles == 0) {
             importClusterToArticle($pages[$i], $this->channelId, $this->categoryId);
         } else {
             $minus++;
             $error = $lang->get("already_imported", "At least one page has not been imported, because it already exists in an channel.");
         }
     }
     if ($errors == "") {
         $this->add(new WZLabel($lang->get("ch_imp_success", "The data was successfully imported to the channel.")));
         if (strlen($error) > 0) {
             $this->add(new WZLabel($error));
         }
         $this->add(new WZLabel($lang->get("num_imp_pages", "Total number of imported pages:") . " " . (count($pages) - $minus)));
     } else {
         $this->add(new WZLabel($lang->get("ch_imp_failed", "There was an error while importing the data to the channel.")));
     }
     $this->parent->finished = true;
     $this->add(new WZLabel($lang->get("back_to_channels", "Back to Article Overview") . " >>", "modules/channels/overview.php?sid={$sid}"));
 }
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:30,代码来源:st_import.php

示例2: parentClusters

function parentClusters($clArray, $level = 0)
{
    $clnids = array();
    if ($level > 5) {
        return $clnids;
    }
    for ($i = 0; $i < count($clArray); $i++) {
        $cl = $clArray[$i];
        // find dynamic clusters....
        $clids = createDBCArray("cluster_content", "CLID", "FKID = {$cl}");
        for ($j = 0; $j < count($clids); $j++) {
            array_push($clnids, getDBCell("cluster_variations", "CLNID", "CLID = " . $clids[$j]));
        }
        // find static clusters...
        $clts = createDBCArray("cluster_template_items", "CLT_ID", "FKID = " . $cl);
        for ($j = 0; $j < count($clts); $j++) {
            $clns = createDBCArray("cluster_node", "CLNID", "CLT_ID = " . $clts[$j]);
            $clnids = array_merge($clnids, $clns);
        }
    }
    if (is_array($clnids)) {
        $clnids = array_unique($clnids);
    }
    // traverse down the tree, max 10 levels...
    $parents = parentClusters($clnids, $level + 1);
    $clnids = array_merge($clnids, $parents);
    if (is_array($clnids)) {
        $clnids = array_unique($clnids);
    }
    return $clnids;
}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:31,代码来源:object_usage.php

示例3: getField

 /**
  * returns an field containing arrays containg the ids of clusters of this channel.
  * Use cluster->getById() to retrieve the content of the cluster.
  * @param string Name of the cluster
  * @param integer ID of the Variation to query. Leave Blank or set to zero for Page-Variation.
  * @param string name of the column to order the cluster-nodes.
  */
 function getField($name, $variation = 0, $order = "POSITION ASC")
 {
     global $c;
     if ($variation == 0) {
         $variation = $this->variation;
     }
     $name = strtolower($name);
     // get the clti..
     $clid = getDBCell("cluster_variations", "CLID", "CLNID = " . $this->parent->pageClusterNodeId . " AND VARIATION_ID = {$variation}");
     $clt = getDBCell("cluster_node", "CLT_ID", "CLNID = " . $this->parent->pageClusterNodeId);
     $clti = getDBCell("cluster_template_items", "CLTI_ID", "CLT_ID = {$clt} AND UPPER(NAME) = '{$name}'");
     if ($clti == "") {
         return "Field not defined!";
     }
     $type = getDBCell("cluster_template_items", "CLTITYPE_ID", "CLTI_ID = {$clti}");
     if ($type == 8) {
         // query parameters...
         $stageIds = createDBCArray("cluster_content", "CLCID", "CLTI_ID = {$clti} AND CLID = {$clid} ORDER BY POSITION ASC");
         $result = array();
         for ($i = 0; $i < count($stageIds); $i++) {
             $result[] = $this->_getArticleClusters($stageIds[$i], $variation);
         }
         return $result;
     } else {
         echo "This field is not a channel-centerstage!";
     }
 }
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:34,代码来源:channel.php

示例4: applyFilterPlugins

/**
 * Apply the filter-plugins on a given input
 * @param string Text to filter
 */
function applyFilterPlugins($text)
{
    $objectParser = new ObjectParser();
    $text = $objectParser->parse($text);
    $plugins = createDBCArray("modules", "MODULE_ID", "MODULE_TYPE_ID=4");
    for ($i = 0; $i < count($plugins); $i++) {
        includePGNSources();
        $plugin = createPGNRef($plugins[$i], 0);
        $text = $plugin->parseText($text);
    }
    return $text;
}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:16,代码来源:plugin.php

示例5: addWebsite

/**
 * Add a page to the Sitemap and start adding the children
 */
function addWebsite($startNode, &$map)
{
    global $c, $variations;
    $childs = createDBCArray("sitemap", "MENU_ID", "PARENT_ID=" . $startNode . " AND VERSION=10 AND DELETED=0");
    for ($i = 0; $i < count($childs); $i++) {
        for ($j = 0; $j < count($variations); $j++) {
            if (!isMenuExpired($childs[$i], $variations[$j])) {
                $url = $c["livehost"] . $c["livedocroot"] . getPageURL($childs[$i], $variations[$j]);
                $map->AddURL($url);
            }
            addWebsite($childs[$i], $map);
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:17,代码来源:update.php

示例6: TagEditor

	function TagEditor($title, $store_table, $pkKey, $pkValue, $fkKey, $values) {
	  $this->title = $title;
	  $this->store_table = $store_table;
	  $this->pkKey = $pkKey;
	  $this->pkValue = $pkValue;
	  $this->fkKey = $fkKey;
	  $this->values = $values;  			
	  
	global $page_state, $page_action, $db;
    if ($page_state == "processing") {  	
		// Get Values form PoST     	
		$this->selectedValues = explode(",", value($this->store_table.$this->pkKey.'selection', "NOSPACES"));     	     	
    } else {
    	if (($page_action == "UPDATE" || $page_action == "DELETE") && $this->cond != "1") {
    		// Load Values from database		    		
    		$this->selectedValues = createDBCArray($this->store_table, $this->fkKey, $this->pkKey.'='.$this->pkValue);   		 
    	  }    		
   	}
   	
   	// selected values jetzt fett machen....
   	if (is_array($this->selectedValues)) {
   	  $this->selectedValues = createNameValueArrayEx("pgn_recipes_tags", "TAG", "TAG_ID", "TAG_ID IN (".implode(",", $this->selectedValues).")", "ORDER BY TAG ASC");
   	} else {
   	  $this->selectedValues = array();	
   	}
   	
   	// extract selected Values from given values
   	$newValues = array();
   	for ($i=0; $i<count($this->values); $i++) {
   		$found = false;   		
   		for ($j=0; $j<count($this->selectedValues); $j++) {   			
   			if ($this->values[$i][1] == $this->selectedValues[$j][1]) 
   			  $found = true;
   		}   		
   		if (!$found)  $newValues[] = $this->values[$i];
   	}
   	$this->values = $newValues;
   	        
   }
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:39,代码来源:tag_selector.php

示例7: getStartPage

		/**
		 * To be used in start file (e.g. index.php) to determine the first pageId
		 * to use.
		 * @param integer ID of the variation the Startpage should be find in.
		 * @returns	integer		Sitepage-ID of the first sitepage to use.
		 */
		function getStartPage($variation=0) {
			global $c;
			
			if ($variation == 0)
			  $variation = $c["stdvariation"];
			$zeroTrans = getDBCell("state_translation", "OUT_ID", "IN_ID=0 AND LEVEL=10");
				
			if ($this->parent->level < 10) {
				$menues = createDBCArray("sitemap", "MENU_ID", "IS_DISPLAYED=1 AND PARENT_ID=0 ORDER BY POSITION");			
			} else {			
				$menues = createDBCArray("sitemap", "MENU_ID", "IS_DISPLAYED=1 AND PARENT_ID=$zeroTrans ORDER BY POSITION");				
			}

			for ($i = 0; $i < count($menues); $i++) {
				$spids = createDBCArray("sitepage", "SPID", "MENU_ID = " . $menues[$i] . " ORDER BY POSITION");
				for ($j = 0; $j < count($spids); $j++) {
					if (!$this->isSPExpired($spids[$j], $variation, $this->level))
						return $spids[$j];
				}
			}

			return 0;
		}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:29,代码来源:management.php

示例8: Configurator

		/**
		  * standard constructor
		  */
		function Configurator() {

			// load the data of the field.
			global $page_state, $page_action, $oid;

			if ($page_state == "processing") {
				$keys = createDBCArray("sys_functions", "FUNCTION_ID", "1");

				$this->configData = array ();

				for ($i = 0; $i < count($keys); $i++) {
					if (value($keys[$i]) != "0")
						array_push($this->configData, $keys[$i]);
				}

				$this->resolveParents();
			} else {
				// fetch values from the database...
				$this->configData = createDBCArray("role_sys_functions", "FUNCTION_ID", "ROLE_ID = $oid");

				if (!is_array($this->configData))
					$this->configData = array ();
			}
		}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:27,代码来源:acl_widget.php

示例9: 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)');
	      }		      
	    }	
	  }	  	  	  
	}	
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:55,代码来源:synchronize.php

示例10: launchContent

	/**
* Launch a Content-Item
* @param integer CID to launch
* @param integer ID of the level to launch to.
* @param integer ID of the variation to launch.
* @returns integer Translated ID after launch
*/
	function launchContent($in, $level, $variation) {
		global $db, $auth;
		if (!checkACL($in)) {						
			$out = translateState($in, $level);
			$sql = "SELECT * FROM content WHERE CID = $in";
			$query = new query($db, $sql);
			$query->getrow();
			$module = $query->field("MODULE_ID");
			$category = $query->field("CATEGORY_ID");
			$mtid = $query->field("MT_ID");
			$name = addslashes($query->field("NAME"));
			$keywords = addslashes($query->field("KEYWORDS"));
			$description = addslashes($query->field("DESCRIPTION"));
			$delme = $query->field("DELETED");
			$accesskey = $query->field("ACCESSKEY");

			// do some launches
			$mtTrans = launchMetaTemplate($mtid, $level);

			$sql = "DELETE FROM content WHERE CID = $out";
			$query = new query($db, $sql);
			$sql = "INSERT INTO content (CID, MODULE_ID, CATEGORY_ID, MT_ID, NAME, DESCRIPTION, KEYWORDS, CREATED, LAST_MODIFIER, VERSION, DELETED, ACCESSKEY) VALUES ";
			$sql .= "($out, $module, $category, $mtTrans, '$name', '$description', '$keywords', NOW(), '$auth->user', $level, $delme, '$accesskey')";
			
			$query = new query($db, $sql);
			// launch the content.
			$dbc = createDBCArray("content_variations", "VARIATION_ID", "DELETED=0 AND CID=".$in);
			for ($i=0; $i<count($dbc);$i++) {
			  launchContentVariation($in, $module, $level, $dbc[$i]);
      }		
			// launch metas
			$sql = "SELECT MID FROM meta WHERE CID = $in AND DELETED=0";
			$query = new query($db, $sql);

			while ($query->getrow()) {
				launchMeta($query->field("MID"), $level);
			}

			$query->free();			
			return $out;
		} else
			return translateState($in, $level);
	}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:50,代码来源:launch.php

示例11: ActionHandler

			$handler = new ActionHandler("INSERT");
			$handler->addFncAction("syncClusterVariations");
			$form->registerActionHandler($handler);

			$page->add($form);
			// edit the properties of an object.
			$handled = true;

		} else if ($action != "foo" && ($action != "0"  || $view != "0")) {
			if ($action == "") $action = value("acstate");	

			if ($action == "createCluster") {
				$id = value("id");

				$clnid = createClusterNode(value("cluster_node_NAME".$id), $clt);
    		    $variations = createDBCArray("variations", "VARIATION_ID");
                for ($varX=0; $varX < count($variations); $varX++) {
                        $clid = createCluster($clnid, $variations[$varX], $auth->userName);
                }

	   		    $sql = "UPDATE cluster_content SET FKID = '$clnid' WHERE CLCID = '$id';";
				$query = new query($db, $sql);
				$query->getrow();
				
				// Trying to set action to Edit All, but it obviously doesn't work.
				$action = value("acstate");
			}
					
			$handled = true;
			$page_action = "UPDATE";
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:30,代码来源:cluster_logic.inc.php

示例12: getFieldnames

		/**
		 * Return an array containing all Meta-Field-Names of this cluster
		 */
		function getFieldnames() {
			$clt = getDBCell("cluster_node", "CLT_ID", "CLNID = ".$this->pageClusterNodeId);
			$mt = getDBCell("cluster_templates", "MT_ID", "CLT_ID = $clt");
			return createDBCArray("meta_template_items", "NAME", "MT_ID = $mt", "ORDER BY POSITION ASC");
		}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:8,代码来源:meta.php

示例13: querySelectedValues

	  /**
	  * Query for the selected values
	  */
	  function querySelectedValues() {
	  	$this->selectedValues = array();		
		if ($this->cond != "1") {
	  		
			$ids = createDBCArray($this->table, $this->idcolumn, $this->cond, "ORDER BY POSITION");	
				for ($i=0; $i < count($ids); $i++) {		        	
	        		$sub[0] = getDBCell($this->lookupTable, $this->lookupName, $this->lookupID." = ".$ids[$i]);
	        		$sub[1] = $ids[$i];
            			$tmp = array();
            			foreach ($this->selectValues as $key) {
            			  if ($sub[1] != $key[1])
            			    $tmp[] = $key;           			  	
            			}
            			$this->selectValues = $tmp;
            			$this->selectedValues[] = $sub;
	      		}
		}  
	  }
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:21,代码来源:select_multiple_input.php

示例14: getChannels

/**
 * Returns an array with the GUIDs of all channels in the system
 */
function getChannels()
{
    return createDBCArray("channels", "CHID");
}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:7,代码来源:channel.php

示例15: Label

			$editPanel->add(new Label("lbl", "<b>Translate: </b>" . getDBCell("internal_resources", "VALUE", "RESID='" . $items[$i] . "' AND LANGID='EN'"), "standardlight", 2));
			$editPanel->add(new TextInput($items[$i], "internal_resources", "VALUE", "RESID='" . $items[$i] . "' AND LANGID='$oid'", "type:textarea,size:2,width:400"));
			$editPanel->add(new TextInput("Tooltip", "internal_resources", "TOOLTIP", "RESID='" . $items[$i] . "' AND LANGID='$oid'", "type:textarea,size:2,width:400"));
			$editPanel->add(new Separator());
		}

		$editPanel->add(new FormButtons(true));
		$editPanel->add(new Hidden("oid", $oid));
		// add the panel to the form and the form to the page.
		$form->addPanel($editPanel);
		$page->add($form);
	} else {
		$form = new Form($lang->get("stats", "Statistics"));

		$page_action = "UPDATE";
		$langs = createDBCArray("internal_resources_languages", "LANGID", "1");

		for ($i = 0; $i < count($langs); $i++) {
			if ($vs != "0")
				syncronizeLanguage ($langs[$i]);

			$langname = getDBCell("internal_resources_languages", "NAME", "LANGID = '" . $langs[$i] . "'");
			$form->add(new Label("lbl", "Statistics for " . $langname, "standard", 2));
			$translated = countRows("internal_resources", "RESID", "LANGID='" . $langs[$i] . "' AND VALUE IS NOT NULL AND VALUE <>''");
			$nottranslated1 = countRows("internal_resources", "RESID", "LANGID='" . $langs[$i] . "' AND VALUE IS NULL");
			$nottranslated2 = countRows("internal_resources", "RESID", "LANGID='" . $langs[$i] . "' AND VALUE =''");
			$nottranslated = $nottranslated1 + $nottranslated2;
			$form->add(new Label("lbl", "Translated: " . $translated, "standardlight"));
			$form->add(new Label("lbl", "Not translated: " . $nottranslated, "standardlight"));
			$form->add(new Separator());
		}
开发者ID:BackupTheBerlios,项目名称:nxwcms-svn,代码行数:31,代码来源:translation.php


注:本文中的createDBCArray函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。