Thanks trabis, that fixed the parse error but I stil can't get the cheat title to show on the pagetitle it is still just showing 'sitename - cheats'.
On looking at the errors in debug I am getting alot of errors like this one:
Quote:
Warning: MyTextSanitizer::makeTareaData4Show is deprecated in file /class/module.textsanitizer.php line 699
My only guess is perhaps this version of wordbook is too old and doesnt conform to the newest XOOPS coding standards?
heres the fule code of cheat.php (was entry.php)there references to makeTareaData4Show in the file and im wondering if thats what is calling up the errors.
<?php
/**
* $Id: cheat.php v 1.0 8 May 2004 hsalazar Exp $
* Module: Cheats - a multicategory glossary
* Version: v 1.00
* Release Date: 8 May 2004
* Author: hsalazar
* Licence: GNU
*/
include( "header.php" );
include_once( XOOPS_ROOT_PATH . "/header.php" );
include_once XOOPS_ROOT_PATH . "/class/module.textsanitizer.php";
$xoopsOption['template_main'] = 'ch_cheat.html';
global $xoopsUser, $xoopsUser, $xoopsConfig, $xoopsDB, $modify, $xoopsModuleConfig, $xoopsModule, $XOOPS_URL;
$myts =& MyTextSanitizer::getInstance();
$cheatID = isset($_GET['cheatID']) ? intval($_GET['cheatID']) : 0;
$xoopsOption['template_main'] = 'ch_cheat.html';
if ($xoopsModuleConfig['multicats'] == 1)
{
$xoopsTpl->assign('multicats', 1);
}
else
{
$xoopsTpl->assign('multicats', 0);
}
// If there's no cheats yet in the system...
$pubwords = $xoopsDB -> query( "SELECT * FROM " . $xoopsDB -> prefix( "chcheats" ) . " WHERE submit = '0' AND offline ='0' " );
$publishedwords = $xoopsDB -> getRowsNum ( $pubwords );
$xoopsTpl->assign('publishedwords', $publishedwords);
if ( $publishedwords == 0 )
{
$xoopsTpl -> assign ('empty', '1');
$xoopsTpl -> assign ('stillnothing', _MD_CH_STILLNOTHINGHERE);
}
// To display the linked letter list
$alpha = alphaArray();
$xoopsTpl->assign('alpha', $alpha);
$sql = $xoopsDB -> query ( "SELECT * FROM " . $xoopsDB -> prefix ( "chcheats") . " WHERE init = '#' " );
$howmanyother = $xoopsDB -> getRowsNum( $sql );
$xoopsTpl->assign('totalother', $howmanyother);
if ( $xoopsModuleConfig['multicats'] == 1 )
{
// To display the list of categories
$block0 = array();
$resultcat = $xoopsDB -> query ( "SELECT categoryID, name, total FROM " . $xoopsDB -> prefix ( "chcategories") . " ORDER BY name ASC" );
while (list( $catID, $name, $total) = $xoopsDB->fetchRow($resultcat))
{
$catlinks = array();
$xoopsModule = XoopsModule::getByDirname("cheats");
$catlinks['id'] = $catID;
$catlinks['total'] = intval($total);
$catlinks['linktext'] = $myts -> makeTboxData4Show( $name );
$block0['categories'][] = $catlinks;
}
$xoopsTpl -> assign ( 'block0', $block0 );
}
if ( !$cheatID )
{
$result = $xoopsDB -> query( "SELECT cheatID, categoryID, term, init, definition, ref, url, uid, submit, datesub, counter, html, smiley, xcodes, breaks, block, offline, notifypub FROM " . $xoopsDB -> prefix( "chcheats" ) . " WHERE datesub < " . time() . " AND datesub > 0 AND (submit = 0) ORDER BY datesub DESC", 1, 0 );
}
else
{
if ( !$xoopsUser || ( $xoopsUser->isAdmin($xoopsModule->mid()) && $xoopsModuleConfig['adminhits'] == 1 ) || ( $xoopsUser && !$xoopsUser -> isAdmin( $xoopsModule -> mid() ) ) )
{
$xoopsDB -> queryF( "UPDATE " . $xoopsDB -> prefix( "chcheats" ) . " SET counter = counter+1 WHERE cheatID = $cheatID " );
}
$result = $xoopsDB -> query( "SELECT cheatID, categoryID, term, init, definition, ref, url, uid, submit, datesub, counter, html, smiley, xcodes, breaks, block, offline, notifypub FROM " . $xoopsDB -> prefix( "chcheats" ) . " WHERE cheatID = $cheatID" );
}
while (list( $cheatID, $categoryID, $term, $init, $definition, $ref, $url, $uid, $submit, $datesub, $counter, $html, $smiley, $xcodes, $breaks, $block, $offline, $notifypub ) = $xoopsDB->fetchRow($result))
{
$thisterm = array();
$xoopsModule = XoopsModule::getByDirname("cheats");
$thisterm['id'] = intval($cheatID);
if ($xoopsModuleConfig['multicats'] == 1)
{
$thisterm['categoryID'] = intval($categoryID);
$catname = $xoopsDB -> query ( "SELECT name FROM " . $xoopsDB -> prefix ( "chcategories" ) . " WHERE categoryID = $categoryID ");
while (list ($name) = $xoopsDB -> fetchRow ( $catname ))
{
$thisterm['catname'] = $myts -> makeTboxData4Show( $name );
}
}
$glossaryterm = $myts -> makeTboxData4Show( $term );
$thisterm['term'] = ucfirst($myts -> makeTboxData4Show( $term ));
if ($init == '#')
{
$thisterm['init'] = _MD_CH_OTHER;
}
else
{
$thisterm['init'] = ucfirst($init);
}
if ($xoopsModuleConfig['linkterms'] == 1)
{
// Code to make links out of glossary terms
$parts = explode(">", $definition);
// First, retrieve all terms from the glossary...
$allterms = $xoopsDB -> query( "SELECT cheatID, term FROM " . $xoopsDB -> prefix( "chcheats" ));
while ( list( $cheatID, $term ) = $xoopsDB -> fetchrow( $allterms ))
{
foreach($parts as $key=>$part)
{
if ( $term != $glossaryterm)
{
// singular
$term_q = preg_quote($term, '/');
$search_term = "/b$term_qb/i";
$replace_term = "<span><b><a style='color: #2F5376; text-decoration: underline; ' href='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/cheat.php?cheatID=".ucfirst($cheatID)."'>".$term."</a></b></span>";
$parts[$key] = preg_replace($search_term, $replace_term, $parts[$key]);
// plural
$term = $term."s";
$term_q = preg_quote($term, '/');
$search_term = "/b$term_qb/i";
$replace_term = "<span><b><a style='color: #2F5376; text-decoration: underline; ' href='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/cheat.php?cheatID=".ucfirst($cheatID)."'>".$term."</a></b></span>";
$parts[$key] = preg_replace($search_term, $replace_term, $parts[$key]);
// plural with e
$term = $term."es";
$term_q = preg_quote($term, '/');
$search_term = "/b$term_qb/i";
$replace_term = "<span><b><a style='color: #2F5376; text-decoration: underline; ' href='".XOOPS_URL."/modules/".$xoopsModule->dirname()."/cheat.php?cheatID=".ucfirst($cheatID)."'>".$term."</a></b></span>";
$parts[$key] = preg_replace($search_term, $replace_term, $parts[$key]);
}
}
}
$definition = implode(">", $parts);
}
$thisterm['definition'] = $myts -> displayTarea( $definition, $html, $smiley, $xcodes, 1, $breaks );
$thisterm['ref'] = $myts -> makeTboxData4Show( $ref );
$thisterm['url'] = $myts->makeClickable($url, $allowimage = 0);
$thisterm['submitter'] = xoops_getLinkedUnameFromId ( $uid );
$thisterm['submit'] = intval($submit);
$thisterm['datesub'] = formatTimestamp($datesub,$xoopsModuleConfig['dateformat']);
$thisterm['counter'] = intval($counter);
$thisterm['block'] = intval($block);
$thisterm['offline'] = intval($offline);
$thisterm['notifypub'] = intval($notifypub);
$thisterm['dir'] = $xoopsModule->dirname();
}
$xoopsTpl -> assign( 'thisterm', $thisterm );
$microlinks = serviceLinks ( $thisterm );
$xoopsTpl -> assign ( 'microlinks', $microlinks );
$xoopsTpl -> assign ( 'lang_modulename', $xoopsModule->name() );
$xoopsTpl -> assign ( 'lang_moduledirname', $xoopsModule->dirname() );
$xoopsTpl -> assign ( 'cheatID', $cheatID);
$xoopsTpl -> assign ( 'submitted', sprintf(_MD_CH_SUBMITTED, $thisterm['submitter'], $thisterm['datesub']) );
$xoopsTpl -> assign ( 'counter', sprintf(_MD_CH_COUNT, $thisterm['counter']) );
$xoopsTpl->assign("xoops_module_header", '<link rel="stylesheet" type="text/css" href="style.css" />');
//Mondarse
include XOOPS_ROOT_PATH.'/include/comment_view.php';
//Mondarse
// page title hack tcnet
$chpagetitle = $myts->htmlSpecialChars( $xoopsModule->getVar('name').' - '.$glossaryterm);
if (is_object($xoTheme)) {
$xoTheme->addMeta( 'meta', 'title', $chpagetitle);
} else {
$xoopsTpl->assign('xoops_pagetitle', $chpagetitle);
}
//end page hack
include_once XOOPS_ROOT_PATH.'/footer.php';
?>
I appreciate any help you can give me I think this would be a great module for cheats (or something else maybe if cloned again) once the bugs are ironed out.
Cheers