Changeset 96 for trunk/wp-content/plugins
- Timestamp:
- Mar 6, 2009, 5:16:22 PM (16 years ago)
- Location:
- trunk/wp-content/plugins/xpressme
- Files:
-
- 1 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/plugins/xpressme/include/custom_functions.php
r95 r96 3 3 function xpress_credit($show = false) 4 4 { 5 global $xoopsModule,$wp_version; 6 7 $ret = '<a href="http://www.toemon.com"'. " target='_blank'" . '>XPressME Ver.' . sprintf('%.2f %s',$xoopsModule->getInfo('version'),$xoopsModule->getInfo('codename')) .'</a>'; 5 global $wp_version , $modversion; 6 7 $xpress_version = $modversion['version']; 8 $xpress_codename = $modversion['codename']; 9 $ret = '<a href="http://www.toemon.com"'. " target='_blank'" . '>XPressME Ver.' . sprintf('%.2f %s',$xpress_version,$xpress_codename) .'</a>'; 8 10 if (strstr($wp_version,'ME')){ 9 11 $ret .= '(included <a href="http://wpme.sourceforge.jp/" title="Powered by WordPress"'." target='_blank'". '>WordPress ' . $wp_version . '</a>)'; … … 192 194 // Set post views given a post ID or post object. 193 195 function post_views_counting($post_id = 0) { 196 global $xoops_db,$wpdb; 194 197 global $table_prefix; 195 198 static $views; … … 201 204 202 205 203 $views_db = $table_prefix . "views";206 $views_db = get_wp_prefix() . 'views'; 204 207 205 208 if($post_id==0 || !empty($views[$post_id])) return null; … … 212 215 213 216 $sql = "SELECT post_views FROM " . $views_db . " WHERE post_id=$post_id"; 214 $exist = false; 215 if ($result = $GLOBALS["xoopsDB"]->query($sql)) { 216 while($row = $GLOBALS["xoopsDB"]->fetchArray($result)){ 217 $exist = true; 218 break; 219 } 220 } 221 if($exist){ 217 $post_views_found = $xoops_db->get_var($sql); 218 if($post_views_found){ 222 219 $sql = "UPDATE " . $views_db . " SET post_views=post_views+1 WHERE post_id=$post_id"; 223 220 }else{ 224 221 $sql = "INSERT INTO " . $views_db . " (post_id, post_views) VALUES ($post_id, 1)"; 225 222 } 226 if ($result = $GLOBALS["xoopsDB"]->queryF($sql)) { 227 $views[$post_id] = 1; 228 } 229 223 $xoops_db->query($sql); 230 224 return true; 231 225 } -
trunk/wp-content/plugins/xpressme/include/notify_functions.php
r95 r96 48 48 $_SERVER['REQUEST_METHOD'] = 'POST'; 49 49 } 50 51 include_once $xoops_config->xoops_mainfile_path; // load XOOPS System 52 include_once $xoops_config->xoops_root_path . '/include/notification_functions.php' ; 50 // set_error_handler("xpress_error_handler"); 51 require $xoops_config->xoops_mainfile_path; // load XOOPS System 53 52 $module_id = get_xpress_modid() ; 54 53 $notification_handler =& xoops_gethandler( 'notification' ) ; … … 58 57 function do_CommentWaiting($commentID, $comment_post_ID) 59 58 { 60 // global $xoops_config;61 // require_once $xoops_config->xoops_mainfile_path;62 // xoops_mainfile_path;63 59 // require_once XOOPS_ROOT_PATH . '/include/notification_functions.php' ; 64 60 // $notification_handler =& xoops_gethandler( 'notification' ) ; … … 120 116 { 121 117 global $xoops_config, $xoops_db; 122 xpress_debug();123 118 124 119 -
trunk/wp-content/plugins/xpressme/include/pluggable-override.php
r87 r96 56 56 endif; 57 57 58 if ( !function_exists('xpress_login') ) : 58 59 function xpress_login(){ 59 60 global $current_user; … … 81 82 return 0; 82 83 } 84 endif; 83 85 86 if ( !function_exists('check_xpress_auth_cookie') ) : 84 87 function check_xpress_auth_cookie() { // for wp2.5 85 88 if ( empty($_COOKIE[AUTH_COOKIE]) ){ … … 112 115 return false; 113 116 } 117 endif; 114 118 115 119 if ( !function_exists('wp_check_password') ) : -
trunk/wp-content/plugins/xpressme/include/xpress_common_functions.php
r95 r96 49 49 } 50 50 51 function is_block_cache_found($block_name) 52 { 53 global $xoops_config; 54 $mydirname = get_xpress_dir_name(); 55 56 if(defined('XOOPS_ROOT_PATH')){ 57 $cache_dir = XOOPS_ROOT_PATH . '/cache/'; 58 } else { 59 $cache_dir = $xoops_config->xoops_root_path . '/cache/'; 60 } 61 $xml_name = $block_name . '.xml'; 62 63 $filename = $cache_dir .$mydirname . '_' . $xml_name; 64 $cache_time = 0; 65 // if (file_exists($filename) && ((time() - filemtime($filename)) < $cache_time)) { 66 if (file_exists($filename)) { 67 return true; 68 } else { 69 return false; 70 } 71 } 72 73 74 //When there is no block cash, and an optional block is different, false is returned. 75 function is_block_cache_normal() 76 { 77 global $xoops_config; 78 global $xoops_db; 79 $mid = get_xpress_modid(); 80 $sql = "SELECT bid,options,func_file FROM " . get_xoops_prefix() . "newblocks WHERE mid = $mid "; 81 $blocks = $xoops_db->get_results($sql); 82 $mydirname = get_xpress_dir_name(); 83 require_once get_xpress_dir_path() . '/include/xpress_block_render.php'; 84 85 foreach($blocks as $block){ 86 $func_file = $block->func_file; 87 $call_theme_function_name = str_replace(".php", "", $func_file); 88 $inc_theme_file_name = str_replace(".php", "", $func_file) . '_theme.php'; 89 $cache_title = str_replace(".php", "", $func_file); 90 $blockID = $block->bid; 91 $options = explode("|", $block->options); 92 93 if (!is_block_cache_found($cache_title . $blockID)) return false; 94 $xml = xpress_block_cache_read($mydirname,$cache_title. $blockID); 95 $options = ''; 96 $options = @$xml['block']['options']; 97 if( strcmp($options,$block->options) != 0 ) return false; 98 } 99 return true; 100 } 101 102 51 103 function block_cache_refresh() 52 104 { … … 71 123 $block_render = $call_theme_function_name($options); //The block name and the called function name should be assumed to be the same name. 72 124 $xml['block'] = $block_render; 125 $xml['block']['options'] = $block->options; 73 126 xpress_block_cache_write($mydirname,$cache_title. $blockID, $xml); 74 127 } -
trunk/wp-content/plugins/xpressme/xpressme.php
r95 r96 27 27 remove_action( 'pre_post_update', 'wp_save_post_revision' ); // Not Save Post Revision 28 28 } 29 30 //XOOPS Bloack Cache Refresh 29 31 add_action("comment_post", "block_cache_refresh"); 30 32 add_action("edit_comment", "block_cache_refresh"); 31 add_action(" delete_comment","block_cache_refresh");32 add_action("delete _post", "block_cache_refresh");33 add_action("wp_set_comment_status","block_cache_refresh"); //wp_delete_comment() at deleted 34 add_action("deleted_post", "block_cache_refresh"); 33 35 add_action("publish_post", "block_cache_refresh"); 34 36 add_action("edit_post", "block_cache_refresh"); 35 37 add_action("private_to_published", "block_cache_refresh"); 36 add_action(" wp_set_comment_status", "block_cache_refresh");38 add_action("transition_post_status", "block_cache_refresh"); 37 39 38 40 add_action("the_content", "set_post_views_count");
Note: See TracChangeset
for help on using the changeset viewer.