<?php do_makeTabbloid('linkName','fileName', showThumbnail, 'bannerText'); ?> in your template (for an explanation of these see the readme file). Author: Martin Hawksey Author URI: http://www.rsc-ne-scotland.org.uk/mashe Version: 1.0 */ /* Copyright 2009 Martin Hawksey (email : martin.hawksey@gmail.com) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ define(MAKE_TABBLOID_WIDGET_ID, "widget_make_tabbloid"); if (!class_exists("MakeTabbloid")) { class MakeTabbloid { var $adminOptionsName = "MakeTabbloidAdminOptionsName"; function MakeTabbloid() { } function init() { $this->getAdminOptions(); } function getAdminOptions() { $MakeTabbloidAdminOptions = array('mt_apikey' => '', 'mt_validkey' => 'false', 'mt_feeds' => array(), 'mt_qrcodeshow' => 'false' ); $devOptions = get_option($this->adminOptionsName); if (!empty($devOptions)) { foreach ($devOptions as $key => $option) $MakeTabbloidAdminOptions[$key] = $option; } update_option($this->adminOptionsName, $MakeTabbloidAdminOptions); return $MakeTabbloidAdminOptions; } function printAdminPage() { $devOptions = $this->getAdminOptions(); if (isset($_POST['update_makeTabbloidPluginSeriesSettings'])) { if (isset($_POST['makeTabbloidAPIKey'])) { $devOptions['mt_validkey'] = mt_checkAPI($_POST['makeTabbloidAPIKey']); if ($devOptions['mt_validkey'] =='true'){ update_option('tabbloid_api_key', $_POST['makeTabbloidAPIKey']); } } update_option($this->adminOptionsName, $devOptions); ?>

adminOptionsName, $devOptions); ?>

Make Tabbloid

Tabbloid API Key

To use Make Tabbloid you need to register with http://www.tabbloid.com/developer and 'agree to do no evil' then click on 'Make me cool' to get an API key to enter below:

Valid Key"; } else {echo "Invalid API Key"; } ?>

Add Blog Feed

Make Tabbloid comes with a custom 'Make Tabbloid RSS' specifically designed for the Tabbloid service. This feed automatically footnotes all the links within your posts and uses TinyURL to shorten any long links. The 'Make Tabbloid RSS' also has the option to embed a QR code at the end of each post within the PDF.

Select your preferred option:

Or you can add your own custom feed:

Current Feeds

These are the current feeds registered with the Tabbloid service.

1){ for ($i=0; $i\n"; $i++; } } else { echo ""; } ?>
Feed  
".$devOptions['mt_feeds'][$i+1]."Remove
None

Additional Information

You can add a link to your "Tabbloid" edition via the widgets or by adding <?php do_makeTabbloid('linkName','fileName', showThumbnail, 'bannerText'); ?> in your template.

1024){ $fileBuilt = TRUE; } } else { $lastBuild = -1; } if ($lastBuild < 0 || $fileSize < 1024){ // start check to see if posts have been made since last file was made $api_key = get_option('tabbloid_api_key'); $pdfData = tabbliodHTTPPost($api_key, 'make_pdf',$mt_banner); $fh = fopen($myFile, 'wb') or die("can't open file"); $fileSize = fwrite($fh, tabbliodHTTPPost($api_key, 'make_pdf',$mt_banner)); fclose($fh); if ($fileSize > 1024){ $fileBuilt = TRUE; } } $pdfURL = str_replace(" ","%20",get_bloginfo('url')."/".$mt_filename.".pdf"); // Prepare POST request if ($mt_preview == "TRUE"){ $build_array = array( 'url' => $pdfURL); $request_data = http_build_query($build_array); // Send the POST request (with cURL) $c = curl_init('http://view.samurajdata.se/ps.php'); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, $request_data); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($c); $status = curl_getinfo($c, CURLINFO_HTTP_CODE); curl_close($c); if ($status == '200'){ $strStart = stripos($result,"id=")+3; $strEnd = stripos($result,"&page"); $previewID = substr($result,$strStart,$strEnd-$strStart); } if (strlen($previewID) < 64){ $previewHTML = "

Preview powered by:
http://view.samurajdata.se
"; } } if ($fileBuilt){?> $api_key, 'method' => $method ); if ($method == 'add_feed'){ $build_array['feed_url'] = $param; } elseif ($method == 'remove_feed'){ $build_array['feed_id'] = $param; } elseif ($method == 'make_pdf' && $param!=""){ $build_array['banner'] = $param; } $request_data = http_build_query($build_array); // Send the POST request (with cURL) $c = curl_init('http://tabbloid.com/api'); curl_setopt($c, CURLOPT_POST, true); curl_setopt($c, CURLOPT_POSTFIELDS, $request_data); curl_setopt($c, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($c); $status = curl_getinfo($c, CURLINFO_HTTP_CODE); curl_close($c); return $result; } function widget_make_tabbloid($args) { extract($args, EXTR_SKIP); $options = get_option(MAKE_TABBLOID_WIDGET_ID); echo $before_widget; echo $before_title . $options['mt_title'] . $after_title; echo $options['mt_text']; do_makeTabbloid($options['mt_link_name'],$options['mt_file_name'],$options['mt_show_preview'],$options['mt_banner_name']); echo $after_widget; } function widget_make_tabbloid_init() { wp_register_sidebar_widget(MAKE_TABBLOID_WIDGET_ID, __('Make Tabbloid'), 'widget_make_tabbloid'); wp_register_widget_control(MAKE_TABBLOID_WIDGET_ID, __('Make Tabbloid'), 'widget_make_tabbloid_control'); } function widget_make_tabbloid_control() { $options = get_option(MAKE_TABBLOID_WIDGET_ID); if (!is_array($options)) { $options = array(); } $widget_data = $_POST[MAKE_TABBLOID_WIDGET_ID]; if ($widget_data['submit']) { $options['mt_title'] = stripslashes($widget_data['mt_title']); $options['mt_text'] = stripslashes($widget_data['mt_text']); $options['mt_link_name'] = stripslashes($widget_data['mt_link_name']); $options['mt_file_name'] = stripslashes($widget_data['mt_file_name']); $options['mt_banner_name'] = stripslashes($widget_data['mt_banner_name']); $options['mt_show_preview'] = $widget_data['mt_show_preview']; update_option(MAKE_TABBLOID_WIDGET_ID, $options); } // Render form $mt_title = $options['mt_title']; $mt_text = $options['mt_text']; $mt_link_name = $options['mt_link_name']; $mt_file_name = $options['mt_file_name']; $mt_banner_name = $options['mt_banner_name']; $mt_show_preview = $options['mt_show_preview']; ?>