Changeset 665373
- Timestamp:
- 02/08/2013 07:55:52 PM (13 years ago)
- Location:
- wp-pocket/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (2 diffs)
-
wp-pocket.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-pocket/trunk/readme.txt
r651615 r665373 5 5 Requires at least: 3.4 6 6 Tested up to: 3.5 7 Stable tag: 1.2. 17 Stable tag: 1.2.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 12 12 13 13 == Description == 14 15 **The plugin had changed the name to WP Stacker. Downloadable at http://wordpress.org/extend/plugins/wp-stacker/** 14 16 15 17 **WP Pocket** is a Wordpress plugin, with which you can post interesting links from Pocket (Pocket.com) automatically on your blog - with autogenerated titles, discriptions and tags. You can customize the layout of the post completely. So you can save a lot of time, but show all your readers all your interesting links. -
wp-pocket/trunk/wp-pocket.php
r651615 r665373 6 6 Author: Jan Karres 7 7 Author URI: http://www.jankarres.de/ 8 Version: 1.2. 18 Version: 1.2.2 9 9 */ 10 10 if(!class_exists('wppocketer')) { … … 23 23 24 24 // Set plugin version 25 $this->version = '1.2. 1';25 $this->version = '1.2.2'; 26 26 27 27 // Check WP version … … 653 653 } 654 654 655 function changeToWpStacker() { 656 ?> 657 <div style="float: left; max-width: 500px; margin: 40px 0;"> 658 <p>Dear WP Pocket user,</p> 659 660 <p>in January 2013 I implemented the Pocket API v3 in WP Pocket, so I had to register the plugin at the Pocket developer system. Afterwards the Pocket support wrote to me, 661 the name and branding of the plugin is not compatible with the new branding guidelines.</p> 662 663 <p>Therefore I had to change the name and a few design elements. At WordPress you can not change the name of the plugin. <strong>Hence this plugin dated out with this remove version. 664 The new plugin is called WP Stacker, downloadable at <a href="http://wp-stacker.com/" target="_blank">WP-Stacker.com</a>!</strong></p> 665 666 <p>I hope for your understanding for this step!</p> 667 668 <p>Best,<br /> 669 <br /> 670 Jan<br /> 671 (Developer of WP Pocket / WP Stacker)</p> 672 </div> 673 <?php 674 } 675 655 676 // Support box on the right side of each WP Pocket page 656 677 function support_div($display = true) { … … 699 720 ?> 700 721 <div class="wrap wppocket_options"> 701 <?php702 // Start the Controller of the options page703 $this->options_page_controller();704 ?>705 706 722 <div id="icon-options-general" class="icon32"><br></div> 707 723 <h2>Einstellungen › WP Pocket</h2> 708 724 709 <?php $this->support_div(); ?> 710 711 <h3>Pocket Login</h3> 712 <table class="form-table"> 713 <tr> 714 <th>Pocket Auth</th> 715 <td> 716 <?php if (get_option('wppocket_pocket_username') != '') { echo $this->xcrypt(1, get_option('wppocket_pocket_username')) . ' authenticated.'; } ?> 717 <?php if (get_option('wppocket_pocket_username') == '') { echo '<a href="?page=settings_pocket_poster&auth-get"><input type="button" class="button-primary" value="Authenticate account" /></a>'; }else { echo '<a href="?page=settings_pocket_poster&auth-get"><input type="button" class="button-primary" value="Authenticate other account" /></a>'; } ?> 718 </td> 719 </tr> 720 721 <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> 722 723 <tr> 724 <th>Pocket Consumer-Key</th> 725 <td> 726 <input type="text" size="57" name="wppocket_pocket_consumer_key" value="<?php if(get_option('wppocket_pocket_consumer_key_custom') == 1) { echo $this->xcrypt(1, get_option('wppocket_pocket_consumer_key')); } ?>" /> 727 728 <?php if(get_option('wppocket_pocket_consumer_key_custom') == 1) { ?> 729 <label><input name="wppocket_pocket_consumer_key_custom_remove" type="checkbox" value="1" /> Use the default Consumer-Key</label> 730 <?php } ?> 731 732 <p class="description">If you wish to use a private Consumer-Key, please enter one. <strong>It is not necessary!</strong><br /> 733 You can get one on <a href="http://getpocket.com/developer/apps/new" target="_blank">http://getpocket.com/developer/apps/new</a>.</p> 734 </td> 735 </tr> 736 </table> 737 738 <h3>WP Pocket Settings</h3> 739 <table class="form-table"> 740 <tr> 741 <th>Language</th> 742 <td> 743 <select name="wppocket_language"> 744 <option value="en" <?php selected('en', get_option('wppocket_language')); ?>>English</option> 745 <option value="de" <?php selected('de', get_option('wppocket_language')); ?>>German</option> 746 <option value="fr" <?php selected('fr', get_option('wppocket_language')); ?>>French</option> 747 </select> 748 <p class="description">A few variables you can set are language-dependent. Which language should WP Pocket use? <strong>This setting does not change the language of complete WP Pocket (currently only English supported)!</strong></p> 749 </td> 750 </tr> 751 <tr> 752 <th>Statistics</th> 753 <td> 754 <select name="wppocket_statistics"> 755 <option value="1" <?php selected('1', get_option('wppocket_statistics')); ?>>Yes</option> 756 <option value="0" <?php selected('0', get_option('wppocket_statistics')); ?>>No</option> 757 </select> 758 <p class="description">Do you allow WP Pocket to collect anonymous statistics about published links and updates and send them to WP-Pocket.com? These statistics will only be used to improve WP Pocket.</p> 759 </td> 760 </tr> 761 </table> 762 763 <h3>Data processing</h3> 764 <table class="form-table"> 765 <tr> 766 <th>Links to use</th> 767 <td> 768 <select name="wppocket_links_to_use"> 769 <option value="0" <?php selected('0', get_option('wppocket_links_to_use')); ?>>Only unread links, which are unposted</option> 770 <option value="1" <?php selected('1', get_option('wppocket_links_to_use')); ?>>Only read/archived links, which are unposted</option> 771 <option value="2" <?php selected('2', get_option('wppocket_links_to_use')); ?>>All links, which are unposted</option> 772 <option value="3" <?php selected('3', get_option('wppocket_links_to_use')); ?>>All unread links, also already posted ones</option> 773 <option value="4" <?php selected('4', get_option('wppocket_links_to_use')); ?>>All read/archived links, also already posted ones</option> 774 <option value="5" <?php selected('5', get_option('wppocket_links_to_use')); ?>>All links, also already posted ones</option> 775 </select> 776 <p class="description">Which links should be used for the new post?</p> 777 </td> 778 </tr> 779 <tr> 780 <th>Favorites</th> 781 <td> 782 <select name="wppocket_faved"> 783 <option value="0" <?php selected('0', get_option('wppocket_faved')); ?>>All links</option> 784 <option value="1" <?php selected('1', get_option('wppocket_faved')); ?>>Only faved links</option> 785 <option value="2" <?php selected('2', get_option('wppocket_faved')); ?>>Only unfaved links</option> 786 </select> 787 <p class="description">Should only faved or unfaved links be used in a new post?</p> 788 </td> 789 </tr> 790 <tr> 791 <th>Order</th> 792 <td> 793 <select name="wppocket_order"> 794 <option value="0" <?php selected('0', get_option('wppocket_order')); ?>>Newest to oldest</option> 795 <option value="1" <?php selected('1', get_option('wppocket_order')); ?>>Oldest to newest</option> 796 </select> 797 <p class="description">Which order should have the links in a new post?</p> 798 </td> 799 </tr> 800 <tr> 801 <th>Mark as readed/archived</th> 802 <td> 803 <select name="wppocket_mark_as_readed"> 804 <option value="1" <?php selected('1', get_option('wppocket_mark_as_readed')); ?>>Yes</option> 805 <option value="0" <?php selected('0', get_option('wppocket_mark_as_readed')); ?>>No</option> 806 </select> 807 <p class="description">Should the links be marked as read in Pocket, after post?</p> 808 </td> 809 </tr> 810 <tr> 811 <th>Clean up URL</th> 812 <td> 813 <select name="wppocket_clean_url"> 814 <option value="1" <?php selected('1', get_option('wppocket_clean_url')); ?>>Yes</option> 815 <option value="0" <?php selected('0', get_option('wppocket_clean_url')); ?>>No</option> 816 </select> 817 <p class="description">If enabled, everything after the <i>?</i> in the url will be cut out. For example: 818 <i>http://example.de/title-of-post/?utm_source=feedreader</i> will be edited to <i>http://example.de/title-of-post/</i> - 819 The <i>p</i> parameter, which is used by default worldpress, will not be cleared - 820 <strong>Sometimes necessary information will be lost!</strong></p> 821 </td> 822 </tr> 823 <tr> 824 <th>Use Meta Tag as Tags</th> 825 <td> 826 <select name="wppocket_meta_keyword_as_tags"> 827 <option value="1" <?php selected('1', get_option('wppocket_meta_keyword_as_tags')); ?>>Yes</option> 828 <option value="0" <?php selected('0', get_option('wppocket_meta_keyword_as_tags')); ?>>No</option> 829 </select> 830 <p class="description">If there are no tags given, the meta tags will be used as tags.</p> 831 </td> 832 </tr> 833 <tr> 834 <th>WP Pocket reference</th> 835 <td> 836 <select name="wppocket_reference_wppocket"> 837 <option value="1" <?php selected('1', get_option('wppocket_reference_wppocket')); ?>>Yes</option> 838 <option value="0" <?php selected('0', get_option('wppocket_reference_wppocket')); ?>>No</option> 839 </select> 840 <p class="description">Should there be a notification, that this post was generated by <i>WP Pocket</i>, at the end of the generated posts?</p> 841 </td> 842 </tr> 843 </table> 844 845 <h3>Post settings</h3> 846 <table class="form-table"> 847 <tr> 848 <th>Post status</th> 849 <td> 850 <select name="wppocket_post_status"> 851 <option value="publish" <?php selected('publish', get_option('wppocket_post_status')); ?>>Publish</option> 852 <option value="pending" <?php selected('pending', get_option('wppocket_post_status')); ?>>Pending</option> 853 <option value="draft" <?php selected('draft', get_option('wppocket_post_status')); ?>>Draft</option> 854 </select> 855 <p class="description">After generating the post, how should it be saved?</p> 856 </td> 857 </tr> 858 <tr> 859 <th>Post category</th> 860 <td> 861 <?php 862 wp_dropdown_categories(array( 863 'name' => 'wppocket_post_category', 864 'hide_empty' => 0, 865 'selected' => get_option('wppocket_post_category') 866 )); 867 ?> 868 <p class="description">Which category should the post be saved in?</p> 869 </td> 870 </tr> 871 <tr> 872 <th>Commect status</th> 873 <td> 874 <select name="wppocket_comment_status"> 875 <option value="open" <?php selected('open', get_option('wppocket_comment_status')); ?>>Open</option> 876 <option value="close" <?php selected('close', get_option('wppocket_comment_status')); ?>>Close</option> 877 </select> 878 <p class="description">Should the generated posts be commentable?</p> 879 </td> 880 </tr> 881 <tr> 882 <th>Ping status</th> 883 <td> 884 <select name="wppocket_ping_status"> 885 <option value="open" <?php selected('open', get_option('wppocket_ping_status')); ?>>Open</option> 886 <option value="close" <?php selected('close', get_option('wppocket_ping_status')); ?>>Close</option> 887 </select> 888 <p class="description">Should the generated posts be pingable?</p> 889 </td> 890 </tr> 891 </table> 892 893 <h3>Post content matching</h3> 894 <table class="form-table"> 895 <tr> 896 <th>Title</th> 897 <td> 898 <input type="text" size="57" name="wppocket_title" value="<?php echo get_option('wppocket_title'); ?>" /> 899 <p class="description"> 900 This is the title of each post, which WP Pocket generates.<br /> 901 <strong>Use <i>%%day%%</i> for the day, on which the post is being generated; <i>%%month%%</i> for the month; 902 <i>%%year%%</i> for the year; <i>%%count%%</i> to get the number of posted links.</strong> 903 </p> 904 </td> 905 </tr> 906 <tr> 907 <th>Entry building</th> 908 <td> 909 <?php 910 $args = array( 911 'textarea_name' => 'wppocket_entry_building', 912 'textarea_rows' => 5 913 ); 914 wp_editor(get_option('wppocket_entry_building'), 'wppocket_entry_building', $args); 915 ?> 916 <p class="description"> 917 Configure how a link should be shown. If you wish to show a part of the text only if a variable is not empty, 918 write the text and the variable in double square brackets. For example: %%title%%[[ - Tags: %%tags%%]]<br /> 919 <strong>Use <i>%%title%%</i> for title of the link in pocket; <i>%%description%%</i> for the meta description of the link; 920 <i>%%url%%</i> for the link itself; <i>%%tags%%</i> for added tags in pocket/metatags; <i>%%author%%</i> for the name 921 of the author who wrote the article; <i>%%countwords%%</i> for the number of words, which the article has</strong> 922 </p> 923 </td> 924 </tr> 925 <tr> 926 <th>Introduction text</th> 927 <td> 928 <?php 929 $args = array( 930 'textarea_name' => 'wppocket_introduction_text', 931 'textarea_rows' => 5 932 ); 933 wp_editor(get_option('wppocket_introduction_text'), 'wppocket_introduction_text', $args); 934 ?> 935 <p class="description"> 936 At the beginning of the post, before the links, this text will be shown.<br /> 937 <strong>Use <i>%%day%%</i> for day, on which the post is being generated; <i>%%month%%</i> for the month; <i>%%year%%</i> for the year; %%count%% to get the number of posted links.</strong> 938 </p> 939 </td> 940 </tr> 941 <tr> 942 <th>Statements text</th> 943 <td> 944 <?php 945 $args = array( 946 'textarea_name' => 'wppocket_statements_text', 947 'textarea_rows' => 5 948 ); 949 wp_editor(get_option('wppocket_statements_text'), 'wppocket_statements_text', $args); 950 ?> 951 <p class="description"> 952 At the end of the post, after the links, this text will be shown.<br /> 953 <strong>Use <i>%%day%%</i> for day, on which the post is being generated; <i>%%month%%</i> for the month; <i>%%year%%</i> for the year; %%count%% to get the number of posted links.</strong> 954 </p> 955 </td> 956 </tr> 957 </table> 958 959 <input type="hidden" name="wppocket_edit" value="1" /> 960 961 <p class="submit"> 962 <input type="submit" class="button-primary" value="<?php _e('Save Changes') ?>" /> 963 </p> 964 </form> 725 <?php $this->changeToWpStacker(); ?> 965 726 </div> 966 727 <?php … … 1167 928 <h2>WP Pocket</h2> 1168 929 1169 <?php // Bullshot Snippet for fix navi-menu JavaScript ?> 1170 <div class="nav-tabs-nav"> 1171 <div class="nav-tabs-arrow nav-tabs-arrow-left" style="display: none; "><a>«</a></div> 1172 <div class="nav-tabs-wrapper"> 1173 <div class="nav-tabs"> 1174 <span class="nav-tab nav-tab-active"></span><a href="#" class="nav-tab menu-add-new"></a> 1175 </div> 1176 </div> 1177 </div> 1178 1179 <?php 1180 if ($_POST['mode'] != 'get') { 1181 $this->support_div(); 1182 } 1183 ?> 1184 1185 <?php $this->main_page_controller(); ?> 1186 1187 <?php 1188 // Check if should get Pocket elements or save as post 1189 if ($_POST['mode'] == 'get') { // Get Elements 1190 // Check Pocket Access 1191 $checkPocketAccess = $this->checkPocketAccess(); 1192 1193 // Check if access is valid 1194 if ($checkPocketAccess) { 1195 // Get links from the user 1196 $getLinksPost = array(); 1197 1198 $getLinksPost['consumer_key'] = $this->xcrypt(1, get_option('wppocket_pocket_consumer_key')); 1199 $getLinksPost['access_token'] = $this->xcrypt(1, get_option('wppocket_pocket_access_key')); 1200 $getLinksPost['detailType'] = 'complete'; 1201 1202 // Should get Readed, unreaded or all links? 1203 if (get_option('wppocket_links_to_use') == 0 || get_option('wppocket_links_to_use') == 3) { // Unreaded 1204 $getLinksPost['state'] = 'unread'; 1205 }elseif (get_option('wppocket_links_to_use') == 1 || get_option('wppocket_links_to_use') == 4) { // Readed / Archived 1206 $getLinksPost['state'] = 'archive'; 1207 }else { // All 1208 $getLinksPost['state'] = 'all'; 1209 } 1210 1211 // Check if only faved or unfaved links should use 1212 if (get_option('wppocket_faved') == 1) { // only faved 1213 $getLinksPost['favorite'] = '1'; 1214 }else if (get_option('wppocket_faved') == 2) { // only unfaved 1215 $getLinksPost['favorite'] = '0'; 1216 } // All 1217 1218 // Check if order should be oldest to newest or newest to oldest 1219 if (get_option('wppocket_order')) { // oldest to newest 1220 $getLinksPost['sort'] = 'oldest'; 1221 }else { // newest to oldest 1222 $getLinksPost['sort'] = 'newest'; 1223 } 1224 1225 $getLinks = $this->cURL( 1226 'https://getpocket.com/v3/get', 1227 $getLinksPost 1228 ); 1229 1230 // Decode JSON to Object 1231 $getLinks = json_decode($getLinks); 1232 1233 // Check if only not posted links should post 1234 if (get_option('wppocket_links_to_use') == 0 || get_option('wppocket_links_to_use') == 1 || get_option('wppocket_links_to_use') == 2) { 1235 // Remove all already posted links 1236 foreach ($getLinks->list as $key => $value) { 1237 // Check if aleady posted. If true, remove it 1238 $sql = 'SELECT `id` FROM `' . $this->wpdb->prefix . 'wppocket_posted_links` WHERE `url`="' . $value->given_url . '"'; 1239 $row = $this->wpdb->get_results($sql); 1240 1241 if ($row[0]->id != '') { 1242 unset($getLinks->list->$key); 1243 } 1244 } 1245 } 1246 1247 if (count((array)$getLinks->list) == 0) { // No elements 1248 ?> 1249 <?php $this->support_div(); ?> 1250 1251 <p><strong>You do not have usable elements in your Pocket account! Is the <i>Links to use</i> setting correct?</strong></p> 1252 <p>You have to look for interesting links, before you can post them ;-)</p> 1253 <?php 1254 }else { 1255 ?> 1256 <?php $this->support_div(false); ?> 1257 1258 <p class="wppocket_loader" style="width: 308px; margin: 15px 0 0 0; text-align: center;"> 1259 <img src="<?php echo plugins_url('images/loading.gif', __FILE__) ?>" alt="loading" /><br /> 1260 <strong>Please wait while loading...</strong> 1261 </p> 1262 1263 <form id="update-nav-menu" action="" method="post" enctype="multipart/form-data" style="display: none;"> 1264 <p><br /><strong>Please edit, sort and associate the links. If you finished, please click on the <i>Generate post</i> button at the end of the list!</strong></p> 1265 1266 <ul class="menu ui-sortable" id="menu-to-edit"> 1267 <?php 1268 // Gennerate output of each link 1269 foreach ($getLinks->list as $key => $value) { 1270 // Rewirte Tags Array as Tags string 1271 if (count($value->tags) != 0) { 1272 $tagsAsString = ''; 1273 $i2 = 0; 1274 foreach ($value->tags as $tag) { 1275 if ($i2 != 0) { 1276 $tagsAsString .= ', '; 1277 } 1278 1279 $tagsAsString .= $tag->tag; 1280 1281 $i2++; 1282 } 1283 1284 $value->tags = $tagsAsString; 1285 unset($tagsAsString); 1286 }else { // Not tags yet 1287 $value->tags = ''; 1288 } 1289 1290 // Get data from the meta tags, if necessary 1291 if ($value->resolved_title == '' || $value->excerpt == '' || (get_option('wppocket_meta_keyword_as_tags') == 1 && $value->tags == '')) { 1292 $urlHtml = $this->cURL($value->given_url, array()); 1293 1294 $doc = new DOMDocument(); 1295 @$doc->loadHTML($urlHtml); 1296 1297 if ($value->resolved_title == '') { 1298 $nodes = $doc->getElementsByTagName('title'); 1299 $value->title = utf8_decode($nodes->item(0)->nodeValue); 1300 1301 if (!$this->is_utf8($value->title)) { 1302 $value->title = utf8_encode($value->title); 1303 } 1304 } 1305 1306 $metas = $doc->getElementsByTagName('meta'); 1307 1308 for ($i = 0; $i < $metas->length; $i++) { 1309 $meta = $metas->item($i); 1310 1311 if ($value->excerpt == '') { 1312 if($meta->getAttribute('name') == 'description') { 1313 $value->excerpt = utf8_decode($meta->getAttribute('content')); 1314 if (!$this->is_utf8($value->excerpt)) { 1315 $value->excerpt = utf8_encode($value->excerpt); 1316 } 1317 } 1318 } 1319 1320 if (get_option('wppocket_meta_keyword_as_tags') == 1 && $value->tags == '') { 1321 if ($meta->getAttribute('name') == 'keywords') { 1322 $value->tags = utf8_decode($meta->getAttribute('content')); 1323 if (!$this->is_utf8($value->tags)) { 1324 $value->tags = utf8_encode($value->tags); 1325 } 1326 } 1327 } 1328 } 1329 } 1330 ?> 1331 <li class="menu-item-edit-inactive"> 1332 <dl class="menu-item-bar"> 1333 <dt class="menu-item-handle"> 1334 <div class="left"> 1335 <?php echo $value->resolved_title; ?> 1336 </div> 1337 <div class="right"> 1338 <a class="item-remove" href="#item-remove-<?php echo $key; ?>">Remove element</a> 1339 <a class="item-edit" href="#item-<?php echo $key; ?>">Edit element</a> 1340 </div> 1341 </dt> 1342 </dl> 1343 1344 <div class="menu-item-settings" id="item-<?php echo $key; ?>"> 1345 <p class="description description-thin description-two-thirds"> 1346 <label for="item-<?php echo $key; ?>-input-title"> 1347 Title<br /> 1348 <input type="text" id="item-<?php echo $key; ?>-input-title" class="widefat input-title" name="element[][title]" value="<?php echo $value->resolved_title; ?>" /> 1349 </label> 1350 </p> 1351 <p class="description description-thin description-one-thirds"> 1352 <label for="item-<?php echo $key; ?>-input-author"> 1353 Author<br /> 1354 <input type="text" id="item-<?php echo $key; ?>-input-author" class="widefat" name="element[][author]" value="<?php 1355 if (count($value->authors) != 0) { 1356 $i2 = 0; 1357 foreach($value->authors as $author) { 1358 if ($i2 != 0) { 1359 echo ', '; 1360 } 1361 1362 echo $author->name; 1363 1364 $i2++; 1365 } 1366 } 1367 ?>" /> 1368 </label> 1369 </p> 1370 <p class="description description-thin description-two-thirds"> 1371 <label for="item-<?php echo $key; ?>-input-url"> 1372 URL<br /> 1373 <input type="text" id="item-<?php echo $key; ?>-input-url" class="widefat" name="element[][url]" value="<?php if (get_option('wppocket_clean_url') == 1) { echo $this->cleanUpURL($value->resolved_url); }else { echo $value->given_url; } ?>" /> 1374 <input type="hidden" id="item-<?php echo $key; ?>-input-url" class="widefat" name="element[][url_uncleaned]" value="<?php echo $value->given_url; ?>" /> 1375 </label> 1376 </p> 1377 <p class="description description-thin description-one-thirds"> 1378 <label for="item-<?php echo $key; ?>-input-tags"> 1379 Tags<br /> 1380 <input type="text" id="item-<?php echo $key; ?>-input-tags" class="widefat" name="element[][tags]" value="<?php echo $value->tags; ?>" /> 1381 </label> 1382 </p> 1383 <p class="description"> 1384 <label for="item-<?php echo $key; ?>-input-description"> 1385 Description (optional)<br /> 1386 <textarea name="element[][description]" rows="4" id="item-<?php echo $key; ?>-input-description" class="widefat" type="textarea"><?php echo $value->excerpt; ?></textarea> 1387 </label> 1388 </p> 1389 1390 1391 <input type="hidden" name="element[][id]" value="<?php echo $value->item_id; ?>" /> 1392 <input type="hidden" name="element[][countwords]" value="<?php echo $value->word_count; ?>" /> 1393 <input type="hidden" name="element[][associate]" class="associate" value="0" /> 1394 </div> 1395 </li> 1396 <?php } ?> 1397 </ul> 1398 1399 <p class="submit"> 1400 <input type="hidden" name="mode" value="save" /> 1401 <input type="submit" name="save_menu" class="button-primary" value="Gennerate post" /> 1402 <strong>This can take up to 30 seconds!</strong> 1403 </p> 1404 </form> 1405 <?php 1406 } 1407 } 1408 }elseif ($_POST['mode'] == 'save') { // Save post 1409 // Check if elements was lposted 1410 if ($_POST['count_elements'] == 0) { // No elements 1411 ?> 1412 <p><strong>No elements to post were found. Is the <i>Links to use</i> setting correct?</strong></strong></p> 1413 <p>You have to look for interesting links, before you can post them ;-)</p> 1414 <?php 1415 }else { // Success 1416 ?> 1417 <p class="short"><strong>Great! You posted <?php echo $_POST['count_elements']; ?> links from your Pocket account into your blog. <?php if ($_POST['wppocket_mark_as_readed']) { ?>[18:56:01] Elias: They are now marked as read in your pocket account!<?php } ?></strong></p> 1418 <p class="short">If you like WP Pocket, I would be pleased, if you supported me. How to? Look in the yellow box on the right!</p> 1419 <?php 1420 } 1421 }else { // Print introduction 1422 ?> 1423 <br /><br /> 1424 <p class="short">You would like to generate a new post with links from you pocket account? Great!</p> 1425 1426 <p class="short">After you click on <i>Get links</i> you will see all links which will be posted. If you would like to 1427 associate to links, take the link which should be shown without title, description and tags in the second level and the main link.<br /> 1428 You will be able to edit all titles, descriptions, links and tags or remove them. If you finished, you can generate the post.<?php if (get_option('wppocket_mark_as_readed') == 1) { ?> Only if you click on <i>Generate post</i>, the links will be marked as read in your Pocket account.<?php } ?></p> 1429 1430 <?php 1431 // Check Pocket Access 1432 $checkPocketAccess = $this->checkPocketAccess(); 1433 ?> 1434 1435 <form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> 1436 <p class="submit"> 1437 <input type="hidden" name="mode" value="get" /> 1438 <input type="submit" class="button-primary" value="Get links"<?php if($checkPocketAccess == false) { echo ' disabled'; } ?> /> 1439 <strong>This can take up to 60 seconds!</strong> 1440 </p> 1441 </form> 1442 <?php 1443 } 1444 ?> 930 <?php $this->changeToWpStacker(); ?> 1445 931 </div> 1446 932 <?php … … 1782 1268 // Statisics send to WP-Pocket.com: Publish post 1783 1269 private function statisticsPublishPost($links) { 1784 echo 'HERO!';1785 1786 1270 // Get Data 1787 1271 $url = explode('?', ((empty($_SERVER['HTTPS'])) ? 'http' : 'https') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
Note: See TracChangeset
for help on using the changeset viewer.