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 .= _US_UNEEDAGREE . '<br />';
         }
     }
     $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 .= _US_UNEEDAGREE . '<br>';
         }
     }
     $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>';
     }
Ejemplo n.º 4
0
 $forum_form = new XoopsThemeForm(_MD_POSTREPLY, 'quick_reply', "post.php", 'post', true);
 if (!is_object($xoopsUser)) {
     require_once XOOPS_ROOT_PATH . "/class/xoopsform/formpassword.php";
     require_once XOOPS_ROOT_PATH . "/class/xoopsform/formcheckbox.php";
     require_once XOOPS_ROOT_PATH . "/class/xoopsform/formtext.php";
     require_once XOOPS_ROOT_PATH . "/class/xoopsform/formelementtray.php";
     require_once XOOPS_ROOT_PATH . "/class/xoopsform/formcaptcha.php";
     $config_handler =& xoops_gethandler('config');
     $user_tray = new XoopsFormElementTray(_MD_ACCOUNT);
     $user_tray->addElement(new XoopsFormText(_MD_NAME, "uname", 26, 255));
     $user_tray->addElement(new XoopsFormPassword(_MD_PASSWORD, "pass", 10, 32));
     $login_checkbox = new XoopsFormCheckBox('', 'login', 1);
     $login_checkbox->addOption(1, _MD_LOGIN);
     $user_tray->addElement($login_checkbox);
     $forum_form->addElement($user_tray);
     $captcha = new XoopsFormCaptcha("", "topic_{$topic_id}_{$start}");
     $captcha->setConfig("mode", "text");
     $forum_form->addElement($captcha);
 }
 $quickform = !empty($xoopsModuleConfig['qr_editor']) ? "dhtmltextarea" : "textarea";
 $editor_configs = array();
 $editor_configs["caption"] = _MD_MESSAGEC;
 $editor_configs["name"] = "message";
 $editor_configs["rows"] = 10;
 $editor_configs["cols"] = 60;
 $forum_form->addElement(new XoopsFormEditor(_MD_MESSAGEC, $quickform, $editor_configs, true), true);
 $forum_form->addElement(new XoopsFormHidden('dohtml', 0));
 $forum_form->addElement(new XoopsFormHidden('dosmiley', 1));
 $forum_form->addElement(new XoopsFormHidden('doxcode', 1));
 $forum_form->addElement(new XoopsFormHidden('dobr', 1));
 $forum_form->addElement(new XoopsFormHidden('attachsig', 1));