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

PHP strip_decode函数代码示例

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

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



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

示例1: bm_list_recent

function bm_list_recent()
{
    global $BMRECENTBOOKS;
    $books = bm_get_books();
    if (!empty($books)) {
        echo '<ul>';
        $books = array_slice($books, 0, $BMRECENTBOOKS, true);
        foreach ($books as $book) {
            $url = bm_get_url('book') . $book->slug;
            $title = strip_tags(strip_decode($book->title));
            echo "<li><a href=\"{$url}\">{$title}</a></li>";
        }
        echo '</ul>';
    }
}
开发者ID:abdelaithadji,项目名称:books_manager,代码行数:15,代码来源:sidebar.php


示例2: page_read

 public function page_read()
 {
     if ($this->auth()) {
         $id = (string) $this->xml->data->slug;
         if (file_exists(GSDATAPAGESPATH . $id . '.xml')) {
             $page = getXML(GSDATAPAGESPATH . $id . '.xml');
             $page->content = strip_decode($page->content);
             $page->metak = strip_decode($page->metak);
             $page->metad = strip_decode($page->metad);
             $page->title = strip_decode($page->title);
             $wrapper = array('status' => 'success', 'message' => 'page_read ok', 'response' => $page);
             return json_encode($wrapper);
         } else {
             $error = array('status' => 'error', 'message' => sprintf(i18n_r('API_ERR_NOPAGE'), $id));
             return json_encode($error);
         }
     }
 }
开发者ID:google-code-backups,项目名称:get-simple-cms,代码行数:18,代码来源:api.class.php


示例3: nm_update_sitemap_xml

function nm_update_sitemap_xml($xml)
{
    if (!defined('NMNOSITEMAP') || !NMNOSITEMAP) {
        $posts = nm_get_posts();
        $tags = array();
        $excludetags = defined('NMSITEMAPEXCLUDETAGS') && (NMSITEMAPEXCLUDETAGS === true || NMSITEMAPEXCLUDETAGS === 1);
        foreach ($posts as $post) {
            $url = nm_get_url('post') . $post->slug;
            $file = NMPOSTPATH . $post->slug . '.xml';
            $date = makeIso8601TimeStamp(date('Y-m-d H:i:s', strtotime($post->date)));
            $item = $xml->addChild('url');
            $item->addChild('loc', $url);
            $item->addChild('lastmod', $date);
            $item->addChild('changefreq', 'monthly');
            $item->addChild('priority', '0.5');
            if (!$excludetags && !empty($post->tags)) {
                foreach (explode(',', nm_lowercase_tags(strip_decode($post->tags))) as $tag) {
                    if (substr($tag, 0, 1) != '_') {
                        if (!in_array($tag, $tags)) {
                            $url = nm_get_url('tag') . rawurlencode($tag);
                            $item = $xml->addChild('url');
                            $item->addChild('loc', $url);
                            $item->addChild('lastmod', $date);
                            $item->addChild('changefreq', 'monthly');
                            $item->addChild('priority', '0.5');
                            $tags[] = $tag;
                        }
                    }
                }
            }
        }
    }
    return $xml;
}
开发者ID:Vin985,项目名称:clqweb,代码行数:34,代码来源:functions.php


示例4: get_cat_list

function get_cat_list($cat, $page)
{
    $cfile = array();
    $cfile = get_filecat($cat);
    $numitems = 7;
    //determine offset
    $page_ = $page - 1;
    $total = count($cfile);
    $offset = $page_ * $numitems;
    $total_pages = ceil($total / $numitems);
    for ($i = $offset; $i < $offset + $numitems and $i < $total; $i++) {
        $file = CONTENTPATH . $cfile[$i] . '.xml';
        $data = getXML($file);
        $title = stripslashes(htmlspecialchars_decode($data->title, ENT_QUOTES));
        $intro = stripslashes(htmlspecialchars_decode($data->intro, ENT_QUOTES));
        $parent = stripslashes(htmlspecialchars_decode($data->parent, ENT_QUOTES));
        $author_edit = stripslashes(htmlspecialchars_decode($data->author_edit, ENT_QUOTES));
        $date = stripslashes(htmlspecialchars_decode($data->pubDate, ENT_QUOTES));
        $url = stripslashes(htmlspecialchars_decode($data->url, ENT_QUOTES));
        $metad = stripslashes(htmlspecialchars_decode($data->metad, ENT_QUOTES));
        $imgb = imagenesHTML(html_entity_decode(strip_decode($intro)));
        ?>
    	
		
		
		<span class="blog_title"><a href="<?php 
        echo find_url($data->url, $data->parent);
        ?>
"><?php 
        echo $title;
        ?>
</a></span>
		<br /><span><i><?php 
        echo lngDate($date);
        ?>
</i> | <?php 
        echo $parent;
        ?>
</span>
		<div class="blog_item">
		<img src="<?php 
        echo $imgb[0];
        ?>
">
		
		<?php 
        $patron = "<img[^<>]*/>";
        echo eregi_replace($patron, "", $intro);
        ?>
		<div class="clear"></div>
		</div>
		
		
	
    <?php 
    }
    echo '<div class="pagination-links">';
    if ($page_ > 0) {
        echo '<a href="?page=' . $page_ . '"> Anterior</a> ';
    }
    for ($i = 1; $i <= $total_pages; $i++) {
        if ($page == $i) {
            echo '<span class="current">Pagina ' . $page . '</span> ';
        } else {
            echo ' <a href="?page=' . $i . '">' . $i . '</a>';
        }
    }
    $page++;
    if (++$page_ < $total_pages) {
        echo ' <a href="?page=' . $page . '"> Siguiente </a>';
    }
    echo "</div>";
}
开发者ID:Emmett-Brown,项目名称:linea,代码行数:73,代码来源:get_category.php


示例5: returnPageField

/**
 * Get Page Field
 *
 * Retrieve and display the requested field from the given page. 
 * If the field is "content" it will call returnPageContent()
 *
 * @since 3.1
 * @param $page - slug of the page to retrieve content
 * @param $field - the Field to display
 * 
 */
function returnPageField($page, $field)
{
    global $pagesArray;
    if (!$pagesArray) {
        getPagesXmlValues();
    }
    if ($field == "content") {
        $ret = returnPageContent($page);
    } else {
        if (isset($pagesArray[(string) $page]) && array_key_exists($field, $pagesArray[(string) $page])) {
            $ret = strip_decode(@$pagesArray[(string) $page][(string) $field]);
        } else {
            $ret = returnPageContent($page, $field);
        }
    }
    return $ret;
}
开发者ID:elephantcode,项目名称:elephantcode,代码行数:28,代码来源:caching_functions.php


示例6: set_blog_title

function set_blog_title()
{
    global $title, $blogSettings, $post;
    // Declare GLOBAL variables
    $slug = base64_encode(return_page_slug());
    // What page are we on?
    if ($slug == base64_encode($blogSettings["blogurl"])) {
        // If we're on the blog page...
        if (isset($_GET['post']) && !empty($post)) {
            // If viewing a post...
            $title = (string) $post->title;
            // Set title of post
        } else {
            if (isset($_GET['archive'])) {
                // If viewing an archive...
                // Set the archive title
                $title = (string) i18n_r(BLOGFILE . '/ARCHIVE_PRETITLE') . date('F Y', strtotime($_GET['archive']));
            } else {
                if (isset($_GET['category'])) {
                    // If viewing a category...
                    $title = (string) i18n_r(BLOGFILE . '/CATEGORY_PRETITLE') . $_GET['category'];
                    // Set category title
                }
            }
        }
    }
    $title = strip_tags(strip_decode($title));
    // Clean the title variable
}
开发者ID:Luigi-,项目名称:gs-blog,代码行数:29,代码来源:frontEndFunctions.php


示例7: get_available_pages

/**
 * Get Available Pages
 *
 * Lists all available pages for plugin/api use
 *
 * @since 2.0
 * @uses GSDATAPAGESPATH
 * @uses find_url
 * @uses getXML
 * @uses subval_sort
 *
 * @return array|string Type 'string' in this case will be XML 
 */
function get_available_pages()
{
    $menu_extract = '';
    $path = GSDATAPAGESPATH;
    $dir_handle = @opendir($path) or die("Unable to open {$path}");
    $filenames = array();
    while ($filename = readdir($dir_handle)) {
        $filenames[] = $filename;
    }
    closedir($dir_handle);
    $count = "0";
    $pagesArray = array();
    if (count($filenames) != 0) {
        foreach ($filenames as $file) {
            if ($file == "." || $file == ".." || is_dir($path . $file) || $file == ".htaccess") {
                // not a page data file
            } else {
                $data = getXML($path . $file);
                if ($data->private != 'Y') {
                    $pagesArray[$count]['menuStatus'] = $data->menuStatus;
                    $pagesArray[$count]['menuOrder'] = $data->menuOrder;
                    $pagesArray[$count]['menu'] = strip_decode($data->menu);
                    $pagesArray[$count]['parent'] = $data->parent;
                    $pagesArray[$count]['title'] = strip_decode($data->title);
                    $pagesArray[$count]['url'] = $data->url;
                    $pagesArray[$count]['private'] = $data->private;
                    $pagesArray[$count]['pubDate'] = $data->pubDate;
                    $count++;
                }
            }
        }
    }
    $pagesSorted = subval_sort($pagesArray, 'title');
    if (count($pagesSorted) != 0) {
        $count = 0;
        foreach ($pagesSorted as $page) {
            $text = (string) $page['menu'];
            $pri = (string) $page['menuOrder'];
            $parent = (string) $page['parent'];
            $title = (string) $page['title'];
            $slug = (string) $page['url'];
            $menuStatus = (string) $page['menuStatus'];
            $private = (string) $page['private'];
            $pubDate = (string) $page['pubDate'];
            $url = find_url($slug, $parent);
            $specific = array("slug" => $slug, "url" => $url, "parent_slug" => $parent, "title" => $title, "menu_priority" => $pri, "menu_text" => $text, "menu_status" => $menuStatus, "private" => $private, "pub_date" => $pubDate);
            $extract[] = $specific;
        }
        return $extract;
    }
}
开发者ID:Emmett-Brown,项目名称:linea,代码行数:64,代码来源:template_functions.php


示例8: create_excerpt

 /** 
  * Create Excerpt for post
  * 
  * @param $content string the content to be excerpted
  * @param $start int the starting character to create excerpt from
  * @param $maxchars int the amount of characters excerpt should be
  * @return string The created excerpt
  */
 public function create_excerpt($content, $start, $maxchars)
 {
     $maxchars = (int) $maxchars;
     $content = htmlspecialchars_decode(strip_tags(strip_decode($content)));
     $content = substr($content, $start, $maxchars);
     $pos = strrpos($content, " ");
     if ($pos > 0) {
         $content = substr($content, $start, $pos);
     }
     $content = str_replace(i18n_r(BLOGFILE . '/READ_FULL_ARTICLE'), "", $content);
     return $content;
 }
开发者ID:Luigi-,项目名称:gs-blog,代码行数:20,代码来源:Blog.php


示例9: nm_show_post

function nm_show_post($slug, $showexcerpt = false, $filter = true, $single = false)
{
    global $nmoption, $nmdata;
    $file = NMPOSTPATH . $slug . '.xml';
    if (dirname(realpath($file)) == realpath(NMPOSTPATH)) {
        // no path traversal
        $post = @getXML($file);
    }
    if (!empty($post) && ($post->private != 'Y' || $single && function_exists('is_logged_in') && is_logged_in())) {
        $url = nm_get_url('post') . $slug;
        $title = stripslashes($post->title);
        $date = nm_get_date(i18n_r('news_manager/DATE_FORMAT'), strtotime($post->date));
        $content = strip_decode($post->content);
        $image = stripslashes($post->image);
        $tags = !empty($post->tags) ? explode(',', nm_lowercase_tags(strip_decode($post->tags))) : array();
        # save post data?
        $nmdata = $single ? compact('slug', 'url', 'title', 'content', 'image', 'tags') : array();
        if ($filter) {
            ob_start();
        }
        echo '  <', $nmoption['markuppost'], ' class="', $nmoption['classpost'], '">', PHP_EOL;
        foreach ($nmoption['fields'] as $field) {
            switch ($field) {
                case 'title':
                    echo '    <', $nmoption['markupposttitle'], ' class="', $nmoption['classposttitle'], '">';
                    if ($nmoption['titlelink']) {
                        $class = $nmoption['classposttitlelink'] ? ' class="' . $nmoption['classposttitlelink'] . '"' : '';
                        echo '<a', $class, ' href="', $url, '">', $title, '</a>';
                    } else {
                        echo $title;
                    }
                    echo '</', $nmoption['markupposttitle'], '>', PHP_EOL;
                    break;
                case 'date':
                    echo '    <', $nmoption['markuppostdate'], ' class="', $nmoption['classpostdate'], '">', i18n_r('news_manager/PUBLISHED'), ' ', $date, '</', $nmoption['markuppostdate'], '>', PHP_EOL;
                    break;
                case 'content':
                    echo '    <', $nmoption['markuppostcontent'], ' class="', $nmoption['classpostcontent'], '">';
                    if ($single) {
                        echo $content;
                    } else {
                        $slice = '';
                        $class = '';
                        $readmore = $nmoption['readmore'];
                        if ($readmore) {
                            $class = $nmoption['classreadmorelink'] ? ' class="' . $nmoption['classreadmorelink'] . '"' : '';
                        }
                        if ($nmoption['more']) {
                            $morepos = strpos($content, '<hr');
                            if ($morepos !== false) {
                                $slice = substr($content, 0, $morepos);
                                if ($readmore) {
                                    $slice .= '      <p class="' . $nmoption['classreadmore'] . '"><a' . $class . ' href="' . $url . '">' . i18n_r('news_manager/READ_MORE') . '</a></p>' . PHP_EOL;
                                }
                            }
                        }
                        if ($slice) {
                            echo $slice;
                        } else {
                            if ($showexcerpt) {
                                if (!$readmore) {
                                    echo nm_create_excerpt($content);
                                } elseif ($readmore === 'a') {
                                    echo nm_create_excerpt($content, $url, true);
                                } else {
                                    echo nm_create_excerpt($content, $url);
                                }
                            } else {
                                echo $content;
                                if ($readmore === 'a') {
                                    echo '      <p class="', $nmoption['classreadmore'], '"><a', $class, ' href="', $url, '">', i18n_r('news_manager/READ_MORE'), '</a></p>', PHP_EOL;
                                }
                            }
                        }
                    }
                    echo '    </', $nmoption['markuppostcontent'], '>', PHP_EOL;
                    break;
                case 'tags':
                    if ($tags) {
                        echo '    <', $nmoption['markupposttags'], ' class="', $nmoption['classposttags'], '"><b>', i18n_r('news_manager/TAGS'), ':</b> ';
                        $sep = '';
                        foreach ($tags as $tag) {
                            if (substr($tag, 0, 1) != '_') {
                                echo $sep, '<a href="', nm_get_url('tag') . rawurlencode($tag), '">', htmlspecialchars($tag), '</a>';
                                if ($sep == '') {
                                    $sep = $nmoption['tagseparator'];
                                }
                            }
                        }
                        echo '</', $nmoption['markupposttags'], '>', PHP_EOL;
                    }
                    break;
                case 'image':
                    $imageurl = $nmoption['showimages'] ? nm_get_image_url($image) : false;
                    if ($imageurl) {
                        $str = '';
                        if (isset($nmoption['imageclass'])) {
                            $str .= ' class="' . $nmoption['imageclass'] . '"';
                        }
                        if ($nmoption['imagesizeattr'] && $nmoption['imagewidth'] && $nmoption['imageheight']) {
//.........这里部分代码省略.........
开发者ID:elephantcode,项目名称:elephantcode,代码行数:101,代码来源:site.php


示例10: i18n_gallery_theme_header

function i18n_gallery_theme_header()
{
    global $content;
    get_i18n_gallery_header_from_content(strip_decode($content));
}
开发者ID:elephantcode,项目名称:elephantcode,代码行数:5,代码来源:i18n_gallery.php


示例11: returnPageField

/**
 * Return Page Field
 *
 * Retrieve the requested field from the given page cache, fallback to page file
 * If the field is "content" and not raw it will run it through content filter
 *
 * @since 3.1
 * @param $page  slug of the page to retrieve content
 * @param $field the Field to display
 * @param $raw   if true, prevent any processing of data, use with caution as result can vary if falls back to page file
 * @param $cache if false, bypass cache and get directly from page file
 * 
 */
function returnPageField($page, $field, $raw = false, $cache = true)
{
    $pagesArray = getPagesXmlValues();
    if ($cache && isset($pagesArray[(string) $page]) && isset($pagesArray[(string) $page][$field])) {
        $ret = $raw ? $pagesArray[(string) $page][(string) $field] : strip_decode($pagesArray[(string) $page][(string) $field]);
    } else {
        $ret = returnPageFieldFromFile($page, $field, $raw);
    }
    // @todo this needs to come out of there, its dumb, special handling for special fields needs to be external
    if ($field == "content" && !$raw) {
        $ret = filterPageContent($page, $ret);
    }
    return $ret;
}
开发者ID:HelgeSverre,项目名称:GetSimpleCMS,代码行数:27,代码来源:caching_functions.php


示例12: get_blog_title

/** 
* Get Page/POST Title
* This function is a modified version of the core get_page_clean_title() function. It will function normally on all pages except individual blog posts, where the post title will be placed in instead of the page title.
* 
* @return void
*/
function get_blog_title($echo = true)
{
    global $title, $blogSettings, $post;
    $slug = base64_encode(return_page_slug());
    if ($slug == base64_encode($blogSettings["blogurl"])) {
        if (isset($_GET['post']) && !empty($post)) {
            $title = (string) $post->title;
        }
    }
    $myVar = strip_tags(strip_decode($title));
    if ($echo) {
        echo $myVar;
    } else {
        return $myVar;
    }
}
开发者ID:hatasu,项目名称:appdroid,代码行数:22,代码来源:frontEndFunctions.php


示例13: 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
 * @param string $classPrefix Prefix that gets added to the parent and slug classnames
 * @return string 
 */
function get_navigation($currentpage, $classPrefix = "")
{
    $menu = '';
    global $pagesArray;
    global $SITEURL;
    // Kevin F - Just initializing array and img tag outside the loops
    $imgExts = array('.png', '.jpg', '.gif');
    $imgTag = '';
    $pagesSorted = subval_sort($pagesArray, 'menuOrder');
    if (count($pagesSorted) != 0) {
        foreach ($pagesSorted as $page) {
            $sel = '';
            $classes = '';
            $url_nav = $page['url'];
            // Kevin F - Change the $icon variable to suit your directory needs
            foreach ($imgExts as $ext) {
                if (is_file(GSDATAUPLOADPATH . 'img/menu-icons/' . $page['url'] . $ext)) {
                    $icon = $SITEURL . 'data/uploads/img/menu-icons/' . $page['url'] . $ext;
                    $imgTag = '<img src="' . $icon . '" alt="' . $page['title'] . ' " width="65" height="65">';
                    break;
                    // File found! break out of loop...
                } else {
                    $imgTag = '';
                    // Add no img element as there is no image...
                }
            }
            if ($page['menuStatus'] == 'Y') {
                $parentClass = !empty($page['parent']) ? $classPrefix . $page['parent'] . " " : "";
                $classes = trim($parentClass . $classPrefix . $url_nav);
                if ("{$currentpage}" == "{$url_nav}") {
                    $classes .= " current active";
                }
                if ($page['menu'] == '') {
                    $page['menu'] = $page['title'];
                }
                if ($page['title'] == '') {
                    $page['title'] = $page['menu'];
                }
                // Kevin F - The menu variable below has been modified to cater for icons and alt name
                $menu .= '<li class="' . $classes . '"><a href="' . find_url($page['url'], $page['parent']) . '" title="' . encode_quotes(cl($page['title'])) . '">' . $imgTag . '<span class="link-title">' . strip_decode($page['menu']) . '</span></a></li>' . "\n";
            }
        }
    }
    echo exec_filter('menuitems', $menu);
}
开发者ID:Kevinf63,项目名称:KevPortfolio,代码行数:63,代码来源:theme_functions.php


示例14: isset

$setlang = isset($_GET["setlang"]);
$result = array();
if ($page == "" || $page == "init" || $setlang) {
    if (!$setlang) {
        $page = "index";
    }
    $result["langs"] = return_i18n_languages();
    $result["tabs"] = return_i18n_menu_data(return_page_slug(), 0, 0, I18N_SHOW_MENU);
    //echo $other_lang;
}
$content = "";
$title = "";
$url = $page;
if (isset($pagesArray[$page])) {
    $data_index = return_i18n_page_data($page);
    $content = strip_decode($data_index->content);
    $content = exec_filter('content', $content);
    $title = strip_decode($data_index->title);
    $url = strip_decode($data_index->url);
}
$page_content = array();
$children = return_i18n_menu_data($page, 1, 1, I18N_SHOW_MENU);
if (!is_null($children)) {
    $page_content["children"] = $children;
}
$page_content["title"] = $title;
$page_content["content"] = $content;
$result["url"] = $url;
$result["page"] = $page_content;
//$result["content"] = get_content($page);
echo json_encode($result);
开发者ID:Vin985,项目名称:clqweb,代码行数:31,代码来源:data.php


示例15: output_collection_item

/**
 * Output a collection item
 *
 * This will output the item requested. 
 * items are parsed for PHP within them if not $raw
 * Will only return the first component matching $id
 *
 * @since 3.4
 *
 * @param string $id This is the ID of the component you want to display
 * @param bool $force Force return of inactive components
 * @param bool $raw do not process php
 */
function output_collection_item($id, $collection, $force = false, $raw = false)
{
    $item = get_collection_item($id, $collection);
    if (!$item) {
        return;
    }
    $disabled = (bool) (string) $item->disabled;
    if ($disabled && !$force) {
        return;
    }
    if (!$raw) {
        eval("?>" . strip_decode($item->value) . "<?php ");
    } else {
        echo strip_decode($item->value);
    }
}
开发者ID:kix23,项目名称:GetSimpleCMS,代码行数:29,代码来源:template_functions.php


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


示例17: 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 = '';
    $path = GSDATAPAGESPATH;
    $dir_handle = opendir($path) or die("Unable to open {$path}");
    $filenames = array();
    while ($filename = readdir($dir_handle)) {
        $filenames[] = $filename;
    }
    $count = "0";
    $pagesArray = array();
    if (count($filenames) != 0) {
        foreach ($filenames as $file) {
            if ($file == "." || $file == ".." || is_dir($path . $file) || $file == ".htaccess") {
                // not a page data file
            } else {
                $data = getXML($path . $file);
                if ($data->private != 'Y') {
                    $pagesArray[$count]['menuStatus'] = $data->menuStatus;
                    $pagesArray[$count]['menuOrder'] = $data->menuOrder;
                    $pagesArray[$count]['menu'] = strip_decode($data->menu);
                    $pagesArray[$count]['url'] = $data->url;
                    $pagesArray[$count]['title'] = strip_decode($data->title);
                    $pagesArray[$count]['parent'] = $data->parent;
                    $count++;
                }
            }
        }
    }
    $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 " . $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="' . strip_quotes($page['title']) . '">' . $page['menu'] . '</a></li>' . "\n";
            }
        }
    }
    closedir($dir_handle);
    echo exec_filter('menuitems', $menu);
}
开发者ID:kazu2012,项目名称:get-simple-ja,代码行数:71,代码来源:theme_functions.php


示例18: 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
 * @param string $classPrefix Prefix that gets added to the parent and slug classnames
 * @return string 
 */
function get_navigation($currentpage = "", $classPrefix = "")
{
    $menu = '';
    global $pagesArray;
    $pagesSorted = subval_sort($pagesArray, 'menuOrder');
    if (count($pagesSorted) != 0) {
        foreach ($pagesSorted as $page) {
            $sel = $classes = '';
            $url_nav = (string) $page['url'];
            if ($page['menuStatus'] == 'Y') {
                $parentClass = !empty($page['parent']) ? $classPrefix . $page['parent'] . " " : "";
                $classes = trim($parentClass . $classPrefix . $url_nav);
                if ((string) $currentpage == $url_nav) {
                    $classes .= " current active";
                }
                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);
    // @filter menuitems (str) menu items html in get_navigation
}
开发者ID:HelgeSverre,项目名称:GetSimpleCMS,代码行数:46,代码来源:theme_functions.php


示例19: printAllItems

    public function printAllItems($page)
    {
        global $SITEURL;
        $data = getXML(ITEMDATA . $page['name'], 'SimpleXMLElement', LIBXML_NOCDATA);
        // $url = ($PRETTYURLS == 1) ? $SITEURL . $data->url : $SITEURL . 'index.php?id=' . $data->url;
        // Extract and filter content
        $content = strip_decode($data->content);
        $content = htmlspecialchars_decode($content, ENT_QUOTES);
        $content = strip_tags($content);
        $content = str_replace("&nbsp;", " ", $content);
        $content = substr($content, 0, 220);
        $b_url = $data->slug;
        // $url = preg_match('/\?/', $b_url) ? '&' : '?';
        $url = str_replace(' ', '-', $b_url);
        $url = $SITEURL . ITEMPAGE . "/?item=" . $url;
        //generowanie linku do strony produktu
        // Print result
        if (file_exists(ITEMSFILE)) {
            $item_manager_file = getXML(ITEMSFILE);
        }
        if (isset($item_manager_file->item->resultspage)) {
            $file_results_page = eval("?>" . strip_decode($item_manager_file->item->resultspage) . "<?php ");
        } else {
            $file_results_page = '
				<style>
					.m_pic {
					width:160px;
					float:left;
					border:1px solid white;
					padding:1px;margin-top:0px;
				}
				.thatable tr td h2 {
					margin:5px;
					font-size:15px;
					margin-toP:6px;
					margin-top:0px;
					padding-top:0px;
				}
				.thetable {
					margin-bottom:30px;
				}
				.thetable td h2{
					font-size:17px;
				}
				</style>
				<table width="100%" class="thetable">
					<tr>
						<td class="resize_img" width="175" valign="top">
							<div><img src="<?php echo $SITEURL; ?>/data/uploads/items/<?php echo $data->image1; ?>" class="m_pic"/></div>
						</td>
						<td valign="top">
							<h2 style=""><?php echo $data->title; ?> - <span class="title_development"><?php echo $data->category; ?></span> - <a href="<?php echo $url; ?>" style="font-size:13px;">View Details</a></h2>
							<p style="margin:0px;margin-left:4px;text-align:left;">
							</p>
							<p style="margin:0px;margin-left:4px;text-align:left;">
							<?php echo $content; ?>.. <a href="<?php echo $url; ?>">Read more</a>
							</p>
						</td>
					</tr>
				</table>
			';
            $file_results_page = eval("?>" . strip_decode($file_results_page) . "<?php ");
        }
    }
开发者ID:nelsonr,项目名称:Items-Manager,代码行数:64,代码来源:IMclassDisplay.php


示例20: sc_get_component

function sc_get_component($page)
{
    $content = returnPageContent(return_page_slug(), 'content', false, true);
    $content = strip_decode($content);
    if (!preg_match('#\\[sc_form(.*)\\]#', $content)) {
        getPageContent($page);
    }
}
开发者ID:elephantcode,项目名称:elephantcode,代码行数:8,代码来源:getsimple_contact.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP strip_domainname函数代码示例发布时间:2022-05-23
下一篇:
PHP strip_bracket函数代码示例发布时间: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