1
mikelmoore
XoopsTree getNicePathFromId/MyTextSanitizer htmlSpecialChars XHTML compliance
  • 2006/5/11 17:32

  • mikelmoore

  • Just popping in

  • Posts: 3

  • Since: 2005/2/23


This question regards XOOPS 2.2.3, as I haven't done any regression testing...

I'm trying to reach XHTML compliance (at least at the transitional level) and I've run into this issue: Link references created by XoopsTree's getNicePathFromId method (which calls the MyTextSanitizer's deprecated makeTboxData4Show, which just calls the MyTextSanitizer class's htmlSpecialChars method) doesn't return quoted values on assignments, which will fail validation tests.

I've written a weather forecast module (with an XML feed pull from the weather channel) and was trying to make the module use more core functions before I would consider submitting it for use. However, I only want to create XHTML compliant code, so this leaves me in a quandry: keep my existing methods and maintain compliancy, or use the core functionality and lose compliancy. The issue revolves around the htmlSpecialChars method's use of PHP's htmlspecialchars function with ENT_QUOTES instead of the default ENT_COMPAT.

For an existing example of what I mean the CBB (v3.01) forum, using XoopsTree, ends up with links like:
http://website/modules/newbb/viewforum.php?forum=70

instead of
http://website/modules/newbb/viewforum.php?forum='70'


This is my first XOOPS modules, so some help would be appreciated.



2
mikelmoore
Re: [BETA] multiMenu 1.8, when mm goes dynamics
  • 2006/4/13 17:41

  • mikelmoore

  • Just popping in

  • Posts: 3

  • Since: 2005/2/23


Can multimenu support this functionality?

I use a bridged coppermine and would like to be able to provide a submenu option to go directly to the users personal gallery. In order to do that I need to pass the users $uid as part of the link and it will vary with each user.

To fully be a replacement for the default XOOPS menus, there has to be some kind of support for this...



3
mikelmoore
PM System Notification hack
  • 2006/3/27 23:55

  • mikelmoore

  • Just popping in

  • Posts: 3

  • Since: 2005/2/23


If you are using the Private Messaging module and want the notifications back, modify the b_system_user_show function in system_blocks.php like this. Adjust 'auto-notify' text in the SELECT statement for your language.

This hack shouldn't cause any problems even if you don't have Private Messaging installed...

I updated this to only count unread notifications,cleaned up formatting and added comments...

function b_system_user_show()
{
global 
$xoopsUser;
//Need to access database & check module install state, so get their handles
$xoopsDB =& Database::getInstance();
$module_handler =& xoops_gethandler('module');
if (
is_object($xoopsUser)) {
    
$block = array();
    
$block['lang_youraccount'] = _MB_SYSTEM_VACNT;
    
$block['lang_editaccount'] = _MB_SYSTEM_EACNT;
    
//see if private messaging is installed
    
if ($module_handler->getCount(new Criteria('dirname''pm'))) {
        
//get count of any unread notifications
        
$result $xoopsDB->query("SELECT COUNT(*) FROM " $xoopsDB->prefix("priv_msgs")." WHERE to_userid = "$xoopsUser->getVar('uid') . " AND read_msg = 0 AND INSTR(subject,'auto-notify') > 0");
        
//if there are any notifications
        
if ( $result ) {
            
$privmsgcnt $xoopsDB->fetchRow($result);
            
//if there are any unread notifications
            
if ( $privmsgcnt[0] > ) {
                
$block['lang_notifications'] = _MB_SYSTEM_NOTIF " (" $privmsgcnt[0] . ")";
            
//if there aren't any unread notifications
            
} else {
                
$block['lang_notifications'] = _MB_SYSTEM_NOTIF;
            }
        } else {
            
$block['lang_notifications'] = _MB_SYSTEM_NOTIF;
        }
    
//Private Messaging not installed
    
} else {
        
$block['lang_notifications'] = _MB_SYSTEM_NOTIF;
    }
    
$block['lang_logout'] = _MB_SYSTEM_LOUT;
    
$block['lang_adminmenu'] = _MB_SYSTEM_ADMENU;
    
$block['admin'] = $xoopsUser->isAdmin(0);
    return 
$block;
}
return 
false;
}




TopTop



Login

Who's Online

251 user(s) are online (157 user(s) are browsing Support Forums)


Members: 0


Guests: 251


more...

Donat-O-Meter

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

Latest GitHub Commits