function print_controller_html in Printer, email and PDF versions 5.4
Same name and namespace in other branches
- 5.3 print.pages.inc \print_controller_html()
- 6 print.pages.inc \print_controller_html()
- 7.2 print.pages.inc \print_controller_html()
- 7 print.pages.inc \print_controller_html()
- 5.x print.pages.inc \print_controller_html()
Generate an HTML version of the printer-friendly page
See also
1 string reference to 'print_controller_html'
- print_menu in ./
print.module - Implementation of hook_menu().
File
- ./
print.pages.inc, line 22
Code
function print_controller_html() {
$args = func_get_args();
$path = implode('/', $args);
$cid = isset($_GET['comment']) ? (int) $_GET['comment'] : NULL;
$print = print_controller($path, $cid, PRINT_HTML_FORMAT);
if ($print !== FALSE) {
$node = $print['node'];
ob_start();
include_once _print_get_template(PRINT_HTML_FORMAT, $print['type']);
$html = ob_get_contents();
ob_end_clean();
$html = drupal_final_markup($html);
print $html;
$nodepath = isset($node->path) ? drupal_get_normal_path($node->path) : $path;
db_query("UPDATE {print_page_counter} SET totalcount = totalcount + 1, timestamp = %d WHERE path = '%s'", time(), $nodepath);
// If we affected 0 rows, this is the first time viewing the node.
if (!db_affected_rows()) {
// We must create a new row to store counters for the new node.
db_query("INSERT INTO {print_page_counter} (path, totalcount, timestamp) VALUES ('%s', 1, %d)", $nodepath, time());
}
}
}