41
rlankford
Re: How can I customize search results to show categories and titles in it
  • 2007/8/16 12:19

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


This is certainly an interesting idea. I've seen modules that implement their own search function. In these cases, they don't rely on the XOOPS search engine API. Rather, they provide a search form inside their module and generate page results however they'd like themselves. So for a module that you are personally developing, this might be a desirable path for you to take.

If, however, you are dealing with other people's modules. Well, you are left with hacking them (like christian's excellent suggestion). Do an elegant enough hack and submit it back to the module developer, however, and it just might become part of that module in the future.

But that still isn't really what you're going for (as far as I can tell). You're asking for the type of change that challenges the very design of the XOOPS search API. It would be interesting, however, to add the concept of 'categories' to the XOOPS search engine concept. Each module would have to define in the xoops_version.php file a way for XOOPS to know what categories are available and how to access these categories. The search engine could then be altered to allow for filtering not only by module, but by category as well.

All of this, obviously, would need to be backward compatible with the existing search engine so that older modules can still be useful in Xoops.

Hmmm..... This might be a fun little project to work on. Anyone else intested in something like this??



42
rlankford
Re: Xoops Search - A Better Implementation?
  • 2007/8/16 11:46

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


You can get the proposed patch by clicking here.

This is from the readme.txt file in the patch:

Quote:

Search Patch for XOOPS 2.0.16

-- rlankford --

2007/8/15

-----------------------

Patch assembled and submitted for XOOPS Core inclusion by rlankford at the request of marcan. Please see this post for more information:

https://xoops.org/modules/newbb/viewtopic.php?topic_id=60067&viewmode=flat&order=ASC&start=10#forumpost269844

-----------------------

To test this patch:

1) Before actually installing Xoops, unzip the files in this zip file and overwrite the files in your 'xoops' directory (the root of Xoops).
2) Install XOOPS as normal.
3) Verify search preferences in the XOOPS admin panel (three new preferences added by the patch).
4) Exercise the search engine on Xoops. Be sure to try both the shallow (the way it always has been) and deep (slower, but more information presented) search methods...

-----------------------

Changes Made:

1) \search.php -- Modest rewrite of the entire search page to support expanded functionality.
2) \include\searchform.php -- file no longer sends HTML output directly to screen. Rather, the render method now returns the HTML output so that it can be sent to the new search Smarty template instead.
3) images\search\* -- a series of graphics files called by the new search template.
4) \modules\system\xoops_version.php -- Search template definition added.
5) \modules\system\templates\system_search.html -- New system search Smarty template used by search.php for rendering HTML output.
6) \install\index.php -- Added 3 new configuration settings.
7) \install\makedata.php -- Added 3 new configuration settings.
8) \modules\system\language\english\admin\preferences.php -- defined several strings used by the new configuration settings.


This is from the description text associated with the download at sourceforge:

Quote:

This patch does the following:

1) It splits out presentation from search.php into a new search Smarty
template. This allows users of XOOPS to alter the appearance of their
search pages via the template without having to know the gory details of
the search process.

2) It creates the concept of 'deep' searching and 'shallow' searching.

Shallow searching exhibits the behavior that Xoops' search has always
exhibited. Namely, the initial search results page only searches for a few
hits in each module and presents those hits on a module-by-module basis.
The user cannot determine how many results are actually to be found in any
given module without drilling down into the hits for that module.

Deep searching, on the other hand, determines the number of hits for every
module. The initial search page still groups the hits by module (and still
limits those shown to a small number), but the user immediately sees how
many total hits are available. Drilling down into the results for a given
module then displays a 'page nav' interface instead of the 'next/previous'
nav buttons.

3) The initial search page sorts the modules by number of hits returned.
Modules with fewer hits are oriented toward the bottom of the page.


Please remember that this patch hasn't been thoroughly tested nor accepted yet for inclusion into the XOOPS core. But feel free to play around with it if you think you can get some use from it!



43
rlankford
Re: Xoops Search - A Better Implementation?
  • 2007/8/16 2:14

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


I've posted the patch. Let me know if you have any trouble with it!



44
rlankford
Re: Apache Restarts at Random
  • 2007/8/15 19:09

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


Thanks for the reply!

I've tried disabling Zend Optimizer and restarting the web server. That didn't seem to help, the web server exhibited the same behavior ~22 hours later...

I've copied over the dll file you mentioned and will wait to see if that makes any difference...

Does no one else ever have this problem?



45
rlankford
Re: Xoops Search - A Better Implementation?
  • 2007/8/14 14:45

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


OK, let me mull it over a little more over the next couple of days. I probably need to 'hack in' a preference setting in the admin panel that lets the XOOPS user choose whether or not they want the main search page to support 'deep' searches or not. That way, large sites can default back to only searching x (where x is 5 at the moment) at a time on the initial search results page.

I'll get back to you...



46
rlankford
Apache Restarts at Random
  • 2007/8/14 14:41

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


This may not be the right place for this, but googling this stuff isn't really getting me anywhere.

I get this at random from Apache about once a day on my site:

Quote:

[Tue Aug 14 10:47:46 2007] [notice] Parent: child process exited with status 3221225477 -- Restarting.


I have XOOPS 2.0.16 running on Windows Server 2003 with the following XAMPP stack:

version 1.6.3a:

* Apache HTTPD 2.2.4 + Openssl 0.9.8e
* MySQL 5.0.45
* PHP 5.2.3 <-- Using PHP 5, not 4.
* PHP 4.4.7
* phpMyAdmin 2.10.3
* Zend Optimizer 3.3.0

I cannot reproduce the error at will. I can't localize it to any particular page on my site. Rather, it just goes nuts around once a day.

It's probably a PHP bug, but I'm not sure that Apache should be bombing out like it is either. Also, from what I've read, I suspect that this bug would be fixed if I ran the server on Linux instead of Windows (which is not something that I want to do since I have some other Windows software running on the server too). Who's to blame? Windows, Apache, PHP, or some combination of the three? I don't have any idea.

Anyone seen this before? Anyone have any ideas at all what could be causing the problem?



47
rlankford
Re: Implementation
  • 2007/8/7 19:42

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


As an added twist, I've updated the search page and the template page. I've also added some graphics in.

PLEASE NOTE: This new search template performs *full* searching across all modules so that totals and page navs can be determined accurately. This can (and will) slow down searching for sites with weak hardware and lots of data.

The results now look something like this:

Resized Image

Notice in the above shot that you immediately know how many hits were returned for each module. Furthermore, the 'more results' button is prominently displayed and it's only visible on modules that generate more than 5 results.

Resized Image

On this page we can still see how many hits were generated and can easily navigate through the hits using the standard page nav.

Here's the new search.php:

<?php
// $Id: search.php 506 2006-05-26 23:10:37Z skalpa $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program 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            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //

$xoopsOption['pagetype'] = "search";

include 
'mainfile.php';

$xoopsOption['template_main'] = 'system_search.html';

$config_handler =& xoops_gethandler('config');
$xoopsConfigSearch =& $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH);

if (
$xoopsConfigSearch['enable_search'] != 1) {
    
header('Location: '.XOOPS_URL.'/index.php');
    exit();
}

include 
XOOPS_ROOT_PATH.'/header.php';

$action "search";
if (!empty(
$_GET['action'])) {
  
$action $_GET['action'];
} elseif (!empty(
$_POST['action'])) {
  
$action $_POST['action'];
}
$query "";
if (!empty(
$_GET['query'])) {
  
$query $_GET['query'];
} elseif (!empty(
$_POST['query'])) {
  
$query $_POST['query'];
}
$andor "AND";
if (!empty(
$_GET['andor'])) {
  
$andor $_GET['andor'];
} elseif (!empty(
$_POST['andor'])) {
  
$andor $_POST['andor'];
}
$mid $uid $start 0;
if ( !empty(
$_GET['mid']) ) {
  
$mid intval($_GET['mid']);
} elseif ( !empty(
$_POST['mid']) ) {
  
$mid intval($_POST['mid']);
}
if (!empty(
$_GET['uid'])) {
  
$uid intval($_GET['uid']);
} elseif (!empty(
$_POST['uid'])) {
  
$uid intval($_POST['uid']);
}
if (!empty(
$_GET['start'])) {
  
$start intval($_GET['start']);
} elseif (!empty(
$_POST['start'])) {
  
$start intval($_POST['start']);
}

$xoopsTpl->assign("start"$start 1);

$queries = array();

if (
$action == "recoosults") {
    if (
$query == "") {
         
redirect_header("search.php",1,_SR_PLZENTER);
        exit();
    }
} elseif (
$action == "showall") {
    if (
$query == "" || empty($mid)) {
        
redirect_header("search.php",1,_SR_PLZENTER);
        exit();
    }
} elseif (
$action == "showallbyuser") {
    if (empty(
$mid) || empty($uid)) {
        
redirect_header("search.php",1,_SR_PLZENTER);
        exit();
    }
}

global 
$xoopsUser;
$groups is_object($xoopsUser) ? $xoopsUser -> getGroups() : XOOPS_GROUP_ANONYMOUS;
$gperm_handler = & xoops_gethandler'groupperm' );
$available_modules $gperm_handler->getItemIds('module_read'$groups);

$xoopsTpl->assign('basic_search'false);
if (
$action == 'search') {
    
// This area seems to handle the 'just display the advanced search page' part.
   
$search_form = include 'include/searchform.php';
   
$xoopsTpl->assign('search_form'$search_form);
   
$xoopsTpl->assign('basic_search'true);
    include 
XOOPS_ROOT_PATH.'/footer.php';
    exit();
}

if ( 
$andor != "OR" && $andor != "exact" && $andor != "AND" ) {
    
$andor "AND";
}
$xoopsTpl->assign("search_type"$andor);

$myts =& MyTextSanitizer::getInstance();
if (
$action != 'showallbyuser') {
    if ( 
$andor != "exact" ) {
        
$ignored_queries = array(); // holds kewords that are shorter than allowed minmum length
        
$temp_queries preg_split('/[s,]+/'$query);
        foreach (
$temp_queries as $q) {
            
$q trim($q);
            if (
strlen($q) >= $xoopsConfigSearch['keyword_min']) {
                
$queries[] = $myts->addSlashes($q);
            } else {
                
$ignored_queries[] = $myts->addSlashes($q);
            }
        }
        if (
count($queries) == 0) {
            
redirect_header('search.php'2sprintf(_SR_KEYTOOSHORT$xoopsConfigSearch['keyword_min']));
            exit();
        }
    } else {
        
$query trim($query);
        if (
strlen($query) < $xoopsConfigSearch['keyword_min']) {
            
redirect_header('search.php'2sprintf(_SR_KEYTOOSHORT$xoopsConfigSearch['keyword_min']));
            exit();
        }
        
$queries = array($myts->addSlashes($query));
    }
}
$xoopsTpl->assign("label_search_results"_SR_SEARCHRESULTS);

// Keywords section.
$xoopsTpl->assign("label_keywords"_SR_KEYWORDS ':');
$keywords = array();
$ignored_keywords = array();
foreach (
$queries as $q) {
    
$keywords[] = htmlspecialchars(stripslashes($q));
}
if (!empty(
$ignored_queries)) {
     
$xoopsTpl->assign("label_ignored_keywords"sprintf(_SR_IGNOREDWORDS$xoopsConfigSearch['keyword_min']));
    foreach (
$ignored_queries as $q) {
        
$ignored_keywords[] = htmlspecialchars(stripslashes($q));
    }
    
$xoopsTpl->assign("ignored_keywords"$ignored_keywords);
}
$xoopsTpl->assign("searched_keywords"$keywords);

$all_results = array();
$all_results_counts = array();
switch (
$action) {
    case 
"results":
        
$max_results_per_page 5;
        
$module_handler =& xoops_gethandler('module');
        
$criteria = new CriteriaCompo(new Criteria('hassearch'1));
        
$criteria->add(new Criteria('isactive'1));
        
$criteria->add(new Criteria('mid'"(".implode(','$available_modules).")"'IN'));
        
$modules =& $module_handler->getObjects($criteriatrue);
        
$mids = isset($_REQUEST['mids']) ? $_REQUEST['mids'] : array();
        if (empty(
$mids) || !is_array($mids)) {
            unset(
$mids);
            
$mids array_keys($modules);
        }
    
        foreach (
$mids as $mid) {
            
$mid intval($mid);
            if ( 
in_array($mid$available_modules) ) {
                
$module =& $modules[$mid];
                
$results =& $module->search($queries$andor00);
                
$xoopsTpl->assign("showing"sprintf(_SR_SHOWING1$max_results_per_page));
                
$count count($results);
                
$all_results_counts[$module->getVar('name')] = $count;

                if (!
is_array($results) || $count == 0) {
                    
$all_results[$module->getVar('name')] = array();
                } else {
                                ((
$count $start) > $max_results_per_page)? $num_show_this_page $max_results_per_page$num_show_this_page $count $start;
                                for (
$i 0$i $num_show_this_page$i++) {
                          
$results[$i]['processed_image_alt_text'] = $myts->makeTboxData4Show($module->getVar('name')) . ": ";
                        if (isset(
$results[$i]['image']) && $results[$i]['image'] != "") {
                              
$results[$i]['processed_image_url'] = "modules/" $module->getVar('dirname') . "/" $results[$i]['image'];
                        } else {
                              
$results[$i]['processed_image_url'] = "images/icons/posticon2.gif";
                        }
                        if (!
preg_match("/^http[s]*:///i"$results[$i]['link'])) {
                            
$results[$i]['link'] = "modules/".$module->getVar('dirname')."/".$results[$i]['link'];
                        }
                        
$results[$i]['processed_title'] = $myts->makeTboxData4Show($results[$i]['title']);
                        
$results[$i]['uid'] = @intval($results[$i]['uid']);
                        if ( !empty(
$results[$i]['uid']) ) {
                            
$uname XoopsUser::getUnameFromId($results[$i]['uid']);
                            
$results[$i]['processed_user_name'] = $uname;
                            
$results[$i]['processed_user_url'] = XOOPS_URL."/userinfo.php?uid=".$results[$i]['uid'];
                        }
                        
$results[$i]['processed_time'] = !empty($results[$i]['time']) ? " ("formatTimestamp(intval($results[$i]['time'])).")" "";
                    }
                    if ( 
$count $max_results_per_page ) {
                        
$search_url XOOPS_URL.'/search.php?query='.urlencode(stripslashes(implode(' '$queries)));
                        
$search_url .= "&mid=$mid&action=showall&andor=$andor";
                    } else {
                        
$search_url "";
                    }
                    
$all_results[$module->getVar('name')] = array("search_more_title" => _SR_SHOWALLR
                                                                
"search_more_url" => htmlspecialchars($search_url), 
                                                                
"results" => array_slice($results0$num_show_this_page));
                }
            }
            unset(
$results);
            unset(
$module);
        }
        break;
    case 
"showall":
    case 
'showallbyuser':
        
$max_results_per_page 20;
        
$module_handler =& xoops_gethandler('module');
        
$module =& $module_handler->get($mid);
        
$results =& $module->search($queries$andor0$start$uid);
      
//$xoopsTpl->assign("showing", sprintf(_SR_SHOWING, $start + 1, $start + 20));
        
$count count($results);
        
$all_results_counts[$module->getVar('name')] = $count;
        if (
is_array($results) && $count 0) {
                    ((
$count $start) > $max_results_per_page)? $num_show_this_page $max_results_per_page$num_show_this_page $count $start;
            for (
$i 0$i $num_show_this_page$i++) {
                  
$results[$i]['processed_image_alt_text'] = $myts->makeTboxData4Show($module->getVar('name')) . ": ";
                if (isset(
$results[$i]['image']) && $results[$i]['image'] != "") {
                      
$results[$i]['processed_image_url'] = "modules/" $module->getVar('dirname') . "/" $results[$i]['image'];
                } else {
                      
$results[$i]['processed_image_url'] = "images/icons/posticon2.gif";
                }
                if (!
preg_match("/^http[s]*:///i"$results[$i]['link'])) {
                    
$results[$i]['link'] = "modules/".$module->getVar('dirname')."/".$results[$i]['link'];
                }
                
$results[$i]['processed_title'] = $myts->makeTboxData4Show($results[$i]['title']);
                
$results[$i]['uid'] = @intval($results[$i]['uid']);
                if ( !empty(
$results[$i]['uid']) ) {
                    
$uname XoopsUser::getUnameFromId($results[$i]['uid']);
                    
$results[$i]['processed_user_name'] = $uname;
                    
$results[$i]['processed_user_url'] = XOOPS_URL."/userinfo.php?uid=".$results[$i]['uid'];
                }
                
$results[$i]['processed_time'] = !empty($results[$i]['time']) ? " ("formatTimestamp(intval($results[$i]['time'])).")" "";
            }
            
                        
$search_url_prev "";
                        
$search_url_next "";
                        
                        
$search_url_base "XOOPS_URL.'/search.php?";
                        
$search_url_get_params 'query=' urlencode(stripslashes(implode(' '$queries)));
                
$search_url_get_params .= "&mid=$mid&action=$action&andor=$andor";
                if (
$action=='showallbyuser') {
                    
$search_url_get_params .= "&uid=$uid";
                }
                        
$search_url $search_url_base $search_url_get_params;
                        
        include_once 
XOOPS_ROOT_PATH.'/class/pagenav.php';
        
$pagenav = new XoopsPageNav($count$max_results_per_page$start"start"$search_url_get_params);
        
$all_results[$module->getVar('name')] = array("results" =>array_slice($results0$num_show_this_page),
                                                      
"page_nav" => $pagenav->renderNav());
        } else {
            echo 
'<p>'._SR_NOMATCH.'</p>';
        }
        break;
}
arsort($all_results_counts);
$xoopsTpl->assign("module_sort_order"$all_results_counts);
$xoopsTpl->assign("search_results"$all_results);

$search_form = include 'include/searchform.php';
$xoopsTpl->assign('search_form'$search_form);

include 
XOOPS_ROOT_PATH."/footer.php";
?>


Here's the new template file:

<{if $basic_search == false }>
<
strong>Search Type:</strong> <{$search_type}><br />
<
strong>Keywords: </strong>
        <{* 
This section generates a space separated list of keywords that were searched. *}>
        <{
section name=cur_kw_searched loop=$searched_keywords}>
              <{
$searched_keywords[cur_kw_searched]}><{if $smarty.section.cur_kw_searched.index <> $smarty.section.cur_kw_searched.total}>&nbsp;<{/if}>
        <{/
section}>
<
br /><br />
<
table cellpadding="0" cellspacing="0" width="100%" height="33" border="0">
 <
tr height="33">
  <
td width="3"><img src="images/search/header.left.gif" /></td>
  <
td style="background-image: url(images/search/header.background.gif); vertical-align: middle">
   <
table cellpadding="0" cellspacing="0" border="0">
    <
tr>
     <
td colspan="2" style="font-family: sans-serif; font-size: large; font-weight: bold; padding-left: 3px;"><{$label_search_results}>: <{$showing}></td>
    </
tr>
   </
table>
  </
td>
  <
td width="3"><img src="images/search/header.right.gif" /></td>
 </
tr>
</
table>

<
table cellpadding="0" cellspacing="0" width="100%" border="0">
<{foreach 
from=$module_sort_order key=sort_key item=sort_value}>
<
tr>
 <
td><img src="images/search/articleHeader.left.gif" /></td>
 <
td style="background-image: url(images/search/articleHeader.background.gif);">
     <
div style="font-size: large; padding-top: 5px; padding-bottom: 5px;"><b><{$sort_key}></b>: (<{$sort_value}> hits returned)</div>
    <{if 
$search_results[$sort_key].search_more_url != ''}>
      <
div style="padding-bottom: 5px;"><a href="<{$search_results[$sort_key].search_more_url}>"><img src="images/search/search.more_results.gif" alt="<{$search_results[$sort_key].search_more_title}>" /></a></div>
    <{/if}>
    <{if 
$search_results[$sort_key].page_nav != ''}>
        <
div style="padding-bottom: 5px; text-align: right"><{$search_results[$sort_key].page_nav}></div>
    <{/if}>
 </
td>
 <
td><img src="images/search/articleHeader.right.gif" /></td>
</
tr>
<
tr style="background-color: #FDFDFD;">
 <
td width="16" style="background-image: url(images/search/article.left.gif)"></td>
 <
td style="padding: 15px">
    <
table class="outer" cellpadding="4" cellspacing="1" width="100%">
        <{
section name=cur_result loop=$search_results[$sort_key].results}>
        <
tr>
            <
td class="head"><{math equation="x + y" x=$smarty.section.cur_result.index y=$start}></td>
            <
td align="left" class="<{cycle values="even,odd"}>" width="100%">
                <
img alt="<{$search_results[$sort_key].results[cur_result].processed_image_alt_text}>" src="<{$search_results[$sort_key].results[cur_result].processed_image_url}>" />
                <{
$search_results[$sort_key].results[cur_result].processed_image_tag}>&nbsp;
                <
b><a href="<{$search_results[$sort_key].results[cur_result].link}>"><{$search_results[$sort_key].results[cur_result].processed_title}></a>                        </b>
                <
br /><small>&nbsp;&nbsp;<a href="<{$search_results[$sort_key].results[cur_result].processed_user_url}>"><{$search_results[$sort_key].results[cur_result].processed_user_name}></a> <{$search_results[$sort_key].results[cur_result].processed_time}></small>
                 </
td>
        </
tr>
        <{/
section}>
    </
table>
    <{if 
$search_results[$sort_key].page_nav != ''}>
        <
div style="padding-bottom: 5px; text-align: right"><{$search_results[$sort_key].page_nav}></div>
    <{/if}>
 </
td>
 <
td width="19" style="background-image: url(images/search/article.right.gif)"></td>
</
tr>
<{/foreach}>

    <
tr>
     <
td><img src="images/search/footer.left.gif" /></td>
     <
td style="background-image: url(images/search/footer.background.gif);"></td>
     <
td><img src="images/search/footer.right.gif" /></td>
    </
tr>
</
table>
<
br /><br />
<{
$label_ignored_keywords}>&nbsp;
    <
strong>
    <{* 
This section generates a space separated list of keywords that were NOT searched. *}>
     <{
section name=cur_kw_not_searched loop=$ignored_keywords}>
          <{
$ignored_keywords[cur_kw_not_searched]}><{if $smarty.section.cur_kw_not_searched.index <> $smarty.section.cur_kw_not_searched.total}>&nbsp;<{/if}>
    <{/
section}>
    </
strong>
<
br /><br />
<{/if}>
<{
$search_form}>


You can get these files and the images that are referenced by the template by clicking here.

So far, this seems to be getting a good reception with my users. If you can handle the performance hit with this latest change, then you might be able to make good use of it too!



48
rlankford
Re: what kind of printer(s) do you use at home?
  • 2007/8/2 16:59

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


Interesting question. If you look closely at any screen shots that I've posted in the past, you might be able to discern that I actually work for Lexmark. So it's probably no surprise to learn that I have 2 Lexmark printers at home. One is an inkjet (5150, I believe). This was one of those that the people in the know would say was a good printer (relatively speaking, of course). So I bought it years ago and have never had a problem with it. It's been great.

My other printer is a color laser (C524, I think, but I still think of it as it's code name). I didn't buy this one, it was a left over after it served it's purpose in one of our test labs. So when I got it, it had over 163,000 pages printed on it already! It's really the only one I ever use anymore (still prints fine too). The 5150 is kept around for scanning/copying and any specialty printing like t-shirts or something.

I think Lexmark is at the C534 generation now. They had a sale on the older 524 models some months back and so I bought one for a family member for $200. That was a fantastic deal for a brand new color laser that, in my experience, is as solid as a rock. It's small, fast (20 color and b/w pages per minute), reliable, and cheap (especially at that $200 price!).

The reality, however, is that I don't print much. Anything photo related gets done at Shutterfly.com. I've read people complaining about Shutterfly's quality, but they look great to me!

I am, of course, speaking as a fellow XOOPS user and not a representative of Lexmark. My views are my own.

An no, in spite of the recent disappointing financial announcements, I'm not worried about losing my job anytime soo....$%$^#@ -- Lost Carrier --



49
rlankford
Re: Xoops Search - A Better Implementation?
  • 2007/7/30 16:34

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


Great! Thanks.



50
rlankford
Implementation
  • 2007/7/30 11:30

  • rlankford

  • Not too shy to talk

  • Posts: 158

  • Since: 2004/8/27


[size=x-large]How To: Update XOOPS 2.0.x Search Page to Support the Template Engine[/size]

Overview

Xoops has a template engine that allows you to separate page generation (php code) from page layout and presentation (HTML + CSS). XOOPS also supports a theme engine. This level of customization exists “above” data generation + layout and is outside the scope of this article.

Templates are HTML documents written to make use of Smarty tags. Smarty is an additional language/layer that you must learn in order layout your XOOPS generated HTML. Basically, though, the paradigm is one of adding in tags throughout your HTML that act as placeholders for incoming variables that were set up by the corresponding PHP page.

By default, the search page for XOOPS is found at the root of your XOOPS directory and is called search.php. This page (unlike most) actually generates the HTML necessary to carry out it's assigned task directly inside the PHP code with a series of 'echo' statements. This makes the process of updating the look and feel of the XOOPS search page more difficult since you now have to deal with the functionality of Xoop's search engine too.

This 'How To' documents the process for stripping out layout from function with regards to search.php. At the end of this tutorial, your XOOPS system will have a new system-level template that is associated with your search page. You'll be able to update the look and feel of your search page by manipulating this Smarty template rather than the search.php file directly. Furthermore, the search.php page will now have an interface (or contract) between itself and the corresponding template page that consists of various tags and their meanings. This means that you can tweak search.php whenever you like to change how the search engine works without necessarily affecting the look and feel of the search page itself (unless, of course, your changes necessitate a change to the interface with the template).

Back Up Everything – Use a Test Site – Yadda, Yadda, Yadda

As with anything, be sure to back up your valuable data first before attempting the changes in this document. Make these changes on test site first (if you can). Although nothing here is too invasive, it's important to be sure that you can recover if something goes wrong.

searchform.php

In the “include” folder, there exists a file called searchform.php. This file is responsible for generating the 'advanced search' form that you see at the bottom of every search page. Before we do anything else, we need to make a small change to this form in order to make it compatible with our new search template. At the very bottom of the file, simply add the following line:

$search_form->addElement(new XoopsFormButton("""submit"_SR_SEARCH"submit"));

return 
$search_form->render();    // Added by Lankford on 2007/7/26.
?>


What does this do? Instead of the entire PHP page being included into “\search.php” (along with the creation and availability of it's $search_form variable), we treat the include like a function and 'return' the HTML version (produced by the render method) of the form that this file's code generates.

modules/system/xoops_version.php

Your next step is to tell XOOPS about the Smarty template that you are about to create. You're probably already somewhat familiar with modules and how to install/configure them. Interestingly enough, XOOPS treats it's system code like a module. This is why you see the “System Admin” button on the left side of Xoops' administration screen along with buttons for all of the other installed modules. It's because the system module is just that...a module! This is great because not only are you able to quickly and easily figure out how to configure the system in the same way that you'd configure a module, but the folks that wrote the XOOPS core code are able to use the same bits of code for installing/updating system settings as they are for installing/updating modules.

So what? Right? Well, the point of all this is that it is really easy to create a new template for the XOOPS system. All you have to do is write the template (we'll do this later) and define that template for the XOOPS system module. If you don't already know, you define templates for your modules in each module's 'xoops_version.php' file. This file contains lots of things in it that tell XOOPS all about your module, not just template data. But the great thing is that, because of this architecture decision, it's really easy to define a new template. Simply add in this additional code somewhere around line 80:

$modversion['templates'][15]['description'] = 'Dummy template for custom blocks or blocks without templates';
$modversion['templates'][16]['file'] = 'system_search.html';
$modversion['templates'][16]['description'] = 'Smarty template for Xoops' search page.';

// Blocks


All we've done here is to define a 16th template. We've given it a file name, 'system_search.html' and a description which will show up whenever we try to edit our system templates.

Create the Smarty Template

Now it's time to really do something. Let's create the Smarty template for rendering our search page by creating a new file called '\modules\system\templates\system_search.html'. Please insert the following HTML/Smarty code into that new file that you just created:

<!-- Added by Lankford on 2007/7/26 -->

<
h3>"<{$search_type}>" <{$label_search_results}>: <{$showing}></h3>
<{
$label_keywords}>&nbsp;
    <
strong>
    <{* 
This section generates a space separated list of keywords that were searched. *}>
  <{
section name=cur_kw_searched loop=$searched_keywords}>
          <{
$searched_keywords[cur_kw_searched]}><{if $smarty.section.cur_kw_searched.index <> $smarty.section.cur_kw_searched.total}>&nbsp;<{/if}>
    <{/
section}>
    </
strong>
<
br />
<{
$label_ignored_keywords}>&nbsp;
    <
strong>
    <{* 
This section generates a space separated list of keywords that were NOT searched. *}>
     <{
section name=cur_kw_not_searched loop=$ignored_keywords}>
          <{
$ignored_keywords[cur_kw_not_searched]}><{if $smarty.section.cur_kw_not_searched.index <> $smarty.section.cur_kw_not_searched.total}>&nbsp;<{/if}>
    <{/
section}>
    </
strong>
<
br />

<{* 
    
This section generates a search results that mimic Xoops' original search.php results. 
    Note: The results are sorted.  Modules with higher hit counts are located on the page
          above modules with lower hit counts.
*}>
<{*  This section has been commented out in favor of the '
table' version located below...
<{foreach from=$module_sort_order key=sort_key item=sort_value}>
   <h3><{$sort_key}>: (<{$sort_value}> hits returned)</h3>
   
   <{section name=cur_result loop=$search_results[$sort_key].results}>
         <{if $smarty.section.cur_result.index > 0}><br /><{/if}>
       <img alt="<{$search_results[$sort_key].results[cur_result].processed_image_alt_text}>" src="<{$search_results[$sort_key].results[cur_result].processed_image_url}>" />
       <{$search_results[$sort_key].results[cur_result].processed_image_tag}>&nbsp;
       <b>
           <a href="<{$search_results[$sort_key].results[cur_result].link}>"><{$search_results[$sort_key].results[cur_result].processed_title}></a>
       </b>
       <br /><small>&nbsp;&nbsp;
           <a href="<{$search_results[$sort_key].results[cur_result].processed_user_url}>"><{$search_results[$sort_key].results[cur_result].processed_user_name}></a> <{$search_results[$sort_key].results[cur_result].processed_time}>
       </small>
   <{/section}>
  
   <br />
   <a href="<{$search_results[$sort_key].search_more_url}>"><{$search_results[$sort_key].search_more_title}></a>
<{/foreach}>

<hr />
*}>

<{* 
    This section generates a search results and places them into tables using the standard
    XOOPS style tags for table formatting. 
    Note: The results are sorted.  Modules with higher hit counts are located on the page
          above modules with lower hit counts.
*}>
<{foreach from=$module_sort_order key=sort_key item=sort_value}>
  <table class="outer" cellpadding="4" cellspacing="1" width="100%">
    <tr>
      <th colspan="2" align="left" class="head">
          <b><{$sort_key}></b>: (<{$sort_value}> hits returned)
      </th>
    </tr>
    <{if ($search_results[$sort_key].search_more_title == '') and ($sort_value > 0)}>
            <tr>
                <th colspan="2">
                <table cellspacing="0" cellpadding="0" width="100%">
                    <tr>
                        <td align="left">
                                <a href="<{$search_results[$sort_key].search_prev_url}>"><{$search_results[$sort_key].search_prev_title}></a>
                        </td>
                        <td align="right">
                                <a href="<{$search_results[$sort_key].search_next_url}>"><{$search_results[$sort_key].search_next_title}></a>
                        </td>
                    </tr>
                </table>
            </th>
            </tr>
       <{/if}>
    <{section name=cur_result loop=$search_results[$sort_key].results}>
        <tr>
          <td class="head">
              <{math equation="x + y" x=$smarty.section.cur_result.index y=$start}>
          </td>
          <td align="left" class="<{cycle values="even,odd"}>" width="100%">
               <img alt="<{$search_results[$sort_key].results[cur_result].processed_image_alt_text}>" src="<{$search_results[$sort_key].results[cur_result].processed_image_url}>" />
               <{$search_results[$sort_key].results[cur_result].processed_image_tag}>&nbsp;
               <b>
                   <a href="<{$search_results[$sort_key].results[cur_result].link}>"><{$search_results[$sort_key].results[cur_result].processed_title}></a>
               </b>
               <br /><small>&nbsp;&nbsp;
                   <a href="<{$search_results[$sort_key].results[cur_result].processed_user_url}>"><{$search_results[$sort_key].results[cur_result].processed_user_name}></a> <{$search_results[$sort_key].results[cur_result].processed_time}>
               </small>
          </td>
        </tr>
       <{/section}>
        <{if $sort_value > 0 }>
           <{if $search_results[$sort_key].search_more_title == ''}>
         <tr>
                <th colspan="2" align="right">
                <table cellspacing="0" cellpadding="0" width="100%">
                    <tr>
                        <td align="left">
                                <a href="<{$search_results[$sort_key].search_prev_url}>"><{$search_results[$sort_key].search_prev_title}></a>
                        </td>
                        <td align="right">
                                <a href="<{$search_results[$sort_key].search_next_url}>"><{$search_results[$sort_key].search_next_title}></a>
                        </td>
                    </tr>
                </table>
            </th>
        </tr>
           <{else}>
             <{if $search_results[$sort_key].search_more_url != ''}>
             <tr>
                    <th colspan="2" align="right">
                         <a href="<{$search_results[$sort_key].search_more_url}>"><{$search_results[$sort_key].search_more_title}></a>
                    </th>
                </tr>
             <{/if}>
        <{/if}>
   <{/if}>
   </table>
   <br />
<{/foreach}>


<hr />
<{$search_form}>


search.php

The last major step involves updating the main search PHP page in the root of the XOOPS system. Since the existing page generates all the HTML, we'll have to overhaul it so that places everything into Smarty template variables and passes those variables to the template we just created instead. So, edit your '\search.php' and make sure it looks like this:

<?php
// $Id: search.php 506 2006-05-26 23:10:37Z skalpa $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://xoops.org/>                             //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program 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            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //

$xoopsOption['pagetype'] = "search";

include 
'mainfile.php';

$xoopsOption['template_main'] = 'system_search.html';

$config_handler =& xoops_gethandler('config');
$xoopsConfigSearch =& $config_handler->getConfigsByCat(XOOPS_CONF_SEARCH);

if (
$xoopsConfigSearch['enable_search'] != 1) {
    
header('Location: '.XOOPS_URL.'/index.php');
    exit();
}

include 
XOOPS_ROOT_PATH.'/header.php';

$action "search";
if (!empty(
$_GET['action'])) {
  
$action $_GET['action'];
} elseif (!empty(
$_POST['action'])) {
  
$action $_POST['action'];
}
$query "";
if (!empty(
$_GET['query'])) {
  
$query $_GET['query'];
} elseif (!empty(
$_POST['query'])) {
  
$query $_POST['query'];
}
$andor "AND";
if (!empty(
$_GET['andor'])) {
  
$andor $_GET['andor'];
} elseif (!empty(
$_POST['andor'])) {
  
$andor $_POST['andor'];
}
$mid $uid $start 0;
if ( !empty(
$_GET['mid']) ) {
  
$mid intval($_GET['mid']);
} elseif ( !empty(
$_POST['mid']) ) {
  
$mid intval($_POST['mid']);
}
if (!empty(
$_GET['uid'])) {
  
$uid intval($_GET['uid']);
} elseif (!empty(
$_POST['uid'])) {
  
$uid intval($_POST['uid']);
}
if (!empty(
$_GET['start'])) {
  
$start intval($_GET['start']);
} elseif (!empty(
$_POST['start'])) {
  
$start intval($_POST['start']);
}

$xoopsTpl->assign("start"$start 1);

$queries = array();

if (
$action == "recoosults") {
    if (
$query == "") {
         
redirect_header("search.php",1,_SR_PLZENTER);
        exit();
    }
} elseif (
$action == "showall") {
    if (
$query == "" || empty($mid)) {
        
redirect_header("search.php",1,_SR_PLZENTER);
        exit();
    }
} elseif (
$action == "showallbyuser") {
    if (empty(
$mid) || empty($uid)) {
        
redirect_header("search.php",1,_SR_PLZENTER);
        exit();
    }
}

$groups is_object($xoopsUser) ? $xoopsUser -> getGroups() : XOOPS_GROUP_ANONYMOUS;
$gperm_handler = & xoops_gethandler'groupperm' );
$available_modules $gperm_handler->getItemIds('module_read'$groups);

if (
$action == 'search') {
    
// This area seems to handle the 'just display the advanced search page' part.
   
$search_form = include 'include/searchform.php';
   
$xoopsTpl->assign('search_form'$search_form);
    include 
XOOPS_ROOT_PATH.'/footer.php';
    exit();
}

if ( 
$andor != "OR" && $andor != "exact" && $andor != "AND" ) {
    
$andor "AND";
}
$xoopsTpl->assign("search_type"$andor);

$myts =& MyTextSanitizer::getInstance();
if (
$action != 'showallbyuser') {
    if ( 
$andor != "exact" ) {
        
$ignored_queries = array(); // holds kewords that are shorter than allowed minmum length
        
$temp_queries preg_split('/[s,]+/'$query);
        foreach (
$temp_queries as $q) {
            
$q trim($q);
            if (
strlen($q) >= $xoopsConfigSearch['keyword_min']) {
                
$queries[] = $myts->addSlashes($q);
            } else {
                
$ignored_queries[] = $myts->addSlashes($q);
            }
        }
        if (
count($queries) == 0) {
            
redirect_header('search.php'2sprintf(_SR_KEYTOOSHORT$xoopsConfigSearch['keyword_min']));
            exit();
        }
    } else {
        
$query trim($query);
        if (
strlen($query) < $xoopsConfigSearch['keyword_min']) {
            
redirect_header('search.php'2sprintf(_SR_KEYTOOSHORT$xoopsConfigSearch['keyword_min']));
            exit();
        }
        
$queries = array($myts->addSlashes($query));
    }
}
$xoopsTpl->assign("label_search_results"_SR_SEARCHRESULTS);

// Keywords section.
$xoopsTpl->assign("label_keywords"_SR_KEYWORDS ':');
$keywords = array();
$ignored_keywords = array();
foreach (
$queries as $q) {
    
$keywords[] = htmlspecialchars(stripslashes($q));
}
if (!empty(
$ignored_queries)) {
     
$xoopsTpl->assign("label_ignored_keywords"sprintf(_SR_IGNOREDWORDS$xoopsConfigSearch['keyword_min']));
    foreach (
$ignored_queries as $q) {
        
$ignored_keywords[] = htmlspecialchars(stripslashes($q));
    }
    
$xoopsTpl->assign("ignored_keywords"$ignored_keywords);
}
$xoopsTpl->assign("searched_keywords"$keywords);

$all_results = array();
$all_results_counts = array();
switch (
$action) {
    case 
"results":
        
$module_handler =& xoops_gethandler('module');
        
$criteria = new CriteriaCompo(new Criteria('hassearch'1));
        
$criteria->add(new Criteria('isactive'1));
        
$criteria->add(new Criteria('mid'"(".implode(','$available_modules).")"'IN'));
        
$modules =& $module_handler->getObjects($criteriatrue);
        
$mids = isset($_REQUEST['mids']) ? $_REQUEST['mids'] : array();
        if (empty(
$mids) || !is_array($mids)) {
            unset(
$mids);
            
$mids array_keys($modules);
        }
    
        foreach (
$mids as $mid) {
            
$mid intval($mid);
            if ( 
in_array($mid$available_modules) ) {
                
$module =& $modules[$mid];
                
$results =& $module->search($queries$andor50);
                
$xoopsTpl->assign("showing"sprintf(_SR_SHOWING15));
                
$count count($results);
                
$all_results_counts[$module->getVar('name')] = $count;

                if (!
is_array($results) || $count == 0) {
                    
$all_results[$module->getVar('name')] = array();
                } else {
                    for (
$i 0$i $count$i++) {
                          
$results[$i]['processed_image_alt_text'] = $myts->makeTboxData4Show($module->getVar('name')) . ": ";
                        if (isset(
$results[$i]['image']) && $results[$i]['image'] != "") {
                              
$results[$i]['processed_image_url'] = "modules/" $module->getVar('dirname') . "/" $results[$i]['image'];
                        } else {
                              
$results[$i]['processed_image_url'] = "images/icons/posticon2.gif";
                        }
                        if (!
preg_match("/^http[s]*:///i"$results[$i]['link'])) {
                            
$results[$i]['link'] = "modules/".$module->getVar('dirname')."/".$results[$i]['link'];
                        }
                        
$results[$i]['processed_title'] = $myts->makeTboxData4Show($results[$i]['title']);
                        
$results[$i]['uid'] = @intval($results[$i]['uid']);
                        if ( !empty(
$results[$i]['uid']) ) {
                            
$uname XoopsUser::getUnameFromId($results[$i]['uid']);
                            
$results[$i]['processed_user_name'] = $uname;
                            
$results[$i]['processed_user_url'] = XOOPS_URL."/userinfo.php?uid=".$results[$i]['uid'];
                        }
                        
$results[$i]['processed_time'] = !empty($results[$i]['time']) ? " ("formatTimestamp(intval($results[$i]['time'])).")" "";
                    }
                    if ( 
$count >= ) {
                        
$search_url XOOPS_URL.'/search.php?query='.urlencode(stripslashes(implode(' '$queries)));
                        
$search_url .= "&mid=$mid&action=showall&andor=$andor";
                    } else {
                        
$search_url "";
                    }
                    
$all_results[$module->getVar('name')] = array("search_more_title" => _SR_SHOWALLR
                                                                
"search_more_url" => htmlspecialchars($search_url), 
                                                                                                                  
"search_next_title" => ""
                                                                    
"search_next_url" => ""
                                                                    
"search_prev_title" => "",
                                                                    
"search_prev_url" => "",
                                                                
"results" =>$results);
                }
            }
            unset(
$results);
            unset(
$module);
        }
        break;
    case 
"showall":
    case 
'showallbyuser':
        
$module_handler =& xoops_gethandler('module');
        
$module =& $module_handler->get($mid);
        
$results =& $module->search($queries$andor20$start$uid);
      
$xoopsTpl->assign("showing"sprintf(_SR_SHOWING$start 1$start 20));
        
$count count($results);
        
$all_results_counts[$module->getVar('name')] = $count;
        if (
is_array($results) && $count 0) {
            
$next_results =& $module->search($queries$andor1$start 20$uid);
            
$next_count count($next_results);
            
$has_next false;

            if (
is_array($next_results) && $next_count == 1) {
                
$has_next true;
            }

            for (
$i 0$i $count$i++) {
                  
$results[$i]['processed_image_alt_text'] = $myts->makeTboxData4Show($module->getVar('name')) . ": ";
                if (isset(
$results[$i]['image']) && $results[$i]['image'] != "") {
                      
$results[$i]['processed_image_url'] = "modules/" $module->getVar('dirname') . "/" $results[$i]['image'];
                } else {
                      
$results[$i]['processed_image_url'] = "images/icons/posticon2.gif";
                }
                if (!
preg_match("/^http[s]*:///i"$results[$i]['link'])) {
                    
$results[$i]['link'] = "modules/".$module->getVar('dirname')."/".$results[$i]['link'];
                }
                
$results[$i]['processed_title'] = $myts->makeTboxData4Show($results[$i]['title']);
                
$results[$i]['uid'] = @intval($results[$i]['uid']);
                if ( !empty(
$results[$i]['uid']) ) {
                    
$uname XoopsUser::getUnameFromId($results[$i]['uid']);
                    
$results[$i]['processed_user_name'] = $uname;
                    
$results[$i]['processed_user_url'] = XOOPS_URL."/userinfo.php?uid=".$results[$i]['uid'];
                }
                
$results[$i]['processed_time'] = !empty($results[$i]['time']) ? " ("formatTimestamp(intval($results[$i]['time'])).")" "";
            }
            
                        
$search_url_prev "";
                        
$search_url_next "";
                        
              
$search_url XOOPS_URL.'/search.php?query='.urlencode(stripslashes(implode(' '$queries)));
                
$search_url .= "&mid=$mid&action=$action&andor=$andor";
                if (
$action=='showallbyuser') {
                    
$search_url .= "&uid=$uid";
                }
                if ( 
$start ) {
                    
$prev $start 20;
                    
$search_url_prev $search_url."&start=$prev";
                }
                if (
false != $has_next) {
                    
$next $start 20;
                    
$search_url_next $search_url."&start=$next";
                }
                
          
$all_results[$module->getVar('name')] = array("search_more_title" => "",
                                                                                                      
"search_more_url" => "",
                                                                                                      
"search_next_title" => _SR_NEXT
                                                        
"search_next_url" => htmlspecialchars($search_url_next), 
                                                        
"search_prev_title" => _SR_PREVIOUS,
                                                        
"search_prev_url" => htmlspecialchars($search_url_prev),
                                                        
"results" =>$results);
        } else {
            echo 
'<p>'._SR_NOMATCH.'</p>';
        }
        break;
}
arsort($all_results_counts);
$xoopsTpl->assign("module_sort_order"$all_results_counts);
$xoopsTpl->assign("search_results"$all_results);

$search_form = include 'include/searchform.php';
$xoopsTpl->assign('search_form'$search_form);

include 
XOOPS_ROOT_PATH."/footer.php";
?>


Update the System Module

You've now placed all your shiny new code onto the site, but you won't see anything good yet until you do a couple of things first. First and foremost, you need to 'update' the system module so that your new Smarty template is loaded into the database. Follow these steps to do this:

*) Goto the administration section on your website ('\admin.php').
*) Click the “System Admin” button on the left side of the screen.
*) Click on “Modules”.
*) Click the module update button for the system administration module (Resized Image) and confirm your selection.

You should see the following text somewhere on the screen:

Quote:

Template system_search.html inserted to the database.
Template system_search.html recompiled.


Update the Default Template Set (optional)

Hopefully, you are aware of the fact that you can define multiple template sets and select whichever one you'd like to be the 'default' template set for your web site. It would be really great if you could associate template sets with themes (hint, hint) ... but I digress. The point here, is that if you've decided to modify your templates to enhance the visual appearance of your web site (and if you are following these instructions, then that's a pretty safe assumption), you'll want to ensure that the new template we just made available is present in your default template set. Please following these instructions to do so:

*) Goto the administration section on your website ('\admin.php').
*) Click the “System Admin” button on the left side of the screen.
*) Click on “Templates”.
*) In the Template Set Manager, find the row with a check mark in the far right column. This row is the currently selected template set for your site.
*) Click the “List” link to the right of “System” in the Templates column of the Template Set Manager for the currently selected template set (boy that's a mouth full!).
*) On the resulting page find the “system_search.html” row that is highlighted in yellow and click on the “Generate” link. This will ensure that this particular template set has your new search template ready for use.

Conclusion

That's it. Your new search page should be up and running (although you might have to clear out your template cache folder if you're still seeing the old one). You may now customize the look and feel of your site's search page by updating the appropriate template whenever you like. If you think this has been helpful, then please lobby the XOOPS folks to have changes like this added to the core for the next version of Xoops.




TopTop
« 1 2 3 4 (5) 6 7 8 ... 14 »



Login

Who's Online

213 user(s) are online (153 user(s) are browsing Support Forums)


Members: 0


Guests: 213


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits