1
fosterm
Smartsection Problems with Notifications
  • 2009/4/30 15:46

  • fosterm

  • Just popping in

  • Posts: 93

  • Since: 2005/8/7 2


Hi All

I am running XOOPS 2.3.1 with smartsection 2.13.

I have noticed a problem with the notifications in this module on my site at http://www.montgomerycountymonitor.com

Notifications for other modules on the site seem to be working appropriately.

The specific problem with the notifications with this module (called news and a clone of the module referred to as public information on my site) is that I do not get a message that notifications are updated when I attempt to add notifications and of course the notifications do not work.

When I check one of the notification boxes while viewing an individual story and hit the "Update Now" button the notifications do not update. It appears it is trying to update but it just refreshes the screen and the box I had just checked is no longer checked.

However, when I attempt to change global notifications on the categories summary page ( reached by clicking on Public Information on the left hand Main Menu), I do get the notifications updated message and the update box that I clicked remains checked after the page refreshes

When I turn on error messages I only get a couple of notices, not actual errors.

So it seems the global notifications for categories is working properly but not any other notification for this module.

I am including the code from the /modules/public_information/include/notification.inc.php in hopes that someone can offer some help.


/**
* $Id: notification.inc.php,v 1.6 2006/03/03 11:52:54 malanciault Exp $
* Module: Public_Information
* Author: The SmartFactory 
* Licence: GNU
*/

function public_information_notify_iteminfo($category$item_id)
{
    global 
$xoopsModule$xoopsModuleConfig$xoopsConfig;
    
    include_once(
XOOPS_ROOT_PATH "/modules/public_information/include/seo_functions.php");
    
    if (empty(
$xoopsModule) || $xoopsModule->getVar('dirname') != 'public_information') {
        
$module_handler = &xoops_gethandler('module');
        
$module = &$module_handler->getByDirname('public_information');
        
$config_handler = &xoops_gethandler('config');
        
$config = &$config_handler->getConfigsByCat(0$module->getVar('mid'));
    } else {
        
$module = &$xoopsModule;
        
$config = &$xoopsModuleConfig;
    } 

    if (
$category == 'global') {
        
$item['name'] = '';
        
$item['url'] = '';
        return 
$item;
    } 

    global 
$xoopsDB;

    if (
$category == 'category') {
        
// Assume we have a valid category id
        
$sql 'SELECT name, short_url FROM ' $xoopsDB->prefix('public_information_categories') . ' WHERE categoryid  = ' $item_id;
        
$result $xoopsDB->query($sql); // TODO: error check
        
$result_array $xoopsDB->fetchArray($result);
        
$item['name'] = $result_array['name'];
        
$item['url'] = public_information_seo_genUrl('category'$item_id$result_array['short_url']); 
        return 
$item;
    } 

    if (
$category == 'item') {
        
// Assume we have a valid story id
        
$sql 'SELECT title, short_url FROM ' $xoopsDB->prefix('public_information_items') . ' WHERE itemid = ' $item_id;
        
$result $xoopsDB->query($sql); // TODO: error check
        
$result_array $xoopsDB->fetchArray($result);
        
$item['name'] = $result_array['title'];
        
$item['url'] = public_information_seo_genUrl('item'$item_id$result_array['short_url']); 
        return 
$item;
    } 


?>


For those trying to help you can login using the following:

Username: test
Pass: tester

If any other info is needed dont hesitate to ask.

I have thoroughly searched both this site and the modules old site and new site and have been unable to resolve this issue.

Thanks for the help.

Foz

2
xgarb
Re: Smartsection Problems with Notifications
  • 2009/5/14 15:34

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


having the same problem and not found a solution either.

If you access the page using the non rewritten URL (ie modules/smartsection/item.php?itemid=68 ) it works so the problem is to do with the rewrite.

Maybe the newest version fixes the problem?

3
trabis
Re: Smartsection Problems with Notifications
  • 2009/5/14 19:33

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


You need to change xoops_root/include/notification_select.php around line around line 61:

$xoops_notification['target_page'] = XOOPS_URL '/modules/' $xoopsModule->getVar('dirname') . '/notification_update.php';
        
$xoops_notification['redirect_script'] = xoops_getenv('PHP_SELF');


Also,
if you are running in a sub directory like http://yoursite.com/xoops/,
you may need to fix smartsection/seo.php around line 38:
$url_arr explode('/modules/'$_SERVER['PHP_SELF']);
    
$newUrl $url_arr[0] . '/modules/smartsection/' $seoMap[$seoOp];


4
xgarb
Re: Smartsection Problems with Notifications
  • 2009/5/15 8:43

  • xgarb

  • Not too shy to talk

  • Posts: 154

  • Since: 2003/3/30


cool, thanks. notification_select.php change worked for me.

I also made the changes in post 2 here.. http://smartfactory.ca/modules/newbb/viewtopic.php?topic_id=1714&forum=5&post_id=7681 but I'm not sure if they were necessary.

Login

Who's Online

338 user(s) are online (271 user(s) are browsing Support Forums)


Members: 0


Guests: 338


more...

Donat-O-Meter

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

Latest GitHub Commits