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


PHP Array2XML::saveXML方法代码示例

本文整理汇总了PHP中Array2XML::saveXML方法的典型用法代码示例。如果您正苦于以下问题:PHP Array2XML::saveXML方法的具体用法?PHP Array2XML::saveXML怎么用?PHP Array2XML::saveXML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Array2XML的用法示例。


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

示例1: nv_CreateXML_bannerPlan

/**
 * nv_CreateXML_bannerPlan()
 *
 * @return
 */
function nv_CreateXML_bannerPlan()
{
    global $db, $global_config;
    $pattern = $global_config['idsite'] ? '/^site\\_' . $global_config['idsite'] . '\\_bpl\\_([0-9]+)\\.xml$/' : '/^bpl\\_([0-9]+)\\.xml$/';
    $files = nv_scandir(NV_ROOTDIR . '/' . NV_DATADIR, $pattern);
    if (!empty($files)) {
        foreach ($files as $file) {
            nv_deletefile(NV_ROOTDIR . '/' . NV_DATADIR . '/' . $file);
        }
    }
    include NV_ROOTDIR . '/includes/class/array2xml.class.php';
    $sql = 'SELECT * FROM ' . NV_BANNERS_GLOBALTABLE . '_plans WHERE act = 1';
    $result = $db->query($sql);
    while ($row = $result->fetch()) {
        $id = intval($row['id']);
        if ($global_config['idsite']) {
            $xmlfile = NV_ROOTDIR . '/' . NV_DATADIR . '/site_' . $global_config['idsite'] . '_bpl_' . $id . '.xml';
        } else {
            $xmlfile = NV_ROOTDIR . '/' . NV_DATADIR . '/bpl_' . $id . '.xml';
        }
        $plan = array();
        $plan['id'] = $id;
        $plan['lang'] = $row['blang'];
        $plan['title'] = $row['title'];
        if (!empty($row['description'])) {
            $plan['description'] = $row['description'];
        }
        $plan['form'] = $row['form'];
        $plan['width'] = $row['width'];
        $plan['height'] = $row['height'];
        $query2 = 'SELECT * FROM ' . NV_BANNERS_GLOBALTABLE . '_rows WHERE pid = ' . $id . ' AND (exp_time > ' . NV_CURRENTTIME . ' OR exp_time = 0 ) AND act = 1';
        if ($row['form'] == 'sequential') {
            $query2 .= ' ORDER BY weight ASC';
        }
        $plan['banners'] = array();
        $result2 = $db->query($query2);
        while ($row2 = $result2->fetch()) {
            $plan['banners'][] = array('id' => $row2['id'], 'title' => $row2['title'], 'clid' => $row2['clid'], 'file_name' => $row2['file_name'], 'imageforswf' => $row2['imageforswf'], 'file_ext' => $row2['file_ext'], 'file_mime' => $row2['file_mime'], 'file_width' => $row2['width'], 'file_height' => $row2['height'], 'file_alt' => $row2['file_alt'], 'file_click' => $row2['click_url'], 'target' => $row2['target'], 'publ_time' => $row2['publ_time'], 'exp_time' => $row2['exp_time']);
        }
        if (sizeof($plan['banners'])) {
            $array2XML = new Array2XML();
            $array2XML->saveXML($plan, 'plan', $xmlfile, $encoding = $global_config['site_charset']);
        }
    }
}
开发者ID:lzhao18,项目名称:nukeviet,代码行数:50,代码来源:admin.functions.php

示例2: nv_CreateXML_bannerPlan

/**
 * nv_CreateXML_bannerPlan()
 * 
 * @return
 */
function nv_CreateXML_bannerPlan()
{
    global $db, $global_config;
    $files = nv_scandir(NV_ROOTDIR . '/' . NV_DATADIR, "/^bpl\\_([0-9]+)\\.xml\$/");
    if (!empty($files)) {
        foreach ($files as $file) {
            nv_deletefile(NV_ROOTDIR . '/' . NV_DATADIR . '/' . $file);
        }
    }
    include NV_ROOTDIR . '/includes/class/array2xml.class.php';
    $sql = "SELECT * FROM `" . NV_BANNERS_PLANS_GLOBALTABLE . "` WHERE `act` = 1";
    $result = $db->sql_query($sql);
    while ($row = $db->sql_fetchrow($result)) {
        $id = intval($row['id']);
        $xmlfile = NV_ROOTDIR . '/' . NV_DATADIR . '/bpl_' . $id . '.xml';
        $plan = array();
        $plan['id'] = $id;
        $plan['lang'] = $row['blang'];
        $plan['title'] = $row['title'];
        if (!empty($row['description'])) {
            $plan['description'] = $row['description'];
        }
        $plan['form'] = $row['form'];
        $plan['width'] = $row['width'];
        $plan['height'] = $row['height'];
        $query2 = "SELECT * FROM `" . NV_BANNERS_ROWS_GLOBALTABLE . "` WHERE `pid` = " . $id . " AND (`exp_time` > " . NV_CURRENTTIME . " OR `exp_time` = 0 ) AND `act` = 1";
        if ($row['form'] == "sequential") {
            $query2 .= " ORDER BY `weight` ASC";
        }
        $result2 = $db->sql_query($query2);
        $numrows2 = $db->sql_numrows($result2);
        if (empty($numrows2)) {
            continue;
        }
        $plan['banners'] = array();
        while ($row2 = $db->sql_fetchrow($result2)) {
            $plan['banners'][] = array('id' => $row2['id'], 'title' => $row2['title'], 'clid' => $row2['clid'], 'file_name' => $row2['file_name'], 'file_ext' => $row2['file_ext'], 'file_mime' => $row2['file_mime'], 'file_width' => $row2['width'], 'file_height' => $row2['height'], 'file_alt' => $row2['file_alt'], 'file_click' => $row2['click_url']);
        }
        $array2XML = new Array2XML();
        $array2XML->saveXML($plan, 'plan', $xmlfile, $encoding = $global_config['site_charset']);
    }
}
开发者ID:atarubi,项目名称:nuke-viet,代码行数:47,代码来源:admin.functions.php

示例3: foreach

    foreach ($metaGroupsName as $key => $name) {
        if ($name == 'http-equiv' or $name == 'name' or $name == 'property') {
            $value = trim(strip_tags($metaGroupsValue[$key]));
            $content = trim(strip_tags($metaContents[$key]));
            $newArray = array('group' => $name, 'value' => $value, 'content' => $content);
            if (preg_match("/^[a-zA-Z0-9\\-\\_\\.\\:]+\$/", $value) and !in_array($value, $ignore) and preg_match("/^([^\\'\"]+)\$/", $content) and !in_array($newArray, $metatags['meta'])) {
                $metatags['meta'][] = $newArray;
            }
        }
    }
    if (file_exists($file_metatags)) {
        nv_deletefile($file_metatags);
    }
    if (!empty($metatags['meta'])) {
        $array2XML = new Array2XML();
        $array2XML->saveXML($metatags, 'metatags', $file_metatags, $global_config['site_charset']);
    }
    $metaTagsOgp = (int) $nv_Request->get_bool('metaTagsOgp', 'post');
    $description_length = $nv_Request->get_int('description_length', 'post');
    $db->query("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = '" . $metaTagsOgp . "' WHERE lang = 'sys' AND module = 'site' AND config_name = 'metaTagsOgp'");
    $db->query("UPDATE " . NV_CONFIG_GLOBALTABLE . " SET config_value = '" . $description_length . "' WHERE lang = 'sys' AND module = 'site' AND config_name = 'description_length'");
    nv_delete_all_cache(false);
    Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $op . '&rand=' . nv_genpass());
    exit;
} else {
    if (!file_exists($file_metatags)) {
        $file_metatags = NV_ROOTDIR . '/' . NV_DATADIR . '/metatags.xml';
    }
    $mt = simplexml_load_file($file_metatags);
    $mt = nv_object2array($mt);
    if ($mt['meta_item']) {
开发者ID:anhtunguyen,项目名称:vietnamguide,代码行数:31,代码来源:metatags.php

示例4: foreach

    $searchEngineActive = $nv_Request->get_array('searchEngineActive', 'post');
    foreach ($searchEngineName as $key => $name) {
        $name = trim(strip_tags($name));
        $value = trim(strip_tags($searchEngineValue[$key]));
        $active = intval($searchEngineActive[$key]);
        if (!empty($name) and !empty($value)) {
            $searchEngines['searchEngine'][] = array('name' => $name, 'value' => $value, 'active' => $active);
        }
    }
    if (file_exists($file_searchEngines)) {
        nv_deletefile($file_searchEngines);
    }
    if (!empty($searchEngines['searchEngine'])) {
        include NV_ROOTDIR . '/includes/class/array2xml.class.php';
        $array2XML = new Array2XML();
        $array2XML->saveXML($searchEngines, 'searchEngines', $file_searchEngines, $global_config['site_charset']);
    }
} else {
    if (file_exists($file_searchEngines)) {
        $mt = simplexml_load_file($file_searchEngines);
        $mt = nv_object2array($mt);
        if ($mt['searchEngine_item']) {
            if (isset($mt['searchEngine_item'][0])) {
                $searchEngines['searchEngine'] = $mt['searchEngine_item'];
            } else {
                $searchEngines['searchEngine'][] = $mt['searchEngine_item'];
            }
        }
    }
    if (!empty($searchEngines['searchEngine']) and $nv_Request->isset_request('ping', 'post')) {
        $searchEngine = $nv_Request->get_string('searchEngine', 'post');
开发者ID:atarubi,项目名称:nuke-viet,代码行数:31,代码来源:sitemapPing.php


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