Forums

Sphider (3 posts)

  1. tommytomato
    Member
    Posted 3 years ago #

    Hi all has any one got Sphider to work with word press at all

    I've installed the plugin OK, can any one give me an idea on how to get it going on my theme

    can any one give me a exsample on what they have done

    I wish to remove my current search.php and replace it with Sphider has the old search throws out my whole site

    http://wordpress.org/extend/plugins/sphider/

    TT

  2. tommytomato
    Member
    Posted 3 years ago #

    I've put up another post on another site asking if any one can help
    may be some here knows who to fix my problem

    http://www.phpfreaks.com/forums/index.php/topic,278404.0.html

    TT

  3. tommytomato
    Member
    Posted 3 years ago #

    I'm using the HostingPlatino theme on the latest word press with Sphider Version 1.3.x

    I'm having trouble getting the Sphider to work in the frame.php

    here is the code for the frame.php

    <?php if ( is_home() ) { ?> 
    
    <div id="frame">
    
    <div id="framecenter">
    
    	<ul id="framebar">
    
            <li><h2>Web Hosting News</h2>
    
    <ul>
    
    <?php $my_query = new WP_Query('showposts=10');	?>
    
    					<?php while ($my_query->have_posts()) : $my_query->the_post(); $shorttitle = substr(the_title('','',FALSE),0,39); ?>
    
                             <li><a title="<?php echo the_title() ?>" href="<?php the_permalink() ?>">
    
    					  <?php echo $shorttitle; if (strlen($shorttitle) >38){ echo '...'; } ?>
    
    					</a></li>
    
    <?php endwhile; ?>
    
    			</ul>
    
    </li>	
    
            	<li><h2>Web Hosting Resources</h2>
    
    <ul><?php get_links('-1', '<li>', '</li>', '<br />'); ?></ul>
    
    		</li>
    
            <li><h2>SQL SERVER Tutorial</h2>
    
    			<ul>
    
    <object width="301" height="233"><param name="movie" value="http://www.youtube.com/v/Sfi6gYSc9os&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Sfi6gYSc9os&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="301" height="233"></embed></object>
    
    			</ul>	
    
              </li>	
    
    	</ul>
    
    </div></div>
    
    <?php } ?>

    I'm able to get this in the frame.php ok

    <!--To search through Sphider-->
    <form method="get" id="searchform" action="<?php bloginfo('url'); ?>">
    <label class="hidden" for="query"><?php _e('Search site for:'); ?></label>
    <div><input type="text" value="<?php the_search_query(); ?>" name="query" id="query" />
    <input type="hidden" name="s" value="1" />
    <input type="submit" id="searchsubmit" value="Search" />
    </div>
    </form>
    
    <!--To search through WordPress-->
    <form method="get" id="searchform" action="<?php bloginfo('url'); ?>">
    <label class="hidden" for="s"><?php _e('Search blog for:'); ?></label>
    <div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="Search" />
    </div>
    </form>

    But I'm not able to get the your_search.php to work with the frame.php

    <?php get_header(); ?>
    
    	<div id="content" class="narrowcolumn">
    
    	<?php if (!isset($_GET['query'])&&have_posts()) : ?>
    
    		<h2 class="pagetitle">Search Results</h2>
    
    		<div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    		</div>
    
    		<?php while (have_posts()) : the_post(); ?>
    
    			<div class="post">
    				<h3 id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
    				<small><?php the_time('l, F jS, Y') ?></small>
    
    				<p class="postmetadata"><?php the_tags('Tags: ', ', ', '<br />'); ?> Posted in <?php the_category(', ') ?> | <?php edit_post_link('Edit', '', ' | '); ?>  <?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?></p>
    			</div>
    
    		<?php endwhile; ?>
    
    		<div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>
    		</div>
    
    	<?php else : ?>
    
    <?php
    // Provided for you to replace as your theme's search.php
    /*******************************************
    * Sphider Version 1.3.x
    * This program is licensed under the GNU GPL.
    * By Ando Saabas          ando(a t)cs.ioc.ee
    ********************************************/
    
    $searchFile = $_SERVER['REQUEST_URI'];
    $searchFile = explode('?',$searchFile);
    $searchFile = $searchFile[0];
    $searchFileAppend = '?s=1&';
    
    //error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING);
    error_reporting(E_ALL);
    $dir_path = "wp-content/plugins/sphider";
    $include_dir = $dir_path."/include";
    include ("$include_dir/commonfuncs.php");
    //extract(getHttpVars());
    
    $search = 1;
    
    if (isset($_GET['query']))
    	$query = $_GET['query'];
    if (isset($_GET['search']))
    	$search = $_GET['search'];
    if (isset($_GET['domain']))
    	$domain = $_GET['domain'];
    if (isset($_GET['type']))
    	$type = $_GET['type'];
    if (isset($_GET['catid']))
    	$catid = $_GET['catid'];
    if (isset($_GET['category']))
    	$category = $_GET['category'];
    if (isset($_GET['results']))
    	$results = $_GET['results'];
    if (isset($_GET['start']))
    	$start = $_GET['start'];
    if (isset($_GET['adv']))
    	$adv = $_GET['adv'];
    
    $include_dir = $dir_path."/include";
    $template_dir = $dir_path."/templates";
    $settings_dir = $dir_path."/settings";
    $language_dir = $dir_path."/languages";
    
    require_once("$settings_dir/database.php");
    require_once("$language_dir/en-language.php");
    require_once("$include_dir/searchfuncs.php");
    require_once("$include_dir/categoryfuncs.php");
    
    include "$settings_dir/conf.php";
    ?>
    <link type="text/css" rel="stylesheet" href="<?php echo $template_dir.'/'.$template; ?>/search.css">
    <!-- suggest script -->
    <style type="text/css">@import url("<?php echo $include_dir; ?>/js_suggest/SuggestFramework.css");</style>
    <script type="text/javascript" src="<?php echo $include_dir; ?>/js_suggest/SuggestFramework.js"></script>
    <script type="text/javascript">window.onload = initializeSuggestFramework;</script>
    <!-- /suggest script -->
    <?php
    include "$language_dir/$language-language.php";
    
    if ($type != "or" && $type != "and" && $type != "phrase") {
    	$type = "and";
    }
    
    if (preg_match("/[^a-z0-9-.]+/", $domain)) {
    	$domain="";
    }
    
    if ($results != "") {
    	$results_per_page = $results;
    }
    
    if (get_magic_quotes_gpc()==1) {
    	$query = stripslashes($query);
    } 
    
    if (!is_numeric($catid)) {
    	$catid = "";
    }
    
    if (!is_numeric($category)) {
    	$category = "";
    } 
    
    if ($catid && is_numeric($catid)) {
    
    	$tpl_['category'] = sql_fetch_all('SELECT category FROM '.$mysql_table_prefix.'categories WHERE category_id='.(int)$_REQUEST['catid']);
    }
    
    $count_level0 = sql_fetch_all('SELECT count(*) FROM '.$mysql_table_prefix.'categories WHERE parent_num=0');
    $has_categories = 0;
    
    if ($count_level0) {
    	$has_categories = $count_level0[0][0];
    }
    
    require_once("$template_dir/$template/search_form.html");
    
    function getmicrotime(){
        list($usec, $sec) = explode(" ",microtime());
        return ((float)$usec + (float)$sec);
        }
    
    function poweredby(){
    	// removed
    	}
    
    function saveToLog ($query, $elapsed, $results) {
            global $mysql_table_prefix;
        if ($results =="") {
            $results = 0;
        }
        $query =  "insert into ".$mysql_table_prefix."query_log (query, time, elapsed, results) values ('$query', now(), '$elapsed', '$results')";
    	mysql_query($query);
    
    	echo mysql_error();
    
    }
    
    switch ($search) {
    	case 1:
    
    		if (!isset($results)) {
    			$results = "";
    		}
    		$search_results = get_search_results($query, $start, $category, $type, $results, $domain);
    		require("$template_dir/$template/search_results.html");
    	break;
    	default:
    		if ($show_categories) {
    			if ($_REQUEST['catid']  && is_numeric($catid)) {
    				$cat_info = get_category_info($catid);
    			} else {
    				$cat_info = get_categories_view();
    			}
    			require("$template_dir/$template/categories.html");
    		}
    	break;
    	}
    ?>
    
    	<?php endif;  ?>
    
    	</div>
    
    <?php get_sidebar(); ?>
    
    <?php get_footer(); ?>

    My frame.php is below

    <?php if ( is_home() ) { ?>
    <div id="frame">
    <div id="framecenter">
    	<ul id="framebar">
    
            <li><h2>Web Hosting News</h2>
    <form method="get" id="searchform" action="<?php bloginfo('url'); ?>">
    <label class="hidden" for="query"><?php _e('Search site for:'); ?></label>
    <div><input type="text" value="<?php the_search_query(); ?>" name="query" id="query" />
    <input type="hidden" name="s" value="1" />
    <input type="submit" id="searchsubmit" value="Search" />
    </div>
    </form>
    
    </li>	
    
            	<li><h2>Web Hosting Resources</h2>
    <form method="get" id="searchform" action="<?php bloginfo('url'); ?>">
    <label class="hidden" for="s"><?php _e('Search blog for:'); ?></label>
    <div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="Search" />
    </div>
    </form>
    		</li>
    
            <li><h2>SQL SERVER Tutorial</h2>
    			<ul>
    
    <object width="301" height="233"><param name="movie" value="http://www.youtube.com/v/Sfi6gYSc9os&autoplay=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Sfi6gYSc9os&autoplay=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="301" height="233"></embed></object>
    
    			</ul>
              </li>	
    
    	</ul>
    </div></div>
    <?php } ?>

    This brings up the search boxes OK, but I have no Search results with in the frame.php, it only loads out side the frame and when it does it throws the whole site out of place.

    Any ideas on how I can get this to work with in the frame.php

    TT

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags