Changeset 597
- Timestamp:
- Apr 30, 2010, 9:37:22 PM (15 years ago)
- Location:
- trunk/xpressme_integration_kit/wp-content/plugins/xpressme
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/d3forum_comment_synchro.php
r595 r597 86 86 } 87 87 88 function onaction_trashed_post_comments($post_id){ 89 global $wpdb; 90 set_d3f_topic_invisible($post_id,1); 91 } 92 function onaction_untrashed_post_comments($post_id){ 93 global $wpdb; 94 set_d3f_topic_invisible($post_id,0); 95 } 96 function onaction_trashed_comment($comment_ID = ""){ 97 global $wpdb; 98 $comment_type = $wpdb->get_var("SELECT comment_type FROM $wpdb->comments WHERE comment_ID = $comment_ID"); 99 if (!empty($comment_type)) return ; 100 set_d3f_post_invisible($comment_ID,1); 101 } 102 function onaction_untrashed_comment($comment_ID = ""){ 103 global $wpdb; 104 $comment_type = $wpdb->get_var("SELECT comment_type FROM $wpdb->comments WHERE comment_ID = $comment_ID"); 105 if (!empty($comment_type)) return ; 106 set_d3f_post_invisible($comment_ID,0); 107 } 108 109 function set_d3f_topic_invisible($topic_external_link_id,$invisible){ 110 global $wpdb,$xoops_db,$blog_id,$xpress_config; 111 112 if (empty($blog_id)) $blog_id =1; 113 $d3forum_prefix = get_xoops_prefix() . $xpress_config->d3forum_module_dir . '_'; 114 $d3f_topic = $d3forum_prefix . 'topics'; 115 $d3f_forum_id = $xpress_config->d3forum_forum_id; 116 //xdb_d3forum_posts where topic_external_link_id = topic_external_link_id update topic_invisible 117 118 $sql = "UPDATE $d3f_topic "; 119 $sql .= "SET topic_invisible = $invisible "; 120 $sql .= "WHERE topic_external_link_id = $topic_external_link_id AND forum_id = $d3f_forum_id" ; 121 $xoops_db->query($sql); 122 } 123 124 function set_d3f_post_invisible($wp_comment_ID, $invisible){ 125 global $wpdb,$xoops_db,$blog_id,$xpress_config; 126 127 if (empty($blog_id)) $blog_id =1; 128 $d3forum_prefix = get_xoops_prefix() . $xpress_config->d3forum_module_dir . '_'; 129 $d3f_posts = $d3forum_prefix . 'posts'; // delete key topic_id 130 131 $d3f_post_id = get_d3forum_post_ID($wp_comment_ID); 132 //xdb_d3forum_posts where post_id update invisible 133 if ($d3f_post_id){ 134 $sql = "UPDATE $d3f_posts SET invisible = $invisible WHERE post_id =$d3f_post_id"; 135 $xoops_db->query($sql); 136 } 137 } 138 88 139 function disp_d3forum_comments($template_dir="", $file_name="") 89 140 { … … 92 143 return $file_path; 93 144 } 94 95 145 96 146 function d3f_module_found($forum_dir ='d3forum'){ //use admin/admin_enhanced.php -
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/xpressme.php
r596 r597 128 128 add_action("wp_set_comment_status" , "onaction_comment_apobe"); 129 129 add_action("publish_post", "onaction_comment_close"); 130 131 130 131 // comment trashed untrashed action 132 add_action("trashed_post_comments", "onaction_trashed_post_comments"); 133 add_action("untrashed_post_comments", "onaction_untrashed_post_comments"); 134 add_action("trashed_comment", "onaction_trashed_comment"); 135 add_action("untrashed_comment", "onaction_untrashed_comment"); 136 132 137 add_filter('comments_template', "disp_d3forum_comments" ); 133 134 } 135 136 138 } 137 139 138 140 //The trackback and the pingback are excluded from the count of the comment.
Note: See TracChangeset
for help on using the changeset viewer.