XPressME Integration Kit

Trac

Changeset 662


Ignore:
Timestamp:
Oct 9, 2010, 2:15:56 PM (14 years ago)
Author:
toemon
Message:

コメント投稿後、ブランクページになるバグ修正 fixes#376

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/notify_functions.php

    r538 r662  
    3535} 
    3636 
    37 function Notification_triggerEvent($category, $item_id, $event, $extra_tags=array(), $user_list=array(), $omit_user_id=null) 
     37function Notification_triggerEvent($force_reserve = false,$category, $item_id, $event, $extra_tags=array(), $user_list=array(), $omit_user_id=null) 
    3838{ 
    3939        global $xoops_db,$xoops_config; 
     40        global $xoopsModule,$xoopsUser,$xoopsUserIsAdmin; 
     41 
    4042        //When notifying by a private message,  
    4143        //it is evaded that the data base becomes read-only as a result of the check on the referrer and the method.  
     
    5658//              } 
    5759//      } 
    58         if ( defined("XOOPS_MAINFILE_INCLUDED")) { 
     60        if (!$force_reserve && defined("XOOPS_MAINFILE_INCLUDED") ) { 
    5961                if ( defined("XPRESS_EVENT_DEBUG")) xpress_debug_message($message = 'call $notification_handler->triggerEvent'); 
    6062                $module_id = get_xpress_modid() ; 
     
    7274//      require_once XOOPS_ROOT_PATH . '/include/notification_functions.php' ; 
    7375//      $notification_handler =& xoops_gethandler( 'notification' ) ; 
    74         Notification_triggerEvent( 'global' , 0 , 'waiting') ; 
     76 
     77        // Fixed Compile Error : /wp-includes/class-phpmailer.php - Cannot redeclare class PHPMailer 
     78        $comments_notify = get_option('comments_notify'); 
     79        if($comments_notify) $force_reserve = true; else $force_reserve = false; 
     80         
     81        Notification_triggerEvent($force_reserve,'global' , 0 , 'waiting') ; 
    7582} 
    7683 
     
    103110 
    104111        $comment_tags = array( 'XPRESS_AUTH_NAME' =>$user_name,'XPRESS_BLOG_NAME' =>$blog_name,'XPRESS_POST_TITLE' => $post_title , 'XPRESS_POST_URL' => $post_url ) ; 
    105         Notification_triggerEvent('global' , 0 , 'comment' , $comment_tags , false); 
    106         Notification_triggerEvent('author' , $post_author , 'comment' , $comment_tags , false); 
    107         Notification_triggerEvent('post' , $comment_post_ID , 'comment' , $comment_tags , false); 
     112 
     113        // Fixed Compile Error : /wp-includes/class-phpmailer.php - Cannot redeclare class PHPMailer 
     114        $moderation_notify = get_option('moderation_notify'); 
     115        if($moderation_notify) $force_reserve = true; else $force_reserve = false; 
     116 
     117        Notification_triggerEvent($force_reserve, 'global' , 0 , 'comment' , $comment_tags , false); 
     118        Notification_triggerEvent($force_reserve, 'author' , $post_author , 'comment' , $comment_tags , false); 
     119        Notification_triggerEvent($force_reserve, 'post' , $comment_post_ID , 'comment' , $comment_tags , false); 
    108120 
    109121        // categorie notification 
     
    120132                $cat_name = $categorie->cat_name; 
    121133                $comment_tags = array( 'XPRESS_AUTH_NAME' =>$user_name,'XPRESS_BLOG_NAME' =>$blog_name,'XPRESS_CAT_TITLE' => $cat_name,'XPRESS_POST_TITLE' => $post_title , 'XPRESS_POST_URL' => $post_url ) ; 
    122                 Notification_triggerEvent('category' , $cat_id , 'comment' , $comment_tags , false); 
     134                Notification_triggerEvent($force_reserve, 'category' , $cat_id , 'comment' , $comment_tags , false); 
    123135 
    124136        } 
     
    152164 
    153165        $posts_tags = array( 'XPRESS_AUTH_NAME' =>$user_name,'XPRESS_BLOG_NAME' =>$blog_name,'XPRESS_POST_TITLE' => $post_title , 'XPRESS_POST_URL' => $post_url ) ; 
    154  
     166        $force_reserve = false; 
    155167        switch ($not_event) { 
    156168                case 'newpost' : 
    157                         Notification_triggerEvent('global' , 0 , 'newpost' , $posts_tags , false); 
    158                         Notification_triggerEvent('author' , $post_author , 'newpost' , $posts_tags , false); 
     169                        Notification_triggerEvent($force_reserve, 'global' , 0 , 'newpost' , $posts_tags , false); 
     170                        Notification_triggerEvent($force_reserve, 'author' , $post_author , 'newpost' , $posts_tags , false); 
    159171 
    160172                        // categorie notification 
     
    171183                                $cat_name = $categorie->cat_name; 
    172184                                $posts_tags = array( 'XPRESS_AUTH_NAME' =>$user_name,'XPRESS_BLOG_NAME' =>$blog_name,'XPRESS_CAT_TITLE' => $cat_name,'XPRESS_POST_TITLE' => $post_title , 'XPRESS_POST_URL' => $post_url ) ; 
    173                                 Notification_triggerEvent('category' , $cat_id , 'newpost' , $posts_tags , false); 
     185                                Notification_triggerEvent($force_reserve, 'category' , $cat_id , 'newpost' , $posts_tags , false); 
    174186                        } 
    175187                        break; 
    176188                case 'editpost' : 
    177                         Notification_triggerEvent('post' , $post_id , 'editpost' , $posts_tags , false); 
     189                        Notification_triggerEvent($force_reserve, 'post' , $post_id , 'editpost' , $posts_tags , false); 
    178190                        break; 
    179191                default : 
Note: See TracChangeset for help on using the changeset viewer.