xoops forums

Forum Index


Board index » All Posts (mdeshane)




mdeshane

Just popping in
Posted on: 2008/1/14 20:48
mdeshane
mdeshane (Show more)
Just popping in
Posts: 3
Since: 2006/10/19
#1

Re: Xoops Modules (All Xoops Users Please Read)

This sounds like a fabulous idea! There are plenty of "DEAD" modules in the repository. It would be nice to see some or most of them useable again. I could probably do some debugging, I seem to be pretty good at that. Also, IMHO we need to keep compatibility with PHP4 for at least 1 more year. As most web hosts have just started upgrading their servers in the last few months. I know that my host (iPowerWeb), will still be upgrading accounts to PHP5 in August. However, come 2009 we should all kiss PHP4 goodbye for good!


mdeshane

Just popping in
Posted on: 2006/11/4 21:18
mdeshane
mdeshane (Show more)
Just popping in
Posts: 3
Since: 2006/10/19
#2

Re: use $xoposDB in own php file

Quote:

clownxx wrote:
no sorry it doesnt work...

this is my pageconten:

<?php
global $xoopsDB;

include( '../../mainfile.php' ) ;

function writehistory($uid, $toid, $action, $comment){
//schreibt einen historyeintrag

//$historytable = $db->prefix("history");
//die ($historytable);
$historytable = "xoops_history";
$xoopsDB->query("INSERT INTO $historytable (uid, date, action, comment, toid) VALUES ($uid, NOW(), $action, '$comment', $toid)");
}
?>


Try:

<?php

include( '../../mainfile.php' ) ;

function writehistory($uid, $toid, $action, $comment)
global $xoopsDB;
{
//schreibt einen historyeintrag

//$historytable = $db->prefix("history");
//die ($historytable);
$historytable = "xoops_history";
$xoopsDB->query("INSERT INTO $historytable (uid, date, action, comment, toid) VALUES ($uid, NOW(), $action, '$comment', $toid)");
}
?>

Sometimes it helps to include the file before you call for a function in it...



TopTop