Highlight active link on dynamic pages


I am trying to customize a site that is I quess what you would call dynamic. The tool creates pages, but there are no real pages all stored in the database. The pages are all index.php…pageid=1, etc.

I am trying to make the active link or the tab for the current page have a different appearence so people understand which page they are on. I understand the CSS of id=current or setting the class=current, but I can’t set that for each page since their realy is no page and I don’t have a different body tag even for each pages. The index.php pulls from several html pages and a css file. There is no page to use traditional css active link methods

I have been searching for several days for and seen some php code that looked like it might work, but I am not a php person. The code was something like <? if home==pageid echo id=current> Not really php code, but that was the concept. I tried it in several places without luck. I think the php code was for another opensource software. The ideas seamed sound though. Maybe it wouldn’t work because I placed in an html file.

Can anyone help me set a php string for each of the links in my main.html file so that it will read and create an active link style for dynamic pages.

if it would help the site I am working on is http://www.leland-realestate.com
and the software is open-reality, but their site has been no help.

It sounds like after 2 days of searching that it could be handled easily with PHP, but I am at a loss. Any help would be appreciated!


Could you show us the code that builds your link list?


The site is setup to somehow create the page or path. The pages are setup to be dynamic, but we overrode the ability to add new pages. We simply just copy the path created and code into the main.html file which creates or controls the header.

So the admin uses fckeditor to create a page and we paste the path to that link in the header file (main.html)
for example: http://www.leland-realestate.com/index. … y&PageID=7

I will attach the index.php file and the header file. But as I said we are not allowning dynamic addition of new pages, we are mannually adding the paths to the dynamic page path.

ok… cant attach will copy in:


<?php /** * Open-Realty * * Open-Realty is free software; you can redistribute it and/or modify * it under the terms of the Open-Realty License as published by * Transparent Technologies; either version 1 of the License, or * (at your option) any later version. * * Open-Realty is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * Open-Realty License for more details. * http://www.open-realty.org/license_info.html * * You should have received a copy of the Open-Realty License * along with Open-Realty; if not, write to Transparent Technologies * RR1 Box 162C, Kingsley, PA 18826 USA * * @author Ryan C. Bonham * @copyright Transparent Technologies 2004 * @link http://www.open-realty.org Open-Realty Project * @link http://www.transparent-tech.com Transparent Technologies * @link http://www.open-realty.org/license_info.html Open-Realty License */ // Set Error Handling to E_ALL // error_reporting(E_ALL); // This Fixes XHTML Validation issues, with PHP @ini_set('arg_separator.output', '&'); @ini_set('url_rewriter.tags', 'a=href,area=href,frame=src,input=src'); // Use Compression // @ini_set('zlib.output_compression', 'On'); session_start(); header("Cache-control: private"); //IE6 Form Refresh Fix // Make sure install file has been removed $filename = dirname(__FILE__) . '/install/index.php'; if (file_exists($filename)) { die ('
You must delete the file ' . $filename . ' before you can access your open-realty install.
'); } // Check for User Selected Language if (isset($_POST['select_users_lang'])) { session_register('users_lang'); $_SESSION['users_lang'] = $_POST['select_users_lang']; } // Register $config as a global variable global $config, $conn, $css_file; $css_file = ''; require_once(dirname(__FILE__) . '/include/common.php'); // Check that the defualt email address has been changed to something other then an open-realty.org address. $pos = strpos($config['admin_email'], 'open-realty.org'); $pos2 = strpos($config['admin_email'], 'changeme@default.com'); if ($pos !== false || $pos2 !== false) { die ('
You must set an administrative email address in the site configuration before you can use your site.
'); } // Add GetMicroTime Function require_once($config['basepath'] . '/include/misc.inc.php'); $misc = new misc(); $start_time = $misc->getmicrotime(); // Start OutPut Buffer ob_start(); if (!isset($_GET['printer_friendly'])) { $_GET['printer_friendly'] = false; } // Determine which Language File to Use if (isset($_SESSION["users_lang"]) && $_SESSION["users_lang"] != $config['lang']) { include($config['basepath'] . '/include/language/' . $_SESSION['users_lang'] . '/lang.inc.php'); }else { // Use Sites Defualt Language unset($_SESSION["users_lang"]); include($config['basepath'] . '/include/language/' . $config['lang'] . '/lang.inc.php'); } if (isset($_GET['action']) && $_GET['action'] == 'logout') { require_once($config['basepath'] . '/include/login.inc.php'); $login = new login(); $login->log_out('user'); }elseif (!isset($_GET['action'])) { $_GET['action'] = 'index'; } require_once($config['basepath'] . '/include/class/template/core.inc.php'); if (isset($_GET['popup'])) { $page = new page_user; $page->load_page($config['template_path'] . '/popup.html'); }elseif (isset($_GET['printer_friendly']) && $_GET['printer_friendly'] == 'yes') { $page = new page_user; $page->load_page($config['template_path'] . '/printer_friendly.html'); }else { $page = new page_user; if (isset($_GET['PageID']) && file_exists($config['template_path'] . '/page' . $_GET['PageID'] . '_main.html')) { $page->load_page($config['template_path'] . '/page' . $_GET['PageID'] . '_main.html'); }elseif ($_GET['action'] == 'index' && file_exists($config['template_path'] . '/page1_main.html')) { $page->load_page($config['template_path'] . '/page1_main.html'); }else { $page->load_page($config['template_path'] . '/main.html'); } } // Allow Addons/Functions to pass back custom jscript. global $jscript,$jscript_last; $jscript = ''; $jscript_last = ''; //Load Content $page->replace_tags(array('content')); //Replace Permission tags first $page->replace_permission_tags(); $page->replace_urls(); $page->auto_replace_tags(); // Load js last to make sure all custom js was added $page->replace_tags(array('load_js','load_js_last')); //Replace Languages $page->replace_lang_template_tags(); $page->replace_css_template_tags(); $page->replace_meta_template_tags(); $page->output_page(); $conn->Close(); // Close Buffer $buffer = ob_get_contents(); ob_end_clean(); echo $buffer; // Display TIme $end_time = $misc->getmicrotime(); $render_time = sprintf('%.3f', $end_time - $start_time); echo ''; ?>

HEADER FILE main.html:

{load_meta_keywords} {load_meta_description} {load_css_style} {load_css_editor} {site_title} {load_js}
Premier, Personalized Real Estate Click for the latest Leland weather forecast.

<!--<a href="index.php"><div class="logo"></a>
	<div class="slogan"><i>Premier. Personalized Real Estate</i></div>
	<div id="navcontainer">
					<ul id="navlist">
					<li><a href="{baseurl}/index.php" title="Home">HOME</a></li>
						<li><a href="{baseurl}/index.php?action=search_step_2&amp;pclass[]=1" title="Homes">LISTINGS</a></li>
						<li><a href="{page_link_3}" title="OUR TEAM">OUR TEAM</a</li>
						<li><a href="{url_search}" title="Search Listings">TERMS</a></li>
						<li><a href="{url_search}" title="GET READY">GET READY</a></li>
						<li><a href="{baseurl}/index.php?action=search_step_2&amp;pclass[]=1" title="Homes">THE REGION</a></li>
						<li><a href="{baseurl}/index.php?action=page_display&PageID=2">CONTACT US</a></li>	
<div id="outer">
	<div id="inner">

		<div id="maincol">
			<div class="content">
				<!-- OR files go here -->
		<div class="clr"></div>
		<!-- close inner and outer -->
<div id="footer" >
	<div class="clr">&nbsp;</div>
	<div class="small">
		<div class="copyright" >
			&copy; 2007 Venture Properties Inc.&nbsp; All Rights Reserved<br />


<div class="clr"></div>



Sorry to say, but this is pretty clearly a 3rd-party script. We do not support them here. I can only recommend trying to contact the person or company in which this created by and see if they couldn’t help.