$uid = 120; //deve conter o id do usuário que irá ser adicionado
$groupid = 3; //id do grupo ao qual vais adicionar.
$member_handler =& xoops_gethandler('member');
// adicionar um usuário a um grupo
if($groupid && $uid){
$result = $xoopsDB->query("SELECT COUNT(*) FROM ".$xoopsDB->prefix('groups_users_link')." WHERE groupid='".$groupid."' AND uid=".$uid."");
list($group_check) = $xoopsDB->fetchRow($result);
$xoopsDB->freeRecordSet($result);
if($group_check == 0){
//Caso não esteja já adicionado então adicionar ao grupo
$member_handler->addUserToGroup($groupid, $uid);
}
}
function xoopstube_tag_iteminfo(&$items)
{
$items_id = array();
foreach(array_keys($items) as $cat_id){
// Some handling here to build the link upon catid
// if catid is not used, just skip it
foreach(array_keys($items[$cat_id]) as $item_id){
// In article, the item_id is "art_id"
$items_id[] = intval($item_id);
}
}
//$item_handler =& xoops_getModuleHandler("xoopstube","xoopstube");
//$items_obj = $item_handler -> getObjects(new Criteria("lid", "(".implode(", ", $items_id).")", "IN"), true);
foreach(array_keys($items) as $cat_id){
foreach(array_keys($items[$cat_id]) as $item_id){
//$item_obj =& $items_obj[$item_id];
//Do your querie here to get video info based on $item_id as the video id
$items[$cat_id][$item_id] = array(
"title" => $row['title'],
"uid" => $row['submitter'],
blablabla, blablabla
//start
$groups = is_object($xoopsUser) ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS;
$gperm_handler =& xoops_gethandler('groupperm');
if ($gperm_handler->checkRight('news_submit', 0, $groups, $xoopsModule->getVar('mid'))) {
$perm = 1;
} else {
$perm = 0;
}
$xoopsTpl->assign('perm', $perm);
//end
include_once XOOPS_ROOT_PATH.'/footer.php';
?>
<{if !$perm}>
You must be a <a href="<{$xoops_url}>/register.php">registered user</a> to post news.
<{else}>
<FORM METHOD='LINK' ACTION='<{$xoops_url}>/modules/news/submit.php'>
<INPUT TYPE='submit' VALUE='Add Your News'></FORM>
<{/if}>
With regards to the last two posts.
If it's a mainfile, db issue, how would that result in a 403 forbidden page, it would show DB errors?
Normally this are made by .htaccess, or index.ext missing.
if index.php is there then it should work.
Just wondering in case I ever hit the same issue.