1
dhansen
Disable "Register Now" if "Allow new user registration"="No"
  • 2004/2/9 3:38

  • dhansen

  • Just popping in

  • Posts: 59

  • Since: 2003/12/6


'Twould be nice if the "Register Now" prompt/link would go bye-bye if the "Allow new user registration" parameter is set to "no" in System Admin > Prefs > User Info Settings.

2
flaystus
Re: Disable "Register Now" if "Allow new user registration"="No"
  • 2004/9/13 4:52

  • flaystus

  • Just popping in

  • Posts: 14

  • Since: 2004/9/12


I agree 100%, seems like a change that makes sense to me.

3
nick89
Re: Disable "Register Now" if "Allow new user registration"="No"
  • 2004/9/13 6:22

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


i will work on a small hack...

4
nick89
Re: Disable "Register Now" if "Allow new user registration"="No"
  • 2004/9/13 7:02

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


Find your header.php file and add the highlighted lines :
// $Id: header.php,v 1.41 2004/08/17 03:29:51 skalpa Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                                                    //
//  ------------------------------------------------------------------------ //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //

include_once XOOPS_ROOT_PATH.'/class/xoopsblock.php';
if (
$xoopsConfig['theme_set'] != 'default' && file_exists(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/theme.php')) {
    
// the old way..
    
$xoopsOption['theme_use_smarty'] = 0;
    if (
file_exists(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/lang-'.$xoopsConfig['language'].'.php')) {
        include 
XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/lang-'.$xoopsConfig['language'].'.php';
    } elseif (
file_exists(XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/lang-english.php')) {
        include 
XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/language/lang-english.php';
    }
    
$config_handler =& xoops_gethandler('config');
    
$xoopsConfigMetaFooter =& $config_handler->getConfigsByCat(XOOPS_CONF_METAFOOTER);
    
xoops_header(false);
    include 
XOOPS_THEME_PATH.'/'.$xoopsConfig['theme_set'].'/theme.php';
    
$xoopsOption['show_rblock'] = (!empty($xoopsOption['show_rblock'])) ? $xoopsOption['show_rblock'] : 0;
    
// include Smarty template engine and initialize it
    
require_once XOOPS_ROOT_PATH.'/class/template.php';
    
$xoopsTpl = new XoopsTpl();
    if (
$xoopsConfig['debug_mode'] == 3) {
        
$xoopsTpl->xoops_setDebugging(true);
    }
    if (
$xoopsUser != '') {
        
$xoopsTpl->assign(array('xoops_isuser' => true'xoops_userid' => $xoopsUser->getVar('uid'), 'xoops_uname' => $xoopsUser->getVar('uname'), 'xoops_isadmin' => $xoopsUserIsAdmin));
    }
    
$xoopsTpl->assign('xoops_requesturi'htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES));
    include 
XOOPS_ROOT_PATH.'/include/old_functions.php';
    
    if (
$xoopsOption['show_cblock'] || (isset($xoopsModule) && preg_match("/index.php$/i"xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname'))) {
        
$xoopsOption['show_rblock'] = $xoopsOption['show_cblock'] = 1;
    }
    
themeheader($xoopsOption['show_rblock']);
    if (
$xoopsOption['show_cblock']) make_cblock();  //create center block
} else {
    
$xoopsOption['theme_use_smarty'] = 1;
    
// include Smarty template engine and initialize it
    
require_once XOOPS_ROOT_PATH.'/class/template.php';
    
$xoopsTpl = new XoopsTpl();
    
$xoopsTpl->xoops_setCaching(2);
    if (
$xoopsConfig['debug_mode'] == 3) {
        
$xoopsTpl->xoops_setDebugging(true);
    }
    
$xoopsTpl->assign(array('xoops_theme' => $xoopsConfig['theme_set'], 'xoops_imageurl' => XOOPS_THEME_URL.'/'.$xoopsConfig['theme_set'].'/''xoops_themecss'=> xoops_getcss($xoopsConfig['theme_set']), 'xoops_requesturi' => htmlspecialchars($GLOBALS['xoopsRequestUri'], ENT_QUOTES), 'xoops_sitename' => htmlspecialchars($xoopsConfig['sitename'], ENT_QUOTES), 'xoops_slogan' => htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES)));
    
// Meta tags
    
$config_handler =& xoops_gethandler('config');
    
$criteria = new CriteriaCompo(new Criteria('conf_modid'0));
    
$criteria->add(new Criteria('conf_catid'XOOPS_CONF_METAFOOTER));
    
$config =& $config_handler->getConfigs($criteriatrue);
    foreach (
array_keys($config) as $i) {
        
// prefix each tag with 'xoops_'
        
$xoopsTpl->assign('xoops_'.$config[$i]->getVar('conf_name'), $config[$i]->getConfValueForOutput());
    }
    
//unset($config);
    // show banner?
    
if ($xoopsConfig['banners'] == 1) {
        
$xoopsTpl->assign('xoops_banner'xoops_getbanner());
    } else {
        
$xoopsTpl->assign('xoops_banner'' ');
    }
    
// Weird, but need extra .XOOPS_URL.'/include/xoops.js">
name="xoops_redirect" value="<{$xoops_requesturi}>" /><input type="hidden" name="op" value="login" /><input type="submit" 

value="<{$block.lang_login}>" /><br /><{$block.sslloginlink}>
form>
<


href
="<{$xoops_url}>/user.php#lost"><{$block.lang_lostpass}>a>
<
br /><br />
[
b][size=medium][color=990000]
<{if 
$allow_register}>
<
a href="<{$xoops_url}>/register.php"><{$block.lang_registernow}>a>
<{/if}>
[/
color][/size][/b]


Hope this helps.

5
Sm0ka
Re: Disable "Register Now" if "Allow new user registration"="No"
  • 2004/9/13 8:01

  • Sm0ka

  • Just popping in

  • Posts: 41

  • Since: 2003/12/25


Please 4give me 4 being such a 0 at php, but if the visiter simply entered http://whatever.com/register.php would that hack still work?

6
nick89
Re: Disable "Register Now" if "Allow new user registration"="No"
  • 2004/9/17 8:09

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


if someone types that in and the option is set then XOOPS will defer them anyway

Login

Who's Online

146 user(s) are online (119 user(s) are browsing Support Forums)


Members: 0


Guests: 146


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Dec 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits