There are no documents to show.
\n"; } } // _pageindex() } // syntax_plugin_pageindexThere are no documents to show.
\n"; } // New Oct 3, 2006 -- end // if(count($search_data)) { // renamed $data to $search_data // $renderer->doc .= html_buildlist($search_data, // 'idx', // 'html_list_index', // 'html_li_index'); // } else { // $renderer->doc .= "\n\tThere are no documents to show.
\n"; // } //$renderer->doc .= "\n\n"; } // _pageindex() } // syntax_plugin_pageindex
*** syntax.php 2006/12/16 19:27:01 1.1
--- syntax.php 2006/12/16 19:37:06
***************
*** 21,27 ****
function search_list_index(&$data,$base,$file,$type,$lvl,$opts){
global $ID;
//we do nothing with directories
! if($type == 'd') return false;
if(preg_match('#\.txt$#',$file)){
//check ACL
$id = pathID($file);
--- 21,35 ----
function search_list_index(&$data,$base,$file,$type,$lvl,$opts){
global $ID;
//we do nothing with directories
! if($type == 'd') {
! $id = pathID($file);
! if($opts['ns'].":$id" <> $ID) {
! $data[] = array(
! 'id' => $opts['ns'].":$id",
! 'type' => $type,
! 'level' => $lvl );
! }
! }
if(preg_match('#\.txt$#',$file)){
//check ACL
$id = pathID($file);
----
**Possible bug?**
Thanks for the plugin, it's very handy. But I have to say I guess I found a bug. If working on Windows (I test my websites on Windows but host them on Linux/FreeBSD then) the hard-coded slashes in the code (I mean like that: /) cause the bug. Windows puts backslashes in directory path and the plugin, quite contrary, adds slashes. It works OK until no arguments are specified (just ~~PAGEINDEX~~), but if something like ~~PAGEINDEX=dev;sidebar~~ is tried then it starts telling there are no documents to index. Please replace ALL hard-coded slashes to something platform-independent. Regards, Webmaster.
//2007/12/30// I've altered the lines with '/' constants to use the DIRECTORY_SEPARATOR constant so paths should now be more platform independent. \\
// New Oct 3, 2006 -- end
$ns = cleanID(getNS("$data:dummy"));
with
// New Oct 3, 2006 -- end
$ns = cleanID(getNS("{$parameters[0]}:dummy"));
to make the exclude function work. We also had to specify the full pagename including namespace: prefix to actually exclude the page.
RĂ¼diger Marwein / Roland Eckert / [[http://21torr.com|21torr.com]]
> **Solution to last thing above**\\
> One way to avoid having to prefix the name space, is to add one line to the $skipitems loop.\\
> Before snippet:
>
foreach($skipitems as $skip) {
if($item['id'] == $skip) {
$found = true;
break;
> After snippet:
>
foreach($skipitems as $skip) {
$skip = strpos($skip,":") ? $skip : "$ns:$skip"; // Add ns if user didn't
if($item['id'] == $skip) {
$found = true;
break;
> Henrik Andreasson.
----
Bug: after copying the script from the page above I got a PHP error on my next "save page" click. I had to remove the ''?>'' part of the last line of the script and it functioned since.
It is reported here about this problem in general: [[:wiki:development#php_closing_tags]]
- Stephen (stephen-dot-leedle-at-gmx-dot-de)
----
I prefer the [[plugin:pagelist|pagelist plugin]] for rendering. It's easy to add :
Just replace theses lines :
$renderer->doc .= html_buildlist($checked,
'idx',
'html_list_index',
'html_li_index');
by
$pages = $checked;
$pagelist =& plugin_load('helper', 'pagelist');
if (!$pagelist) return false; // failed to load plugin
$pagelist->startList();
foreach ($pages as $page){
$pagelist->addPage($page);
}
$renderer->doc .= $pagelist->finishList();
You can set flags too with
$pagelist->setFlags(array("nouser", "desc")); // Just after $pagelist->startList();
I don't know why, but it don't work with "tag" and "comments" flags. Any idea ? (I have both plugins installed)
--- //[[jeanmichel.lacroix@gmail.com|Jean-Michel]] 2008-03-02 18:26//
-------------
:!: Possible bug
I really like this plugin, but I think I've found a bug. When I create a new page in a namespace, it doesn't appear on the list created by the plugin, but if I make a preview of the page it does appear.
May it be a problem of refreshing?
//[[digna.gonzalezotero@gmail.com|Ayla]] 2008-04-06 18:40//
try to to a ~~NOCACHE~~ on the page with the ~~PAGEINDEX~~ . Every Page is cached in plain-HTML for a given time if not modified or with that tag.
----------------
:!: It's not a bug, it's a feature
If you use some templates that make a sitemap on the right or on the left ... beware of redefinition of function search_list_index()
workaround is vi regexp in the pasted syntax.php :
:%s/search_list_index/search_list_index_whateveryouwant/g
----------------
:!: Possible bug: No unicode (cyrillics, for example) support.