For instance, I know how to get the user's username by:
$xoopsUser->getVar("uname", "E");
Is there a similar way for me to call the user's groupname?
Thank you!
<script language="javascript">
function nextpage(){
window.location = "'.$url.'";
}
</script>
<body onload="setTimeout('nextpage()', 2500)">
$sform -> addElement( new XoopsFormText( 'Favorite TV Show:', 'favoritetvshow', 50, 80, $favoritetvshow) );
$sform -> addElement( new XoopsFormText( 'Favorite TV Show:', 'favoritetvshow', 50, 80, addSlashes($favoritetvshow)) );
<{counter assign="storycount" print=false start=1 skip=1}>
<{foreach item=news from=$block.stories}>
<{if $storycount == 1}><p><a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>"><{$news.artimage}></a><strong><{$news.title}></strong> : <{$news.introtext}><a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>">[read more]</a> (<{$news.date}>)</p><p><strong>Other new headlines:</strong><br /><{/if}><{if $storycount > 1}>-<a href="<{$xoops_url}>/modules/news/article.php?storyid=<{$news.id}>"><{$news.title}></a> (<{$news.date}>)<br /><{/if}>
<{counter}>
<{/foreach}></p>
Array ( [MAX_FILE_SIZE] => 250000 [partnerlogo] => C:\Documents and Settings\User\My Documents\My Pictures\mylogo.jpg [xoops_upload_file] => Array ( [0] => partnerlogo ) [op] => uppImage [submit] => Upload )
Errors Returned While Uploading
File not found
function imageUpload()
{
$xoopsDB =& Database::getInstance();
$myts =& MyTextSanitizer::getInstance();
xoops_cp_header();
echo "<h4>"._MD_PARTNERADMIN."</h4>";
include XOOPS_ROOT_PATH."/class/xoopsformloader.php";
$form = new XoopsThemeForm(_MD_ADDPARTNER, "addform", "index.php");
$op_hidden = new XoopsFormHidden("op", "uppImage");
$submit_button = new XoopsFormButton("", "submit", "Upload", "submit");
$form->addElement($formweight);
//TN removed: $form->addElement($formimage);
//TN trying to add image upload
$form -> addElement( new XoopsFormFile( 'Upload an image', 'partnerlogo', '250000' ), false );
//TN EOF
$form->addElement($op_hidden);
$form->addElement($submit_button);
$form->display();
xoops_cp_footer();
}
function uppImage()
{
$allowed_mimetypes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png');
$maxfilesize = 50000;
$maxfilewidth = 120;
$maxfileheight = 120;
include_once(XOOPS_ROOT_PATH."/class/uploader.php");
$uploader = new XoopsMediaUploader(XOOPS_ROOT_PATH."/modules/xoopspartners/images/uploads/", $allowed_mimetypes, $maxfilesize, $maxfilewidth, $maxfileheight);
if ($uploader->fetchMedia($HTTP_POST_VARS['partnerlogo'])) {
if (!$uploader->upload()) {
echo $uploader->getErrors();
} else {
echo '<h4>File uploaded successfully!</h4>';
echo 'Saved as: ' . $uploader->getSavedFileName() . '<br />';
echo 'Full path: ' . $uploader->getSavedDestination();
}
} else {
echo $uploader->getErrors();
}
exit();
}