Exemplo n.º 1
0
<?php

// -*-php-*-
rcs_id('$Id: CategoryPage.php,v 1.2 2004/07/08 20:30:07 rurban Exp $');
/**
Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam

This file is part of PhpWiki.

PhpWiki 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.

PhpWiki 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 PhpWiki; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
#require_once('lib/InlineParser.php');
require_once 'lib/BlockParser.php';
/**
 * CategoryPage plugin.
 *
 * This puts boilerplate text on a category page to make it easily usable
 * by novices.
 *
Exemplo n.º 2
0
<?php

// -*-php-*-
rcs_id('$Id: RichTable.php,v 1.7 2005/05/06 17:44:24 rurban Exp $');
/**
  RichTablePlugin
  A PhpWiki plugin that allows insertion of tables using a richer syntax.
  Src: http://www.it.iitb.ac.in/~sameerds/phpwiki/index.php/RichTablePlugin
  Docs: http://phpwiki.org/RichTablePlugin
*/
/* 
 * Copyright (C) 2003 Sameer D. Sahasrabuddhe
 * Copyright (C) 2005 $ThePhpWikiProgrammingTeam
 *
 * This file is part of PhpWiki.
 *
 * PhpWiki 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.
 * 
 * PhpWiki 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 PhpWiki; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
// error_reporting (E_ALL & ~E_NOTICE);
Exemplo n.º 3
0
<?php

rcs_id('PHP Fortune - Made by henrik@aasted.org. HP: http://www.aasted.org');
rcs_id('$Id: fortune.php,v 1.2 2004/11/21 11:59:20 rurban Exp $');
/* 
Main methods to use:
 quoteFromDir($dir):
   Quotes from any of the fortune-files in the dir.
 getRandomQuote($file):
   Quotes from the specific file.
   
 Written by Henrik Aasted Sorensen, henrik@aasted.org
 Read more at http://www.aasted.org/quote
*/
class Fortune
{
    function quoteFromDir($dir)
    {
        $amount = 0;
        $index = 0;
        if ($handle = opendir($dir)) {
            while (false !== ($file = readdir($handle))) {
                if (strpos($file, ".dat") != false) {
                    $len = strlen($file);
                    if (substr($file, $len - 4) == ".dat") {
                        $number = $this->getNumberOfQuotes($dir . "/" . $file);
                        $amount += $number;
                        $quotes[$index] = $amount;
                        $files[$index] = $file;
                        $index++;
                    }
Exemplo n.º 4
0
<?php

rcs_id('$Id: themeinfo.php,v 1.3 2005/09/18 13:04:37 rurban Exp $');
/*
 * This file defines the default appearance ("theme") of PhpWiki.
 */
require_once 'lib/Theme.php';
$WikiTheme = new WikiTheme('Crao');
// CSS file defines fonts, colors and background images for this
// style.  The companion '*-heavy.css' file isn't defined, it's just
// expected to be in the same directory that the base style is in.
// This should result in phpwiki-printer.css being used when
// printing or print-previewing with style "PhpWiki" selected.
$WikiTheme->setDefaultCSS('Crao', array('' => 'crao.css', 'print' => ''));
// This allows one to manually select "Printer" style (when browsing page)
// to see what the printer style looks like.
//$WikiTheme->addAlternateCSS(_("Printer"), 'phpwiki-printer.css');
//$WikiTheme->addAlternateCSS(_("Top & bottom toolbars"), 'phpwiki-topbottombars.css');
//$WikiTheme->addAlternateCSS(_("Modern"), 'phpwiki-modern.css');
/**
 * The logo image appears on every page and links to the HomePage.
 */
//$WikiTheme->addImageAlias('logo', 'logo.png');
/**
 * The Signature image is shown after saving an edited page. If this
 * is not set, any signature defined in index.php will be used. If it
 * is not defined by index.php or in here then the "Thank you for
 * editing..." screen will be omitted.
 */
// Comment this next line out to enable signature.
$WikiTheme->addImageAlias('signature', false);
Exemplo n.º 5
0
<?php

// -*-php-*-
rcs_id('$Id: WikiAdminChown.php,v 1.8 2005/01/29 19:48:14 rurban Exp $');
/*
Copyright 2004 $ThePhpWikiProgrammingTeam

This file is part of PhpWiki.

PhpWiki 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.

PhpWiki 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 PhpWiki; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
/**
 * Usage:   <?plugin WikiAdminChown s||=* ?> or called via WikiAdminSelect
 * @author:  Reini Urban <*****@*****.**>
 *
 * KNOWN ISSUES:
 * Requires PHP 4.2 so far.
 */
require_once 'lib/PageList.php';
Exemplo n.º 6
0
<?php

// display.php: fetch page or get default content
rcs_id('$Id: display.php,v 1.65 2005/05/05 08:54:40 rurban Exp $');
require_once 'lib/Template.php';
require_once 'common/reference/CrossReferenceFactory.class.php';
/**
 * Extract keywords from Category* links on page. 
 */
function GleanKeywords($page)
{
    if (!defined('KEYWORDS')) {
        return '';
    }
    include_once "lib/TextSearchQuery.php";
    $search = new TextSearchQuery(KEYWORDS, true);
    $KeywordLinkRegexp = $search->asRegexp();
    // iterate over the pagelinks (could be a large number) [15ms on PluginManager]
    // or do a titleSearch and check the categories if they are linked?
    $links = $page->getPageLinks();
    $keywords[] = SplitPagename($page->getName());
    while ($link = $links->next()) {
        if (preg_match($KeywordLinkRegexp, $link->getName(), $m)) {
            $keywords[] = SplitPagename($m[0]);
        }
    }
    $keywords[] = WIKI_NAME;
    return join(', ', $keywords);
}
/** Make a link back to redirecting page.
 *
Exemplo n.º 7
0
<?php

rcs_id('$Id: themeinfo.php,v 1.1 2004/12/19 17:34:19 rurban Exp $');
/**
 * A minimalistic design by walter rafelsberger
 * See http://www.shamino.com/wiki/
 *
 * Tiny actionbar: PageInfo, Edit and 
 *   all other Actionbars buttons in info.tmpl, 
 * Signin implictly after Edit.
 * tiny navbar: without buttons, just links
 * no logo
 */
require_once 'lib/Theme.php';
class Theme_shamino_com extends Theme
{
    function makeActionButton($action, $label = false, $page_or_rev = false)
    {
        extract($this->_get_name_and_rev($page_or_rev));
        if (is_array($action)) {
            $attr = $action;
            $action = isset($attr['action']) ? $attr['action'] : 'browse';
        } else {
            $attr['action'] = $action;
        }
        $class = is_safe_action($action) ? 'named-wiki' : 'wikiadmin';
        if (!$label) {
            $label = $this->_labelForAction($action);
        }
        if ($version) {
            $attr['version'] = $version;
Exemplo n.º 8
0
<?php

//-*-php-*-
rcs_id('$Id: WikiUserNew.php,v 1.137 2006/05/03 06:05:37 rurban Exp $');
/* Copyright (C) 2004,2005 $ThePhpWikiProgrammingTeam
 *
 * This file is part of PhpWiki.
 * 
 * PhpWiki 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.
 * 
 * PhpWiki 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 PhpWiki; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
/**
 * This is a complete OOP rewrite of the old WikiUser code with various
 * configurable external authentication methods.
 *
 * There's only one entry point, the function WikiUser which returns 
 * a WikiUser object, which contains the name, authlevel and user's preferences.
 * This object might get upgraded during the login step and later also.
 * There exist three preferences storage methods: cookie, homepage and db,
 * and multiple password checking methods.
Exemplo n.º 9
0
<?php

// -*-php-*-
rcs_id('$Id: UserPreferences.php,v 1.35 2004/10/13 14:13:55 rurban Exp $');
/**
Copyright (C) 2001,2002,2003,2004,2005 $ThePhpWikiProgrammingTeam

This file is part of PhpWiki.

PhpWiki 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.

PhpWiki 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 PhpWiki; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
/**
 * Plugin to allow any user to adjust his own preferences.
 * This must be used in the page "UserPreferences".
 * Prefs are stored in metadata in the current session, 
 *  within the user's home page or in a database.
 *
 * Theme extension: Themes are able to extend the predefined list 
 * of preferences.
Exemplo n.º 10
0
<?php

// -*-php-*-
rcs_id('$Id: PDO.php,v 1.7 2006/05/14 12:28:03 rurban Exp $');
/*
 Copyright 2005 $ThePhpWikiProgrammingTeam

 This file is part of PhpWiki.

 PhpWiki 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.

 PhpWiki 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 PhpWiki; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
/**
 * @author: Reini Urban
 */
require_once 'lib/WikiDB/backend.php';
class WikiDB_backend_PDO extends WikiDB_backend
{
    function WikiDB_backend_PDO($dbparams)
    {
Exemplo n.º 11
0
<?php

// -*-php-*-
rcs_id('$Id: Transclude.php,v 1.9 2004/06/14 11:31:39 rurban Exp $');
/**
Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam

This file is part of PhpWiki.

PhpWiki 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.

PhpWiki 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 PhpWiki; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
/**
 * Transclude:  Include an external web page within the body of a wiki page.
 *
 * Usage:
 *  <?plugin Transclude
 *           src=http://www.internet-technology.de/fourwins_de.htm
 *  ?>
 *
Exemplo n.º 12
0
<?php

// -*-php-*-
rcs_id('$Id: SiteMap.php,v 1.13 2004/12/14 21:36:06 rurban Exp $');
/**
Copyright 1999,2000,2001,2002,2004 $ThePhpWikiProgrammingTeam

This file is part of PhpWiki.

PhpWiki 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.

PhpWiki 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 PhpWiki; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
/**
 * http://sourceforge.net/tracker/?func=detail&aid=537380&group_id=6121&atid=306121
 *
 * Submitted By: Cuthbert Cat (cuthbertcat)
 *
 * This is a quick mod of BackLinks to do the job recursively. If your
 * site is categorized correctly, and all the categories are listed in
 * CategoryCategory, then a RecBackLinks there will produce a contents
Exemplo n.º 13
0
<?php

//-*-php-*-
rcs_id('$Id: RatingsUser.php,v 1.5 2004/11/15 16:00:02 rurban Exp $');
/* Copyright (C) 2004 Dan Frankowski
 *
 * This file is (not yet) part of PhpWiki.
 * 
 * PhpWiki 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.
 * 
 * PhpWiki 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 PhpWiki; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
require_once "lib/wikilens/RatingsDb.php";
/**
 * Get a RatingsUser instance (possibly from a cache).
 */
class RatingsUserFactory
{
    function &getUser($userid)
    {
        //print "getUser($userid) ";
Exemplo n.º 14
0
<?php

// -*-php-*-
rcs_id('$Id: PageType.php,v 1.45 2005/05/06 16:48:41 rurban Exp $');
/*
Copyright 1999,2000,2001,2002,2003,2004,2005 $ThePhpWikiProgrammingTeam

This file is part of PhpWiki.

PhpWiki 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.

PhpWiki 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 PhpWiki; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
require_once 'lib/CachedMarkup.php';
/** A cacheable formatted wiki page.
 */
class TransformedText extends CacheableMarkup
{
    /** Constructor.
     *
     * @param WikiDB_Page $page
Exemplo n.º 15
0
    ${$var} = preg_replace('/&PHPSESSID=.*/', '', $value);
}
// essential internal stuff -- skip it. Go down to Part One. There
// are four parts to this file that interest you, all labeled Part
// One, Two, Three and Four.
set_magic_quotes_runtime(0);
error_reporting(E_ALL ^ E_NOTICE);
if (!function_exists('rcs_id')) {
    function rcs_id($id)
    {
        // Gilles Casse (2003-01-21) for the Oralux website
        //
        //echo "<!-- $id -->\n";
    }
}
rcs_id('$Id: config.php,v 1.1 2004/09/28 21:48:45 gcasse Exp $');
// end essential internal stuff
/////////////////////////////////////////////////////////////////////
// Part One:
// Constants and settings. Edit the values below for your site.
/////////////////////////////////////////////////////////////////////
// Gilles Casse (2003-01-21) for the Oralux website.
$FrontPage = "German1";
$Menu = array("German" => array(1 => "German1", 2 => "German2"), "Spanish" => array(1 => "Spanish1", 2 => "Spanish2"));
$Translate = array("Translation" => array("en" => "Translation", "fr" => "Traduction"), "RecentChanges" => array("en" => "Recent changes", "fr" => "Changements récents"), "Diff" => array("en" => "Comparison to the archived version of ", "fr" => "Comparaison avec la version archivée de "), "German" => array("en" => "German Translations", "fr" => "Traductions en allemand"), "Spanish" => array("en" => "Spanish Translations", "fr" => "Traductions en espagnol"));
function GetFullName($theName)
{
    global $Translate;
    global $Menu;
    // Translate the filename in the relevant title
    // e.g. "German1" gets "Allemand (1)"
Exemplo n.º 16
0
<?php

//-*-php-*-
rcs_id('$Id: loadsave.php,v 1.137 2005/01/30 23:14:38 rurban Exp $');
/*
Copyright 1999,2000,2001,2002,2004,2005,2006 $ThePhpWikiProgrammingTeam

This file is part of PhpWiki.

PhpWiki 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.

PhpWiki 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 PhpWiki; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
require_once "lib/ziplib.php";
require_once "lib/Template.php";
/**
 * ignore fatal errors during dump
 */
function _dump_error_handler(&$error)
{
    if ($error->isFatal()) {
Exemplo n.º 17
0
<?php

// -*-php-*-
rcs_id('$Id: Diff.php,v 1.3 2005/09/30 18:53:10 uckelman Exp $');
/**
Copyright 1999, 2000, 2001, 2002, 2004 $ThePhpWikiProgrammingTeam

This file is part of PhpWiki.

PhpWiki 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.

PhpWiki 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 PhpWiki; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
/**
 * lib/diff.php converted to a plugin by electrawn, 
 * plugin cleaned up by rurban,
 * code by dairiki
 *
 * Would make sense to see arbitrary diff's between any files or revisions.
 */
require_once 'lib/difflib.php';
Exemplo n.º 18
0
<?php

// -*-php-*-
rcs_id('$Id: RecentChanges.php,v 1.109 2006/03/19 14:26:29 rurban Exp $');
/**
Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam

This file is part of PhpWiki.

PhpWiki 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.

PhpWiki 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 PhpWiki; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
/**
 */
class _RecentChanges_Formatter
{
    var $_absurls = false;
    function _RecentChanges_Formatter($rc_args)
    {
        $this->_args = $rc_args;
Exemplo n.º 19
0
<?php

// -*-php-*-
rcs_id('$Id: RatingsDb.php,v 1.12 2004/11/15 16:00:02 rurban Exp $');
/*
 * @author:  Dan Frankowski (wikilens group manager), Reini Urban (as plugin)
 *
 * TODO: 
 * - fix RATING_STORAGE = WIKIPAGE
 * - fix smart caching
 * - finish mysuggest.c (external engine with data from mysql)
 * - add php_prediction from wikilens
 * - add the various show modes (esp. TopN queries in PHP)
 */
/*
 CREATE TABLE rating (
        dimension INT(4) NOT NULL,
        raterpage INT(11) NOT NULL,
        rateepage INT(11) NOT NULL,
        ratingvalue FLOAT NOT NULL,
        rateeversion INT(11) NOT NULL,
        isPrivate ENUM('yes','no'),
        tstamp TIMESTAMP(14) NOT NULL,
        PRIMARY KEY (dimension, raterpage, rateepage)
 );
*/
//FIXME! for other than SQL backends
if (!defined('RATING_STORAGE')) {
    define('RATING_STORAGE', 'SQL');
}
//TODO: support ADODB
Exemplo n.º 20
0
<?php

rcs_id('$Id: BlockParser.php,v 1.55 2005/01/29 21:08:41 rurban Exp $');
/* Copyright (C) 2002 Geoffrey T. Dairiki <*****@*****.**>
 * Copyright (C) 2004,2005 Reini Urban
 *
 * This file is part of PhpWiki.
 * 
 * PhpWiki 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.
 * 
 * PhpWiki 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 PhpWiki; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
require_once 'lib/HtmlElement.php';
require_once 'lib/CachedMarkup.php';
require_once 'lib/InlineParser.php';
////////////////////////////////////////////////////////////////
//
//
/**
 * Deal with paragraphs and proper, recursive block indents 
 * for the new style markup (version 2)
Exemplo n.º 21
0
<?php

// -*-php-*-
rcs_id('$Id: ListSubpages.php,v 1.6 2004/11/23 15:17:19 rurban Exp $');
/*
Copyright 2002 $ThePhpWikiProgrammingTeam

This file is part of PhpWiki.

PhpWiki 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.

PhpWiki 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 PhpWiki; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
/**
 * ListSubpages:  Lists the names of all SubPages of the current page.
 *                Based on UnfoldSubpages.
 * Usage:   <?plugin ListSubpages noheader=1 info=pagename,hits,mtime ?>
 */
require_once 'lib/PageList.php';
class WikiPlugin_ListSubpages extends WikiPlugin
{
Exemplo n.º 22
0
<?php

// -*-php-*-
rcs_id('$Id: RdfDefinition.php,v 1.6 2004/09/14 10:33:39 rurban Exp $');
/*
Copyright 2004 Reini Urban

This file is part of PhpWiki.

PhpWiki 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.

PhpWiki 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 PhpWiki; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
/**
 * RdfDefinition - Define the RDF vocabulary for a wiki subset.
 * <subject> - <predicate>  - <object>
 *                 <=>
 * page    - link-qualifier - pagelinkedto
 *
 * Similar to the InterWikiMap PageType, with the difference 
 * that the initerwiki map links are wiki global, and a RDF vocabulary
Exemplo n.º 23
0
<?php

// -*-php-*-
rcs_id('$Id: ADODB_sqlite.php,v 1.2 2004/07/05 13:56:23 rurban Exp $');
require_once 'lib/WikiDB/backend/ADODB.php';
/**
 * WikiDB layer for ADODB-sqlite, called by lib/WikiDB/ADODB.php.
 * Just to create a not existing database.
 * 
 * @author: Reini Urban
 */
class WikiDB_backend_ADODB_sqlite extends WikiDB_backend_ADODB
{
    /**
     * Constructor.
     */
    function WikiDB_backend_ADODB_sqlite($dbparams)
    {
        $parsed = parseDSN($dbparams['dsn']);
        if (!file_exists($parsed['database'])) {
            // creating the empty database
            $db = $parsed['database'];
            $schema = FindFile("schemas/sqlite.sql");
            `sqlite {$db} < {$schema}`;
        }
        $this->WikiDB_backend_ADODB($dbparams);
    }
    function _get_pageid($pagename, $create_if_missing = false)
    {
        $dbh =& $this->_dbh;
        $page_tbl = $this->_table_names['page_tbl'];
Exemplo n.º 24
0
<?php

// -*-php-*-
rcs_id('$Id: WikiFormRich.php,v 1.15 2004/11/26 18:25:33 rurban Exp $');
/*
Copyright 2004 $ThePhpWikiProgrammingTeam

This file is part of PhpWiki.

PhpWiki 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.

PhpWiki 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 PhpWiki; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
/**
 * This is another replacement for MagicPhpWikiURL forms.
 * Previously encoded with the "phpwiki:" syntax.
 *
 * Enhanced WikiForm to be more generic:
 * - editbox[] 		name=.. value=.. text=..
 * - checkbox[] 	name=.. value=0|1 checked text=..
 * - radio[] 	        name=.. value=.. text=..
Exemplo n.º 25
0
<?php

//-*-php-*-
rcs_id('$Id: main.php,v 1.223  2006/03/19 15:01:00  rurban Exp $');
/*
Copyright 1999,2000,2001,2002,2004,2005,2006 $ThePhpWikiProgrammingTeam

This file is part of PhpWiki.

PhpWiki 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.

PhpWiki 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 PhpWiki; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
define('USE_PREFS_IN_PAGE', true);
//include "lib/config.php";
require_once dirname(__FILE__) . "/stdlib.php";
require_once 'lib/Request.php';
require_once 'lib/WikiDB.php';
if (ENABLE_USER_NEW) {
    require_once "lib/WikiUserNew.php";
} else {
Exemplo n.º 26
0
<?php

// -*-php-*-
rcs_id('$Id: PearDB_mysql.php,v 1.21 2005/10/10 19:42:15 rurban Exp $');
require_once 'lib/WikiDB/backend/PearDB.php';
// The slowest function overall is mysql_connect with [680ms]
// 2nd is db_mysql::simpleQuery with [257ms]
class WikiDB_backend_PearDB_mysql extends WikiDB_backend_PearDB
{
    /**
     * Constructor.
     */
    function WikiDB_backend_PearDB_mysql($dbparams)
    {
        $this->WikiDB_backend_PearDB($dbparams);
        //$this->_serverinfo = $this->_dbh->ServerInfo();
        $row = $this->_dbh->GetOne("SELECT version()");
        if (!DB::isError($row) and !empty($row)) {
            $arr = explode('.', $row);
            $this->_serverinfo['version'] = (string) ($arr[0] * 100 + $arr[1]) . "." . (int) $arr[2];
            if ($this->_serverinfo['version'] < 323.0) {
                // Older MySQL's don't have CASE WHEN ... END
                $this->_expressions['maxmajor'] = "MAX(IF(minor_edit=0,version,0))";
                $this->_expressions['maxminor'] = "MAX(IF(minor_edit<>0,version,0))";
            }
            // esp. needed for utf databases
            if ($this->_serverinfo['version'] > 401.0) {
                global $charset;
                $aliases = array('iso-8859-1' => 'latin1', 'utf-8' => 'utf8');
                //http://dev.mysql.com/doc/mysql/en/charset-connection.html
                if (isset($aliases[strtolower($charset)])) {
Exemplo n.º 27
0
<?php

// -*-php-*-
rcs_id('$Id: PhpHighlight.php,v 1.9 2004/04/10 07:25:24 rurban Exp $');
/**
Copyright 1999, 2000, 2001, 2002 $ThePhpWikiProgrammingTeam

This file is part of PhpWiki.

PhpWiki 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.

PhpWiki 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 PhpWiki; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
/**
 * A plugin that runs the highlight_string() function in PHP on it's
 * arguments to pretty-print PHP code.
 *
 * Usage:
 * <?plugin PhpHighlight default='#FF0000' comment='#0000CC'
 * code that should be highlighted
 * ?>
Exemplo n.º 28
0
<?php

rcs_id('$Id: removepage.php,v 1.26 2004/12/20 12:12:31 rurban Exp $');
require_once 'lib/Template.php';
function RemovePage(&$request)
{
    global $WikiTheme;
    $page = $request->getPage();
    $pagelink = WikiLink($page);
    if ($request->getArg('cancel')) {
        $request->redirect(WikiURL($page));
        // noreturn
    }
    $current = $page->getCurrentRevision();
    if (!$current or !($version = $current->getVersion())) {
        $html = HTML(HTML::h2(_("Already deleted")), HTML::p(_("Sorry, this page is not in the database.")));
    } elseif (!$request->isPost() || !$request->getArg('verify')) {
        $removeB = Button('submit:verify', _("Remove Page"), 'wikiadmin');
        $cancelB = Button('submit:cancel', _("Cancel"), 'button');
        // use generic wiki button look
        $html = HTML(HTML::h2(fmt("You are about to remove '%s'!", $pagelink)), HTML::form(array('method' => 'post', 'action' => $request->getPostURL()), HiddenInputs(array('currentversion' => $version, 'pagename' => $page->getName(), 'action' => 'remove')), HTML::div(array('class' => 'toolbar'), $removeB, $WikiTheme->getButtonSeparator(), $cancelB)), HTML::hr());
        $sample = HTML::div(array('class' => 'transclusion'));
        // simple and fast preview expanding only newlines
        foreach (explode("\n", firstNWordsOfContent(100, $current->getPackedContent())) as $s) {
            $sample->pushContent($s, HTML::br());
        }
        $html->pushContent(HTML::div(array('class' => 'wikitext'), $sample));
    } elseif ($request->getArg('currentversion') != $version) {
        $html = HTML(HTML::h2(_("Someone has edited the page!")), HTML::p(fmt("Since you started the deletion process, someone has saved a new version of %s.  Please check to make sure you still want to permanently remove the page from the database.", $pagelink)));
    } else {
        // Real delete.
Exemplo n.º 29
0
<?php

rcs_id('$Id: dba.php,v 1.3 2005/08/07 10:49:57 rurban Exp $');
/** DBA Sessions
 *  session:
 *     Index: session_id
 *    Values: date : IP : data
 * @author: Reini Urban.
 */
class DbSession_dba extends DbSession
{
    var $_backend_type = "dba";
    function DbSession_dba(&$dbh, $table)
    {
        $this->_dbh = $dbh;
        ini_set('session.save_handler', 'user');
        session_module_name('user');
        // new style
        session_set_save_handler(array(&$this, 'open'), array(&$this, 'close'), array(&$this, 'read'), array(&$this, 'write'), array(&$this, 'destroy'), array(&$this, 'gc'));
        return $this;
    }
    function quote($str)
    {
        return $str;
    }
    function query($sql)
    {
        return false;
    }
    function &_connect()
    {
Exemplo n.º 30
0
<?php

rcs_id('$Id: dba.php,v 1.4 2006/02/22 20:56:24 rurban Exp $');
/** DBA Sessions
 *  session:
 *     Index: session_id
 *    Values: date : IP : data
 * @author: Reini Urban.
 */
class DbSession_dba extends DbSession
{
    var $_backend_type = "dba";
    function DbSession_dba(&$dbh, $table)
    {
        $this->_dbh = $dbh;
        ini_set('session.save_handler', 'user');
        session_module_name('user');
        // new style
        session_set_save_handler(array(&$this, 'open'), array(&$this, 'close'), array(&$this, 'read'), array(&$this, 'write'), array(&$this, 'destroy'), array(&$this, 'gc'));
        return $this;
    }
    function quote($str)
    {
        return $str;
    }
    function query($sql)
    {
        return false;
    }
    function &_connect()
    {