- Timestamp:
- Mar 6, 2009, 5:16:22 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/oninstall.php
r89 r96 51 51 wp_cache_flush(); 52 52 make_db_current_silent(); 53 $ret[] = "The data base of wordpress was made by prefix $table_prefix."; 53 54 54 55 $option_desc = __('WordPress web address'); … … 67 68 update_option("home", $site_url); 68 69 update_option("siteurl", $site_url); 70 update_option("what_to_show", "posts"); 71 update_option('default_pingback_flag', 0); 72 $ret[] = 'The initial data was written in the data base of wordpress.'; 73 69 74 update_option("template", "xpress_default"); 70 75 update_option("stylesheet", "xpress_default"); 71 update_option("what_to_show", "posts"); 72 76 $ret[] = 'The default theme of wordpress was set to xpress_default.'; 73 77 /* add new option for uploads */ 74 78 // update_option('uploads_use_yearmonth_folders', 1); 75 79 // update_option('upload_path', $module->getVar("dirname")); 76 80 81 82 // Admin User Data write 83 // Change uid field 84 $wpdb->query("ALTER TABLE $wpdb->posts CHANGE `post_author` `post_author` mediumint(8) NOT NULL DEFAULT '0'"); 85 $user_name = is_object($GLOBALS["xoopsUser"])?$GLOBALS["xoopsUser"]->getVar("uname"):'admin'; 86 $email = is_object($GLOBALS["xoopsUser"])?$GLOBALS["xoopsUser"]->getVar("email"):'foo@exsample.com'; 87 $pass_md5 = is_object($GLOBALS["xoopsUser"])?$GLOBALS["xoopsUser"]->getVar("pass"):''; 88 89 $user_id = username_exists($user_name); 90 if ( !$user_id ) { 91 $random_password = 'admin'; 92 $user_id = wp_create_user($user_name, $random_password, $email); 93 } else { 94 $random_password = __('User already exists. Password inherited.'); 95 } 96 97 $user = new WP_User($user_id); 98 $user->set_role('administrator'); 99 'User ' . $user_name . ' of the administrator was made.'; 100 // over write xoops md5 password 101 $sql = "UPDATE $wpdb->users SET user_pass ='$pass_md5' WHERE ID = $user_id"; 102 $wpdb->query($sql); 103 $ret[] = 'The password of XOOPS was copied.'; 104 // Set Default data 105 wp_install_defaults($user_id); 106 $ret[] = 'The first sample post & comment was written.'; 107 // generate_page_uri_index(); 108 77 109 /* activate the XPressME plugin */ 78 110 $plugin_current = "xpressme/xpressme.php"; … … 80 112 include_once(dirname(__FILE__) . '/../wp-content/plugins/'.$plugin_current); 81 113 do_action('activate_'.$plugin_current); 82 83 // Admin User Data write 84 // Change uid field 85 $wpdb->query("ALTER TABLE $wpdb->posts CHANGE `post_author` `post_author` mediumint(8) NOT NULL DEFAULT '0'"); 86 $ID = is_object($GLOBALS["xoopsUser"])?$GLOBALS["xoopsUser"]->getVar("uid"):1; 87 // require_once($mydirpath . '/include/user_sync.php'); 88 $sync_messg = ''; 89 // user_sync_to_wordpress($ID,$sync_messg); //this function in XPressME plugin 90 91 // Set Default data 92 wp_install_defaults($ID); 93 // generate_page_uri_index(); 94 95 114 $ret[] = 'The xpressme plug-in was activated.'; 115 96 116 // create views table 97 117 $xp_prefix = $mydirname; … … 115 135 116 136 dbDelta($views_queries); 137 $ret[] = "$views_table table of XPressME was made."; 138 117 139 118 140 $d3forum_link = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_d3forum_link' ; … … 124 146 )$charset_collate;"; 125 147 dbDelta($views_queries); 148 $ret[] = "$d3forum_link table of XPressME was made."; 126 149 127 150 $group_role = XOOPS_DB_PREFIX . '_' . $xp_prefix .'_group_role' ; … … 136 159 )$charset_collate;"; 137 160 dbDelta($views_queries); 161 $ret[] = "$group_role table of XPressME was made."; 162 138 163 $sql = "INSERT INTO $group_role (groupid, role) VALUES (1, 'administrator')"; 139 164 $wpdb->query($sql); -
trunk/include/onupdate.php
r89 r96 46 46 } 47 47 } 48 48 49 /* activate the tag plugin */ 49 50 $plugin_current = "xpressme/xpressme.php"; -
trunk/include/request_url.php
r95 r96 13 13 */ 14 14 function check_page_call($check_file =''){ 15 global $xoops_config; 15 global $xoops_config; // not object at install 16 16 if (empty($check_file)) return false; 17 $xpress_page = $xoops_config->module_name. '/' . $check_file;17 $xpress_page = basename(dirname(dirname(__FILE__))) . '/' . $check_file; 18 18 $php_script_name = $_SERVER['SCRIPT_NAME']; 19 19 $php_query_string = $_SERVER['QUERY_STRING']; … … 49 49 return $ret; 50 50 } 51 52 function is_xpress_install_call(){ 53 $action = 'action=ModuleInstall&dirname='; 54 $php_script_name = $_SERVER['SCRIPT_NAME']; 55 $php_query_string = $_SERVER['QUERY_STRING']; 56 if (strstr($php_query_string,$action) !== false) return true; 57 return false; 58 } 51 59 ?> -
trunk/include/xpress_block_render.php
r95 r96 99 99 } 100 100 101 function xpress_block_cache_found($mydirname,$block_name) 102 { 103 global $xoops_config; 104 if(defined('XOOPS_ROOT_PATH')){ 105 $cache_dir = XOOPS_ROOT_PATH . '/cache/'; 106 } else { 107 $cache_dir = $xoops_config->xoops_root_path . '/cache/'; 108 } 109 $xml_name = $block_name . '.xml'; 110 111 $filename = $cache_dir .$mydirname . '_' . $xml_name; 112 $cache_time = 0; 113 // if (file_exists($filename) && ((time() - filemtime($filename)) < $cache_time)) { 114 if (file_exists($filename)) { 115 return true; 116 } else { 117 return false; 118 } 119 } 120 101 121 function xpress_block_render($mydirname,$block_function_name,$options) 102 122 { … … 108 128 $blockID =get_block_id($mydirname,$func_file,$options); 109 129 110 if (!is_null($wpdb)){ 130 $this_url = '/modules/'. $mydirname; 131 $call_url = $_SERVER['REQUEST_URI']; 132 if (strstr($call_url,$this_url)){ 111 133 xpress_block_css_set($mydirname); 112 134 … … 114 136 require_once $block_theme_file; 115 137 $block = $call_theme_function_name($options); //The block name and the called function name should be assumed to be the same name. 116 117 // Not Cache Write Now. Becose Cache Write On WordPress Event118 // xpress_block_cache_write($mydirname,$cache_title. $blockID, $block);119 138 } else { 120 $xml = xpress_block_cache_read($mydirname,$cache_title. $blockID); 121 $block = $xml['block']; 139 if (xpress_block_cache_found($mydirname,$cache_title. $blockID)){ 140 $xml = xpress_block_cache_read($mydirname,$cache_title. $blockID); 141 $block = $xml['block']; 142 } else { 143 $block['err_message'] = sprintf(_MB_XPRESS_BLOCK_CACHE_ERR, '<a href="' . XOOPS_URL . '/modules/' . $mydirname . '">' . $mydirname .'</a>'); 144 } 122 145 } 123 146 -
trunk/include/xpress_cache.php
r95 r96 1 1 <?php 2 2 3 if(!function_exists("xpress_cache_found")): 4 function xpress_cache_found($filename) 5 { 6 $cache_time = 0; 7 // if (file_exists($filename) && ((time() - filemtime($filename)) < $cache_time)) { 8 if (file_exists($filename)) { 9 return true; 10 } else { 11 return false; 12 } 13 } 14 endif; 15 3 16 if(!function_exists("xpress_cache_read")): 4 17 function xpress_cache_read($mydirname,$collation_key) 5 18 { 6 19 global $xoops_config; 7 $cache_dir = $xoops_config->xoops_root_path . '/cache/'; 8 $cache_time = 0; 20 if(defined('XOOPS_ROOT_PATH')){ 21 $cache_dir = XOOPS_ROOT_PATH . '/cache/'; 22 } else { 23 $cache_dir = $xoops_config->xoops_root_path . '/cache/'; 24 } 9 25 $filename = $cache_dir .$mydirname . '_' . $collation_key; 10 // if (file_exists($filename) && ((time() - filemtime($filename)) < $cache_time)) { 11 if (file_exists($filename)) { 26 if (xpress_cache_found($filename)) { 12 27 return file_get_contents($filename); 13 28 } else { -
trunk/include/xpress_debug_log.php
r95 r96 57 57 } 58 58 } 59 60 function xpress_error_handler($errno,$errstr,$errfile,$errline,$errcontext) { 61 $module_dirpath = dirname(dirname(__FILE__)); 62 $root_path = dirname(dirname(dirname(dirname(__FILE__)))); 63 64 $show_backtrace = true; 65 66 // Time stamp of error entry 67 $dt = date("Y-m-d H:i:s (T)"); 68 69 // define an assoc array of error string 70 // in reality the only entries we should 71 // consider are E_WARNING, E_NOTICE, E_USER_ERROR, 72 // E_USER_WARNING and E_USER_NOTICE 73 $errortype = array ( 74 E_ERROR => "Error", 75 E_WARNING => "Warning", 76 E_PARSE => "Parsing Error", 77 E_NOTICE => "Notice", 78 E_CORE_ERROR => "Core Error", 79 E_CORE_WARNING => "Core Warning", 80 E_COMPILE_ERROR => "Compile Error", 81 E_COMPILE_WARNING => "Compile Warning", 82 E_USER_ERROR => "User Error", 83 E_USER_WARNING => "User Warning", 84 E_USER_NOTICE => "User Notice", 85 E_STRICT => "Runtime Notice" 86 ); 87 if (strstr($errstr, 'Use of undefined constant xpress_debug_message - assumed') !== false) return; 88 // set of errors for which a var trace will be saved 89 $user_errors = array(E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE); 90 91 $err = "<errorentry>\n"; 92 $err .= "\t<datetime>" . $dt . "</datetime>\n"; 93 $err .= "\t<errornum>" . $errno . "</errornum>\n"; 94 $err .= "\t<errortype>" . $errortype[$errno] . "</errortype>\n"; 95 $err .= "\t<errormsg>" . $errstr . "</errormsg>\n"; 96 $err .= "\t<scriptname>" . $errfile . "</scriptname>\n"; 97 $err .= "\t<scriptlinenum>" . $errline . "</scriptlinenum>\n"; 98 $err .= "\t<errcontext>" . $errcontext . "</errcontext>\n"; 99 100 if (in_array($errno, $user_errors)) { 101 $err .= "\t<vartrace>" . wddx_serialize_value($vars, "Variables") . "</vartrace>\n"; 102 } 103 $err .= "</errorentry>\n\n"; 104 105 $err_trace = ''; 106 if ($show_backtrace){ 107 $backtraces = array_reverse(debug_backtrace()); 108 $err_trace .= "BACK TRACE\n"; 109 foreach($backtraces as $backtrace){ 110 $trace = @$backtrace['file']. "\tLINE(" . @$backtrace['line'] . ")\t" . @$backtrace['function'] . "()\n"; 111 $trace = str_replace($root_path,"",$trace); 112 $trace = str_replace("\\","/",$trace); 113 $trace = str_replace($root_path,"",$trace); 114 $trace = "\t" . $trace; 115 $err_trace .= $trace; 116 } 117 } 118 $head = "\n***** XPressME ERROR LOG ****************************************************************************************************\n"; 119 $message = $head . $err . $err_trace; 120 $_debug_file = $module_dirpath . '/wp-content/xpress_error.log'; 121 if ($errno != E_STRICT) { 122 $_fp = fopen($_debug_file, 'a'); 123 fwrite($_fp, $message); 124 fclose($_fp); 125 } 126 } 59 127 ?> -
trunk/include/xpress_render.php
r61 r96 10 10 $pattern = "<style[^>]*?>(.*)<\/style>"; 11 11 preg_match("/".$pattern."/s", $head_str, $style_matches); 12 $style = $style_matches[0]; 12 if (empty($style_matches[0])) 13 $style = ''; 14 else 15 $style = $style_matches[0]; 13 16 14 17 $pattern = "<link(.*)>"; … … 95 98 //rendering for the module header and the body 96 99 function xpress_render($contents){ 97 global $xoops Tpl;98 include XOOPS_ROOT_PATH."/header.php";99 $page_title = $GLOBALS["xoopsModule"]->getVar("name")." ".wp_title('»', false); 100 global $xoops_config , $xoopsTpl; 101 include $xoops_config->xoops_root_path ."/header.php"; 102 $page_title = $GLOBALS["xoopsModule"]->getVar("name")." ".wp_title('»', false); 100 103 $xoopsTpl->assign('xoops_module_header', get_xpress_module_header($contents)); 101 104 $xoopsTpl->assign('xoops_pagetitle', $page_title); 102 105 $xoopsTpl->assign('xpress_body_contents', get_body($contents)); 103 106 echo get_body($contents); 107 require_once( ABSPATH .'/include/xpress_breadcrumbs.php' ); 108 include $xoops_config->xoops_root_path . '/footer.php'; 104 109 } 105 110 -
trunk/language/ja_utf8/blocks.php
r54 r96 16 16 define("_MB_XPRESS_CATS_SELECT","カテゴリー選択"); 17 17 define("_MB_XPRESS_TAGS_SELECT","タグ選択(複数ある場合はカンマ区切りで入力"); 18 19 define("_MB_XPRESS_BLOCK_CACHE_ERR","キャッシュが存在しません。<br />最初に%sモジュールにアクセスしてください。"); 18 20 19 21 } -
trunk/templates/source/recent_comments_block.html
r89 r96 23 23 24 24 <div id="xpress_recent_comments"> 25 <{$block.err_message}> 25 26 <{$block.data_count}> 26 27 <{foreach from=$block.contents item=content}> -
trunk/templates/source/recent_posts_content_block.html
r89 r96 21 21 22 22 <ul class="xpress_recent_comments"> 23 <{$block.err_message}> 23 24 <{$block.data_count}> 24 25 <{foreach from=$block.contents item=content}> -
trunk/wp-config.php
r95 r96 5 5 require_once dirname( __FILE__ ).'/include/set_cash_cookie_path.php' ; 6 6 7 /** 8 * mb_language() sets language. If language is omitted, it returns current language as string. 9 * language setting is used for encoding e-mail messages. 10 * Valid languages are "Japanese", "ja","English","en" and "uni" (UTF-8). 11 * mb_send_mail() uses this setting to encode e-mail. 12 * Language and its setting is ISO-2022-JP/Base64 for Japanese, UTF-8/Base64 for uni, ISO-8859-1/quoted printable for English. 13 */ 14 if (function_exists("mb_language")) mb_language('uni'); 7 15 8 if (function_exists("mb_language")) mb_language('Japanese');9 // The setting of mb_internal_encoding might be unnecessary.10 // Because mb_internal_encoding setting wp-setting.php line 48411 if (function_exists("mb_internal_encoding")) mb_internal_encoding('UTF-8');12 16 13 // ** MySQL settings ** // 14 define('DB_NAME', $xoops_config->xoops_db_name); // The name of the database 15 define('DB_USER', $xoops_config->xoops_db_user); // Your MySQL username 16 define('DB_PASSWORD', $xoops_config->xoops_db_pass); // ...and password 17 define('DB_HOST', $xoops_config->xoops_db_host); // 99% chance you won't need to change this value 17 // ** MySQL settings - You can get this info from your web host ** // 18 // Do not change 'DB_NAME','DB_USER','DB_PASSWORD' & 'DB_HOST' 19 // because copies a set value of XOOPS. 20 21 /** Do not change. The name of the database for WordPress */ 22 define('DB_NAME', $xoops_config->xoops_db_name); 23 24 /** Do not change. MySQL database username */ 25 define('DB_USER', $xoops_config->xoops_db_user); 26 27 /** Do not change. MySQL database password */ 28 define('DB_PASSWORD', $xoops_config->xoops_db_pass); 29 30 /** Do not change. MySQL hostname */ 31 define('DB_HOST', $xoops_config->xoops_db_host); 32 33 /** Database Charset to use in creating database tables. */ 18 34 define('DB_CHARSET', 'utf8'); 35 36 /** The Database Collate type. Don't change this if in doubt. */ 19 37 define('DB_COLLATE', ''); 20 38 21 39 //define('WP_DEBUG' ,true); 22 40 23 // Change each KEY to a different unique phrase. You won't have to remember the phrases later, 24 // so make them long and complicated. You can visit http://api.wordpress.org/secret-key/1.1/ 25 // to get keys generated for you, or just make something up. Each key should have a different phrase. 26 define('AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. 27 define('SECURE_AUTH_KEY', 'put your unique phrase here'); // Change this to a unique phrase. 28 define('LOGGED_IN_KEY', 'put your unique phrase here'); // Change this to a unique phrase. 41 /**#@+ 42 * Authentication Unique Keys. 43 * 44 * Change these to different unique phrases! 45 * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/ WordPress.org secret-key service} 46 * 47 * @since 2.6.0 48 */ 49 define('AUTH_KEY', 'put your unique phrase here'); 50 define('SECURE_AUTH_KEY', 'put your unique phrase here'); 51 define('LOGGED_IN_KEY', 'put your unique phrase here'); 52 define('NONCE_KEY', 'put your unique phrase here'); 29 53 30 // You can have multiple installations in one database if you give each a unique prefix 31 $table_prefix = $xoops_config->module_db_prefix; // Only numbers, letters, and underscores please! 54 /** 55 * WordPress Database Table prefix. 56 * 57 * You can have multiple installations in one database if you give each a unique 58 * prefix. Only numbers, letters, and underscores please! 59 */ 60 // Do not change. $table_prefix is generated from XOOPS DB Priefix and the module directory name. 61 $table_prefix = $xoops_config->module_db_prefix; 32 62 33 // Change this to localize WordPress. A corresponding MO file for the 34 // chosen language must be installed to wp-content/languages. 35 // For example, install de.mo to wp-content/languages and set WPLANG to 'de' 36 // to enable German language support. 37 define ('WPLANG', 'ja'); 63 /** 64 * WordPress Localized Language, defaults to Japanese. 65 * 66 * Change this to localize WordPress. A corresponding MO file for the chosen 67 * language must be installed to wp-content/languages. For example, install 68 * de.mo to wp-content/languages and set WPLANG to 'de' to enable German 69 * language support. 70 * 71 * Example: 72 * define ('WPLANG', ''); // language support to English 73 */ 74 define ('WPLANG', 'ja'); // language support to Japanese 38 75 39 76 /* That's all, stop editing! Happy blogging. */ 40 77 78 /** WordPress absolute path to the Wordpress directory. */ 41 79 if ( !defined('ABSPATH') ) 42 80 define('ABSPATH', dirname(__FILE__).'/'); 43 81 44 require_once dirname( __FILE__ ).'/include/request_url.php' ; 45 if (!is_xpress_index_page_call()){ 46 // if ( is_wp_cron_page_call()){ 47 // if ( !defined("XOOPS_ROOT_PATH") ) { 48 // require_once $xoops_config->xoops_mainfile_path; 49 // } 50 // } 82 require_once( ABSPATH .'/include/request_url.php'); 83 if (is_xpress_index_page_call()){ 84 require_once $xoops_config->xoops_mainfile_path; //It is necessary to execute it for the user attestation before wp-settings.php. 51 85 require_once(ABSPATH.'wp-settings.php'); 52 } else {53 // If $xoops_config->xoops_mainfile_path is not executed before wp-settings.php is executed, log in cannot be done.54 require_once $xoops_config->xoops_mainfile_path;55 require_once(ABSPATH.'wp-settings.php');56 // The return to wp-blog-header.php is stolen here57 86 wp(); 58 87 ob_start(); … … 62 91 require_once( ABSPATH .'/include/xpress_render.php' ); 63 92 xpress_render($wp_output); 64 require_once( ABSPATH .'/include/xpress_breadcrumbs.php' ); 65 include $xoops_config->xoops_root_path . '/footer.php'; 66 exit(); 93 94 //When there is no block cache, and an optional block is different, cache is refreshed. 95 //When adding, and changing and deleting Post & Comment, block cache is refreshed by add_action at any time. 96 // This Function in xpressme plugin 97 if (!is_block_cache_normal()) block_cache_refresh(); 98 exit(); // The return to wp-blog-header.php is stolen here 67 99 } 100 require_once(ABSPATH.'wp-settings.php'); 68 101 ?> -
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"); -
trunk/wp-content/themes/xpress_default/index.php
r64 r96 33 33 </div> 34 34 35 <p class="postmetadata"><!-- Post author start --><?php/* _e('Posted:', 'xpress'); echo ' '; the_author_posts_link(); echo '<br />' ; */?><!-- Post author end --><?php if(function_exists('the_tags')) : ?><?php the_tags(__('Tags:', 'xpress') . ' ', ', ', '<br />'); ?><?php endif; ?><?php printf(__('Posted in %s', 'xpress'), get_the_category_list(', ')); ?> | <?php edit_post_link(__('Edit', 'xpress'), '', ' | '); ?> <?php comments_popup_link(__('No Comments »', 'xpress'), __('1 Comment »', 'xpress'), __('% Comments »', 'xpress'), '', __('Comments Closed', 'xpress') ); ?></p> 36 <?php xpress_post_views_count($post->id,__('Views :%d', 'xpress'),true) ?> 35 <p class="postmetadata"><!-- Post author start --> 36 <!-- Post author end --> 37 <?php 38 if(function_exists('the_tags')) 39 echo the_tags(__('Tags:', 'xpress') . ' ', ', ', '<br />'); 40 printf(__('Posted in %s', 'xpress'), get_the_category_list(', ')); 41 echo ' | '; 42 edit_post_link(__('Edit', 'xpress'), '', ' | '); 43 comments_popup_link(__('No Comments »', 'xpress'), __('1 Comment »', 'xpress'), __('% Comments »', 'xpress'), '', __('Comments Closed', 'xpress') ); 44 ?> 45 </p> 46 <?php xpress_post_views_count($post->ID,__('Views :%d', 'xpress'),true) ?> 37 47 38 48 </div> -
trunk/wp-content/themes/xpress_default/searchform.php
r64 r96 1 1 <form method="get" id="searchform" action="<?php bloginfo('url'); ?>/"> 2 2 <label class="hidden" for="s"><?php _e('Search for:', 'xpress'); ?></label> 3 <div><input type="text" value="<?php if(function_exists('the_serch_query')) : ?><?php the_search_query(); ?><?php else : ?><?php echo attribute_escape($s); ?><?php endif; ?>" name="s" id="s" />3 <div><input type="text" value="<?php the_search_query(); ?>" name="s" id="s" /> 4 4 <input type="submit" id="searchsubmit" value="<?php _e('Search', 'xpress'); ?>" /> 5 5 </div> -
trunk/xoops_version.php
r95 r96 31 31 $modversion['name'] = ucfirst($mydirname) . ' ' . constant('_MI_XPRESS_NAME') ; 32 32 $modversion['description'] = constant( '_MI_XPRESS_DESC'); 33 $modversion['version'] = "0.0 4";33 $modversion['version'] = "0.05"; 34 34 $modversion['credits'] = "Wordpress DEV (http://wordpress.org/) XPressME DEV Toemon) (http://www.toemon.com) ;"; 35 35 $modversion['author'] = "toemon (http://www.toemon.com)"; … … 40 40 41 41 // status 42 $modversion['codename'] = " r48";42 $modversion['codename'] = "fix notify"; 43 43 44 44 // onInstall, onUpdate, onUninstall
Note: See TracChangeset
for help on using the changeset viewer.