xoops forums

goffy

Just can't stay away
Posted on: 3/15 8:32
goffy
goffy (Show more)
Just can't stay away
Posts: 410
Since: 2010/12/27
#41

Re: wgGallery 1.10 ready for testing

Hi Michael

I will have a look into it

@Pino: give me some time, then you get it :)

Lupin

Just popping in
Posted on: 3/16 12:46
Lupin
Lupin (Show more)
Just popping in
Posts: 89
Since: 2007/6/1 2
#42

Re: wgGallery 1.10 ready for testing

Noprob ... in Italy now we have enough time ...
Anyway you are doing a great job with wggallery module

andalways viva XOOPS !

Pino

goffy

Just can't stay away
Posted on: 3/25 21:40
goffy
goffy (Show more)
Just can't stay away
Posts: 410
Since: 2010/12/27
#43

Re: wgGallery 1.10 ready for testing

Hi

is there somewhere a documentation how to implement this feature "get notification for each comment"

Mamba

Moderator
Posted on: 3/25 21:54
Mamba
Mamba (Show more)
Moderator
Posts: 10935
Since: 2004/4/23
#44

Re: wgGallery 1.10 ready for testing

I'm not sure about the documentation, but it seems like SmartFAQ had it implemented, as they point out in this Q&A
And if you look there - they have an option to subscribe to new comments, so check out the code in SmartFAQ

If you figure that out, please share your solution....
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

Mamba

Moderator
Posted on: 3/25 22:07
Mamba
Mamba (Show more)
Moderator
Posts: 10935
Since: 2004/4/23
#45

Re: wgGallery 1.10 ready for testing

I just checked - so the code itself is in the /include/notifications_functions.php around line 192:

if ($module->getVar('hascomments')) {
        
$com_config $module->getInfo('comments');
        if (!empty(
$category['item_name']) && $category['item_name'] == $com_config['itemName']) {
            if (!
is_dir($dir XOOPS_ROOT_PATH '/language/' $xoopsConfig['language'] . '/mail_template/')) {
                
$dir XOOPS_ROOT_PATH '/language/english/mail_template/';
            }
            
$mail_template_dir $dir;

            include_once 
$GLOBALS['xoops']->path('include/comment_constants.php');
            
$config_handler xoops_getHandler('config');
            
$com_config     $config_handler->getConfigsByCat(0$module_id);
            if (!
$enabled_only) {
                
$insert_comment true;
                
$insert_submit  true;
            } else {
                
$insert_comment false;
                
$insert_submit  false;
                switch (
$com_config['com_rule']) {
                    case 
XOOPS_COMMENT_APPROVENONE:
                        
// comments disabled, no comment events
                        
break;
                    case 
XOOPS_COMMENT_APPROVEALL:
                        
// all comments are automatically approved, no 'submit'
                        
if (!$override_comment) {
                            
$insert_comment true;
                        }
                        break;
                    case 
XOOPS_COMMENT_APPROVEUSER:
                    case 
XOOPS_COMMENT_APPROVEADMIN:
                        
// comments first submitted, require later approval
                        
if (!$override_comment) {
                            
$insert_comment true;
                        }
                        if (!
$override_commentsubmit) {
                            
$insert_submit true;
                        }
                        break;
                }
            }
            if (
$insert_comment) {
                
$event = array(
                    
'name'              => 'comment',
                    
'category'          => $category['name'],
                    
'title'             => _NOT_COMMENT_NOTIFY,
                    
'caption'           => _NOT_COMMENT_NOTIFYCAP,
                    
'description'       => _NOT_COMMENT_NOTIFYDSC,
                    
'mail_template_dir' => $mail_template_dir,
                    
'mail_template'     => 'comment_notify',
                    
'mail_subject'      => _NOT_COMMENT_NOTIFYSBJ);
                if (!
$enabled_only || notificationEventEnabled($category$event$module)) {
                    
$event_array[] = $event;
                }
            }
            if (
$insert_submit) {
                
$event = array(
                    
'name'              => 'comment_submit',
                    
'category'          => $category['name'],
                    
'title'             => _NOT_COMMENTSUBMIT_NOTIFY,
                    
'caption'           => _NOT_COMMENTSUBMIT_NOTIFYCAP,
                    
'description'       => _NOT_COMMENTSUBMIT_NOTIFYDSC,
                    
'mail_template_dir' => $mail_template_dir,
                    
'mail_template'     => 'commentsubmit_notify',
                    
'mail_subject'      => _NOT_COMMENTSUBMIT_NOTIFYSBJ,
                    
'admin_only'        => 1);
                if (!
$enabled_only || notificationEventEnabled($category$event$module)) {
                    
$event_array[] = $event;
                }
            }
        }
    }
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

Mamba

Moderator
Posted on: 3/25 22:30
Mamba
Mamba (Show more)
Moderator
Posts: 10935
Since: 2004/4/23
#46

Re: wgGallery 1.10 ready for testing

In SmartFAQ in xoops_version.php you have this code:

// Comments
$modversion['hasComments']          = 1;
$modversion['comments']['itemName'] = 'faqid';
$modversion['comments']['pageName'] = 'faq.php';
// Comment callback functions
$modversion['comments']['callbackFile']        = 'include/comment_functions.php';
$modversion['comments']['callback']['approve'] = 'smartfaq_com_approve';
$modversion['comments']['callback']['update']  = 'smartfaq_com_update';
// Notification
$modversion['hasNotification']             = 1;
$modversion['notification']['lookup_file'] = 'include/notification.inc.php';
$modversion['notification']['lookup_func'] = 'smartfaq_notify_iteminfo';

$modversion['notification']['category'][] = [
    
'name'           => 'global_faq',
    
'title'          => _MI_SF_GLOBAL_FAQ_NOTIFY,
    
'description'    => _MI_SF_GLOBAL_FAQ_NOTIFY_DSC,
    
'subscribe_from' => ['index.php''category.php''faq.php'],
];


I think, that's the way to implement it....
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

goffy

Just can't stay away
Posted on: 3/26 6:44
goffy
goffy (Show more)
Just can't stay away
Posts: 410
Since: 2010/12/27
#47

Re: wgGallery 1.10 ready for testing

Hi Michael

thank you
I will check it

goffy

Just can't stay away
Posted on: 3/27 20:50
goffy
goffy (Show more)
Just can't stay away
Posts: 410
Since: 2010/12/27
#48

Re: wgGallery 1.10 ready for testing

Hi Pino

can you please test last version from github?

Dont forget to adapt .\wggallery\language\italian\mail_template\global_img_comment_notify.tpl

Mamba

Moderator
Posted on: 3/27 22:45
Mamba
Mamba (Show more)
Moderator
Posts: 10935
Since: 2004/4/23
#49

Re: wgGallery 1.10 ready for testing

The new comment notifications work! Nice job, Goffy!

Congratulations!
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

Lupin

Just popping in
Posted on: 3/28 11:06
Lupin
Lupin (Show more)
Just popping in
Posts: 89
Since: 2007/6/1 2
#50

Re: wgGallery 1.10 ready for testing

Running to test it