Commit 68669810 authored by jcnventura's avatar jcnventura

Coder fixes

parent d18f4933
......@@ -313,7 +313,7 @@ function print_block_view($delta = '') {
break;
case 'print-top':
$block['subject'] = t('Most printed');
$result = db_query_range("SELECT path FROM {print_page_counter} LEFT JOIN {node} ON path = CONCAT('node/', node.nid) WHERE status != 0 OR status IS NULL ORDER BY totalcount DESC", 0, 3)
$result = db_query_range("SELECT path FROM {print_page_counter} LEFT JOIN {node} ON path = CONCAT('node/', node.nid) WHERE status <> 0 OR status IS NULL ORDER BY totalcount DESC", 0, 3)
->fetchAll();
if (count($result)) {
$block['content'] = '<div class="item-list"><ul>';
......
......@@ -555,7 +555,7 @@ function _print_generate_node($nid, $cid = NULL, $format = PRINT_HTML_FORMAT, $t
$content = render($build);
//Get rid of the annoying D7 title link
$pattern = '!(<h2 property="dc:title" datatype="">)\s*<a [^>]*?>(.*?)</a>\s*(</h2>)!mis';
$pattern = '!(<h2 property="dc:title"[^>]*>)\s*<a [^>]*?>(.*?)</a>\s*(</h2>)!mis';
$content = preg_replace($pattern, '$1$2$3', $content);
//Check URL list settings
......
......@@ -116,7 +116,7 @@ function print_mail_block_view($delta = 0) {
switch ($delta) {
case 'print_mail-top':
$block['subject'] = t('Most emailed');
$result = db_query_range("SELECT path FROM {print_mail_page_counter} LEFT JOIN {node} ON path = CONCAT('node/', node.nid) WHERE status != 0 OR status IS NULL ORDER BY sentcount DESC", 0, 3)
$result = db_query_range("SELECT path FROM {print_mail_page_counter} LEFT JOIN {node} ON path = CONCAT('node/', node.nid) WHERE status <> 0 OR status IS NULL ORDER BY sentcount DESC", 0, 3)
->fetchAll();
if (count($result)) {
$block['content'] = '<div class="item-list"><ul>';
......
......@@ -288,9 +288,9 @@ function _print_pdf_tools() {
$tools = array_keys(file_scan_directory(drupal_get_path('module', 'print'), $pattern));
$tools = array_merge($tools, array_keys(file_scan_directory(PRINT_PDF_LIB_PATH, $pattern)));
if (module_exists('libraries')) {
$tools = array_merge($tools, array_keys(file_scan_directory(libraries_get_path('dompdf'), '!^dompdf_config.inc.php$!')));
$tools = array_merge($tools, array_keys(file_scan_directory(libraries_get_path('tcpdf'), '!^tcpdf.php$!')));
$tools = array_merge($tools, array_keys(file_scan_directory(libraries_get_path('wkhtmltopdf'), '!^wkhtmltopdf!')));
$tools = array_merge($tools, array_keys(file_scan_directory(libraries_get_path('dompdf'), '/^dompdf_config.inc.php$/')));
$tools = array_merge($tools, array_keys(file_scan_directory(libraries_get_path('tcpdf'), '/^tcpdf.php$/')));
$tools = array_merge($tools, array_keys(file_scan_directory(libraries_get_path('wkhtmltopdf'), '/^wkhtmltopdf/')));
}
......
......@@ -143,7 +143,7 @@ function print_pdf_block_view($delta = 0) {
switch ($delta) {
case 'print_pdf-top':
$block['subject'] = t('Most PDFd');
$result = db_query_range("SELECT path FROM {print_pdf_page_counter} LEFT JOIN {node} ON path = CONCAT('node/', node.nid) WHERE status != 0 OR status IS NULL ORDER BY totalcount DESC", 0, 3)
$result = db_query_range("SELECT path FROM {print_pdf_page_counter} LEFT JOIN {node} ON path = CONCAT('node/', node.nid) WHERE status <> 0 OR status IS NULL ORDER BY totalcount DESC", 0, 3)
->fetchAll();
if (count($result)) {
$block['content'] = '<div class="item-list"><ul>';
......
......@@ -148,7 +148,7 @@ function _print_pdf_file_access_images($html) {
$lang = '';
break;
}
*/
*/
// Always convert private to local paths
$pattern = "!(<img\s[^>]*?src\s*?=\s*?['\"]?)${base_url}/(?:(?:index.php)?\?q=)?(?:${lang}/)?system/files/([^>]*?>)!is";
$replacement = '$1file://' . realpath(variable_get('file_private_path', '')) . '/$2';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment