コード例 #1
0
ファイル: viewer.class.php プロジェクト: sevenns/alpremstroy
 public static function displayRSSLink($params)
 {
     global $url, $parent, $SITEURL;
     if (!@$params['name']) {
         return;
     }
     $href = function_exists('find_i18n_url') ? find_i18n_url($url, $parent) : find_url($url, $parent);
     $href .= (strpos($url, '?') === false ? '?' : '&') . $params['name'];
     echo '<a href="' . htmlspecialchars($href) . '"><img src="' . $SITEURL . 'plugins/i18n_search/images/rss.gif" alt="rss" width="12" height="12"/> ' . htmlspecialchars(@$params['title']) . '</a>';
 }
コード例 #2
0
ファイル: functions.php プロジェクト: hatasu/appdroid
/**
 * Innovation Parent Link
 *
 * This creates a link for a parent for the breadcrumb feature of this theme
 *
 * @param string $name - This is the slug of the link you want to create
 * @return string
 */
function Innovation_Parent_Link($name)
{
    $file = GSDATAPAGESPATH . $name . '.xml';
    if (file_exists($file)) {
        $p = getXML($file);
        $title = $p->title;
        $parent = $p->parent;
        $slug = $p->slug;
        echo '<a href="' . find_url($name, '') . '">' . $title . '</a> &nbsp;&nbsp;&#149;&nbsp;&nbsp; ';
    }
}
コード例 #3
0
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;
}
コード例 #4
0
ファイル: frontend.class.php プロジェクト: Vin985/clqweb
 public static function outputLink($gallery)
 {
     include_once GSPLUGINPATH . 'i18n_gallery/helper.php';
     $url = @$gallery['url'] ? $gallery['url'] : 'index';
     $parent = @$gallery['parent'] ? $gallery['parent'] : null;
     $tags = @$gallery['tags'] ? $gallery['tags'] : null;
     $thumb = i18n_gallery_thumb($gallery);
     $title = $gallery['title'];
     if (function_exists('return_i18n_languages')) {
         $languages = return_i18n_languages();
         $deflang = return_i18n_default_language();
         foreach ($languages as $language) {
             $fullkey = 'title' . ($language == $deflang ? '' : '_' . $language);
             if (isset($gallery[$fullkey])) {
                 $title = $gallery[$fullkey];
                 break;
             }
         }
     }
     $link = function_exists('find_i18n_url') ? find_i18n_url($url, $parent) : find_url($url, $parent);
     if ($tags) {
         $link .= (strpos($link, '?') !== false ? '&' : '?') . 'imagetags=' . urlencode($tags);
     }
     if (isset($thumb)) {
         $item = @$gallery['items'][$thumb];
         if (!$item) {
             $item = $gallery['items'][0];
         }
         echo '<div class="gallery-link">';
         echo '<a href="' . htmlspecialchars($link) . '" class="gallery-thumb-link">';
         echo '<img src="';
         i18n_gallery_thumb_link($gallery, $item);
         echo '" alt="' . htmlspecialchars($title) . '" title="' . htmlspecialchars($title) . '"/>';
         echo '</a>';
         echo '<span class="gallery-title">' . htmlspecialchars($title) . '</span>';
         echo '</div>';
     } else {
         echo '<a href="' . htmlspecialchars($link) . '" class="gallery-title-link">';
         echo htmlspecialchars($title);
         echo '</a>';
     }
 }
コード例 #5
0
 protected function get($name)
 {
     if (!$this->data) {
         $this->data = getXML(GSDATAPAGESPATH . $this->fullId . '.xml');
         if (!$this->data) {
             return null;
         }
     }
     switch ($name) {
         case 'tags':
             if ($this->tags == null) {
                 $metak = html_entity_decode(strip_tags(stripslashes(htmlspecialchars_decode($this->data->meta))), ENT_QUOTES, 'UTF-8');
                 $this->tags = preg_split("/\\s*,\\s*/", trim($metak), -1, PREG_SPLIT_NO_EMPTY);
             }
             return $this->tags;
         case 'title':
             if ($this->title == null) {
                 $this->title = stripslashes(html_entity_decode($this->data->title, ENT_QUOTES, 'UTF-8'));
             }
             return $this->title;
         case 'content':
             if ($this->content == null) {
                 $this->content = stripslashes(htmlspecialchars_decode($this->data->content, ENT_QUOTES));
             }
             return $this->content;
         case 'contenttext':
             if ($this->content == null) {
                 $this->content = stripslashes(htmlspecialchars_decode($this->data->content, ENT_QUOTES));
             }
             return trim(strip_tags($this->content));
         case 'url':
             return $this->id;
         case 'slug':
             return $this->fullId;
         case 'parent':
             return (string) $this->data->parent;
         case 'link':
             if (function_exists('find_i18n_url')) {
                 return find_i18n_url($this->id, $this->parent, $this->language);
             } else {
                 return find_url($this->fullId, $this->parent);
             }
         case 'simplelink':
             return find_url($this->fullId, $this->parent);
         case 'menuOrder':
             if ($this->id != $this->fullId) {
                 return $this->getDefaultDataProp($name);
             }
             return (int) $this->data->{$name};
         case 'parent':
         case 'menuStatus':
         case 'private':
             if ($this->id != $this->fullId) {
                 return $this->getDefaultDataProp($name);
             }
         default:
             return (string) $this->data->{$name};
     }
 }
コード例 #6
0
ファイル: theme_functions.php プロジェクト: Foltys/Masopust
/**
 * 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);
}
コード例 #7
0
ファイル: MY_form_helper.php プロジェクト: abdulmanan7/stms
 function box_img($val = '', $img_name = '', $img_x = '.png')
 {
     return '<div class="img-box">
            <div class="box-img">
             <img src="' . find_url('images', 'entry/' . $img_name . $img_x) . '" class="img-inside" alt="Image">
             </div>
             <div class="box-text">' . find_style($val) . '</div>
             </div>';
 }
コード例 #8
0
/**
 * Recursive list of pages
 *
 * Returns a recursive list of items for the main page
 *
 * @author Mike
 *
 * @since 3.0
 * @uses $pagesSorted
 *
 * @param string $parent
 * @param string $menu
 * @param int $level
 * 
 * @returns string
 */
function get_pages_menu($parent, $menu, $level)
{
    global $pagesSorted;
    $items = array();
    foreach ($pagesSorted as $page) {
        if ($page['parent'] == $parent) {
            $items[(string) $page['url']] = $page;
        }
    }
    if (count($items) > 0) {
        foreach ($items as $page) {
            $dash = "";
            if ($page['parent'] != '') {
                $page['parent'] = $page['parent'] . "/";
            }
            for ($i = 0; $i <= $level - 1; $i++) {
                if ($i != $level - 1) {
                    $dash .= '<span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>';
                } else {
                    $dash .= '<span>&nbsp;&nbsp;&ndash;&nbsp;&nbsp;&nbsp;</span>';
                }
            }
            $menu .= '<tr id="tr-' . $page['url'] . '" >';
            if ($page['title'] == '') {
                $page['title'] = '[No Title] &nbsp;&raquo;&nbsp; <em>' . $page['url'] . '</em>';
            }
            if ($page['menuStatus'] != '') {
                $page['menuStatus'] = ' <sup>[' . i18n_r('MENUITEM_SUBTITLE') . ']</sup>';
            } else {
                $page['menuStatus'] = '';
            }
            if ($page['private'] != '') {
                $page['private'] = ' <sup>[' . i18n_r('PRIVATE_SUBTITLE') . ']</sup>';
            } else {
                $page['private'] = '';
            }
            if ($page['url'] == 'index') {
                $homepage = ' <sup>[' . i18n_r('HOMEPAGE_SUBTITLE') . ']</sup>';
            } else {
                $homepage = '';
            }
            $menu .= '<td class="pagetitle">' . $dash . '<a title="' . i18n_r('EDITPAGE_TITLE') . ': ' . cl($page['title']) . '" href="edit.php?id=' . $page['url'] . '" >' . cl($page['title']) . '</a><span class="showstatus toggle" >' . $homepage . $page['menuStatus'] . $page['private'] . '</span></td>';
            $menu .= '<td style="width:80px;text-align:right;" ><span>' . shtDate($page['date']) . '</span></td>';
            $menu .= '<td class="secondarylink" >';
            $menu .= '<a title="' . i18n_r('VIEWPAGE_TITLE') . ': ' . cl($page['title']) . '" target="_blank" href="' . find_url($page['url'], $page['parent']) . '">#</a>';
            $menu .= '</td>';
            if ($page['url'] != 'index') {
                $menu .= '<td class="delete" ><a class="delconfirm" href="deletefile.php?id=' . $page['url'] . '&nonce=' . get_nonce("delete", "deletefile.php") . '" title="' . i18n_r('DELETEPAGE_TITLE') . ': ' . cl($page['title']) . '" >X</a></td>';
            } else {
                $menu .= '<td class="delete" ></td>';
            }
            $menu .= '</tr>';
            $menu = get_pages_menu((string) $page['url'], $menu, $level + 1);
        }
    }
    return $menu;
}
コード例 #9
0
ファイル: frontend.class.php プロジェクト: Vin985/clqweb
 public static function getURL($slug, $slugparent, $language = null, $type = 'full')
 {
     global $url, $parent, $PERMALINK, $PERMALINK_ORIG;
     if (!isset($PERMALINK_ORIG)) {
         $PERMALINK_ORIG = $PERMALINK;
     }
     if (!$slug) {
         $slug = @$url;
         $slugparent = @$parent;
     }
     if (@strpos(@$PERMALINK_ORIG, '%language%') !== false || @strpos(@$PERMALINK_ORIG, '%nondefaultlanguage%') !== false) {
         if (substr($language, 0, 1) == '(') {
             $language = substr($language, 1, 2);
         }
         $u = self::getFancyLanguageUrl($slug, $slugparent, $language, $type);
     } else {
         if (substr($language, 0, 1) == '(') {
             $language = null;
         }
         if (@strpos(@$PERMALINK_ORIG, '%parents%') !== false) {
             $u = self::getFancyLanguageUrl($slug, $slugparent, null, $type);
         } else {
             $u = find_url($slug, $slugparent, $type);
         }
         if ($language && (!defined('I18N_SINGLE_LANGUAGE') || !I18N_SINGLE_LANGUAGE)) {
             if (defined('I18N_SEPARATOR') && $slug == 'index') {
                 $u .= I18N_SEPARATOR . $language;
             } else {
                 if (defined('I18N_SEPARATOR')) {
                     preg_match('/^([^\\?]*[^\\?\\/])(\\/?(\\?.*)?)$/', $u, $match);
                     $u = $match[1] . I18N_SEPARATOR . $language . @$match[2];
                 } else {
                     $u .= (strpos($u, '?') !== false ? '&' : '?') . I18N_LANGUAGE_PARAM . '=' . $language;
                 }
             }
         }
     }
     return $u;
 }
コード例 #10
0
ファイル: edit.php プロジェクト: hatasu/appdroid
		<div class="main">
		
		<h3 class="floated"><?php 
if (isset($data_edit)) {
    i18n('PAGE_EDIT_MODE');
} else {
    i18n('CREATE_NEW_PAGE');
}
?>
</h3>	

		<!-- pill edit navigation -->
		<div class="edit-nav" >
			<?php 
if (isset($id)) {
    echo '<a href="', find_url($url, $parent), '" target="_blank" accesskey="', find_accesskey(i18n_r('VIEW')), '" >', i18n_r('VIEW'), ' </a>';
}
?>
			<a href="#" id="metadata_toggle" accesskey="<?php 
echo find_accesskey(i18n_r('PAGE_OPTIONS'));
?>
" ><?php 
i18n('PAGE_OPTIONS');
?>
</a>
			<div class="clear" ></div>
		</div>	
			
		<form class="largeform" id="editform" action="changedata.php" method="post" accept-charset="utf-8" >
			<input id="nonce" name="nonce" type="hidden" value="<?php 
echo get_nonce("edit", "edit.php");
コード例 #11
0
 public function __get($name)
 {
     switch ($name) {
         case 'id':
         case 'url':
         case 'slug':
             return $this->item['url'];
         case 'parent':
             return $this->item['parent'];
         case 'classes':
             return $this->classes;
         case 'text':
             return $this->text;
         case 'title':
             return $this->title;
         case 'current':
         case 'iscurrent':
         case 'isCurrent':
             return $this->item['current'];
         case 'currentpath':
         case 'currentPath':
         case 'iscurrentpath':
         case 'isCurrentPath':
             return $this->item['currentpath'];
         case 'haschildren':
         case 'hasChildren':
             return $this->item['haschildren'];
         case 'open':
         case 'isOpen':
             return isset($this->item['children']) && count($this->item['children']) > 0;
         case 'closed':
         case 'isClosed':
             return $this->item['haschildren'] && (!isset($this->item['children']) || count($this->item['children']) <= 0);
         case 'titles':
         case 'showtitles':
         case 'showTitles':
             return $this->showTitles;
         case 'link':
             if (@$this->item['link']) {
                 return $this->item['link'];
             } else {
                 if (function_exists('find_i18n_url')) {
                     return find_i18n_url($this->item['url'], $this->item['parent']);
                 } else {
                     return find_url($this->item['url'], $this->item['parent']);
                 }
             }
         case 'simplelink':
         case 'simpleLink':
             if (@$this->item['link']) {
                 return $this->item['link'];
             } else {
                 return find_url($this->item['url'], $this->item['parent']);
             }
         case 'content':
             return html_entity_decode(stripslashes((string) $this->getProp('content')), ENT_QUOTES, 'UTF-8');
         case 'tags':
             return preg_split('/\\s*,\\s*/', trim(html_entity_decode(stripslashes((string) $this->getProp('meta')), ENT_QUOTES, 'UTF-8')));
         default:
             return (string) $this->getProp($name);
     }
 }
コード例 #12
0
ファイル: get_category.php プロジェクト: Emmett-Brown/linea
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>";
}
コード例 #13
0
ファイル: edit.php プロジェクト: elephantcode/elephantcode
                    $gallery = return_i18n_gallery(@$_POST['post-name']);
                    // reread
                    $name = @$_POST['post-name'];
                } else {
                    $msg = i18n_r('i18n_gallery/SAVE_FAILURE');
                }
            }
        } else {
            $gallery = return_i18n_gallery(@$_GET['name']);
        }
    }
}
$settings = i18n_gallery_settings();
$w = intval(@$settings['adminthumbwidth']) > 0 ? intval($settings['adminthumbwidth']) : I18N_GALLERY_DEFAULT_THUMB_WIDTH;
$h = intval(@$settings['adminthumbheight']) > 0 ? intval($settings['adminthumbheight']) : I18N_GALLERY_DEFAULT_THUMB_HEIGHT;
$viewlink = function_exists('find_i18n_url') ? find_i18n_url('index', null) : find_url('index', null);
$viewlink .= (strpos($viewlink, '?') === false ? '?' : '&amp;') . 'name=' . $name . '&amp;preview-gallery';
$plugins = i18n_gallery_plugins();
$plugins = subval_sort($plugins, 'name');
// default gallery type
if (!@$gallery['type']) {
    $gallery['type'] = @$settings['type'] ? $settings['type'] : I18N_GALLERY_DEFAULT_TYPE;
}
?>
		<h3 class="floated" style="float:left"><?php 
$name ? i18n('i18n_gallery/EDIT_HEADER') : i18n('i18n_gallery/CREATE_HEADER');
?>
</h3>

		<div class="edit-nav" >
      <p>
コード例 #14
0
ファイル: searchform.php プロジェクト: sevenns/alpremstroy
<?php

global $SITEURL;
require_once GSPLUGINPATH . 'i18n_search/viewer.class.php';
$i18n =& $params;
// alias for i18n parsing
$slug = array_key_exists('slug', $params) ? $params['slug'] : return_page_slug();
$showTags = array_key_exists('showTags', $params) ? $params['showTags'] : true;
$minTagSizePercent = array_key_exists('minTagSize', $params) ? (int) $params['minTagSize'] : 100;
$maxTagSizePercent = array_key_exists('maxTagSize', $params) ? (int) $params['maxTagSize'] : 250;
$addTags = array_key_exists('addTags', $params) ? $params['addTags'] : '';
$goText = @$i18n['GO'];
$is_ajax = !isset($params['ajax']) || $params['ajax'];
$live = $is_ajax && isset($params['live']) && $params['live'];
$url = function_exists('find_i18n_url') ? find_i18n_url($slug, null) : find_url($slug, null);
$method = strpos($url, '?') !== false ? 'POST' : 'GET';
// with GET the parameters are not submitted!
$language = isset($params['lang']) ? $params['lang'] : null;
$placeholderText = @$params['PLACEHOLDER'];
// languages
$reqlangs = null;
if (function_exists('return_i18n_languages')) {
    $deflang = return_i18n_default_language();
    $languages = $language ? array($language) : return_i18n_languages();
    foreach ($languages as $lang) {
        if ($lang == $deflang) {
            $lang = '';
        }
        $reqlangs = $reqlangs === null ? $lang : $reqlangs . ',' . $lang;
    }
}
コード例 #15
0
ファイル: edit.php プロジェクト: promil23/GetSimpleCMS
        <div class="main">
        
        <h3 class="floated"><?php 
if (isset($data_edit)) {
    i18n('PAGE_EDIT_MODE');
} else {
    i18n('CREATE_NEW_PAGE');
}
?>
</h3>   

        <!-- pill edit navigation -->
        <div class="edit-nav" >
            <?php 
if (isset($id)) {
    echo '<a href="' . find_url($url, $parent) . '" target="_blank" accesskey="' . find_accesskey(i18n_r('VIEW')) . '" >' . i18n_r('VIEW') . '</a>';
    if ($url != '') {
        echo '<a href="pages.php?id=' . $url . '&amp;action=clone&amp;nonce=' . get_nonce("clone", "pages.php") . '" >' . i18n_r('CLONE') . '</a>';
    }
    echo '<span class="save-close"><a href="javascript:void(0)" >' . i18n_r('SAVE_AND_CLOSE') . '</a></span>';
}
?>
            <!-- @todo: fix accesskey for options  -->
            <!-- <a href="javascript:void(0)" id="metadata_toggle" accesskey="<?php 
echo find_accesskey(i18n_r('PAGE_OPTIONS'));
?>
" ><?php 
i18n('PAGE_OPTIONS');
?>
</a> -->
            <div class="clear" ></div>
コード例 #16
0
/**
 * 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);
}
コード例 #17
0
/**
 * 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
}
コード例 #18
0
ファイル: functions.php プロジェクト: Vin985/clqweb
function nm_get_url($query = false)
{
    global $PRETTYURLS, $NMPAGEURL, $NMPRETTYURLS;
    $str = '';
    $url = find_url($NMPAGEURL, nm_get_parent());
    if ($query) {
        switch ($query) {
            case 'post':
                $query = NMPARAMPOST;
                break;
            case 'page':
                $query = NMPARAMPAGE;
                break;
            case 'tag':
                $query = NMPARAMTAG;
                break;
            case 'archive':
                $query = NMPARAMARCHIVE;
                break;
        }
        if ($PRETTYURLS == 1 && $NMPRETTYURLS == 'Y') {
            if ($query == NMPARAMPOST && defined('NMNOPARAMPOST') && NMNOPARAMPOST) {
                $str = '';
            } else {
                $str = $query . '/';
            }
            if (substr($url, -1) != '/') {
                $str = '/' . $str;
            }
        } else {
            $str = strpos($url, '?') === false ? '?' : '&amp;';
            $str .= $query . '=';
        }
    }
    return $url . $str;
}
コード例 #19
0
ファイル: header.php プロジェクト: abdulmanan7/stms
'>currency</a>
            </li>
            <li>
              <a href='#'>Setting 4</a>
            </li>
          </ul>
        </li>
        <li class='dropdown user'>
          <a class='dropdown-toggle' data-toggle='dropdown' href='#'>
            <i class='icon-user'></i>
            <strong><?php 
echo $user_name;
?>
</strong>
            <img class="img-rounded" src="<?php 
echo find_url('images', 'logo.png');
?>
" />
            <b class='caret'></b>
          </a>
          <ul class='dropdown-menu'>
            <li>
              <a href="<?php 
echo base_url('auth/edit_user/' . $user_id);
?>
">Edit Profile</a>
            </li>
            <li class='divider'></li>
            <li>
              <a href="<?php 
echo base_url('auth/logout');
コード例 #20
0
ファイル: registration.php プロジェクト: abdulmanan7/stms
		<meta content='IE=edge,chrome=1' http-equiv='X-UA-Compatible'>
		<title>Registration</title>
		<meta content='lab2023' name='author'>
		<meta content='' name='description'>
		<meta content='' name='keywords'>
		<link href='<?php 
echo find_url("css", "application-a07755f5.css");
?>
' rel="stylesheet" type="text/css" />
		<link href="//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
		<link href='<?php 
echo find_url("images", "favicon.ico");
?>
' rel="icon" type="image/ico" />
		<link href='<?php 
echo find_url("css", "custom.css");
?>
' rel="stylesheet" type="text/css" />
	</head>
	<body class='login'>
		<!-- <div class='wrapper'> -->
		<div class="container-fluid">
			<div class='row'>
				<div class='col-lg-12'>
					<div class='brand text-center'>
						<h1>
						<div class='logo-icon'>
							<img src="<?php 
echo base_url('assets/images/logo.png');
?>
" alt="smart tailor logo" class="logo-img"/>
コード例 #21
0
ファイル: edit.php プロジェクト: HelgeSverre/GetSimpleCMS
    $template = isset($_GET['template']) ? var_in($_GET['template']) : '';
    $parent = isset($_GET['parent']) ? var_in($_GET['parent']) : '';
    $menu = isset($_GET['menu']) ? var_in($_GET['menu']) : '';
    $private = isset($_GET['private']) ? var_in($_GET['private']) : '';
    $menuStatus = isset($_GET['menuStatus']) ? var_in($_GET['menuStatus']) : '';
    $menuOrder = isset($_GET['menuOrder']) ? var_in($_GET['menuOrder']) : '';
    $titlelong = isset($_GET['titlelong']) ? var_in($_GET['titlelong']) : '';
    $summary = isset($_GET['summary']) ? var_in($_GET['summary']) : '';
    $metarNoIndex = isset($_GET['metarNoIndex']) ? var_in($_GET['metarNoIndex']) : '';
    $metarNoFollow = isset($_GET['metarNoFollow']) ? var_in($_GET['metarNoFollow']) : '';
    $metarNoArchive = isset($_GET['metarNoArchive']) ? var_in($_GET['metarNoArchive']) : '';
    $buttonname = i18n_r('BTN_SAVEPAGE');
}
$newdraft = $draft && !$draftExists;
// (bool) is this a new never saved draft?
$path = find_url($url, $parent);
// make select box of available theme templates
if ($template == '') {
    $template = GSTEMPLATEFILE;
}
$themes_path = GSTHEMESPATH . $TEMPLATE;
$themes_handle = opendir($themes_path) or die("Unable to open " . GSTHEMESPATH);
while ($getfile = readdir($themes_handle)) {
    if (isFile($getfile, $themes_path, 'php')) {
        // exclude functions.php, and include files .inc.php
        if ($getfile != 'functions.php' && substr(strtolower($getfile), -8) != '.inc.php' && substr($getfile, 0, 1) !== '.') {
            $templates[] = $getfile;
        }
    }
}
sort($templates);
コード例 #22
0
/**
 * 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;
    }
}
コード例 #23
0
ファイル: Blog.php プロジェクト: Luigi-/gs-blog
 /** 
  * Generates link to blog or blog area
  * 
  * @param $query string Optionally you can provide the type of blog url you are looking for (eg: 'post', 'category', 'archive', etc..)
  * @return url to requested blog area
  */
 public function get_blog_url($query = FALSE)
 {
     global $SITEURL, $PRETTYURLS;
     $blogurl = $this->getSettingsData("blogurl");
     $data = getXML(GSDATAPAGESPATH . $blogurl . '.xml');
     $url = find_url($blogurl, $data->parent);
     if ($query) {
         if ($query == 'rss') {
             $url = $SITEURL . 'plugins/' . BLOGFILE . '/rss.php';
         } elseif ($PRETTYURLS == 1 && $this->getSettingsData("prettyurls") == 'Y') {
             $url .= $query . '/';
         } elseif ($blogurl == 'index') {
             $url = $SITEURL . "index.php?{$query}=";
         } else {
             $url = $SITEURL . "index.php?id={$blogurl}&{$query}=";
         }
     }
     return $url;
 }
コード例 #24
0
ファイル: structure.php プロジェクト: Vin985/clqweb
        ?>
">&gt;</a></td>
            <td class="secondarylink"><a href="#" class="toggleMenu" title="<?php 
        i18n('i18n_navigation/TOGGLE_MENU');
        ?>
">M</a></td>
            <td class="secondarylink"><a href="#" class="togglePrivate" title="<?php 
        i18n('i18n_navigation/TOGGLE_PRIVATE');
        ?>
">P</a></td>
	          <td class="secondarylink">
	            <a title="<?php 
        echo i18n_r('VIEWPAGE_TITLE') . ': ' . stripslashes($page['title']);
        ?>
" target="_blank" href="<?php 
        echo $i18n_url ? find_i18n_url($page['url'], $page['parent'], $def_language) : find_url($page['url'], $page['parent']);
        ?>
">#</a>
	          </td>
           </tr>
        <?php 
        $i++;
    }
}
?>
        </tbody>
			</table>
      <input type="submit" name="save" value="<?php 
i18n('i18n_navigation/SAVE_NAVIGATION');
?>
" class="submit"/>
コード例 #25
0
/**
 * 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;
    }
}
コード例 #26
0
ファイル: index.php プロジェクト: RobAnt/GetSimple-Plugins
$parent = $data_index->parent;
$template_file = $data_index->template;
$private = $data_index->private;
# if page is private, send to 404 error page
if ($private == 'Y') {
    header('Location: 403');
    exit;
}
# if page does not exist, throw 404 error
if ($url == '403') {
    header('HTTP/1.0 404 Not Found');
}
# check for correctly formed url
if (defined('GSCANONICAL')) {
    if ($_SERVER['REQUEST_URI'] != find_url($url, $parent, 'relative')) {
        header('Location: ' . find_url($url, $parent));
    }
}
# include the functions.php page if it exists within the theme
if (file_exists("theme/" . $TEMPLATE . "/functions.php")) {
    include "theme/" . $TEMPLATE . "/functions.php";
}
# call pretemplate Hook
exec_action('index-pretemplate');
# include the template and template file set within theme.php and each page
if (!file_exists("theme/" . $TEMPLATE . "/" . $template_file) || $template_file == '') {
    $template_file = "template.php";
}
include "theme/" . $TEMPLATE . "/" . $template_file;
# call posttemplate Hook
exec_action('index-posttemplate');
コード例 #27
0
ファイル: backup-edit.php プロジェクト: Emmett-Brown/linea
i18n('PAGE_TITLE');
?>
:</td><td><b><?php 
echo cl($title);
?>
</b> <?php 
echo $private;
?>
</td></tr>
		<tr><td class="title" ><?php 
i18n('BACKUP_OF');
?>
:</td><td>
			<?php 
if (isset($id)) {
    echo '<a target="_blank" href="' . find_url($url, $parent) . '">' . find_url($url, $parent) . '</a>';
}
?>
		</td></tr>
		<tr><td class="title" ><?php 
i18n('DATE');
?>
:</td><td><?php 
echo lngDate($pubDate);
?>
</td></tr>
		<tr><td class="title" ><?php 
i18n('TAG_KEYWORDS');
?>
:</td><td><em><?php 
echo $metak;
コード例 #28
0
ファイル: helper.php プロジェクト: elephantcode/elephantcode
function i18n_gallery_page_url()
{
    global $url, $parent;
    return function_exists('find_i18n_url') ? find_i18n_url($url, $parent) : find_url($url, $parent);
}
コード例 #29
0
ファイル: sitemap.php プロジェクト: RobAnt/GetSimple-Plugins
             $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);
コード例 #30
0
# if page is private, check user
if ($private == 'Y') {
    if (isset($USR) && $USR == get_cookie('GS_ADMIN_USERNAME')) {
        //ok, allow the person to see it then
    } else {
        redirect('404');
    }
}
# if page does not exist, throw 404 error
if ($url == '404') {
    header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found");
}
# check for correctly formed url
if (defined('GSCANONICAL')) {
    if ($_SERVER['REQUEST_URI'] != find_url($url, $parent, 'relative')) {
        redirect(find_url($url, $parent));
    }
}
# include the functions.php page if it exists within the theme
if (file_exists(GSTHEMESPATH . $TEMPLATE . "/functions.php")) {
    include GSTHEMESPATH . $TEMPLATE . "/functions.php";
}
# call pretemplate Hook
exec_action('index-pretemplate');
# include the template and template file set within theme.php and each page
if (!file_exists(GSTHEMESPATH . $TEMPLATE . "/" . $template_file) || $template_file == '') {
    $template_file = "template.php";
}
include GSTHEMESPATH . $TEMPLATE . "/" . $template_file;
# call posttemplate Hook
exec_action('index-posttemplate');