1
nick89
Re: Hack search/request
  • 2004/9/17 8:36

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


Quote:

ManXP wrote:
Hm, now i am looking how to make some changes i submiting news on module News 1.2x. There are checkboxes "Approve" and "Notify by mail when published". 1st isn't checked, 2nd - is. Now i want to change it (so 1st will be checked, 2nd - not). Hope i have to edit submit.php file?


Find these lines on submit.php
case 'form':
    default:
        
$xt = new XoopsTopic($xoopsDB->prefix("topics"));
        
$title '';
        
$hometext '';
        
$noname 0;
        
$nohtml 0;
        
$nosmiley 0;
        
$notifypub 1;
        
$topicid 0;
        if (
$approveprivilege) {
            
$topicdisplay 0;
            
$topicalign 'R';
            
$ihome 0;
            
$bodytext '';
            
$approve 0;
            
$autodate '';
            
$expired 0;
            
$published 0;
        }
        if(
$xoopsModuleConfig['autoapprove'] == 1) {
            
$approve=1;
        }
        include_once 
'include/storyform.inc.php';
        break;
}


change:
$notifypub = 1; TO $notifypub = 0;
AND
$approve = 0; TO $approve = 1;



2
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



3
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 :
<?php
// $Id: header.php,v 1.41 2004/08/17 03:29:51 skalpa Exp $
//  ------------------------------------------------------------------------ //
//                XOOPS - PHP Content Management System                      //
//                    Copyright (c) 2000 XOOPS.org                           //
//                       <https://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''&nbsp;');
    }
    
// Weird, but need extra <script> tags for 2.0.x themes
    
$xoopsTpl->assign('xoops_js''//--></script><script type="text/javascript" src="'.XOOPS_URL.'/include/xoops.js"></script><script type="text/javascript"><!--');
    
// get all blocks and assign to smarty
    
$xoopsblock = new XoopsBlock();
    
$block_arr = array();
    if (
$xoopsUser != '') {
        
$xoopsTpl->assign(array('xoops_isuser' => true'xoops_userid' => $xoopsUser->getVar('uid'), 'xoops_uname' => $xoopsUser->getVar('uname'), 'xoops_isadmin' => $xoopsUserIsAdmin));
        if (!empty(
$xoopsModule)) {
            
// set page title
            
$xoopsTpl->assign('xoops_pagetitle'$xoopsModule->getVar('name'));
            if (
preg_match("/index.php$/i"xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname')) {
                
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), $xoopsModule->getVar('mid'), trueXOOPS_BLOCK_VISIBLE);
            } else {
                
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), $xoopsModule->getVar('mid'), falseXOOPS_BLOCK_VISIBLE);
            }
        } else {
            
$xoopsTpl->assign('xoops_pagetitle'htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES));
            if (!empty(
$xoopsOption['show_cblock'])) {
                
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), 0trueXOOPS_BLOCK_VISIBLE);
            } else {
                
$block_arr =& $xoopsblock->getAllByGroupModule($xoopsUser->getGroups(), 0falseXOOPS_BLOCK_VISIBLE);
            }
        }
    } else {
        
$xoopsTpl->assign(array('xoops_isuser' => false'xoops_isadmin' => false));
        if (isset(
$xoopsModule)) {
            
// set page title
            
$xoopsTpl->assign('xoops_pagetitle'$xoopsModule->getVar('name'));
            if (
preg_match("/index.php$/i"xoops_getenv('PHP_SELF')) && $xoopsConfig['startpage'] == $xoopsModule->getVar('dirname')) {
                
$block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS$xoopsModule->getVar('mid'), trueXOOPS_BLOCK_VISIBLE);
            } else {
                
$block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS$xoopsModule->getVar('mid'), falseXOOPS_BLOCK_VISIBLE);
            }
        } else {
            
$xoopsTpl->assign('xoops_pagetitle'htmlspecialchars($xoopsConfig['slogan'], ENT_QUOTES));
            if (!empty(
$xoopsOption['show_cblock'])) {
                
$block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS0trueXOOPS_BLOCK_VISIBLE);
            } else {
                
$block_arr =& $xoopsblock->getAllByGroupModule(XOOPS_GROUP_ANONYMOUS0falseXOOPS_BLOCK_VISIBLE);
            }
        }
        [
b][size=medium][color=990000]$noreg_handle =& xoops_gethandler('config');
        
$noreg =& $noreg_handle->getConfigsByCat(XOOPS_CONF_USER);
        
$xoopsTpl->assign('allow_register',$noreg['allow_register'])[/color][/size][/b]
    }
    foreach (
array_keys($block_arr) as $i) {
        
$bcachetime $block_arr[$i]->getVar('bcachetime');
        if (empty(
$bcachetime)) {
            
$xoopsTpl->xoops_setCaching(0);
        } else {
            
$xoopsTpl->xoops_setCaching(2);
            
$xoopsTpl->xoops_setCacheTime($bcachetime);
        }
        
$btpl $block_arr[$i]->getVar('template');
        if (
$btpl != '') {
            if (empty(
$bcachetime) || !$xoopsTpl->is_cached('db:'.$btpl)) {
                
$xoopsLogger->addBlock($block_arr[$i]->getVar('name'));
                
$bresult =& $block_arr[$i]->buildBlock();
                if (!
$bresult) {
                    continue;
                }
                
$xoopsTpl->assign_by_ref('block'$bresult);
                
$bcontent =& $xoopsTpl->fetch('db:'.$btpl);
                
$xoopsTpl->clear_assign('block');
            } else {
                
$xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true$bcachetime);
                
$bcontent =& $xoopsTpl->fetch('db:'.$btpl);
            }
        } else {
            
$bid $block_arr[$i]->getVar('bid');
            if (empty(
$bcachetime) || !$xoopsTpl->is_cached('db:system_dummy.html''blk_'.$bid)) {
                
$xoopsLogger->addBlock($block_arr[$i]->getVar('name'));
                
$bresult =& $block_arr[$i]->buildBlock();
                if (!
$bresult) {
                    continue;
                }
                
$xoopsTpl->assign_by_ref('dummy_content'$bresult['content']);
                
$bcontent =& $xoopsTpl->fetch('db:system_dummy.html''blk_'.$bid);
                
$xoopsTpl->clear_assign('block');
            } else {
                
$xoopsLogger->addBlock($block_arr[$i]->getVar('name'), true$bcachetime);
                
$bcontent =& $xoopsTpl->fetch('db:system_dummy.html''blk_'.$bid);
            }
        }
        switch (
$block_arr[$i]->getVar('side')) {
        case 
XOOPS_SIDEBLOCK_LEFT:
            
$xoopsTpl->append('xoops_lblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
            break;
        case 
XOOPS_CENTERBLOCK_LEFT:
            if (!isset(
$show_cblock)) {
                
$xoopsTpl->assign('xoops_showcblock'1);
                
$show_cblock 1;
            }
            
$xoopsTpl->append('xoops_clblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
            break;
        case 
XOOPS_CENTERBLOCK_RIGHT:
            if (!isset(
$show_cblock)) {
                
$xoopsTpl->assign('xoops_showcblock'1);
                
$show_cblock 1;
            }
            
$xoopsTpl->append('xoops_crblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
            break;
        case 
XOOPS_CENTERBLOCK_CENTER:
            if (!isset(
$show_cblock)) {
                
$xoopsTpl->assign('xoops_showcblock'1);
                
$show_cblock 1;
            }
            
$xoopsTpl->append('xoops_ccblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
            break;
        case 
XOOPS_SIDEBLOCK_RIGHT:
            if (!isset(
$show_rblock)) {
                
$xoopsTpl->assign('xoops_showrblock'1);
                
$show_rblock 1;
            }
            
$xoopsTpl->append('xoops_rblocks', array('title' => $block_arr[$i]->getVar('title'), 'content' => $bcontent));
            break;
        }
        unset(
$bcontent);
    }
    
//unset($block_arr);
    
if (!isset($show_rblock)) {
        
$xoopsTpl->assign('xoops_showrblock'0);
    }
    if (!isset(
$show_cblock)) {
        
$xoopsTpl->assign('xoops_showcblock'0);
    }
    if (
xoops_getenv('REQUEST_METHOD') != 'POST' && !empty($xoopsModule) && !empty($xoopsConfig['module_cache'][$xoopsModule->getVar('mid')])) {
        
$xoopsTpl->xoops_setCaching(2);
        
$xoopsTpl->xoops_setCacheTime($xoopsConfig['module_cache'][$xoopsModule->getVar('mid')]);
        if (!isset(
$xoopsOption['template_main'])) {
            
$xoopsCachedTemplate 'db:system_dummy.html';
        } else {
            
$xoopsCachedTemplate 'db:'.$xoopsOption['template_main'];
        }
        
// generate safe cache Id
        
$xoopsCachedTemplateId 'mod_'.$xoopsModule->getVar('dirname').'|'.md5(str_replace(XOOPS_URL''$GLOBALS['xoopsRequestUri']));
        if (
$xoopsTpl->is_cached($xoopsCachedTemplate$xoopsCachedTemplateId)) {
            
$xoopsLogger->addExtra($xoopsCachedTemplate$xoopsConfig['module_cache'][$xoopsModule->getVar('mid')]);
            
$xoopsTpl->assign('xoops_contents'$xoopsTpl->fetch($xoopsCachedTemplate$xoopsCachedTemplateId));
            
$xoopsTpl->xoops_setCaching(0);
            if (!
headers_sent()) {
                
header ('Content-Type:text/html; charset='._CHARSET);
            }
            
$xoopsTpl->display($xoopsConfig['theme_set'].'/theme.html');
            if (
$xoopsConfig['debug_mode'] == && $xoopsUserIsAdmin) {
                
$dummyfile 'dummy_'.time().'.html';
                
$fp fopen(XOOPS_CACHE_PATH.'/'.$dummyfile'w');
                
fwrite($fp$xoopsLogger->dumpAll());
                
fclose($fp);
                echo 
'<script language=javascript>
                debug_window = openWithSelfMain("'
.XOOPS_URL.'/misc.php?action=showpopups&type=debug&file='.$dummyfile.'", "popup", 680, 450);
                </script>'
;
            }
            exit();
        }
    } else {
        
$xoopsTpl->xoops_setCaching(0);
    }
    if (!isset(
$xoopsOption['template_main'])) {
        
// new themes using Smarty does not have old functions that are required in old modules, so include them now
        
include XOOPS_ROOT_PATH.'/include/old_theme_functions.php';
        
// need this also
        
$xoopsTheme['thename'] = $xoopsConfig['theme_set'];
        
ob_start();
    }
}
?>


And in your current theme set -> system_block_login.html
<form style="margin-top: 0px;" action="<{$xoops_url}>/user.php" 

method="post"><{$block.lang_username}><br /><input type="text" name="uname" size="12" value="<{$block.unamevalue}>" /><br 

/><{$block.lang_password}><br /><input type="password" name="pass" size="12" /><!-- <br /><input type="checkbox" 

name="rememberme" value="On" class ="formButton" /><{$block.lang_rememberme}> //--><br /><input type="hidden" 

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.



4
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...



5
nick89
Re: Report about the newbb
  • 2004/9/11 11:39

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


Quote:

ladon wrote:
Predator,

Something I was wondering about. Because newbb is using a lot of corefunctions (and is going to use even more) this might be an issue for some, at least it is for me. I think it's a good thing that the forum is well intergrated and that it uses many global functions.

However, one function in particular is bothering me. In the personal user settings a user can choose thread, flat or nested view. I don't like the fact that this applies to the forum as well. I know there are a lot of people who like this but I don't. I am planning to disable these options for my users and I want to set the view options to different settings for the forum and the commentsystem (flat for forum and nested for comments).

Is it possible that view settings can be separated? I know it is yet another whistle or bell (something like that), but I think it would be very usefull.


Navigate to /modules/newbb/viewtopic.php
Line 58 is currently empty.
If you want to force flat mode add the following on line 58 -
$viewmode = 'flat';
If you want to force threaded mode add the following on line 58 -
$viewmode = 'thread';

Note this will still alow the 'clicking' of the flat/threaded link on each forum page to change, if you do not want to allow this then do the above on line 66. OR alternatively remove it from the template.



6
nick89
Re: Hack search/request
  • 2004/9/11 11:03

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


Find the following file:
XOOPS DIRECTORY /modules/news/article.php

On Line 60 you can find the following:
$story['title'] = $article->textlink()."&nbsp;:&nbsp;".$article->title();


Change it to:
$story['title'] = $article->title();


All Done.



7
nick89
Re: Truncating text of users news posts
  • 2004/9/9 8:59

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


A working example can be seen at www.webmaster-universe.com



8
nick89
Re: Removing number of reads
  • 2004/9/9 8:16

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


that would require a SQL edit aswell



9
nick89
Re: Update deafult templates
  • 2004/9/9 8:07

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


Oh and you can see it in action at www.webmaster-universe.com - it is the forum index.



10
nick89
Re: Update deafult templates
  • 2004/9/9 8:06

  • nick89

  • Just popping in

  • Posts: 47

  • Since: 2004/7/9 8


Hi there! I solved my own problem, without cloning the deafult. The deafult templates can be found in your SQL database under the table xoops_tplsource. I meerly editted this, as well as the file in the modules directory.




TopTop
(1) 2 3 4 »



Login

Who's Online

164 user(s) are online (107 user(s) are browsing Support Forums)


Members: 0


Guests: 164


more...

Donat-O-Meter

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

Latest GitHub Commits