示例#1
0
function display_page_content()
{
    // We use the old way to get all entries, because the FindAll function forces an exclusion date
    $the_blog = Blogs::FindById(BLOG_DEFAULT_ID);
    $entries = $the_blog->getEntries(false, false);
    $categories = Categories::FindAll();
    $year_month = $year = $month = $extraheader = "";
    $default_open = "opened";
    $thiscategory_id = requestIdParam();
    $thiscategory = Categories::FindById($thiscategory_id);
    if (is_object($thiscategory)) {
        $default_open = "";
        $extraheader = "from “" . $thiscategory->display_name . "”";
        $entries = $thiscategory->getEntries(false, false);
    }
    ?>
	
	<div id="edit-header" class="entrynav">		
		<div class="nav-left column">
			<h1>Edit <?php 
    echo ucwords(BLOG_STATIC_AREA);
    ?>
 Entries <?php 
    echo $extraheader . ' :: <a href="' . get_link(BLOG_STATIC_AREA) . '" title="Click to View All Entries">View Entries</a>';
    ?>
</h1>
		</div>
		<div class="nav-right column">
			<a class="hcd_button" href="<?php 
    echo get_link("/admin/edit_entry/add");
    ?>
">Add an Entry</a>
			<a class="hcd_button" href="<?php 
    echo get_link("/admin/list_categories/");
    ?>
">Edit Categories</a>
			<a class="hcd_button" href="<?php 
    echo get_link("/admin/add_category/");
    ?>
">Add a Category</a>
		</div>
		<div class="clearleft"></div>
	</div>
	
	<ul id="sort-list" class="menu tabs">
		<li><a class="<?php 
    echo $default_open;
    ?>
" href="<?php 
    echo get_link("admin/list_entries/");
    ?>
">All Categories</a></li><?php 
    foreach ($categories as $category) {
        $posts = $category->getEntries(false, false);
        if (count($posts) > 0) {
            $openclass = $category->id == $thiscategory_id ? "opened" : "";
            echo "<li><a class=\"{$openclass}\" href=\"" . get_link("admin/list_entries/" . $category->id) . "\">{$category->display_name}</a></li>";
        }
    }
    ?>
	
	</ul>
	<div class="clearleft"></div>
	
<?php 
    if (count($entries) > 0) {
        ?>
	<div id="table-header" class="entries">
		<strong class="item-link">Entry Name</strong>
		<span class="item-public">Public</span>
		<span class="item-created">Publication Date</span>
		<span class="item-revised">Author</span>
	</div>
	
	<ul id="listitems" class="managelist">
	<?php 
        foreach ($entries as $entry) {
            $blogyear_month = parseDate($entry->date, "Y-m");
            $blogyear = parseDate($entry->date, "Y");
            $blogmonth = parseDate($entry->date, "F");
            if ($blogyear_month != $year_month) {
                echo "\t\t<li class=\"monthname\">{$blogmonth} {$blogyear}</li>";
                $year_month = $blogyear_month;
                $year = $blogyear;
                $month = $blogmonth;
            }
            $public = $entry->public ? "" : "<span class=\"red\">(not public)</span>";
            echo "\t\t<li>\n\t\t\t\t<a class=\"item-link\" href=\"" . get_link("/admin/edit_entry/{$entry->id}") . "\">{$entry->title}</a>\n\t\t\t\t<span class=\"item-public\">{$public}</span>\n\t\t\t\t<span class=\"item-created\">" . formatDateTimeView($entry->date) . "</span>\n\t\t\t\t<span class=\"item-revised\">" . $entry->get_author() . "</span>\n\t\t\t</li>\n";
        }
        ?>

	</ul>
<?php 
    } else {
        echo "\t\t<h3 class=\"empty-list\">There are no " . BLOG_STATIC_AREA . " entries to edit. <a class=\"short\" href=\"" . get_link("admin/add_entry") . "\">Add one if you like</a>.</h3>";
    }
}
示例#2
0
						<h4>Pages</h4>
						<a href="<?php 
echo get_link("admin/list_pages");
?>
">Edit Areas/Pages</a>
						<a href="<?php 
echo get_link("admin/add_page");
?>
">Add a new Page</a>  
						<a href="<?php 
echo get_link("admin/edit_area/add");
?>
">Add a new Area</a>  
					<?php 
if (BLOG_INSTALL) {
    $blog = Blogs::FindById(1);
    if (is_object($blog)) {
        ?>
					
						<h4><?php 
        echo ucwords(BLOG_STATIC_AREA);
        ?>
</h4>
						<a href="<?php 
        echo get_link("/admin/list_entries/");
        ?>
">Edit <?php 
        echo ucwords(BLOG_STATIC_AREA);
        ?>
 Entries</a>
						<a href="<?php 
示例#3
0
function display_page_content()
{
    // Define a function to draw a post... easiest way to manage the output in one place
    function get_entry($thisentry, $link = true, $excerpt = false, $current_user = '')
    {
        $categories = $thisentry->get_categories() != '' ? ' in ' . $thisentry->get_categories() : '';
        $entry = '<article class="entry typography"><header>';
        // If there is an image
        if ($thisentry->template == 'with-image') {
            echo '<p>image</p>';
        }
        if ($link) {
            $entry .= '<h1 class="entry--title"><a href="' . $thisentry->get_url() . '">' . $thisentry->get_title() . '</a></h1>';
        } else {
            $entry .= '<h1 class="entry--title">' . $thisentry->get_title() . '</h1>';
        }
        // If an admin is logged in, set these flags so they can see new posts in the stream.
        if (empty($current_user)) {
            $public = $future = '';
        } else {
            $public = $thisentry->public ? '' : '<span class="entry--notpublic">Not Public</span> ';
            $future = $thisentry->date > date('Y-m-d h:i:s') ? '<span class="entry--future">Future Dated</span> ' : '';
        }
        $entry .= '<p class="entry--date-posted">' . $future . $public . ' <time datetime="' . $thisentry->get_pubdate("c") . '">' . $thisentry->get_pubdate('F j, Y') . '</time>' . $categories . '</p>';
        $entry .= '</header>';
        $entry .= '<div class="entry--content">';
        if ($excerpt) {
            // This preserves HTML and HCD images, but chops on a paragraph and adds a read more.
            $entry .= $thisentry->chopForBlogDigest(480, 'Read the Entire Post');
        } else {
            $entry .= $thisentry->get_content();
        }
        $entry .= '</div></article>' . "\n";
        return $entry;
    }
    function the_entry($thisentry, $link = true, $excerpt = false, $current_user = '')
    {
        echo get_entry($thisentry, $link, $excerpt, $current_user);
    }
    // Start the template
    /* This include sets the following: 
     * $page, $area or $area->is_portfolioarea(), is_object( $current_user )
     * $page_title, $description, $bodyclass, $template
     * getRequestVarAtIndex()s = $var0, $var1, $var2, $var3
     * isset( $blogarea ), isset( $category ), isset( $blogitem )
     */
    $area = Areas::FindById(3);
    include_once snippetPath("header");
    // Still need this to build the navigation and for previous and next posts
    $the_blog = Blogs::FindById(1);
    $entries_per_page = 8;
    $breadcrumbs = '<div class="breadcrumbs"><a class="breadcrumbs--link" href="' . BASEHREF . '">Home</a> <span class="breadcrumbs--sep">&raquo;</span> <a class="breadcrumbs--link" href="' . get_link(BLOG_STATIC_AREA) . '">' . $area->get_title() . '</a>';
    if (!empty($blogitem)) {
        $title = $blogitem->get_title();
        $breadcrumbs .= ' <span class="breadcrumbs--sep">&raquo;</span> <span class="breadcrumbs--link__active">' . chopText($title, 36, ' ') . '&hellip;</span>';
    }
    $breadcrumbs .= '</div>';
    ?>
                        
                        <?php 
    echo $breadcrumbs;
    ?>
                        
                        <div class="default-col">
                        
                            <section class="column" role="main">  
                                <div class="content--main">
<?php 
    // Single post
    if (!empty($blogitem)) {
        $singleentry = get_entry($blogitem, false, false, $current_user);
        $singleentry .= '<footer class="prevnext prevnext__entry" role="navigation"><ul class="prevnext--list menu">';
        // Previous entry link
        $prev = $the_blog->getPrevEntry($blogitem->date);
        $singleentry .= '<li class="prevnext--previous">';
        if (!empty($prev)) {
            $singleentry .= '<a class="prevnext--link prevnext--link__prev" href="' . $prev->get_URL() . '"><h4 class="prevnext--label">Previous:</h4><h2 class="prevnext--title">' . $prev->get_title() . '</h2></a>';
        } else {
            $singleentry .= '&nbsp;';
        }
        $singleentry .= '</li>';
        // Next entry link
        $next = $the_blog->getNextEntry($blogitem->date);
        $singleentry .= '<li class="prevnext--next">';
        if (!empty($next)) {
            $singleentry .= '<a class="prevnext--link prevnext--link__next" href="' . $next->get_URL() . '"><h4 class="prevnext--label">Next</h4><h2 class="prevnext--title">' . $next->get_title() . '</h2></a></li>';
        } else {
            $singleentry .= '&nbsp;';
        }
        $singleentry .= '</li></ul></footer>';
        echo $singleentry;
    } else {
        // Landing page or Filtered page
        echo '<div class="entry--wrapper">';
        $public = is_object($current_user) ? false : true;
        // Check for category
        if (isset($category)) {
            $pagenum = '';
            $entries = $category->getEntries();
            echo '<header class="category--header">';
            $category->the_title('<h1 class="category--title">Posts in <b>&ldquo;', '&rdquo;</b></h1>');
            echo '</header>' . "\n";
            // Check for Year archive
        } elseif ($var1 == 'year' and is_numeric($var2)) {
            $pagenum = '';
            $entries = Blog_Entries::FindByYear($var2, $public);
            echo '<header class="category--header">';
            echo '<h1 class="category--title">Posts from <b>' . $var2 . '</b></h1>';
            echo '</header>' . "\n";
            // Not a category landing page, not a year archive, and not a single item, so, this is the blog landing page
        } else {
            $pagenum = $var1 == "page" ? $var2 : 1;
            $entries = Blog_Entries::FindByPagination($entries_per_page, $pagenum, $public);
        }
        // The list of articles if there is not a single article present
        foreach ($entries as $entry) {
            the_entry($entry, true, true, $current_user);
        }
        // Add some pagination
        if (!empty($pagenum)) {
            ?>

                                    <footer class="pagination">
                                        <ul class="pagination--list menu">
                                        <?php 
            $lastpage = Blog_Entries::FindLastPage($entries_per_page, $public);
            $numbernav = "";
            if ($pagenum > 1) {
                $numbernav .= '<li class="pagination--listitem"><a class="pagination--link pagination--link__prev" href="' . get_link(BLOG_STATIC_AREA . "/page/" . ($pagenum - 1)) . '" title="View Newer Posts">&#9664;</a></li>';
            }
            $counter = 1;
            while ($counter <= $lastpage) {
                $thispage = $counter == $pagenum ? ' pagination--link__disabled' : '';
                $numbernav .= '<li class="pagination--listitem"><a class="pagination--link' . $thispage . '" href="' . get_link(BLOG_STATIC_AREA . "/page/" . $counter) . '">' . $counter . '</a></li>';
                $counter++;
            }
            if ($pagenum != $lastpage) {
                $numbernav .= '<li class="pagination--listitem"><a class="pagination--link pagination--link__next" href="' . get_link(BLOG_STATIC_AREA . "/page/" . ($pagenum + 1)) . '" title="View Older Posts">&#9654;</a></li>';
            }
            echo $numbernav;
            ?>
                                        
                                        </ul>
                                    </footer> 
<?php 
        }
        echo '</div><!-- end .entry--wrapper -->';
    }
    // end if
    ?>
 

                                </div>
                            </section>
                            
                            <aside class="content--sidebar column" role="complementary">
                            <?php 
    // List All the Categories
    // Show/Hide empty ones, show/hide the number of posts, show/hide the 'Uncategorized' category.
    $posts_by_category = $the_blog->list_categories(true, false, true);
    if (!empty($posts_by_category)) {
        echo '<div class="widget widget__categories"><h2 class="widget--title">Categories</h2>' . $posts_by_category . '</div>';
    }
    // List the unique years
    $archive = '<div class="widget widget__archive"><h2 class="widget--title">Archive</h2><ul class="widget--list menu">';
    $allyears = Blog_Entries::FindUniqueYears();
    foreach ($allyears as $year) {
        $archive .= '<li><a href="' . get_link(BLOG_STATIC_AREA . '/year/' . $year->year) . '">' . $year->year . '</a></li>';
    }
    $archive .= '</ul></div>';
    echo $archive;
    ?>
                                
                            </aside>
                        </div><!-- end .default-col -->


<?php 
    include_once snippetPath("footer");
    echo Blogs::DisplayBlogEditLinks(1, $blogitem);
}
示例#4
0
function display_page_content()
{
    // Set all values to null by default
    $entry = $entrytitle = $entrypublic = $entrydate = $entryimage = $entrycontent = $entryexcerpt = $entryauthor = $entrytemplate = $preventry = $nextentry = null;
    // Get values from existing object if this is not the Add page
    if (requestIdParam() != 'add') {
        $entry_id = requestIdParam();
        $entry = Blog_Entries::FindById($entry_id);
        $entrytitle = $entry->title;
        $entrypublic = $entry->public;
        $entrydate = $entry->getDateStart();
        if (BLOG_ENTRY_IMAGES) {
            $possibleimage = $entry->getImage();
            if (is_object($possibleimage)) {
                $entryimage = $possibleimage;
            }
        }
        $entrycontent = $entry->content;
        $entryexcerpt = $entry->excerpt;
        $entryauthor = $entry->author_id;
        $entrytemplate = $entry->template;
    }
    // Get other needed objects
    $the_blog = Blogs::FindById(BLOG_DEFAULT_ID);
    $authors = Users::FindAll();
    $categories = Categories::FindAll();
    $thisuser = Users::GetCurrentUser();
    // Get Previous and Next links
    if (is_object($entry)) {
        $preventry = $the_blog->getPrevEntry($entry->date, false);
        $nextentry = $the_blog->getNextEntry($entry->date, false);
    }
    // Warning thrown
    // Double check that the proper columns exist
    $photo_entry_id = find_db_column('photos', 'entry_id');
    if (!$photo_entry_id) {
        echo '<h2 class="system-warning"><span>HCd&gt;CMS says:</span> The Photos table does not have a column called "entry_id"</h2>';
    }
    // Language for the header
    if (is_object($entry)) {
        $header = 'Edit ' . ucwords(BLOG_STATIC_AREA) . ' Entry :: <a href="' . get_link(BLOG_STATIC_AREA . "/view/" . $entry->id . "/" . slug($entry->title)) . '" title="Click to View this Entry (save it first!)">View Entry</a>';
    } else {
        $header = 'Create new ' . ucwords(BLOG_STATIC_AREA) . ' Entry';
    }
    ?>

	<div id="edit-header" class="entrynav threecolumnnav">
		<div class="nav-left column">
			<h1><?php 
    echo $header;
    ?>
</h1>
		</div>
		<div class="nav-center column">
			<?php 
    if (!empty($preventry)) {
        ?>
<a href="<?php 
        echo get_link("/admin/edit_entry/" . $preventry->id);
        ?>
" title="<?php 
        $preventry->the_title();
        ?>
">&larr; Previous Entry</a><?php 
    }
    ?>
		</div>
		<div class="nav-right column">
			<?php 
    if (!empty($nextentry)) {
        ?>
<a href="<?php 
        echo get_link("/admin/edit_entry/" . $nextentry->id);
        ?>
" title="<?php 
        $nextentry->the_title();
        ?>
">Next Entry &rarr;</a><?php 
    }
    ?>
			
		</div>
		<div class="clearleft"></div>
	</div>
	
	<form method="POST" id="edit_entry" enctype="multipart/form-data">
		
		<p><span class="hint">If a text box is underlined in red, it is a required field</span></p>
		
		<p class="display_name">
			<label for="display_name">Title:</label>
			<span class="hint">This is the Title of the entry; how it will display in the navigation.</span><br />
			<?php 
    textField("title", $entrytitle, "required: true");
    ?>
		</p>
		
		<div id="entry_date" class="column half">
			
			<p><label for="public">Public: <input type="checkbox" name="public" id="public" <?php 
    if ($entrypublic) {
        ?>
checked="checked"<?php 
    }
    ?>
></label> &nbsp; <span class="hint">Visible or not visible to the public? If you are working on an entry that is not yet ready, leave this off until it is complete. </span></p>
			
			<p>
				<label for="date">Entry Date: </label>
				<input type="text" name="date" id="date" value="<?php 
    echo $entrydate;
    ?>
" />
			</p>
        
        <?php 
    if (!BLOG_ENTRY_IMAGES) {
        ?>
		</div>
		<div class="column half last">
		<?php 
    }
    ?>
        
			<p>
				<label for="author_id">Author:</label> &nbsp; 
				<select name="author_id" id="author_id">
				<?php 
    foreach ($authors as $theauthor) {
        $selected = $theauthor->id == $entryauthor ? ' selected="selected"' : '';
        echo "<option value=\"{$theauthor->id}\"{$selected}> " . $theauthor->get_username() . " </option>\r\n";
    }
    ?>
				
				</select>
			</p>
			
			<?php 
    if (BLOG_ENTRY_TEMPLATES) {
        ?>
			<p>
    			<label for="template">Template:</label>
    			<select id="template" name="template">
    				<?php 
        require_once snippetPath("blog_templates_array");
        foreach ($blog_templates as $template) {
            echo '<option value="' . $template . '"';
            if ($template == $entrytemplate) {
                echo ' selected="selected"';
            }
            echo '>' . $template . '</option>';
        }
        ?>
    				
    			</select>
    		</p>
    		<?php 
    }
    ?>

        <?php 
    if (BLOG_ENTRY_IMAGES) {
        ?>
		</div>
		<div id="entry-thumb" class="column half last">
			
			<!-- Entry image -->
            <div style="padding-bottom: 1em;">
                <p><label for="entry_image"><?php 
        echo empty($entryimage) ? 'Add' : 'Edit';
        ?>
 an Entry Image:</label>
    				<input type="file" name="entry_image" id="entry_image" value="" />
    			</p>
    			<p class="hint">An image may be used by your site design on landing pages or menus. </p>
			<?php 
        if (!empty($entryimage)) {
            echo '<h3>Existing Entry Image (reduced in size)</h3>';
            echo '<p><img src="' . $entryimage->getPublicUrl() . '" style="max-width:100%;" alt=""></p>';
        }
        echo '</div>';
    }
    // end if BLOG_ENTRY_IMAGES
    ?>

		</div>
		
		<p class="clearleft">
			<label for="entry_content">Content:</label><br />
			<?php 
    textArea("entry_content", $entrycontent, 98, EDIT_WINDOW_HEIGHT / 2);
    ?>
		</p>
		
<?php 
    require_once snippetPath("admin-insert_configs");
    ?>
		
		<ul id="gallery-options-nav" class="menu tabs">
			<li><a href="#section_selector" class="openclose opened">Edit Categories for this Entry</a></li>
		</ul>
		<div id="section_selector" class="dropslide">
			<h2><legend>Select a Category to include this Entry in:</legend></h2>
			<fieldset>
				<p>
			<?php 
    $entrycats = is_object($entry) ? $entry->getCategories() : false;
    foreach ($categories as $thecategory) {
        $checked = "";
        if ($entrycats) {
            foreach ($entrycats as $entry_cat) {
                if ($thecategory->id == $entry_cat->id) {
                    $checked = ' checked="checked"';
                }
            }
        }
        echo '<label for="' . slug($thecategory->display_name) . '">' . $thecategory->display_name . '&nbsp;';
        echo '<input name="selected_cats[]" id="' . slug($thecategory->display_name) . '" class="boxes"' . $checked . ' type="checkbox" value="' . $thecategory->id . '" /></label>';
    }
    ?>
				
				</p>					
				<p><span class="hint">Any entry can be in more than one Category. If no categories are selected, this entry will be categorized in the default &ldquo;Uncategorized&rdquo; category.</span></p>
			</fieldset>
		</div><!-- #section_selector -->
        
        
        <p class="clearleft">
			<label for="entry_excerpt">Excerpt:</label><br />
			<?php 
    textArea("entry_excerpt", $entryexcerpt, 98, EDIT_WINDOW_HEIGHT / 3);
    ?>
			<p><span class="hint"><i>Optional:</i> An excerpt is commonly used on landing pages or in special areas, like the meta (SEO) description. Keep it short and limit the use of HTML.</span></p>
		</p>
		
		
		<div id="edit-footer" class="entrynav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Save Entry"> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Save and Return to List">
				</p>
				
			</div>
			<div class="column half last">
			
				<p>
				<?php 
    if (is_object($entry)) {
        ?>
					<label for="delete">Delete this entry?</label>
					<input name="delete" class="boxes" type="checkbox" value='<?php 
        echo $entry->id;
        ?>
' />
					<span class="hint">Check the box and then click &ldquo;Save&rdquo; above to delete this entry from the database</span>
				<?php 
    } else {
        echo '&nbsp;';
    }
    ?>
				</p>
			
			</div>
		</div>
		
	</form>
	
	<script type="text/javascript">
	    var entrydate;
		
		$().ready(function() {
			
			$( "#date" ).datetimepicker({
    			showButtonPanel: true,
    			showOtherMonths: true,
    			selectOtherMonths: true,
    			timeFormat: 'hh:mm:ss tt',
    			stepMinute: 5
    		});

			$("#edit_entry").validate({
				rules: {
					title: "required",
				},
				messages: {
					title: "Please enter a title for this <?php 
    echo BLOG_STATIC_AREA;
    ?>
 entry",
				}
			});
		});
	</script>
	
<?php 
}
示例#5
0
 function DisplayBlogEditLinks($the_blog = "", $entry = "", $additional_button = "")
 {
     if (!$the_blog) {
         $the_blog = Blogs::FindById("1");
     }
     if (IsUserLoggedIn()) {
         echo "<div id=\"admin-pane-controls\">\n";
         echo "\t<h3>Admin Controls:</h3>\n";
         echo "\t<a href=\"" . get_link("admin/list_entries/") . "\">List Blog Entries</a>\n";
         if ($entry) {
             echo "\t<a href=\"" . get_link("admin/edit_entry/" . $entry->id) . "\">Edit this Entry</a>\n";
         }
         echo "\t<a href=\"" . get_link("admin/edit_entry/add") . "\">Add an Entry</a>\n";
         if ($additional_button != "") {
             echo $additional_button;
         }
         echo "\t<a href=\"" . get_link("admin/logout") . "\">Logout</a>\n";
         echo "</div>\n";
     }
 }
示例#6
0
function display_page_content()
{
    $isoLastModifiedSite = "";
    $newLine = "\n";
    $indent = " ";
    $rootUrl = "http://" . SITE_URL;
    $xmlHeader = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>{$newLine}";
    $urlsetOpen = "<urlset xmlns=\"http://www.google.com/schemas/sitemap/0.84\"\n\txmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n\txsi:schemaLocation=\"http://www.google.com/schemas/sitemap/0.84\n\thttp://www.google.com/schemas/sitemap/0.84/sitemap.xsd\">{$newLine}";
    $urlsetValue = "";
    $urlsetClose = "</urlset>";
    function makeUrlString($urlString)
    {
        return htmlentities($urlString, ENT_QUOTES, 'UTF-8');
    }
    function makeIso8601TimeStamp($dateTime)
    {
        if (!$dateTime) {
            $dateTime = date('Y-m-d H:i:s');
        }
        if (is_numeric(substr($dateTime, 11, 1))) {
            $isoTS = substr($dateTime, 0, 10) . "T" . substr($dateTime, 11, 8) . "+00:00";
        } else {
            $isoTS = substr($dateTime, 0, 10);
        }
        return $isoTS;
    }
    function makeUrlTag($url, $modifiedDateTime, $changeFrequency, $priority)
    {
        global $newLine;
        global $indent;
        global $isoLastModifiedSite;
        $urlOpen = "{$indent}<url>{$newLine}";
        $urlValue = "";
        $urlClose = "{$indent}</url>{$newLine}";
        $locOpen = "{$indent}{$indent}<loc>";
        $locValue = "";
        $locClose = "</loc>{$newLine}";
        $lastmodOpen = "{$indent}{$indent}<lastmod>";
        $lastmodValue = "";
        $lastmodClose = "</lastmod>{$newLine}";
        $changefreqOpen = "{$indent}{$indent}<changefreq>";
        $changefreqValue = "";
        $changefreqClose = "</changefreq>{$newLine}";
        $priorityOpen = "{$indent}{$indent}<priority>";
        $priorityValue = "";
        $priorityClose = "</priority>{$newLine}";
        $urlTag = $urlOpen;
        $urlValue = $locOpen . makeUrlString("{$url}") . $locClose;
        if ($modifiedDateTime) {
            $urlValue .= $lastmodOpen . makeIso8601TimeStamp($modifiedDateTime) . $lastmodClose;
            if (!$isoLastModifiedSite) {
                // last modification of web site
                $isoLastModifiedSite = makeIso8601TimeStamp($modifiedDateTime);
            }
        }
        if ($changeFrequency) {
            $urlValue .= $changefreqOpen . $changeFrequency . $changefreqClose;
        }
        if ($priority) {
            $urlValue .= $priorityOpen . $priority . $priorityClose;
        }
        $urlTag .= $urlValue;
        $urlTag .= $urlClose;
        return $urlTag;
    }
    if (BLOG_INSTALL) {
        $blog_id = "1";
        $the_blog = Blogs::FindById($blog_id);
    }
    if (PORTFOLIO_INSTALL) {
        $sections = Sections::FindPublicSections();
    }
    $areas = Areas::FindPublicAreas();
    //$pageLastModified = date('Y-m-d H:i:s');
    // Today last month instead of today's date
    $pageLastModified = date("Y-m-d H:i:s", mktime(date("H"), date("i"), date("s"), date("m") - 1, date("d"), date("Y")));
    $pageChangeFrequency = "monthly";
    $pagePriority = 0.6;
    $urlsetValue .= makeUrlTag($rootUrl, $pageLastModified, $pageChangeFrequency, 1);
    foreach ($areas as $area) {
        if ($area->name == "site_blog" && BLOG_INSTALL) {
            $urlsetValue .= makeUrlTag($rootUrl . get_link(BLOG_STATIC_AREA . "/view/"), $pageLastModified, $pageChangeFrequency, 1);
            $entries = $the_blog->getEntries();
            foreach ($entries as $entry) {
                $urlsetValue .= makeUrlTag($rootUrl . $entry->get_url(), $entry->get_pubdate("Y-m-d H:i:s"), $pageChangeFrequency, $pagePriority);
            }
        } else {
            if (strstr($area->name, "-portfolio") && PORTFOLIO_INSTALL) {
                $first = true;
                foreach ($sections as $index => $menu_section) {
                    if ($first) {
                        $pagePriority = 1;
                        $first = false;
                    } else {
                        $pagePriority = 0.6;
                    }
                    if ($menu_section->name != "") {
                        $changedate = !is_null($menu_section->date_revised) ? formatDateTimeView($menu_section->date_revised, "Y-m-d H:i:s") : $pageLastModified;
                        $urlsetValue .= makeUrlTag($rootUrl . $menu_section->get_url($area), $changedate, $pageChangeFrequency, $pagePriority);
                        $items = $menu_section->findItems();
                        foreach ($items as $item) {
                            $changedate = !is_null($item->date_revised) ? formatDateTimeView($item->date_revised, "Y-m-d H:i:s") : $pageLastModified;
                            $urlsetValue .= makeUrlTag($rootUrl . $item->get_url($area, $menu_section), $changedate, $pageChangeFrequency, $pagePriority);
                        }
                    }
                }
            } else {
                if ($area->name != "") {
                    $pages = $area->findPages();
                    $first = true;
                    foreach ($pages as $page) {
                        if ($first) {
                            $pagePriority = 1;
                            $first = false;
                        } else {
                            $pagePriority = 0.6;
                        }
                        $urlsetValue .= makeUrlTag($rootUrl . $page->get_url($area), $pageLastModified, $pageChangeFrequency, $pagePriority);
                    }
                }
            }
        }
    }
    header('Content-type: application/xml; charset="utf-8"', true);
    print "{$xmlHeader}\n\t{$urlsetOpen}\n\t{$urlsetValue}\n\t{$urlsetClose}";
}
示例#7
0
<?php

// THIS ONE DOES IT ALL!! modify, simplify as needed. Format is for sliding menus, with counter for a li.first
$area = get_content_area();
$areas = Areas::FindPublicAreas();
$open_page = $var1;
if (PORTFOLIO_INSTALL && $area->is_portfolioarea()) {
    $thissection = $page;
    $open_section = $var1;
}
if (BLOG_INSTALL) {
    $blog_id = "1";
    $the_blog = Blogs::FindById($blog_id);
}
// We use this if statement to try and feed the javascript which menu to leave open
if (getRequestVarAtIndex() == "events") {
    $whereat = "";
} elseif (is_object($area)) {
    $whereat = "area_" . $area->name;
} else {
    $whereat = "area_" . $var0;
}
?>

<script type="text/javascript">
	//<![CDATA[
	function alreadyOpen(ul_id)
	{
		$('ul#' + ul_id).show();
		return true;
	}