Revision [2426]
This is an old revision of IncludePageAction made by JamieScuffell on 2004-11-24 18:51:28.
Syntax:
{{incpage page="PageName"}}
{{incpage page="PageName"}}
Save the following script as actions/incpage.php
-- Jamie
php <?php if (!isset($vars['page'])) { echo "No page specified.<br><br><strong>Syntax: {{incpage page=\"wikiname\"}}</strong> (Case insensitive)"; } else { $url = $vars['page']; $host = $this->config['mysql_host']; $db = $this->config['mysql_database']; $user = $this->config['mysql_user']; $passwd = $this->config['mysql_password']; $connection = @mysql_connect($host, $user, $passwd); @mysql_select_db($db, $connection); $sql = "select body from" . $this->config['table_prefix'] . " pages where tag=\"$url\" and latest=\"Y\""; $query = mysql_query($sql, $connection); while ($nav = mysql_fetch_array($query)) { $body = $nav['body']; break; } $body = $this->Format($body, "wakka"); echo $body; } ?>
CategoryDevelopment