Re: search plugin
If you can show us what's in your layout, we might be able to help.
"old" site - 0.6.0 RC1 - belv.xlphp.net
Home Page - body
<h2>Web Site For You</h2>
<div id="mainText"> Many business owners still operate without a web presence. Most of them will tell you they don't need a web site because their business is already going well. Then I remind them about the threat of losing business because they can not be reached on the web...</div>
<div id="mainPic" class="floatleft">
<div class="newsPic">
<div class="picStyle"><a href="<?php echo URL_PUBLIC; ?>"><img alt="#1" width="272" height="190" src="<?php echo URL_PUBLIC; ?>/public/themes/freelance/images/01.jpg" /></a></div>
</div>
<div class="newsPic">
<div class="picStyle"><a href="<?php echo URL_PUBLIC; ?>"><img alt="#2" width="272" height="190" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/02.jpg" /></a></div>
</div>
<div class="newsPic">
<div class="picStyle"><a href="<?php echo URL_PUBLIC; ?>"><img alt="#3" width="272" height="190" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/03.jpg" /></a></div>
</div>
<div class="newsPic">
<div class="picStyle"><a href="<?php echo URL_PUBLIC; ?>"><img alt="#4" width="272" height="190" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/04.gif" /></a></div>
</div>
<div class="newsPic">
<div class="picStyle"><a href="<?php echo URL_PUBLIC; ?>"><img alt="#5" width="272" height="190" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/05.gif" /></a></div>
</div>
<div class="newsPic">
<div class="picStyle"><a href="<?php echo URL_PUBLIC; ?>"><img alt="#6" width="272" height="190" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/06.gif" /></a></div>
</div>
</div>
<p style="margin-left: 295px"><strong style="color: #4088b8">The website it is not luxury, it is means of advancement of your business!</strong> While having a web site is not an end all for marketing your business, it is something that modern consumers expect and will use if available. Potential customers expect businesses to keep up with the times and a website can help you do that. Expansion is another reason for a web site. Most small businesses cannot afford to expand significantly.With a well managed web site you can have a business presence that is world wide...
<p class="readmore"><a href="<?php echo URL_PUBLIC; ?>">Read more</a> »</p>
<h2>Software For You</h2>
<p>Are you looking for a WordPress theme version of this template? Or maybe a version that is ported for Textpattern, Etomite, MODx, Blogger or some other <a href="http://solucija.com/">great content management system</a> or blog engine? Then check out my <a href="http://andreasviklund.com/templates/themes">ports and themes page</a> to see if there are any version available that you can use. If you make a port yourself, please let me know so I can your version to the list.</p>
<p class="readmore"><a href="<?php echo URL_PUBLIC; ?>">Read more</a> »</p>
<p class="box"><strong>Note:</strong> Contact me at the email address valerib@012.net.il or call at 0545-237689. Just send me information about your business and what you have in mind and I will submit a complete proposal by email. There is no obligation. Thanks.
<a href="<?php echo URL_PUBLIC; ?>?price_estimate.php">Get a free price estimate</a> »</p>Home Page – sidebar
<div id="searchframe">
<form action="/?search-results<?php echo URL_SUFFIX;?>#listing" method="post" id="searchbox">
<input type="text" name="search" id="search" value="<?php echo strip_tags($_POST['search']);?>" />
<input type="submit" name="searchsubmit" value="search" class="submit" /></form>
</div>
Search results
<a name="listing"></a>
<?php
if (isset($_POST['search'])){
$searchcriteria = $_POST['search'];
if($searchcriteria != NULL && preg_match('#^[a-z0-9\x20]+$#i', $searchcriteria)){
echo $this->includeSnippet('sitesearch');
}else{
echo "<p>Please input a search criteria.</p>";
}
}
?>
Contact
<?php TB_Contactform('valerib@012.net.il', 'admin@belv.xlphp.net', 'Your message was sent successfully', 'Please allow up to 24 hours for a reply.'); ?>
Layout-main (for Home Page)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "[url]http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd[/url]">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Carmel Software - Freelance Web Designer and Database Developer in Haifa, Israel - <?php echo $this->title(); ?></title>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
<meta name="robots" content="index, follow" />
<meta name="description" content="<?php echo ($this->description() != '') ? $this->description() : 'Homepage Carmel Software'; ?>" />
<meta name="keywords" content="<?php echo ($this->keywords() != '') ? $this->keywords() : 'theme, graphique, css, template, frog'; ?>" />
<meta name="author" content="Carmel Software" />
<link rel="favourites icon" href="<?php echo URL_PUBLIC; ?>favicon.ico" />
<link rel="canonical" href="<?php echo $this->url(); ?>" />
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="<?php echo URL_PUBLIC; ?>public/themes/freelance/style.css" title="800px css style" media="screen,projection" />
<link rel="stylesheet" type="text/css" href="<?php echo URL_PUBLIC; ?>public/themes/freelance/contact.css" title="contact_form css style" media="screen,projection" />
<!-- Javascript -->
<script type="text/javascript" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/js/jquery.js"></script>
<script type="text/javascript" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/js/jquery.innerfade.js"></script>
<script type="text/javascript" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/js/slide.js"></script>
</head>
<body>
<noscript>
<center><table border="0" style="height: 100%; width: 100%; right: 1%; left: 1%; background: #F5E391; position: fixed">
<tr><td align="center">
<div style="position: fixed; font-size: 18px; z-index: 2; cursor: help; background: #F5E391; width: 480px; color: black; padding: 5px 5px 5px 5px; border: 1px solid; border-color: #000000; height: auto; text-align: left; left: 20%">
<span style="font: bold 20px Arial; color:#000000; background: #F5E391; vertical-align: middle">NO SCRIPT ERROR:</span><br />
Sorry this site will not function properly without the use of scripts.
The scripts are safe and will not harm your computer in anyway.
Adjust your settings to allow scripts for this site and reload the site.</div>
</td></tr></table></center>
</noscript>
<div id="wrap">
<div id="header">
<p id="toplinks">
<a href="<?php echo URL_PUBLIC; ?>?"><img src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/home.gif" alt="Home" /> Home</a> |
<a href="<?php echo BASE_URL; ?>sitemap"><img src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/sitemap.gif" alt="Sitemap" /> Sitemap</a> |
<a href="<?php echo URL_PUBLIC; ?>?contact.html"><img src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/contact.gif" alt="Contact" /> Contact</a>
</p>
<h1><a href="<?php echo URL_PUBLIC; ?>">Carmel<span class="fade"> Software</span></a></h1>
<p id="slogan">software development and webdesign</p>
</div> <!--/Header-->
<!--main section-->
<div id="content">
<?php echo $this->content(); ?>
<?php if ($this->hasContent('extended')) echo $this->content('extended'); ?>
</div>
<!--/main section-->
<div id="sidebar">
<h2>Welcome!</h2>
<p> My name is Valeri and I am freelance software developer and websites builder. Not matter where you are in the world, and who you are, I can help you to take your business online,
I can help to solve your computer problems quickly and for a moderate payment...</p>
<p class="readmore"><a href="styles.html">Read more</a> »</p>
<h2>Pages:</h2>
<ul>
<li><a href="#">About</a></li>
<li><a href="#">Site's Gallery</a></li>
<li><a href="#">Services:</a>
<ul>
<li><a href="#">Sites</a></li>
<li><a href="#">Software</a></li>
</ul></li>
<li><a href="#">Price estimate</a></li>
<li><a href="?contact.html">Contact</a></li>
<li><a class="hide" href="#header">Back to top</a></li>
</ul>
<h2>Links:</h2>
<ul class="links">
<li><a href="http://andreasviklund.com/templates/">Free templates</a></li>
<li><a href="http://www.onderhond.com/tools/ie6fixer/">IE6 CSS Fixer</a></li>
<li><a href="http://www.andybudd.com/archives/2006/10/7_habits_of_a_highly_successful_freelance_web_designer/">Andy Budd article</a></li>
<li><a href="http://www.flickr.com/">Flickr - Photo Sharing</a></li>
<li><a href="http://oswd.org">del.icio.us - bookmarks </a></li>
</ul>
<h2>Site Search:</h2>
<?php echo $this->content('sidebar', true); ?>
</div> <!--/sidebar-->
<!--footer-->
<div id="footer">
<p class="footer-left"><a href="#header">Back to top</a></p>
<p><a href="<?php echo URL_PUBLIC; ?>">Home</a> | <a href="#">About</a> | <a href="#">Services</a> | <a href="#">Portfolio</a> |
<a href="<?php echo URL_PUBLIC; ?>?contact.html">Contact</a> | <a href="<?php echo URL_PUBLIC; ?>admin">Administrator</a> <br />
Carmel Software © 2009 | Thanks to <a href="http://andreasviklund.com/">Andreas Viklund</a> | Based on<a href="http://www.wolfcms.org" rel="external"> Wolf CMS</a> technology</p>
</div><!--/footer-->
</div>
</body>
</html> Layout-additional(for pages Contact, Seach results, etc)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "[url]http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd[/url]">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Carmel Software - Freelance Web Designer and Database Developer in Haifa, Israel - <?php echo $this->title(); ?></title>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="robots" content="index, follow" />
<meta name="description" content="<?php echo ($this->description() != '') ? $this->description() : 'Homepage Carmel Software'; ?>" />
<meta name="keywords" content="<?php echo ($this->keywords() != '') ? $this->keywords() : 'theme, graphique, css, template, wolf,cms'; ?>" />
<meta name="author" content="Carmel Software" />
<link rel="favourites icon" href="<?php echo URL_PUBLIC; ?>favicon.ico" />
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="<?php echo URL_PUBLIC; ?>public/themes/freelance/style.css" title="800px css style" media="screen,projection" />
<link rel="stylesheet" type="text/css" href="<?php echo URL_PUBLIC; ?>public/themes/freelance/contact.css" title="contact_form css style" media="screen,projection" />
<!-- Javascript -->
<script type="text/javascript" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/js/jquery.js"></script>
<script type="text/javascript" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/js/jquery.innerfade.js"></script>
<script type="text/javascript" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/js/slide.js"></script>
</head>
<body>
<noscript>
<center><table border="0" style="height: 100%; width: 100%; right: 1%; left: 1%; background: #F5E391; position: fixed">
<tr><td align="center">
<div style="position: fixed; font-size: 18px; z-index: 2; cursor: help; background: #F5E391; width: 480px; color: black; padding: 5px 5px 5px 5px; border: 1px solid; border-color: #000000; height: auto; text-align: left; left: 20%">
<span style="font: bold 20px Arial; color:#000000; background: #F5E391; vertical-align: middle">NO SCRIPT ERROR:</span><br />
Sorry this site will not function properly without the use of scripts.
The scripts are safe and will not harm your computer in anyway.
Adjust your settings to allow scripts for this site and reload the site.</div>
</td></tr></table></center>
</noscript>
<div id="wrap">
<div id="header">
<p id="toplinks">
<a href="<?php echo URL_PUBLIC; ?>?"><img src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/home.gif" alt="Home" /> Home</a> |
<a href="<?php echo BASE_URL; ?>sitemap"><img src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/sitemap.gif" alt="Sitemap" /> Sitemap</a> |
<a href="<?php echo URL_PUBLIC; ?>?contact.html"><img src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/contact.gif" alt="Contact" /> Contact</a>
</p>
<div style="width=400px;">
<h1><a href="<?php echo URL_PUBLIC; ?>">Carmel<span class="fade"> Software</span></a></h1>
<p id="slogan">software development and webdesign</p></div>
<div style="float:right;position:relative;top:-90px;display:inline">
<form action="/?search-results<?php echo URL_SUFFIX;?>#listing" method="post" id="searchbox">
<table class="searchBox">
<tr>
<td>
<input type="text" name="search" size="20" value="<?php echo strip_tags($_POST['search']);?>" />
<input type="submit" name="searchsubmit" value="search" class="submit" />
</td>
</tr>
</table>
</form></div></div>
<!--main section-->
<div id="content">
<?php echo $this->content(); ?>
<?php if ($this->hasContent('extended')) echo $this->content('extended'); ?>
</div>
<!--/main section-->
<!--footer-->
<div id="footer">
<p class="footer-left"><a href="#header">Back to top</a></p>
<p><a href="<?php echo URL_PUBLIC; ?>">Home</a> | <a href="#">About</a> | <a href="#">Services</a> | <a href="#">Portfolio</a> |
<a href="<?php echo URL_PUBLIC; ?>?contact.html">Contact</a> | <a href="<?php echo URL_PUBLIC; ?>admin">Administrator</a> <br />
Carmel Software © 2009 | Thanks to <a href="http://andreasviklund.com/">Andreas Viklund</a> | Based on<a href="http://www.wolfcms.org/" rel="external"> Wolf CMS</a> technology</p>
</div><!--/footer-->
</div>
</body>
</html> Snippets:
sitesearch
<?php
function is_in_array($str, $array) {
return preg_grep('/^' . preg_quote($str, '/') . '$/i', $array);
}
function snippet_sitesearch($parent){
$exclude = array("search-results");
$mysearch = htmlentities($_POST['search']);
if($parent->slug == "") {
if(!in_array($parent->slug,$exclude)){
$mylink = $parent->link();
$mycrumb = $parent->breadcrumb;
if(stristr($parent->content(),$mysearch) || stristr($parent->title(),$mysearch) || is_in_array($mysearch,$parent->tags())){
$out .= '<li><strong><a href="/">'.$mycrumb.'</a></strong></li>';
}
}
}
$childs = $parent->children();
foreach ($childs as $child) {
if(!in_array($child->parent->slug,$exclude)){
$myparent = snippet_sitesearch($child);
$mylink = $child->link();
$url_segments = explode('/', $child->url);
$url_seg_count = count($url_segments);
if($url_seg_count > 1){
$mycrumb = ucfirst(str_replace('-',' ',$child->parent->breadcrumb)).' / '.$child->breadcrumb;
} else {
$mycrumb = $child->breadcrumb;
}
if(stristr($child->content(),$mysearch) || stristr($child->title(),$mysearch) || is_in_array($mysearch,$child->tags())){
$out .= '<li><strong><a href="'.$child->url.URL_SUFFIX.'">'.$mycrumb.'</a></strong></li>';
}
$out .= snippet_sitesearch($child);
}
}
$out = str_replace("<li><li>", "<li>", $out);
$out = str_replace("</li></li>", "</li>", $out);
return $out;
}
?>
<div id="listing">
<?php
$searchdata = "";
$searchdata .= snippet_sitesearch($this->find('/'));
$occurances = substr_count($searchdata,"<li>");
if($searchdata != NULL){
if($occurances > 1){$results="results";}else{$results="result";}
echo "<p>Search $results for: <strong>" . $_POST['search'] . "</strong></p>";
echo "<ol>";
echo $searchdata;
echo "</ol>";
} else {
echo "<p>Search result for: <strong>" . $_POST['search'] . "</strong></p>";
echo "<p>No matching results were found.</p>";
}
?>
</div>"new" site - 0.6.0 RC1b - belv.0fees.net
Home Page - body
<h2>Web Site For You</h2>
<div id="mainText"> Many business owners still operate without a web presence. Most of them will tell you they don't need a web site because their business is already going well. Then I remind them about the threat of losing business because they can not be reached on the web...</div>
<div id="mainPic" class="floatleft">
<div class="newsPic">
<div class="picStyle"><a href="<?php echo URL_PUBLIC; ?>"><img alt="#1" width="272" height="190" src="<?php echo URL_PUBLIC; ?>/public/themes/freelance/images/01.jpg" /></a></div>
</div>
<div class="newsPic">
<div class="picStyle"><a href="<?php echo URL_PUBLIC; ?>"><img alt="#2" width="272" height="190" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/02.jpg" /></a></div>
</div>
<div class="newsPic">
<div class="picStyle"><a href="<?php echo URL_PUBLIC; ?>"><img alt="#3" width="272" height="190" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/03.jpg" /></a></div>
</div>
<div class="newsPic">
<div class="picStyle"><a href="<?php echo URL_PUBLIC; ?>"><img alt="#4" width="272" height="190" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/04.gif" /></a></div>
</div>
<div class="newsPic">
<div class="picStyle"><a href="<?php echo URL_PUBLIC; ?>"><img alt="#5" width="272" height="190" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/05.gif" /></a></div>
</div>
<div class="newsPic">
<div class="picStyle"><a href="<?php echo URL_PUBLIC; ?>"><img alt="#6" width="272" height="190" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/06.gif" /></a></div>
</div>
</div>
<p style="margin-left: 295px"><strong style="color: #4088b8">The website it is not luxury, it is means of advancement of your business!</strong> While having a web site is not an end all for marketing your business, it is something that modern consumers expect and will use if available. Potential customers expect businesses to keep up with the times and a website can help you do that. Expansion is another reason for a web site. Most small businesses cannot afford to expand significantly.With a well managed web site you can have a business presence that is world wide...
<p class="readmore"><a href="<?php echo URL_PUBLIC; ?>">Read more</a> »</p>
<h2>Software For You</h2>
<p>Are you looking for a WordPress theme version of this template? Or maybe a version that is ported for Textpattern, Etomite, MODx, Blogger or some other <a href="http://solucija.com/">great content management system</a> or blog engine? Then check out my <a href="http://andreasviklund.com/templates/themes">ports and themes page</a> to see if there are any version available that you can use. If you make a port yourself, please let me know so I can your version to the list.</p>
<p class="readmore"><a href="<?php echo URL_PUBLIC; ?>">Read more</a> »</p>
<p class="box"><strong>Note:</strong> Contact me at the email address valerib@012.net.il or call at 0545-237689. Just send me information about your business and what you have in mind and I will submit a complete proposal by email. There is no obligation. Thanks.
<a href="<?php echo URL_PUBLIC; ?>?price_estimate.php">Get a free price estimate</a> »</p>Home Page – sidebar
<div id="searchframe">
<form action="/?search-results<?php echo URL_SUFFIX;?>#listing" method="post" id="searchbox">
<input type="text" name="search" id="search" value="<?php echo strip_tags($_POST['search']);?>" />
<input type="submit" name="searchsubmit" value="search" class="submit" /></form>
</div>
Search results
<a name="listing"></a>
<?php
if (isset($_POST['search'])){
$searchcriteria = $_POST['search'];
if($searchcriteria != NULL && preg_match('#^[a-z0-9\x20]+$#i', $searchcriteria)){
echo $this->includeSnippet('sitesearch');
}else{
echo "<p>Please input a search criteria.</p>";
}
}
?>
Contact
<?php TB_Contactform('valerib@012.net.il', 'admin@belv.0fees.net', 'Your message was sent successfully', 'Please allow up to 24 hours for a reply.'); ?>
Layout-main (for Home Page)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "[url]http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd[/url]">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Carmel Software - Freelance Web Designer and Database Developer in Haifa, Israel - <?php echo $this->title(); ?></title>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
<meta name="robots" content="index, follow" />
<meta name="description" content="<?php echo ($this->description() != '') ? $this->description() : 'Homepage Carmel Software'; ?>" />
<meta name="keywords" content="<?php echo ($this->keywords() != '') ? $this->keywords() : 'theme, graphique, css, template, frog'; ?>" />
<meta name="author" content="Carmel Software" />
<link rel="favourites icon" href="<?php echo URL_PUBLIC; ?>favicon.ico" />
<link rel="canonical" href="<?php echo $this->url(); ?>" />
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="<?php echo URL_PUBLIC; ?>public/themes/freelance/style.css" title="800px css style" media="screen,projection" />
<link rel="stylesheet" type="text/css" href="<?php echo URL_PUBLIC; ?>public/themes/freelance/contact.css" title="contact_form css style" media="screen,projection" />
<!-- Javascript -->
<script type="text/javascript" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/js/jquery.js"></script>
<script type="text/javascript" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/js/jquery.innerfade.js"></script>
<script type="text/javascript" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/js/slide.js"></script>
</head>
<body>
<!--begin:search\/\/-->
<noscript>
<center><table border="0" style="height: 100%; width: 100%; right: 1%; left: 1%; background: #F5E391; position: fixed">
<tr><td align="center">
<div style="position: fixed; font-size: 18px; z-index: 2; cursor: help; background: #F5E391; width: 480px; color: black; padding: 5px 5px 5px 5px; border: 1px solid; border-color: #000000; height: auto; text-align: left; left: 20%">
<span style="font: bold 20px Arial; color:#000000; background: #F5E391; vertical-align: middle">NO SCRIPT ERROR:</span><br />
Sorry this site will not function properly without the use of scripts.
The scripts are safe and will not harm your computer in anyway.
Adjust your settings to allow scripts for this site and reload the site.</div>
</td></tr></table></center>
</noscript>
<div id="wrap">
<div id="header">
<p id="toplinks">
<a href="<?php echo URL_PUBLIC; ?>?"><img src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/home.gif" alt="Home" /> Home</a> |
<a href="<?php echo BASE_URL; ?>sitemap"><img src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/sitemap.gif" alt="Sitemap" /> Sitemap</a> |
<a href="<?php echo URL_PUBLIC; ?>?contact.html"><img src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/contact.gif" alt="Contact" /> Contact</a>
</p>
<h1><a href="<?php echo URL_PUBLIC; ?>">Carmel<span class="fade"> Software</span></a></h1>
<p id="slogan">software development and webdesign</p>
</div> <!--/Header-->
<!--main section-->
<div id="content">
<?php echo $this->content(); ?>
<?php if ($this->hasContent('extended')) echo $this->content('extended'); ?>
</div>
<!--/main section-->
<div id="sidebar">
<h2>Welcome!</h2>
<p> My name is Valeri and I am freelance software developer and websites builder. Not matter where you are in the world, and who you are, I can help you to take your business online,
I can help to solve your computer problems quickly and for a moderate payment...</p>
<p class="readmore"><a href="styles.html">Read more</a> »</p>
<h2>Pages:</h2>
<ul>
<li><a href="#">About</a></li>
<li><a href="#">Site's Gallery</a></li>
<li><a href="#">Services:</a>
<ul>
<li><a href="#">Sites</a></li>
<li><a href="#">Software</a></li>
</ul></li>
<li><a href="#">Price estimate</a></li>
<li><a href="?contact.html">Contact</a></li>
<li><a class="hide" href="#header">Back to top</a></li>
</ul>
<h2>Links:</h2>
<ul class="links">
<li><a href="http://andreasviklund.com/templates/">Free templates</a></li>
<li><a href="http://www.onderhond.com/tools/ie6fixer/">IE6 CSS Fixer</a></li>
<li><a href="http://www.andybudd.com/archives/2006/10/7_habits_of_a_highly_successful_freelance_web_designer/">Andy Budd article</a></li>
<li><a href="http://www.flickr.com/">Flickr - Photo Sharing</a></li>
<li><a href="http://oswd.org">del.icio.us - bookmarks </a></li>
</ul>
<h2>Site Search:</h2>
<?php echo $this->content('sidebar', true); ?>
</div> <!--/sidebar-->
<!--footer-->
<div id="footer">
<p class="footer-left"><a href="#header">Back to top</a></p>
<p><a href="<?php echo URL_PUBLIC; ?>">Home</a> | <a href="#">About</a> | <a href="#">Services</a> | <a href="#">Portfolio</a> |
<a href="<?php echo URL_PUBLIC; ?>?contact.html">Contact</a> | <a href="<?php echo URL_PUBLIC; ?>admin">Administrator</a> <br />
Carmel Software © 2009 | Thanks to <a href="http://andreasviklund.com/">Andreas Viklund</a> | Based on<a href="http://www.wolfcms.org" rel="external"> Wolf CMS</a> technology</p>
</div><!--/footer-->
</div>
<!--end:search\/\/-->
</body>
</html>Layout-additional(for pages Contact, Seach results, etc)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "[url]http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd[/url]">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Carmel Software - Freelance Web Designer and Database Developer in Haifa, Israel - <?php echo $this->title(); ?></title>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="robots" content="index, follow" />
<meta name="description" content="<?php echo ($this->description() != '') ? $this->description() : 'Homepage Carmel Software'; ?>" />
<meta name="keywords" content="<?php echo ($this->keywords() != '') ? $this->keywords() : 'theme, graphique, css, template, wolf,cms'; ?>" />
<meta name="author" content="Carmel Software" />
<link rel="favourites icon" href="<?php echo URL_PUBLIC; ?>favicon.ico" />
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="<?php echo URL_PUBLIC; ?>public/themes/freelance/style.css" title="800px css style" media="screen,projection" />
<link rel="stylesheet" type="text/css" href="<?php echo URL_PUBLIC; ?>public/themes/freelance/contact.css" title="contact_form css style" media="screen,projection" />
<!-- Javascript -->
<script type="text/javascript" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/js/jquery.js"></script>
<script type="text/javascript" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/js/jquery.innerfade.js"></script>
<script type="text/javascript" src="<?php echo URL_PUBLIC; ?>public/themes/freelance/js/slide.js"></script>
</head>
<body>
<!--begin:search\/\/-->
<noscript>
<center><table border="0" style="height: 100%; width: 100%; right: 1%; left: 1%; background: #F5E391; position: fixed">
<tr><td align="center">
<div style="position: fixed; font-size: 18px; z-index: 2; cursor: help; background: #F5E391; width: 480px; color: black; padding: 5px 5px 5px 5px; border: 1px solid; border-color: #000000; height: auto; text-align: left; left: 20%">
<span style="font: bold 20px Arial; color:#000000; background: #F5E391; vertical-align: middle">NO SCRIPT ERROR:</span><br />
Sorry this site will not function properly without the use of scripts.
The scripts are safe and will not harm your computer in anyway.
Adjust your settings to allow scripts for this site and reload the site.</div>
</td></tr></table></center>
</noscript>
<div id="wrap">
<div id="header">
<p id="toplinks">
<a href="<?php echo URL_PUBLIC; ?>?"><img src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/home.gif" alt="Home" /> Home</a> |
<a href="<?php echo BASE_URL; ?>sitemap"><img src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/sitemap.gif" alt="Sitemap" /> Sitemap</a> |
<a href="<?php echo URL_PUBLIC; ?>?contact.html"><img src="<?php echo URL_PUBLIC; ?>public/themes/freelance/images/contact.gif" alt="Contact" /> Contact</a>
</p>
<div style="width=400px;">
<h1><a href="<?php echo URL_PUBLIC; ?>">Carmel<span class="fade"> Software</span></a></h1>
<p id="slogan">software development and webdesign</p></div>
<div style="float:right;position:relative;top:-90px;display:inline">
<form action="/?search-results<?php echo URL_SUFFIX;?>#listing" method="post" id="searchbox">
<table class="searchBox">
<tr>
<td>
<input type="text" name="search" size="20" value="<?php echo strip_tags($_POST['search']);?>" />
<input type="submit" name="searchsubmit" value="search" class="submit" />
</td>
</tr>
</table>
</form></div></div>
<!--main section-->
<div id="content">
<?php echo $this->content(); ?>
<?php if ($this->hasContent('extended')) echo $this->content('extended'); ?>
</div>
<!--/main section-->
<!--footer-->
<div id="footer">
<p class="footer-left"><a href="#header">Back to top</a></p>
<p><a href="<?php echo URL_PUBLIC; ?>">Home</a> | <a href="#">About</a> | <a href="#">Services</a> | <a href="#">Portfolio</a> |
<a href="<?php echo URL_PUBLIC; ?>?contact.html">Contact</a> | <a href="<?php echo URL_PUBLIC; ?>admin">Administrator</a> <br />
Carmel Software © 2009 | Thanks to <a href="http://andreasviklund.com/">Andreas Viklund</a> | Based on<a href="http://www.wolfcms.org/" rel="external"> Wolf CMS</a> technology</p>
</div><!--/footer-->
</div>
<!--end:search\/\/-->
</body>
</html>Snippets:
sitesearch
<?php
function is_in_array($str, $array) {
return preg_grep('/^' . preg_quote($str, '/') . '$/i', $array);
}
function snippet_sitesearch($parent){
$exclude = array("search-results");
$mysearch = htmlentities($_POST['search']);
if($parent->slug == "") {
if(!in_array($parent->slug,$exclude)){
$mylink = $parent->link();
$mycrumb = $parent->breadcrumb;
if(stristr($parent->content(),$mysearch) || stristr($parent->title(),$mysearch) || is_in_array($mysearch,$parent->tags())){
$out .= '<li><strong><a href="/">'.$mycrumb.'</a></strong></li>';
}
}
}
$childs = $parent->children();
foreach ($childs as $child) {
if(!in_array($child->parent->slug,$exclude)){
$myparent = snippet_sitesearch($child);
$mylink = $child->link();
$url_segments = explode('/', $child->url);
$url_seg_count = count($url_segments);
if($url_seg_count > 1){
$mycrumb = ucfirst(str_replace('-',' ',$child->parent->breadcrumb)).' / '.$child->breadcrumb;
} else {
$mycrumb = $child->breadcrumb;
}
if(stristr($child->content(),$mysearch) || stristr($child->title(),$mysearch) || is_in_array($mysearch,$child->tags())){
$out .= '<li><strong><a href="'.$child->url.URL_SUFFIX.'">'.$mycrumb.'</a></strong></li>';
}
$out .= snippet_sitesearch($child);
}
}
$out = str_replace("<li><li>", "<li>", $out);
$out = str_replace("</li></li>", "</li>", $out);
return $out;
}
?>
<div id="listing">
<?php
$searchdata = "";
$searchdata .= snippet_sitesearch($this->find('/'));
$occurances = substr_count($searchdata,"<li>");
if($searchdata != NULL){
if($occurances > 1){$results="results";}else{$results="result";}
echo "<p>Search $results for: <strong>" . $_POST['search'] . "</strong></p>";
echo "<ol>";
echo $searchdata;
echo "</ol>";
} else {
echo "<p>Search result for: <strong>" . $_POST['search'] . "</strong></p>";
echo "<p>No matching results were found.</p>";
}
?>
</div>Thanks in advance!

