Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 0a6d8ae5e0
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 40 lines (35 sloc) 1.023 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
<?php
// $Id: text.php,v 1.12 2006/05/03 01:31:48 glen Exp $
// Copyright (c)2005, Glen Campbell. All rights reserved.

require_once 'siteframe.inc';

// get a database reader
$DB = Database::getReader();

if ($_GET['id'] != '')
{
    if (is_numeric($_GET['id']))
        $stat = new Text($_GET['id']);
    else {
        $tex = new Text;
        $q = sprintf("SELECT text_id FROM %s WHERE text_name='%s'",
                $tex->table_name(), $_GET['id']);
        $result = $DB->query($q);
        check_db($DB);
        list($id) = $result->fetch_row();
        $stat = new Text($id);
    }
    if ($stat->get('text_name') == '')
        $PAGE->assign('error', sprintf(lang('err_notext'), htmlentities($_GET['id'])));
}
else
{
    $PAGE->assign('error', lang('err_noid'));
    $PAGE->display();
    exit;
}

if ($stat->get('text_title') != '')
    $PAGE->assign('page_title', $stat->get('text_title'));
else
    $PAGE->assign('page_title', $stat->get('text_name'));
$PAGE->assign($stat->get_all());

$PAGE->display();
?>
Something went wrong with that request. Please try again.