本文整理汇总了PHP中getXML函数的典型用法代码示例。如果您正苦于以下问题:PHP getXML函数的具体用法?PHP getXML怎么用?PHP getXML使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getXML函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: im_customfield_def
function im_customfield_def()
{
global $im_customfield_def;
if ($im_customfield_def == null) {
$files = GSDATAOTHERPATH . IM_CUSTOMFIELDS_FILE;
if (file_exists($files)) {
$data = getXML($files);
$items = $data->item;
if (count($items) > 0) {
foreach ($items as $item) {
$cf = array();
$cf['key'] = (string) $item->desc;
$cf['label'] = (string) $item->label;
$cf['type'] = (string) $item->type;
$cf['value'] = (string) $item->value;
if ($item->type == "dropdown") {
$cf['options'] = array();
foreach ($item->option as $option) {
$cf['options'][] = (string) $option;
}
}
$im_customfield_def[] = $cf;
}
}
}
}
return $im_customfield_def;
}
开发者ID:nelsonr,项目名称:Items-Manager,代码行数:28,代码来源:common.php
示例2: __construct
function __construct($filename, $logdefaults = true)
{
// @todo check filename, must be .log
if ($this->validFilename($filename)) {
$this->_xmlfile = GSDATAOTHERPATH . 'logs/' . $filename;
if (file_exists($this->_xmlfile)) {
$xml = getXML($this->_xmlfile);
if (!is_object($xml)) {
$this->_xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><channel></channel>');
} else {
$this->_xml = $xml;
}
} else {
$this->_xml = new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><channel></channel>');
}
// create entry and add date
$thislog = $this->_xml->addChild('entry');
$thislog->addChild('date', date('r'));
$this->_entry = $thislog;
if ($logdefaults == true) {
$this->defaults();
}
} else {
return false;
}
}
开发者ID:HelgeSverre,项目名称:GetSimpleCMS,代码行数:26,代码来源:logging.class.php
示例3: i18n_customfield_defs
function i18n_customfield_defs()
{
global $i18n_customfield_defs, $i18n_customfield_types;
if ($i18n_customfield_defs === null) {
$i18n_customfield_defs = array();
$i18n_customfield_types = array();
$file = GSDATAOTHERPATH . I18N_CUSTOMFIELDS_FILE;
if (file_exists($file)) {
$data = getXML($file);
$items = $data->item;
if (count($items) > 0) {
foreach ($items as $item) {
$cf = array();
$cf['key'] = (string) $item->desc;
$cf['label'] = (string) $item->label;
$cf['type'] = (string) $item->type;
$cf['value'] = (string) $item->value;
if ($item->type == "dropdown") {
$cf['options'] = array();
foreach ($item->option as $option) {
$cf['options'][] = (string) $option;
}
}
$cf['index'] = (bool) $item->index;
$i18n_customfield_defs[] = $cf;
$i18n_customfield_types[$cf['key']] = $cf['type'];
}
}
}
}
return $i18n_customfield_defs;
}
开发者ID:hatasu,项目名称:appdroid,代码行数:32,代码来源:i18n_customfields.php
示例4: getData
function getData($searchString)
{
$newLink = getSubstring($searchString, "a-link-normal a-text-normal", "<a", "href=\"", "\"");
$searchString = getXML($newLink);
$imgLink = getSubstring($searchString, "imgBlkFront", "<img", "src=\"", "\"", "\"");
$price = getSubstring($searchString, "offer-price", "<span", ">", "<", ">");
return array($imgLink, $price);
}
开发者ID:edulopez44,项目名称:GSU_book_project_webpage,代码行数:8,代码来源:book-puller.php
示例5: DM_nibbler_init
function DM_nibbler_init()
{
global $nibblercode, $DM_nibbler_config_file, $thisfile_nibbler;
$success = null;
$error = null;
if (isset($_POST['submit'])) {
$nibblercode = isset($_POST['nibblercode']) ? $_POST['nibblercode'] : $nibblercode;
if (!$error) {
$xml = @new SimpleXMLElement('<item></item>');
$xml->addChild('nibblercode', $nibblercode);
if (!$xml->asXML($DM_nibbler_config_file)) {
$error = i18n_r($thisfile_nibbler . '/NIBBLER_ERROR');
} else {
$x = getXML($DM_nibbler_config_file);
$nibblercode = $x->nibblercode;
$success = i18n_r($thisfile_nibbler . '/NIBBLER_SUCCESS');
}
}
}
//Main Navigation For Admin Panel
?>
<h3 class="floated"><?php
echo i18n_r($thisfile_nibbler . '/NIBBLER_TITLE');
?>
</h3> <br/><br/>
<?php
if ($success) {
echo '<p style="color:#669933;"><b>' . $success . '</b></p>';
}
if ($error) {
echo '<p style="color:#cc0000;"><b>' . $error . '</b></p>';
}
?>
<form method="post" action="<?php
echo $_SERVER['REQUEST_URI'];
?>
">
<p><label for="nibblercode" ><?php
echo i18n_r($thisfile_nibbler . '/NIBBLER_DESC');
?>
</label>
<input id="nibblercode" name="nibblercode" class="text" value="<?php
echo $nibblercode;
?>
" />
</p>
<p><input type="submit" id="submit" class="submit" value="<?php
echo i18n_r($thisfile_nibbler . '/NIBBLER_SAVE');
?>
" name="submit" /></p>
</form>
<?php
}
开发者ID:n00dles,项目名称:DM_nibbler,代码行数:57,代码来源:DM_nibbler.php
示例6: loadSettings
private static function loadSettings()
{
self::$settings = array();
if (file_exists(GSDATAOTHERPATH . I18N_SETTINGS_FILE)) {
$data = getXML(GSDATAOTHERPATH . I18N_SETTINGS_FILE);
foreach ($data->children() as $child) {
self::$settings[$child->getName()] = (string) $child;
}
}
}
开发者ID:Vin985,项目名称:clqweb,代码行数:10,代码来源:basic.class.php
示例7: Innovation_Settings
/**
* Innovation Settings
*
* This defines variables based on the theme plugin's settings
*
* @return bool
*/
function Innovation_Settings()
{
$file = GSDATAOTHERPATH . 'InnovationSettings.xml';
if (file_exists($file)) {
$p = getXML($file);
return $p;
} else {
return false;
}
}
开发者ID:hatasu,项目名称:appdroid,代码行数:17,代码来源:functions.php
示例8: read_pluginsxml
/**
* read_pluginsxml
*
* Read in the plugins.xml file and populate the $live_plugins array
*
* @since 2.04
* @uses $live_plugins
*
*/
function read_pluginsxml()
{
global $live_plugins;
$data = getXML(GSDATAOTHERPATH . "plugins.xml");
$componentsec = $data->item;
$count = 0;
if (count($componentsec) != 0) {
foreach ($componentsec as $component) {
$live_plugins[(string) $component->plugin] = (string) $component->enabled;
}
}
}
开发者ID:kazu2012,项目名称:get-simple-ja,代码行数:21,代码来源:plugin_functions.php
示例9: generateSitemapWithoutPing
public static function generateSitemapWithoutPing()
{
global $SITEURL;
$filenames = getFiles(GSDATAPAGESPATH);
if (count($filenames)) {
foreach ($filenames as $file) {
if (isFile($file, GSDATAPAGESPATH, 'xml')) {
$data = getXML(GSDATAPAGESPATH . $file);
if ($data->url != '404' && $data->private != 'Y') {
$pagesArray[] = array('url' => (string) $data->url, 'parent' => (string) $data->parent, 'date' => (string) $data->pubDate, 'menuStatus' => (string) $data->menuStatus);
}
}
}
}
$pagesSorted = subval_sort($pagesArray, 'menuStatus');
$languages = return_i18n_available_languages();
$deflang = return_i18n_default_language();
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="UTF-8"?><urlset></urlset>');
$xml->addAttribute('xsi:schemaLocation', 'http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd', 'http://www.w3.org/2001/XMLSchema-instance');
$xml->addAttribute('xmlns', 'http://www.sitemaps.org/schemas/sitemap/0.9');
if (count($pagesSorted)) {
foreach ($pagesSorted as $page) {
// set <loc>
if (count($languages) > 1) {
$pos = strrpos($page['url'], '_');
if ($pos !== false) {
$pageLoc = find_i18n_url(substr($page['url'], 0, $pos), $page['parent'], substr($page['url'], $pos + 1));
} else {
$pageLoc = find_i18n_url($page['url'], $page['parent'], $deflang);
}
} else {
$pageLoc = find_i18n_url($page['url'], $page['parent']);
}
// set <lastmod>
$pageLastMod = makeIso8601TimeStamp(date("Y-m-d H:i:s", strtotime($page['date'])));
// set <changefreq>
$pageChangeFreq = 'weekly';
// set <priority>
$pagePriority = $page['menuStatus'] == 'Y' ? '1.0' : '0.5';
//add to sitemap
$url_item = $xml->addChild('url');
$url_item->addChild('loc', htmlspecialchars($pageLoc));
$url_item->addChild('lastmod', $pageLastMod);
$url_item->addChild('changefreq', $pageChangeFreq);
$url_item->addChild('priority', $pagePriority);
}
}
//create xml file
$file = GSROOTPATH . 'sitemap.xml';
XMLsave($xml, $file);
}
开发者ID:Vin985,项目名称:clqweb,代码行数:51,代码来源:sitemap.class.php
示例10: bm_get_url
function bm_get_url($query = false)
{
global $SITEURL, $PRETTYURLS, $BMPAGEURL, $BMPRETTYURLS;
$data = getXML(GSDATAPAGESPATH . $BMPAGEURL . '.xml');
$url = find_url($BMPAGEURL, $data->parent);
if ($query) {
if ($PRETTYURLS == 1 && $BMPRETTYURLS == 'Y') {
$url .= $query . '/';
} elseif ($BMPAGEURL == 'index') {
$url = $SITEURL . "index.php?{$query}=";
} else {
$url = $SITEURL . "index.php?id={$BMPAGEURL}&{$query}=";
}
}
return $url;
}
开发者ID:abdelaithadji,项目名称:books_manager,代码行数:16,代码来源:functions.php
示例11: bm_edit_book
function bm_edit_book($slug)
{
$file = BMBOOKPATH . "{$slug}.xml";
# get book data, if it exists
$data = @getXML($file);
$title = @stripslashes($data->title);
$date = !empty($data) ? date('m/d/Y', strtotime($data->date)) : '';
$time = !empty($data) ? date('H:i', strtotime($data->date)) : '';
$tags = @str_replace(',', ', ', $data->tags);
$private = @$data->private != '' ? 'checked' : '';
$content = @stripslashes($data->content);
# show edit book form
include BMTEMPLATEPATH . 'edit_book.php';
if (file_exists($file)) {
$mtime = date(i18n_r('DATE_AND_TIME_FORMAT'), filemtime($file));
echo '<small>' . i18n_r('books_manager/LAST_SAVED') . ": {$mtime}</small>";
}
include BMTEMPLATEPATH . 'ckeditor.php';
}
开发者ID:abdelaithadji,项目名称:books_manager,代码行数:19,代码来源:books.php
示例12: ahf_show
function ahf_show()
{
global $ahf_header;
global $ahf_footer;
global $ahf_file;
global $i18n;
// submitted form
if (isset($_POST['submit'])) {
$ahf_header = htmlentities($_POST['ahf_head'], ENT_QUOTES, 'UTF-8');
$ahf_footer = htmlentities($_POST['ahf_foot'], ENT_QUOTES, 'UTF-8');
$xml = @new SimpleXMLElement('<item></item>');
$xml->addChild('header', $ahf_header);
$xml->addChild('footer', $ahf_footer);
if (!$xml->asXML($ahf_file)) {
$error = $i18n['CHMOD_ERROR'];
} else {
$x = getXML($ahf_file);
$ahf_header = stripslashes(htmlspecialchars_decode($x->header, ENT_QUOTES));
$ahf_footer = stripslashes(htmlspecialchars_decode($x->footer, ENT_QUOTES));
}
}
?>
<h3>Admin Header Footer</h3>
<form method="post" action="<?php
echo $_SERVER['REQUEST_URI'];
?>
">
<p><b>Code for Header</b>:<br /><textarea name="ahf_head" class="shorttext" ><?php
echo @$ahf_header;
?>
</textarea><br />
<span class="hint">"Header" should only include code to be shown within the <head> tag or PHP code</span></p>
<p><b>Code for Footer</b>:<br /><textarea name="ahf_foot" class="shorttext" ><?php
echo @$ahf_footer;
?>
</textarea><br />
<span class="hint">"Footer" can echo any text or run any javascript or PHP code</span></p>
<p><input type="submit" id="submit" class="submit" value="Save Header/Footer Code" name="submit" /></p>
</form>
<?php
}
开发者ID:hatasu,项目名称:appdroid,代码行数:42,代码来源:admin-header-footer.php
示例13: loadRates
private function loadRates($lang)
{
$this->rates = array();
$data = array();
$filename = GSDATAPATH . RATES_DIR . RATES_FILENAME . '_' . $lang . '.xml';
if (!file_exists($filename)) {
$filename = GSDATAPATH . RATES_DIR . RATES_FILENAME . '.xml';
}
if (file_exists($filename)) {
$data = getXML($filename);
if ($data) {
foreach ($data as $key => $value) {
if ($key == "category") {
$category = $this->extractCategory($value);
$this->rates[] = $category;
}
}
}
}
}
开发者ID:Vin985,项目名称:clqweb,代码行数:20,代码来源:rates.class.php
示例14: getGallery
public static function getGallery($name)
{
$gallery = array('items' => array());
if (!file_exists(GSDATAPATH . 'i18n_gallery/' . $name . '.xml')) {
return $gallery;
}
$data = getXML(GSDATAPATH . I18N_GALLERY_DIR . $name . '.xml');
if (!$data) {
return $gallery;
}
$dofilter = basename($_SERVER['PHP_SELF']) == 'index.php';
foreach ($data as $key => $value) {
if ($key != 'item' && $key != 'items') {
$gallery[$key] = (string) $value;
} else {
$include = true;
if ($dofilter) {
global $filters;
$filename = (string) $value->filename;
$tags = preg_split('/\\s*,\\s*/', (string) $value->tags);
foreach ($filters as $filter) {
if ($filter['filter'] == 'image-veto') {
if (call_user_func_array($filter['function'], array($name, $filename, $tags))) {
$include = false;
break;
}
}
}
}
if ($include) {
$item = array();
foreach ($value as $itemkey => $itemvalue) {
$item[$itemkey] = (string) $itemvalue;
}
$gallery['items'][] = $item;
}
}
}
return $gallery;
}
开发者ID:Vin985,项目名称:clqweb,代码行数:40,代码来源:gallery.class.php
示例15: getCustomFields
public function getCustomFields()
{
$cfData = getXML(BLOGCUSTOMFIELDS);
$cf = array('options' => '', 'main' => '');
$count_options = 0;
$count_main = 0;
$count_opt = 0;
foreach ($cfData->item as $custom_field) {
if ($custom_field->area == 'options') {
$cf['options'][$count_options]['key'] = (string) $custom_field->desc;
$cf['options'][$count_options]['label'] = (string) $custom_field->label;
$cf['options'][$count_options]['type'] = (string) $custom_field->type;
$cf['options'][$count_options]['value'] = (string) $custom_field->value;
if ($custom_field->type == "dropdown") {
$count_opt = 0;
$cf['options'][$count_options]['options'] = array();
foreach ($custom_field->option as $option) {
$cf['options'][$count_options]['options'][] = (string) $option;
$count_opt++;
}
}
$count_options++;
} elseif ($custom_field->area == 'main') {
$cf['main'][$count_main]['key'] = (string) $custom_field->desc;
$cf['main'][$count_main]['label'] = (string) $custom_field->label;
$cf['main'][$count_main]['type'] = (string) $custom_field->type;
$cf['main'][$count_main]['value'] = (string) $custom_field->value;
if ($custom_field->type == "dropdown") {
$count_opt = 0;
$cf['main'][$count_main]['options'] = array();
foreach ($custom_field->option as $option) {
$cf['main'][$count_main]['options'][] = (string) $option;
$count_opt++;
}
}
$count_main++;
}
}
return $cf;
}
开发者ID:hatasu,项目名称:appdroid,代码行数:40,代码来源:customFields.php
示例16: Innovation_Settings
/**
* Innovation Settings
*
* This defines variables based on the theme plugin's settings
*
* @return bool
*/
function Innovation_Settings()
{
$file = GSDATAOTHERPATH . 'InnovationSettings.xml';
if (file_exists($file)) {
$p = getXML($file);
if ($p->facebook != '') {
define('FACEBOOK', $p->facebook);
}
if ($p->twitter != '') {
define('TWITTER', $p->twitter);
}
if ($p->linkedin != '') {
define('LINKEDIN', $p->linkedin);
}
if ($p->webfont != '') {
define('WEBFONT', $p->webfont);
}
return true;
} else {
return false;
}
}
开发者ID:Emmett-Brown,项目名称:linea,代码行数:29,代码来源:functions.php
示例17: component_exists
function component_exists($id)
{
global $components;
if (!$components) {
if (file_exists(GSDATAOTHERPATH . 'components.xml')) {
$data = getXML(GSDATAOTHERPATH . 'components.xml');
$components = $data->item;
} else {
$components = array();
}
}
$exists = FALSE;
if (count($components) > 0) {
foreach ($components as $component) {
if ($id == $component->slug) {
$exists = TRUE;
break;
}
}
}
return $exists;
}
开发者ID:kjodle,项目名称:fossa,代码行数:22,代码来源:functions.php
示例18: bm_get_cache_data
function bm_get_cache_data()
{
$books = array();
$files = getFiles(BMBOOKPATH);
# collect all book data
foreach ($files as $file) {
if (isFile($file, BMBOOKPATH, 'xml')) {
$data = getXML(BMBOOKPATH . $file);
$time = strtotime($data->date);
while (array_key_exists($time, $books)) {
$time++;
}
$books[$time]['slug'] = basename($file, '.xml');
$books[$time]['title'] = strval($data->title);
$books[$time]['date'] = strval($data->date);
$books[$time]['tags'] = strval($data->tags);
$books[$time]['private'] = strval($data->private);
}
}
krsort($books);
return $books;
}
开发者ID:abdelaithadji,项目名称:books_manager,代码行数:22,代码来源:cache.php
示例19: auto_import
function auto_import()
{
$Blog = new Blog();
if ($_GET['import'] == urldecode($Blog->getSettingsData("autoimporterpass")) && $Blog->getSettingsData("autoimporter") == 'Y') {
ini_set("memory_limit", "350M");
define('MAGPIE_CACHE_DIR', GSCACHEPATH . 'magpierss/');
require_once BLOGPLUGINFOLDER . 'inc/magpierss/rss_fetch.inc';
$rss_feed_file = getXML(BLOGRSSFILE);
foreach ($rss_feed_file->rssfeed as $the_fed) {
$rss_uri = $the_fed->feed;
$rss_category = $the_fed->category;
$rss = fetch_rss($rss_uri);
$items = array_slice($rss->items, 0);
foreach ($items as $item) {
$post_data['title'] = $item['title'];
$post_data['slug'] = '';
$post_data['date'] = $item['pubdate'];
$post_data['private'] = '';
$post_data['tags'] = '';
$post_data['category'] = $rss_category;
if ($Blog->getSettingsData('rssinclude') == 'Y') {
if (!empty($item['content']['encoded'])) {
$post_data['content'] = htmlentities($item['content']['encoded'], ENT_QUOTES, 'iso-8859-1');
} else {
$post_data['content'] = htmlentities($item['summary'], ENT_QUOTES, 'iso-8859-1') . '<p class="blog_auto_import_readmore"><a href="' . $item['link'] . '" target="_blank">' . i18n_r(BLOGFILE . '/READ_FULL_ARTICLE') . '</a></p>';
}
} else {
$post_data['content'] = htmlentities($item['summary'], ENT_QUOTES, 'iso-8859-1') . '<p class="blog_auto_import_readmore"><a href="' . $item['link'] . '" target="_blank">' . i18n_r(BLOGFILE . '/READ_FULL_ARTICLE') . '</a></p>';
}
$post_data['excerpt'] = $Blog->create_excerpt($item['summary'], 0, $Blog->getSettingsData("excerptlength"));
$post_data['thumbnail'] = auto_import_thumbnail($item);
$post_data['current_slug'] = '';
$post_data['author'] = htmlentities('<a href="' . $rss_uri . '">RSS Feed</a>', ENT_QUOTES, 'iso-8859-1');
$Blog->savePost($post_data, true);
echo '<p class="blog_rss_post_added">' . i18n_r(BLOGFILE . '/ADDED') . ': ' . $post_data['title'] . '</p>';
}
}
}
}
开发者ID:hatasu,项目名称:appdroid,代码行数:39,代码来源:rssAutoImporter.php
示例20: nm_edit_post
function nm_edit_post($slug = '')
{
$newpost = $slug === '';
if ($newpost) {
$title = '';
$date = '';
$time = '';
$tags = '';
$private = '';
$image = '';
$content = '';
} else {
$file = NMPOSTPATH . $slug . '.xml';
if (dirname(realpath($file)) != realpath(NMPOSTPATH)) {
die('');
}
// path traversal
# get post data, if it exists
$data = @getXML($file);
$title = @stripslashes($data->title);
$date = isset($data->date) ? date('Y-m-d', strtotime($data->date)) : '';
$time = isset($data->date) ? date('H:i', strtotime($data->date)) : '';
$tags = isset($data->tags) ? str_replace(',', ', ', stripslashes($data->tags)) : '';
$private = @$data->private != '' ? 'checked' : '';
$image = @stripslashes($data->image);
$content = @stripslashes($data->content);
if (isset($data->author)) {
$author = stripslashes($data->author);
}
}
# show edit post form
include NMTEMPLATEPATH . 'edit_post.php';
if (!$newpost) {
$mtime = date(i18n_r('DATE_AND_TIME_FORMAT'), filemtime($file));
echo '<small>', i18n_r('news_manager/LAST_SAVED'), ': ', $mtime, '</small>';
}
include NMTEMPLATEPATH . 'ckeditor.php';
}
开发者ID:hatasu,项目名称:appdroid,代码行数:38,代码来源:posts.php
注:本文中的getXML函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论