Ejemplo n.º 1
0
/**
 * @copyright       The XUUPS Project http://sourceforge.net/projects/xuups/
 * @license         http://www.fsf.org/copyleft/gpl.html GNU public license
 * @package         Shoutbox
 * @author          Alphalogic <*****@*****.**>
 * @author          tank <*****@*****.**>
 * @author          trabis <*****@*****.**>
 * @version         $Id: shoutbox.php 0 2010-01-29 18:47:04Z trabis $
 */
function b_shoutbox_show($options)
{
    include_once XOOPS_ROOT_PATH . '/modules/shoutbox/include/functions.php';
    global $xoopsUser, $xoopsConfig;
    $module_handler =& xoops_gethandler('module');
    $module =& $module_handler->getByDirname('shoutbox');
    $config_handler =& xoops_gethandler('config');
    $block =& $config_handler->getConfigsByCat(0, $module->getVar('mid'));
    if ($block['captcha_enable']) {
        xoops_load('XoopsFormCaptcha');
        $shoutcaptcha = new XoopsFormCaptcha();
        $block['captcha_caption'] = $shoutcaptcha->getCaption();
        $block['captcha_render'] = $shoutcaptcha->render();
    }
    $block['shoutbox_access'] = false;
    if (is_object($xoopsUser)) {
        $block['shoutbox_access'] = true;
        $block['shoutbox_uname'] = $xoopsUser->getVar('uname');
        $block['shoutbox_userid'] = $xoopsUser->getVar('uid');
    } else {
        if ($block['guests_may_post']) {
            $block['shoutbox_access'] = true;
            $block['shoutbox_uname'] = shoutbox_makeGuestName();
            $block['shoutbox_uid'] = 0;
        }
    }
    $block['shoutbox_anonymous'] = $xoopsConfig['anonymous'];
    if ($block['show_smileybar']) {
        ob_start();
        include_once XOOPS_ROOT_PATH . '/include/xoopscodes.php';
        xoopsSmilies('shoutfield');
        $block['shoutbox_smibar'] = ob_get_contents();
        ob_end_clean();
        $block['shoutbox_smibar'] = str_replace("<a href='#moresmiley' onmouseover='style.cursor=\"hand\"' alt=''", "<a href='#moresmiley' onmouseover='style.cursor=\"hand\"' title='More'", $block['shoutbox_smibar']);
    }
    if (!is_object($xoopsUser) && !$block['popup_guests']) {
        $block['popup'] = false;
    }
    return $block;
}
Ejemplo n.º 2
0
         }
     }
     $stop .= XoopsUserUtility::validate($uname, $email, $pass, $vpass);
     if (empty($stop)) {
         echo _US_USERNAME . ": " . $myts->htmlSpecialChars($uname) . "<br />";
         echo _US_EMAIL . ": " . $myts->htmlSpecialChars($email) . "<br />";
         if ($url != '') {
             $url = formatURL($url);
             echo _US_WEBSITE . ': ' . $myts->htmlSpecialChars($url) . '<br />';
         }
         $f_timezone = $timezone_offset < 0 ? 'GMT ' . $timezone_offset : 'GMT +' . $timezone_offset;
         echo _US_TIMEZONE . ": {$f_timezone}<br />";
         echo "<form action='register.php' method='post'>";
         xoops_load("XoopsFormCaptcha");
         $cpatcha = new XoopsFormCaptcha();
         echo "<br />" . $cpatcha->getCaption() . ": " . $cpatcha->render();
         echo "\n        <input type='hidden' name='uname' value='" . $myts->htmlSpecialChars($uname) . "' />\n        <input type='hidden' name='email' value='" . $myts->htmlSpecialChars($email) . "' />";
         echo "<input type='hidden' name='user_viewemail' value='" . $user_viewemail . "' />\n        <input type='hidden' name='timezone_offset' value='" . (double) $timezone_offset . "' />\n        <input type='hidden' name='url' value='" . $myts->htmlSpecialChars($url) . "' />\n        <input type='hidden' name='pass' value='" . $myts->htmlSpecialChars($pass) . "' />\n        <input type='hidden' name='vpass' value='" . $myts->htmlSpecialChars($vpass) . "' />\n        <input type='hidden' name='user_mailok' value='" . $user_mailok . "' />\n        <br /><br /><input type='hidden' name='op' value='finish' />" . $GLOBALS['xoopsSecurity']->getTokenHTML() . "<input type='submit' value='" . _US_FINISH . "' /></form>";
     } else {
         echo "<span style='color:#ff0000;'>{$stop}</span>";
         include 'include/registerform.php';
         $reg_form->display();
     }
     include 'footer.php';
     break;
 case 'finish':
     include 'header.php';
     $stop = XoopsUserUtility::validate($uname, $email, $pass, $vpass);
     if (!$GLOBALS['xoopsSecurity']->check()) {
         $stop .= implode('<br />', $GLOBALS['xoopsSecurity']->getErrors()) . "<br />";
     }
Ejemplo n.º 3
0
         }
     }
     $stop .= XoopsUserUtility::validate($uname, $email, $pass, $vpass);
     if (empty($stop)) {
         echo _US_USERNAME . ': ' . $myts->htmlSpecialChars($uname) . '<br>';
         echo _US_EMAIL . ': ' . $myts->htmlSpecialChars($email) . '<br>';
         if ($url != '') {
             $url = formatURL($url);
             echo _US_WEBSITE . ': ' . $myts->htmlSpecialChars($url) . '<br>';
         }
         $f_timezone = $timezone_offset < 0 ? 'GMT ' . $timezone_offset : 'GMT +' . $timezone_offset;
         echo _US_TIMEZONE . ": {$f_timezone}<br>";
         echo "<form action='register.php' method='post'>";
         xoops_load('XoopsFormCaptcha');
         $cpatcha = new XoopsFormCaptcha();
         echo '<br>' . $cpatcha->getCaption() . ': ' . $cpatcha->render();
         echo "<input type='hidden' name='uname' value='" . $myts->htmlSpecialChars($uname) . "' />\n                  <input type='hidden' name='email' value='" . $myts->htmlSpecialChars($email) . "' />\n                  <input type='hidden' name='user_viewemail' value='" . $user_viewemail . "' />\n                  <input type='hidden' name='timezone_offset' value='" . (double) $timezone_offset . "' />\n                  <input type='hidden' name='url' value='" . $myts->htmlSpecialChars($url) . "' />\n                  <input type='hidden' name='pass' value='" . $myts->htmlSpecialChars($pass) . "' />\n                  <input type='hidden' name='vpass' value='" . $myts->htmlSpecialChars($vpass) . "' />\n                  <input type='hidden' name='user_mailok' value='" . $user_mailok . "' />\n                  <br><br><input type='hidden' name='op' value='finish' />" . $GLOBALS['xoopsSecurity']->getTokenHTML() . "<input type='submit' value='" . _US_FINISH . "' /></form>";
     } else {
         echo "<span class='red'>{$stop}</span>";
         include $GLOBALS['xoops']->path('include/registerform.php');
         $reg_form->display();
     }
     include $GLOBALS['xoops']->path('footer.php');
     break;
 case 'finish':
     include $GLOBALS['xoops']->path('header.php');
     $stop = XoopsUserUtility::validate($uname, $email, $pass, $vpass);
     if (!$GLOBALS['xoopsSecurity']->check()) {
         $stop .= implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()) . '<br>';
     }
     xoops_load('XoopsCaptcha');