Monday, November 10, 2008

Adding new User RunCMS

include_once(XOOPS_ROOT_PATH."/class/xoopsobject.php");
include_once(XOOPS_ROOT_PATH."/class/xoopsuser.php");
include_once(XOOPS_ROOT_PATH."/include/functions.php");


$name=$_REQUEST["name"];
$uname=$_REQUEST["uname"];
$passwd=$_REQUEST["passwd"];
$shapwd = rc_shatool($uname.$passwd);
$user= new XoopsUser();
$user->setVar("name", $name,true);
$user->setVar("uname", $uname,true);
$user->setVar("pass", $shapwd,true);
$user->setVar("level",1,true);
$user->store();

Monday, November 03, 2008

FCK editor integration in RunCMS

include_once(XOOPS_ROOT_PATH.'/class/fckeditor/fckeditor.php');
$runFCKeditor = new FCKeditor('content');
$runFCKeditor->BasePath = XOOPS_URL."/class/fckeditor/";

//$runFCKeditor->create();

if ($runFCKeditor->IsCompatible() && $editorConfig["displayeditor"] == 1 && $editorConfig["displayforuser"] == 1 && $xoopsUser)
{
$runFCKeditor->EchoEditArea('content', $news->hometext);
//$runFCKeditor->create();
}

How get Topics IN RunCMS

global $db;
$table=$db->prefix("topics");
$rt= new XoopsTopic($table,0);
$topics=$rt->getAllChildTopics();
foreach($topics as $topic)
{
echo $topic->topic_id;
echo $topic->topic_title;
}

Sunday, November 02, 2008