Fatal Error! To debug,please put OR change define('WP_DEBUG', TRUE); in your wp-config.php and then visit this page again to see what happened.Error Message generated by Down As PDF plugin"); } if (WP_DEBUG) { ini_set('display_errors', 1); } else { ini_set('display_errors', 0); add_action('shutdown', 'hacklog_dap_process_error_backtrace', -999); } if (headers_sent($file, $line)) { if (WP_DEBUG) { wp_die('Error: header already sent in file ' . $file . ' line ' . $line . '.Please check your server configure or contact the administrator.'); } else { wp_die(__('Error: header already sent! Please contact the site administrator to solve this problem.', self::textdomain)); } } /** * antileech check * for that https does not send referer info */ if (!is_ssl() && (!isset($_SERVER ['HTTP_REFERER']) || $_SERVER ['HTTP_REFERER'] == '')) { wp_die(__('Please do not leech.', hacklog_dap::plugin_domain)); } $refererhost = @parse_url($_SERVER ['HTTP_REFERER']); //如果本站下载也被误认为盗链,请修改下面www.your-domain.com为你的博客域名 $validReferer = array('www.your-domain.com', $_SERVER ['HTTP_HOST']); if (!(in_array($refererhost ['host'], $validReferer))) { wp_die(__('Please do not leech.', hacklog_dap::plugin_domain)); } /** * make sure the input data is secure. */ $post_id = 0; $post_id = (int) $_GET['id']; if( !hacklog_dap::get_allow_down_default() && 1!= get_post_meta($post_id, hacklog_dap::meta_key ,TRUE)) { wp_die(__('OOPS! this post is not allowed to be downloaded currently.', hacklog_dap::plugin_domain)); } //if( !is_user_logged_in() && $post_id != 4579 ) //{ // wp_die(__('
:(,Sorry.Currently only logged in user can download.
" . htmlspecialchars($matches[4]) . "
" . htmlspecialchars($matches[3]) . "
" . htmlspecialchars($matches[5]) . "
(.*?)\
(.*)<\/pre>(\s*)/siU", 'dap_codeblock_callback::wp_syntax_plugin_callback', $content ); } //blockquote #F0F0F0 #F5F5F5; border: 1px solid #DADADA; color:#555555; if (strpos($content, '') !== FALSE) { $content = preg_replace_callback( "/(\s*)(.*)<\/blockquote>(\s*)/siU", create_function('$matches', 'return $matches[1] ."". $matches[2] ."" . $matches[3];'), $content ); } //format table if (strpos($content, '') !== FALSE) { $content = preg_replace_callback( "/(\s*)]*)>/i", create_function('$matches', 'return $matches[1] ."";'), $content ); $content = str_replace(array('', ''), '', $content); } $postOutput = $content; //$postOutput = apply_filters('the_content',$content); // --------------------------------------------------------- $html_title = '' . $post->post_title . ''; //$pdf->writeHTMLCell(0, 0, '', '', $html_title, 0, 0, 0, true, 'C', true); $html_author = ''; //$pdf->writeHTMLCell(0, 0, '', '', $html_author, 0, 0, 0, false, 'R', true); $postOutput = str_replace(array('', '', ''), array('', '', ''), $postOutput); $html_to_write = wpautop($html_title . $html_author . '' . $postOutput . '', true); //$strHtml = $html_title . $html_author . '' . $postOutput . ''; //------------------------------------------------------------- //return the codeblock $code_blocks_found = dap_codeblock_callback::get_code_block(); //var_dump($code_blocks_found);exit; $code_blocks_num = count($code_blocks_found); if ($code_blocks_num > 0) { foreach ($code_blocks_found as $key => $value) { $html_to_write = str_replace($key, $value, $html_to_write); } } //OK ,done let's generate the PDF // Print text using writeHTMLCell() $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html_to_write, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true); //Creative Commons Attribution-NonCommercial-ShareAlike 2.5 Generic License $copy_right = $use_cc ? sprintf(__('Product link:%4$s', hacklog_dap::plugin_domain), home_url('/'), get_bloginfo('name'), $strPermalink, $strPermalink) : ''; if ('' != $copy_right) { //cc // set color for background $pdf->SetFillColor(255, 255, 127); $pdf->setCellPaddings(5, 5, 0, 0); //L T R B $pdf->writeHTMLCell(180, 0 , '', '', $copy_right . "\n", 1, 1 , TRUE , TRUE , 'L', TRUE); } // --------------------------------------------------------- //var_dump(timer_stop(0, 3));exit; // Close and output PDF document // This method has several options, check the source code documentation for more information. $pdf->Output($post->post_name . '.pdf', $download_type); // End of file
(.*)<\/blockquote>(\s*)/siU", create_function('$matches', 'return $matches[1] ."". $matches[2] ."" . $matches[3];'), $content ); } //format table if (strpos($content, '') !== FALSE) { $content = preg_replace_callback( "/(\s*)]*)>/i", create_function('$matches', 'return $matches[1] ."";'), $content ); $content = str_replace(array('', ''), '', $content); } $postOutput = $content; //$postOutput = apply_filters('the_content',$content); // --------------------------------------------------------- $html_title = '' . $post->post_title . ''; //$pdf->writeHTMLCell(0, 0, '', '', $html_title, 0, 0, 0, true, 'C', true); $html_author = ''; //$pdf->writeHTMLCell(0, 0, '', '', $html_author, 0, 0, 0, false, 'R', true); $postOutput = str_replace(array('', '', ''), array('', '', ''), $postOutput); $html_to_write = wpautop($html_title . $html_author . '' . $postOutput . '', true); //$strHtml = $html_title . $html_author . '' . $postOutput . ''; //------------------------------------------------------------- //return the codeblock $code_blocks_found = dap_codeblock_callback::get_code_block(); //var_dump($code_blocks_found);exit; $code_blocks_num = count($code_blocks_found); if ($code_blocks_num > 0) { foreach ($code_blocks_found as $key => $value) { $html_to_write = str_replace($key, $value, $html_to_write); } } //OK ,done let's generate the PDF // Print text using writeHTMLCell() $pdf->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html_to_write, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true); //Creative Commons Attribution-NonCommercial-ShareAlike 2.5 Generic License $copy_right = $use_cc ? sprintf(__('Product link:%4$s', hacklog_dap::plugin_domain), home_url('/'), get_bloginfo('name'), $strPermalink, $strPermalink) : ''; if ('' != $copy_right) { //cc // set color for background $pdf->SetFillColor(255, 255, 127); $pdf->setCellPaddings(5, 5, 0, 0); //L T R B $pdf->writeHTMLCell(180, 0 , '', '', $copy_right . "\n", 1, 1 , TRUE , TRUE , 'L', TRUE); } // --------------------------------------------------------- //var_dump(timer_stop(0, 3));exit; // Close and output PDF document // This method has several options, check the source code documentation for more information. $pdf->Output($post->post_name . '.pdf', $download_type); // End of file