Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 09:06:40 PM

Login with username, password and session length
Search:     Advanced search
Interested in joining the WebsiteBaker team?
For more Information read here or on our new website.
155553 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: [1]   Go Down
Print
Author Topic: Sitemap  (Read 1684 times)
hudge

Offline Offline

Posts: 174


WWW
« on: January 28, 2005, 08:59:32 AM »

can someone make a mod or script for a sitemap page. I would assume it would be something like how the ALLCSS menu works. (showing full expansion)

Stefan you got any ideas on this?
Logged

: Member of the Baker's Dozen :
Baking at 350˚ for 2 hours now...
Ryan

Offline Offline

Posts: 2048



WWW
« Reply #1 on: January 28, 2005, 09:26:27 AM »

It should be easy to just steal the code from the "All CSS" template and place it in a code page. Cool
Logged

Website Baker Project Founder
www.websitebaker.or g

To contact me via email, visit:
www.ryandjurovich.c om
Stefan
Guest
« Reply #2 on: January 29, 2005, 11:29:31 AM »

Because of the way the code page is evaluated, you cannot simply cut'n'paste ("<?php" tags are not permitted, you have to echo out html code). But here is working code for the simplest imaginable sitemap. Just create a page (or section) "Code" and paste it.

Code:

function site_map($parent) {
global $database;
global $page_id;
// Query pages
$query_menu = $database->query("SELECT page_id,menu_title,link,target,level FROM ".TABLE_PREFIX."pages WHERE parent = '$parent' ORDER BY position ASC");
// Check if there are any pages to show
if($query_menu->numRows() > 0) {
// Loop through pages
while($page = $query_menu->fetchRow()) {
$pad=$page['level']*8;
echo '<li style="padding-left: '.$pad.'px;';
if($page['level'] == 0)  echo 'font-weight: bold;';
echo '"><a href="'.page_link($page['link']).'" target="'.$page['target'].'">';
echo $page['menu_title'];
echo '</a></li>';
site_map($page['page_id']);
}
}
}
echo '<ul style="list-style: none;">';
site_map(0);
echo '</ul>';


Maybe this would be something for our scripts collection.

[EDIT: I changed the name of the function because of possible conflicts with the menu code!]
Logged
hudge

Offline Offline

Posts: 174


WWW
« Reply #3 on: January 29, 2005, 11:35:48 AM »

thanks stefan. I sent you an email. Ryan is making one that I think we all will like. sorrry for wasting your time.
Logged

: Member of the Baker's Dozen :
Baking at 350˚ for 2 hours now...
Pages: [1]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!