function render_image_thumbnail($orig, $width, $height = 0) { $file = inner_create_image_thumbnail($orig, $width, $height); if ($file) { if (get_ci_config('enable_cache') && cache_support($file)) { return; } $out = fopen('php://output', 'wb'); $in = fopen($file, 'r'); stream_copy_to_stream($in, $out); fclose($in); return; } trigger_error('No image generated!!!!'); }
/** * Overload the CI's default method to support ajax, form and the interceptors */ function _remap($method, $args) { $this->processAutoload(); set_breadscrum(); // Setting the breadscrums $method = $this->_get_method($method, $args); // Checking for the interceptors $interceptors = $this->interceptor_support->getInterceptors($method); $this->interceptors = $interceptors; // Save the interceptors for render to use // For before interceptor $failed = false; foreach ($interceptors['before'] as $before) { if (!$before->intercept($method, $args)) { // If any before inteceptor thinks this execution should be fail, then fail it $failed = true; if (isset($before->error_message)) { $this->error('Failed to pass the %s when calling method %s of %s of error message %s with args', $args, $before->toString(), $method, get_class($this), $before->error_message); trigger_error($before->error_message); } else { $this->error('Failed to pass the %s when calling method %s of %s of with args', $args, $before->toString(), $method, get_class($this)); } break; } } if ($failed) { return false; } // For around interceptor if (count($interceptors['around']) > 0) { $around = $interceptors['around'][0]; if (count($interceptors['around']) > 1) { $this->warn('The around interceptor for method %s is bigger than 1', $args, $method); } return $around->intercept($method, $args); } // Using git to test if the file has been changed, test this after the interceptors // In order pass the security check. if (file_exists(FCPATH . APPPATH . '.git/HEAD')) { $ref = file_get_contents(FCPATH . APPPATH . '.git/HEAD'); $ref = explode(' ', $ref); $ref = trim($ref[1]); $ref = FCPATH . APPPATH . '.git/' . $ref; } if (get_ci_config('enable_cache') && !isset($this->disable_cache) && isset($ref) && cache_support($ref)) { return; } // Run the original method $ret = $this->_process($method, $args); // Run the after method foreach ($interceptors['after'] as $after) { $after->intercept($method, $args); } return $ret; }
<p>PayPal Account ( Global ): <a href="https://www.paypal.com/" target="_blank"> message@ziming.org</a> | AliPay Account ( China ): <a href="https://www.alipay.com//" target="_blank"> message@ziming.org</a></p> '); } function update_excerpt_views() { global $post; process_post_views_excerpt(); $output = $post->post_excerpt; if (post_password_required($post)) { $output = 'There is no excerpt because this is a protected post'; } return $output; } register_activation_hook(__FILE__, 'check_post_views_install'); cache_support(); function post_views_textdomain() { load_plugin_textdomain('post-views', false, 'post-views/lang'); } function post_views_menu() { if (function_exists('add_dashboard_page')) { add_dashboard_page('Post-Views', __('Post Views', 'post-views'), 2, 'post-views', 'post_views'); } if (function_exists('add_options_page')) { add_options_page('Post Views', 'Post Views', 8, 'post-views', 'post_views'); } //add_options_page(page_title, menu_title, access_level/capability, file, [function]); } /******************************* Cache Related Functions *********************************/