• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP subval_sort函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: 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


示例2: login_cookie_check

/**
 * Menu Preview
 *
 * Previews the current main menu hierarchy  
 *
 * @package GetSimple
 * @subpackage Page-Edit
 */
# Setup
$load['plugin'] = true;
include 'inc/common.php';
login_cookie_check();
# get pages
getPagesXmlValues();
$pagesSorted = subval_sort($pagesArray, 'menuOrder');
global $LANG;
$LANG_header = preg_replace('/(?:(?<=([a-z]{2}))).*/', '', $LANG);
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<title>Share GetSimple</title>
	<style>
		.navigate {
			padding:20px;
			width:400px;
			background:#f6f6f6;
		}
		table {border-collapse:collapse;font-family:arial;font-size:12px;margin:0;color:#333;width:100%;}
		td, th {padding:5px 20px 5px 5px;text-shadow:1px 1px 0 #fff;}
开发者ID:google-code-backups,项目名称:get-simple-cms,代码行数:30,代码来源:navigation.php


示例3: getFiles

 $filenames = getFiles($path);
 if (count($filenames) != 0) {
     foreach ($filenames as $file) {
         if (isFile($file, $path, 'xml')) {
             $data = getXML($path . $file);
             $status = $data->menuStatus;
             $pagesArray[$count]['url'] = $data->url;
             $pagesArray[$count]['parent'] = $data->parent;
             $pagesArray[$count]['date'] = $data->pubDate;
             $pagesArray[$count]['private'] = $data->private;
             $pagesArray[$count]['menuStatus'] = $data->menuStatus;
             $count++;
         }
     }
 }
 $pagesSorted = subval_sort($pagesArray, 'menuStatus');
 if (count($pagesSorted) != 0) {
     $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');
     foreach ($pagesSorted as $page) {
         if ($page['private'] != 'Y') {
             // set <loc>
             $pageLoc = find_url($page['url'], $page['parent']);
             // set <lastmod>
             $tmpDate = date("Y-m-d H:i:s", strtotime($page['date']));
             $pageLastMod = makeIso8601TimeStamp($tmpDate);
             // set <changefreq>
             $pageChangeFreq = 'weekly';
             // set <priority>
             if ($page['menuStatus'] == 'Y') {
开发者ID:RobAnt,项目名称:GetSimple-Plugins,代码行数:31,代码来源:sitemap.php


示例4: getFileExtension

            $dircount++;
        } else {
            $filesArray[$count]['name'] = $file;
            $ext = getFileExtension($file);
            $filetype = get_FileTypeToken($ext);
            $filesArray[$count]['type'] = lowercase($filetype);
            clearstatcache();
            $ss = @stat($path . $file);
            $filesArray[$count]['date'] = @date('M j, Y', $ss['ctime']);
            $filesArray[$count]['size'] = fSize($ss['size']);
            $totalsize = $totalsize + $ss['size'];
            $count++;
        }
    }
    $filesSorted = subval_sort($filesArray, 'name');
    $dirsSorted = subval_sort($dirsArray, 'name');
}
echo '<div class="edit-nav clearfix" >';
echo '<select id="imageFilter">';
echo '<option value="all">' . i18n_r('SHOW_ALL') . '</option>';
if (count($filesSorted) > 0) {
    foreach ($filesSorted as $filter) {
        $filterArray[$filter['type']] = '';
    }
    if (count($filterArray) != 0) {
        ksort($filterArray);
        foreach ($filterArray as $type => $value) {
            $sel = false;
            # check for filter querystring
            if (isset($_GET['type']) && $_GET['type'] == $type) {
                $sel = true;
开发者ID:HelgeSverre,项目名称:GetSimpleCMS,代码行数:31,代码来源:upload.php


示例5: array

     $coArray = array();
     foreach ($ids as $id) {
         if ($title[$ct] != null && $value[$ct] != null) {
             if ($slug[$ct] == null) {
                 $slug_tmp = to7bit($title[$ct], 'UTF-8');
                 $slug[$ct] = clean_url($slug_tmp);
                 $slug_tmp = '';
             }
             $coArray[$ct]['id'] = $ids[$ct];
             $coArray[$ct]['title'] = htmlentities($title[$ct], ENT_QUOTES, 'UTF-8');
             $coArray[$ct]['slug'] = $slug[$ct];
             $coArray[$ct]['value'] = htmlentities($value[$ct], ENT_QUOTES, 'UTF-8');
         }
         $ct++;
     }
     $ids = subval_sort($coArray, 'title');
     $count = 0;
     foreach ($ids as $comp) {
         //body of xml file
         $components = $xml->addChild('item');
         $c_note = $components->addChild('title');
         $c_note->addCData(@$comp['title']);
         $components->addChild('slug', @$comp['slug']);
         $c_note = $components->addChild('value');
         $c_note->addCData(@$comp['value']);
         $count++;
     }
 }
 exec_action('component-save');
 XMLsave($xml, $path . $file);
 header('Location: components.php?upd=comp-success');
开发者ID:RobAnt,项目名称:GetSimple-Plugins,代码行数:31,代码来源:components.php


示例6: init

 function init()
 {
     if (isset($_REQUEST['post'])) {
         $post_id = $_REQUEST['post'];
     } elseif (isset($_REQUEST['post_ID'])) {
         $post_id = $_REQUEST['post_ID'];
     } else {
         $post_id = 99999999999999.0;
     }
     global $md_metabox;
     function subval_sort($a, $subkey)
     {
         foreach ($a as $k => $v) {
             $b[$k] = strtolower($v[$subkey]);
         }
         asort($b);
         foreach ($b as $key => $val) {
             $c[] = $a[$key];
         }
         return $c;
     }
     $md_metabox = subval_sort($md_metabox, 'order');
     $form_helper = new FORM_HELPER($post_id, $md_metabox);
     add_action('add_meta_boxes', 'page_metabox_init');
     add_action('save_post', 'page_metabox_save');
     function page_metabox_init()
     {
         add_meta_box('page-metabox', 'Advanced Page Options', 'page_metabox_ui');
     }
     function page_metabox_ui($post)
     {
         global $md_metabox;
         wp_nonce_field(plugin_basename(__FILE__), 'nonce_page_metabox');
         $form_helper = new FORM_HELPER($post->ID, $md_metabox);
         $form_helper->metabox_init();
     }
     function page_metabox_save($post_id)
     {
         if (isset($_POST['nonce_page_metabox'])) {
             // Autosave, do nothing
             if (defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
                 return;
             }
             // Ajax not used here
             if (defined('DOING_AJAX') && DOING_AJAX) {
                 return;
             }
             // Check user permissions
             if (!current_user_can('edit_post', $post_id)) {
                 return;
             }
             // Return if it's a post revision
             if (false !== wp_is_post_revision($post_id)) {
                 return;
             }
             // verify this came from the our screen and with proper authorization
             if (!wp_verify_nonce($_POST['nonce_page_metabox'], plugin_basename(__FILE__))) {
                 return;
             }
             // OK, we're authenticated
             global $md_metabox;
             $form_helper = new FORM_HELPER($post_id, $md_metabox);
             $form_helper->metabox_save();
         }
     }
 }
开发者ID:Beutiste,项目名称:wordpress,代码行数:66,代码来源:metabox.class.php


示例7: generate_sitemap

/**
 * Creates Sitemap
 *
 * Creates sitemap.xml in the site's root.
 * Pending: read the content path (xml's)
 */
function generate_sitemap()
{
    // Variable settings
    global $SITEURL;
    $path = GSDATAPAGESPATH;
    $count = "0";
    $filenames = getFiles($path);
    if (count($filenames) != 0) {
        foreach ($filenames as $file) {
            if (isFile($file, $path, 'xml')) {
                $data = getXML($path . $file);
                if ($data->url != '404') {
                    $status = $data->menuStatus;
                    $pagesArray[$count]['url'] = $data->url;
                    $pagesArray[$count]['parent'] = $data->parent;
                    $pagesArray[$count]['date'] = $data->pubDate;
                    $pagesArray[$count]['private'] = $data->private;
                    $pagesArray[$count]['menuStatus'] = $data->menuStatus;
                    $count++;
                }
            }
        }
    }
    $pagesSorted = subval_sort($pagesArray, 'menuStatus');
    if (count($pagesSorted) != 0) {
        $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');
        foreach ($pagesSorted as $page) {
            if ($page['private'] != 'Y') {
                // set <loc>
                $pageLoc = find_url($page['url'], $page['parent']);
                // set <lastmod>
                $tmpDate = date("Y-m-d H:i:s", strtotime($page['date']));
                $pageLastMod = makeIso8601TimeStamp($tmpDate);
                // set <changefreq>
                $pageChangeFreq = 'weekly';
                // set <priority>
                if ($page['menuStatus'] == 'Y') {
                    $pagePriority = '1.0';
                } else {
                    $pagePriority = '0.5';
                }
                //add to sitemap
                $url_item = $xml->addChild('url');
                $url_item->addChild('loc', $pageLoc);
                $url_item->addChild('lastmod', $pageLastMod);
                $url_item->addChild('changefreq', $pageChangeFreq);
                $url_item->addChild('priority', $pagePriority);
                exec_action('sitemap-additem');
            }
        }
        //create xml file
        $file = GSROOTPATH . 'sitemap.xml';
        exec_action('save-sitemap');
        XMLsave($xml, $file);
    }
    if (!defined('GSDONOTPING')) {
        if (file_exists(GSROOTPATH . 'sitemap.xml')) {
            if (200 === ($status = pingGoogleSitemaps($SITEURL . 'sitemap.xml'))) {
                #sitemap successfully created & pinged
                return true;
            } else {
                error_log(i18n_r('SITEMAP_ERRORPING'));
                return i18n_r('SITEMAP_ERRORPING');
            }
        } else {
            error_log(i18n_r('SITEMAP_ERROR'));
            return i18n_r('SITEMAP_ERROR');
        }
    } else {
        #sitemap successfully created - did not ping
        return true;
    }
}
开发者ID:Emmett-Brown,项目名称:linea,代码行数:81,代码来源:template_functions.php


示例8: subval_sort

            $count++;
        }
    }
    $filesSorted = subval_sort($filesArray, 'name');
    $dirsSorted = subval_sort($dirsArray, 'name');
}
echo '<div class="edit-nav" >';
echo '<select id="imageFilter">';
echo '<option value="All">' . i18n_r('SHOW_ALL') . '</option>';
if (count($filesSorted) > 0) {
    foreach ($filesSorted as $filter) {
        $filterArr[] = $filter['type'];
    }
    if (count($filterArr) != 0) {
        $filterArray = array_unique($filterArr);
        $filterArray = subval_sort($filterArray, 'type');
        foreach ($filterArray as $type) {
            # check for image type
            if (strstr($type, ' Images')) {
                $typeCleaned = 'Images';
                $typeCleaned_2 = str_replace(' Images', '', $type);
            } else {
                $typeCleaned = $type;
                $typeCleaned_2 = $type;
            }
            echo '<option value="' . $typeCleaned . '">' . $typeCleaned_2 . '</option>';
        }
    }
}
echo '</select><div class="clear" ></div></div>';
$pathParts = explode("/", $subPath);
开发者ID:hatasu,项目名称:appdroid,代码行数:31,代码来源:upload.php


示例9: eshop_parse_optsets

 function eshop_parse_optsets($data)
 {
     global $wpdb;
     $opt['optset'] = $data['optset'];
     $addoprice = $data['addoprice'];
     $oset = $qb = array();
     $optings = unserialize($opt['optset']);
     //then sort it how we want.
     $optings = subval_sort($optings, 'id');
     $c = 0;
     if (isset($newoptings)) {
         unset($newoptings);
     }
     foreach ($optings as $foo => $opst) {
         if (!isset($opst['type']) || ($opst['type'] == '2' || $opst['type'] == '3') && (isset($opst['text']) && trim($opst['text']) != '')) {
             $newoptings[] = $optings[$c];
             $qb[] = "id={$opst['id']}";
         }
         $c++;
     }
     if (isset($newoptings)) {
         $qbs = implode(" OR ", $qb);
         $otable = $wpdb->prefix . 'eshop_option_sets';
         $otablename = $wpdb->prefix . 'eshop_option_names';
         $orowres = $wpdb->get_results("select o.name, o.price, o.id, t.type,t.name as oname from {$otable} as o, {$otablename} as t where ({$qbs}) && o.optid=t.optid ORDER BY id ASC");
         $x = 0;
         foreach ($orowres as $orow) {
             if (isset($newoptings[$x]['id']) && $orow->id == $newoptings[$x]['id']) {
                 if (isset($newoptings[$x]['type']) && isset($newoptings[$x]['text']) && trim($newoptings[$x]['text']) != '' && ($newoptings[$x]['type'] == '2' || $newoptings[$x]['type'] == '3')) {
                     $oset[] = '<span class="eshopoptset"><span class="eshopoptname">' . stripslashes($orow->name) . "</span>\n" . '<span class="eshoptext">' . stripslashes($newoptings[$x]['text']) . '</span></span>';
                 } elseif (($orow->type == '2' || $orow->type == '3') && !isset($newoptings[$x]['text'])) {
                     $xxxx = '';
                 } else {
                     $oset[] = '<span class="eshopoptset"><span class="eshopoptname">' . stripslashes($orow->oname) . "</span>\n" . '<span class="eshoptext">' . stripslashes($orow->name) . '</span></span>';
                 }
                 $addoprice = $addoprice + $orow->price;
                 $x++;
             }
         }
         $optset = "\n" . implode("\n", $oset);
     } else {
         $optset = '';
     }
     $data['optset'] = $optset;
     $data['addoprice'] = $addoprice;
     return $data;
 }
开发者ID:par-orillonsoft,项目名称:creationOfSociety,代码行数:47,代码来源:cart-functions.php


示例10: get_navigation

/**
 * Get Main Navigation
 *
 * This will return unordered list of main navigation
 * This function uses the menu opitions listed within the 'Edit Page' control panel screen
 *
 * @since 1.0
 * @uses GSDATAOTHERPATH
 * @uses getXML
 * @uses subval_sort
 * @uses find_url
 * @uses strip_quotes 
 * @uses exec_filter 
 *
 * @param string $currentpage This is the ID of the current page the visitor is on
 * @return string 
 */
function get_navigation($currentpage)
{
    $menu = '';
    global $pagesArray;
    $pagesSorted = subval_sort($pagesArray, 'menuOrder');
    if (count($pagesSorted) != 0) {
        foreach ($pagesSorted as $page) {
            $sel = '';
            $classes = '';
            $url_nav = $page['url'];
            if ($page['menuStatus'] == 'Y') {
                if ("{$currentpage}" == "{$url_nav}") {
                    $classes = "current active " . $page['parent'] . " " . $url_nav;
                } else {
                    $classes = trim($page['parent'] . " " . $url_nav);
                }
                if ($page['menu'] == '') {
                    $page['menu'] = $page['title'];
                }
                if ($page['title'] == '') {
                    $page['title'] = $page['menu'];
                }
                $menu .= '<li class="' . $classes . '"><a href="' . find_url($page['url'], $page['parent']) . '" title="' . encode_quotes(cl($page['title'])) . '">' . strip_decode($page['menu']) . '</a></li>' . "\n";
            }
        }
    }
    echo exec_filter('menuitems', $menu);
}
开发者ID:Foltys,项目名称:Masopust,代码行数:45,代码来源:theme_functions.php


示例11: isset

$pluginid = isset($_GET['set']) ? $_GET['set'] : null;
$nonce = isset($_GET['nonce']) ? $_GET['nonce'] : null;
if ($pluginid) {
    if (check_nonce($nonce, "set_" . pathinfo_filename($pluginid), "plugins.php")) {
        $plugin = antixss($pluginid);
        change_plugin($plugin);
        redirect('plugins.php?success=' . i18n_r('PLUGIN_UPDATED'));
    } else {
        redirect('plugins.php?error=' . i18n_r('ERROR_OCCURED'));
    }
}
// Variable settings
$counter = 0;
$table = '';
$needsupdate = false;
$plugin_info_sorted = subval_sort($plugin_info, 'name');
foreach ($plugin_info_sorted as $pluginid => $plugininfo) {
    $setNonce = '&amp;nonce=' . get_nonce("set_" . $pluginid, "plugins.php");
    // @todo disabled plugins have a version of (str) 'disabled', should be 0 or null
    $pluginver = $plugininfo['version'] == 'disabled' ? 0 : $plugininfo['version'];
    if (plugin_active($pluginid)) {
        $cls_Enabled = 'hidden';
        $cls_Disabled = '';
        $trclass = 'enabled';
    } else {
        $cls_Enabled = '';
        $cls_Disabled = 'hidden';
        $trclass = 'disabled';
    }
    // get extend api for this plugin filename
    $api_data = json_decode(get_api_details('plugin', $pluginid));
开发者ID:promil23,项目名称:GetSimpleCMS,代码行数:31,代码来源:plugins.php


示例12: displayMonthEvents

 /**
  * displayMonthEvents 
  * 
  * Displays a listing of events for a given month.
  * Used on the homepage with the small calendar view.
  *
  * @param int $month 
  * @param int $year 
  *
  * @return void
  */
 function displayMonthEvents($month, $year)
 {
     $month = (int) $month;
     $month = str_pad($month, 2, 0, STR_PAD_LEFT);
     $year = (int) $year;
     $gm_next = gmdate('Y-m-d H:i:s', gmmktime(gmdate('h'), gmdate('i'), gmdate('s'), $month + 1, 1, $year));
     $nextMonth = fixDate('m', $this->fcmsUser->tzOffset, $gm_next);
     $today = fixDate('Ymd', $this->fcmsUser->tzOffset, gmdate('Y-m-d H:i:s'));
     $today_year = fixDate('Y', $this->fcmsUser->tzOffset, gmdate('Y-m-d H:i:s'));
     $sql = "SELECT `id`, DATE_FORMAT(`date`, '%m%d') as day, `title`, `desc`, \n                    `date`, `private`, `created_by`, `repeat`\n                FROM fcms_calendar \n                WHERE (`date` LIKE '{$year}-{$month}-%%') \n                OR (`date` LIKE '{$year}-{$nextMonth}-%%') \n                OR (`date` LIKE '%%%%-{$month}-%%' AND `repeat` = 'yearly') \n                OR (`date` LIKE '%%%%-{$nextMonth}-%%' AND `repeat` = 'yearly') \n                ORDER BY day";
     $rows = $this->fcmsDatabase->getRows($sql);
     if ($rows === false) {
         $this->fcmsError->displayError();
         return;
     }
     $events = array();
     if (count($rows) > 0) {
         foreach ($rows as $row) {
             $events[] = $row;
         }
     }
     // Get birthdays
     $sql = "SELECT `id`, `fname`, `lname`, `dob_year`, `dob_month`, `dob_day`, \n                    `dod_year`, `dod_month`, `dod_day` \n                FROM `fcms_users` \n                WHERE `dob_month` = ?";
     $rows = $this->fcmsDatabase->getRows($sql, $month);
     if ($rows === false) {
         $this->fcmsError->displayError();
         return;
     }
     if (count($rows) > 0) {
         foreach ($rows as $r) {
             if (empty($r['dob_month']) || empty($r['dob_day'])) {
                 continue;
             }
             if (!empty($r['dod_year']) || !empty($r['dod_month']) || !empty($r['dod_day'])) {
                 continue;
             }
             $age = getAge($r['dob_year'], $r['dob_month'], $r['dob_day'], "{$year}-{$month}-" . $r['dob_day']);
             $r['id'] = 'birthday' . $r['id'];
             $r['day'] = $r['dob_month'] . $r['dob_day'];
             $r['date'] = $r['dob_year'] . '-' . $r['dob_month'] . '-' . $r['dob_day'];
             $r['title'] = $r['fname'] . ' ' . $r['lname'];
             $r['desc'] = sprintf(T_('%s turns %s today.'), $r['fname'], $age);
             $r['private'] = 0;
             $r['repeat'] = 'yearly';
             $r['created_by'] = $r['id'];
             $events[] = $r;
         }
     }
     if (count($events) <= 0) {
         return;
     }
     // show the next 5
     $count = 0;
     // fix order
     $events = subval_sort($events, 'day');
     foreach ($events as $row) {
         if ($count > 5) {
             break;
         }
         $show = false;
         list($event_year, $event_month, $event_day) = explode("-", $row['date']);
         // Fix repeating event year
         if ($row['repeat'] == 'yearly') {
             $event_year = $today_year;
         }
         // Skip events that have already happened
         if ($event_year . $event_month . $event_day < $today) {
             continue;
         }
         if ($row['private'] == 0) {
             $show = true;
         } else {
             if ($row['created_by'] == $this->fcmsUser->id) {
                 $show = true;
             }
         }
         if ($show) {
             $count++;
             $title = !empty($row['desc']) ? $row['desc'] : $row['title'];
             $title = cleanOutput($title);
             $event = cleanOutput($row['title']);
             echo '
             <div class="events">
                 <a title="' . $title . '" href="calendar.php?event=' . $row['id'] . '">' . $event . '</a><br/>
                 ' . formatDate(T_('M. d'), $row['date']) . '
             </div>';
         }
     }
 }
开发者ID:lmcro,项目名称:fcms,代码行数:100,代码来源:calendar_class.php


示例13: getFiles

$filenames = getFiles($path);
$count = "0";
$pagesArray_tmp = array();
$pagesSorted = array();
if (count($filenames) != 0) {
    foreach ($filenames as $file) {
        if (isFile($file, $path, 'bak')) {
            $data = getXML($path . $file);
            $status = $data->menuStatus;
            $pagesArray_tmp[$count]['title'] = html_entity_decode($data->title, ENT_QUOTES, 'UTF-8');
            $pagesArray_tmp[$count]['url'] = $data->url;
            $pagesArray_tmp[$count]['date'] = $data->pubDate;
            $count++;
        }
    }
    $pagesSorted = subval_sort($pagesArray_tmp, 'title');
}
if (count($pagesSorted) != 0) {
    foreach ($pagesSorted as $page) {
        $counter++;
        $table .= '<tr id="tr-' . $page['url'] . '" >';
        if ($page['title'] == '') {
            $page['title'] = '[No Title] &nbsp;&raquo;&nbsp; <em>' . $page['url'] . '</em>';
        }
        $table .= '<td class="pagetitle"><a title="' . i18n_r('VIEWPAGE_TITLE') . ' ' . cl($page['title']) . '" href="backup-edit.php?p=view&amp;id=' . $page['url'] . '">' . cl($page['title']) . '</a></td>';
        $table .= '<td style="width:80px;text-align:right;" ><span>' . output_date($page['date']) . '</span></td>';
        $table .= '<td class="delete" ><a class="delconfirm" title="' . i18n_r('DELETEPAGE_TITLE') . ' ' . cl($page['title']) . '?" href="backup-edit.php?p=delete&amp;id=' . $page['url'] . '&amp;nonce=' . get_nonce("delete", "backup-edit.php") . '">&times;</a></td>';
        $table .= '</tr>';
    }
}
$pagetitle = i18n_r('BAK_MANAGEMENT');
开发者ID:promil23,项目名称:GetSimpleCMS,代码行数:31,代码来源:backups.php


示例14: array_merge

for ($i = 0; $i < count($regional_map_results); $i++) {
    if ($regional_map_results[$i]["info"]["type"] == "Map") {
        $mapinfo[$i] = array_merge($regional_map_results[$i]["map_info"][0]);
    }
    if ($regional_map_results[$i]["info"]["type"] == "Group") {
        $groupinfo[$i] = array_merge($regional_map_results[$i]["map_info"]);
    }
}
foreach ($groupinfo as $key => $groupvalue) {
    $groupmapinfo[] = array_merge($groupinfo[$key]);
}
foreach ($groupmapinfo as $array) {
    $group = array_merge($group, $array);
}
$merged_maps_tosort = array_merge($mapinfo, $group);
$merged_maps = subval_sort($merged_maps_tosort, "title");
$total_maps = count($merged_maps);
//code for pagination
$mapsperpage = get_option('arcgis_maps_per_page') != '' ? get_option('arcgis_maps_per_page') : '8';
if (isset($regional_map_results)) {
    $total_pages = ceil($total_maps / $mapsperpage);
} else {
    $total_pages = 1;
    $total_maps = 0;
}
if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) {
    $currentpage = (int) $_GET['currentpage'];
} else {
    $currentpage = 1;
}
if ($currentpage > $total_pages) {
开发者ID:30mps,项目名称:data.gov,代码行数:31,代码来源:content-ocean-map-regional.php


示例15: generate_sitemap

/**
 * Creates Sitemap
 *
 * Creates GSSITEMAPFILE (sitemap.xml) in the site's root.
 */
function generate_sitemap()
{
    if (getDef('GSNOSITEMAP', true)) {
        return;
    }
    global $pagesArray;
    // Variable settings
    $SITEURL = getSiteURL(true);
    $path = GSDATAPAGESPATH;
    getPagesXmlValues(false);
    $pagesSorted = subval_sort($pagesArray, 'menuStatus');
    if (count($pagesSorted) > 0) {
        $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');
        foreach ($pagesSorted as $page) {
            if ($page['url'] != '404') {
                if ($page['private'] != 'Y') {
                    // set <loc>
                    $pageLoc = find_url($page['url'], $page['parent'], 'full');
                    // set <lastmod>
                    $tmpDate = date("Y-m-d H:i:s", strtotime($page['pubDate']));
                    $pageLastMod = makeIso8601TimeStamp($tmpDate);
                    // set <changefreq>
                    $pageChangeFreq = 'weekly';
                    // set <priority>
                    if ($page['menuStatus'] == 'Y') {
                        $pagePriority = '1.0';
                    } else {
                        $pagePriority = '0.5';
                    }
                    //add to sitemap
                    $url_item = $xml->addChild('url');
                    $url_item->addChild('loc', $pageLoc);
                    $url_item->addChild('lastmod', $pageLastMod);
                    $url_item->addChild('changefreq', $pageChangeFreq);
                    $url_item->addChild('priority', $pagePriority);
                }
            }
        }
        //create xml file
        $file = GSROOTPATH . GSSITEMAPFILE;
        $xml = exec_filter('sitemap', $xml);
        // @filter sitemap (obj) filter the sitemap $xml obj
        $status = XMLsave($xml, $file);
        exec_action('sitemap-aftersave');
        // @hook sitemap-aftersave after a sitemap data file was saved
        #sitemap successfully created
        return $status;
    } else {
        return true;
    }
}
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:58,代码来源:template_functions.php


示例16: getPages

 public static function getPages()
 {
     if (self::$pages) {
         return self::$pages;
     }
     $cachefile = GSDATAOTHERPATH . I18N_CACHE_FILE;
     if (!I18N_USE_CACHE || !file_exists($cachefile)) {
         // read pages into associative array
         self::$pages = array();
         $dir_handle = @opendir(GSDATAPAGESPATH) or die("Unable to open pages directory");
         while ($filename = readdir($dir_handle)) {
             if (strrpos($filename, '.xml') === strlen($filename) - 4 && !is_dir(GSDATAPAGESPATH . $filename)) {
                 $data = getXML(GSDATAPAGESPATH . $filename);
                 if (strpos($filename, '_') !== false) {
                     $pos = strpos($data->url, '_');
                     $url = substr($data->url, 0, $pos);
                     $lang = substr($data->url, $pos + 1);
                     if (!isset(self::$pages[$url])) {
                         self::$pages[$url] = array('url' => $url);
                     }
                     $menu = (string) $data->menu ? (string) $data->menu : (string) $data->title;
                     $title = (string) $data->title ? (string) $data->title : (string) $data->menu;
                     if ($menu) {
                         self::$pages[$url]['menu_' . $lang] = stripslashes($menu);
                     }
                     if ($title) {
                         self::$pages[$url]['title_' . $lang] = stripslashes($title);
                     }
                     if (isset($data->link) && (string) $data->link) {
                         self::$pages[$url]['link_' . $lang] = (string) $data->link;
                     }
                 } else {
                     $url = (string) $data->url;
                     if (!isset(self::$pages[$url])) {
                         self::$pages[$url] = array('url' => $url);
                     }
                     self::$pages[$url]['menuStatus'] = (string) $data->menuStatus;
                     self::$pages[$url]['menuOrder'] = (int) $data->menuOrder;
                     self::$pages[$url]['menu'] = stripslashes($data->menu);
                     self::$pages[$url]['title'] = stripslashes($data->title);
                     self::$pages[$url]['parent'] = (string) $data->parent;
                     self::$pages[$url]['private'] = (string) $data->private;
                     self::$pages[$url]['tags'] = (string) stripslashes($data->meta);
                     if (isset($data->link) && (string) $data->link) {
                         self::$pages[$url]['link'] = (string) $data->link;
                     }
                 }
             }
         }
         // sort pages
         $urlsToDelete = array();
         $sortedpages = array();
         foreach (self::$pages as $url => $page) {
             if (isset($page['parent']) && $page['private'] != 'Y') {
                 $sortedpages[] = array('url' => $url, 'parent' => $page['parent'], 'sort' => sprintf("%s%03s%s", $page['parent'], $page['menuOrder'], $url));
             } else {
                 $urlsToDelete[] = $url;
             }
         }
         $sortedpages = subval_sort($sortedpages, 'sort');
         if (count($urlsToDelete) > 0) {
             foreach ($urlsToDelete as $url) {
                 unset(self::$pages[$url]);
             }
         }
         // save cache file
         if (I18N_USE_CACHE) {
             $data = @new SimpleXMLExtended('<?xml version="1.0" encoding="UTF-8"?><pages></pages>');
             foreach ($sortedpages as $sortedpage) {
                 $url = $sortedpage['url'];
                 $page = self::$pages[$url];
                 $pagedata = $data->addChild('page');
                 foreach ($page as $key => $value) {
                     $propdata = $pagedata->addChild($key);
                     $propdata->addCData($value);
                 }
             }
             XMLsave($data, $cachefile);
         }
     } else {
         $sortedpages = array();
         $data = getXML($cachefile);
         foreach ($data->page as $pagedata) {
             $url = '' . $pagedata->url;
             self::$pages[$url] = array();
             foreach ($pagedata as $propdata) {
                 self::$pages[$url][$propdata->getName()] = (string) $propdata;
             }
             $sortedpages[] = array('url' => $url, 'parent' => self::$pages[$url]['parent']);
         }
     }
     // fill children
     self::$pages[null] = array();
     foreach ($sortedpages as $sortedpage) {
         $parent = $sortedpage['parent'];
         if (isset(self::$pages[$parent])) {
             if (!isset(self::$pages[$parent]['children'])) {
                 self::$pages[$parent]['children'] = array();
             }
             self::$pages[$parent]['children'][] = $sortedpage['url'];
//.........这里部分代码省略.........
开发者ID:sevenns,项目名称:alpremstroy,代码行数:101,代码来源:frontend.class.php


示例17: getAttribute_json

 function getAttribute_json()
 {
     $iParticipantId = Yii::app()->request->getQuery('pid');
     $records = ParticipantAttributeName::model()->getParticipantVisibleAttribute($iParticipantId);
     $records = subval_sort($records, "attribute_name", "asc");
     $i = 0;
     $doneattributes = array();
     //If the user has any actual attribute values, they'll be stored here
     /* Iterate through each attribute owned by this user */
     foreach ($records as $row) {
         $outputs[$i] = array("", $row['participant_id'] . "_" . $row['attribute_id'], $row['attribute_type'], $row['attribute_id'], $row['attribute_name'], $row['value']);
         /* Collect allowed values for a DropDown attribute */
         if ($row['attribute_type'] == "DD") {
             $attvalues = ParticipantAttributeName::model()->getAttributesValues($row['attribute_id']);
             if (!empty($attvalues)) {
                 $attval = "";
                 foreach ($attvalues as $val) {
                     $attval .= $val['value'] . ":" . $val['value'];
                     $attval .= ";";
                 }
                 $attval = substr($attval, 0, -1);
                 array_push($outputs[$i], $attval);
             } else {
                 array_push($outputs[$i], "");
             }
         } else {
             array_push($outputs[$i], "");
         }
         array_push($doneattributes, $row['attribute_id']);
         $i++;
     }
     /* Build a list of attribute names for which this user has NO values stored, keep it in $attributenotdone */
     $attributenotdone = array();
     /* The user has NO values stored against any attribute */
     if (count($doneattributes) == 0) {
         $attributenotdone = ParticipantAttributeName::model()->getCPDBAttributes();
     } else {
         $attributenotdone = ParticipantAttributeName::model()->getnotaddedAttributes($doneattributes);
     }
     /* Go through the empty attributes and build an entry in the output for them */
     foreach ($attributenotdone as $row) {
         $outputs[$i] = array("", $iParticipantId . "_" . $row['attribute_id'], $row['attribute_type'], $row['attribute_id'], $row['attribute_name'], "");
         if ($row['attribute_type'] == "DD") {
             $attvalues = ParticipantAttributeName::model()->getAttributesValues($row['attribute_id']);
             if (!empty($attvalues)) {
                 $attval = "";
                 foreach ($attvalues as $val) {
                     $attval .= $val['value'] . ":" . $val['value'];
                     $attval .= ";";
                 }
                 $attval = substr($attval, 0, -1);
                 array_push($outputs[$i], $attval);
             } else {
                 array_push($outputs[$i], "");
             }
         } else {
             array_push($outputs[$i], "");
         }
         $i++;
     }
     $outputs = subval_sort($outputs, 3, "asc");
     $aData = new stdClass();
     $aData->page = 1;
     $aData->rows[0]['id'] = $iParticipantId;
     $aData->rows[0]['cell'] = array();
     $aData->records = count($outputs);
     $aData->total = ceil($aData->records / 10);
     foreach ($outputs as $key => $output) {
         $aData->rows[$key]['id'] = $output[1];
         $aData->rows[$key]['cell'] = $output;
     }
     /* TODO: It'd be nice to do a natural sort on the attribute list at some point.
         Currently they're returned in order of attributes WITH values, then WITHOUT values
        */
     echo ls_json_encode($aData);
 }
开发者ID:jdbaltazar,项目名称:survey-office,代码行数:76,代码来源:participantsaction.php


示例18: eshop_base_manager


//.........这里部分代码省略.........
            $records = $max;
        }
        if ($max > 0) {
            $apge = get_admin_url() . 'admin.php?page=eshop-base.php';
            echo '<ul id="eshopsubmenu" class="stuffbox">';
            echo '<li><span>' . __('Sort Orders by &raquo;', 'eshop') . '</span></li>';
            echo '<li><a href="' . $apge . '&amp;by=sf"' . $csf . '>' . __('ID Number', 'eshop') . '</a></li>';
            echo '<li><a href="' . $apge . '&amp;by=sa"' . $csa . '>' . __('Sku', 'eshop') . '</a></li>';
            echo '<li><a href="' . $apge . '&amp;by=sb"' . $csb . '>' . __('Product', 'eshop') . '</a></li>';
            // echo '<li><a href="'.$apge.'&amp;by=sd"'.$csd.'>'.__('Stock','eshop').'</a></li>';
            echo '</ul>';
            $myrowres = $wpdb->get_results("\n\t\tSELECT DISTINCT meta.post_id\n\t\tFROM {$metatable}  

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP succ_msg函数代码示例发布时间:2022-05-23
下一篇:
PHP subtplcheck函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap