Configure... Version: 0.5 Author: Joe Tan Author URI: http://tantannoodles.com/ Copyright (C) 2005 Joe Tan 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 Street, Fifth Floor, Boston, MA 02110-1301, USA */ /* ****************************************************************** Front end display functions ****************************************************************** */ /* Prints HTML code where badge should be displayed */ function tantan_fpbFormDisplay() { //$photos = tantan_fpbGetData(); //$tantan_fpbSize = get_option('tantan_fpbSize'); //$tantan_flickrMaxPhotos = get_option('tantan_flickrMaxPhotos'); //if (!$tantan_fpbSize) $tantan_fpbSize = 'Small'; $html = "
". "Flickr Photos". "". "
"; // $html .= ""; echo $html; // include(dirname(__FILE__).'/post-bar-form.html'); } /* Retrieve Flickr data */ function tantan_fpbGetData() { // check to see if data is cached $lastTimestamp = get_option('tantan_fpbTimestamp'); $photos = get_option('tantan_fpbPhotos'); $cached = false; if ((is_array($photos) && count($photos) && $lastTimestamp && ((time() - $lastTimestamp) < 60*60))) { // data is cached and still fresh, so don't do anything $cached = true; } if (!$cached) { include_once(dirname(__FILE__).'/lib.flickrBadge.php'); // not cached, so get data from flickr and update $badge = new TanTanBadge(); $badge->setFlickrAPI(get_option('tantan_flickrAPI')); $photos = $badge->getData(get_option('tantan_flickrUser'), get_option('tantan_flickrMaxPhotos')); if (!is_array($photos) || (count($photos) == 0)) { // some sort of error update_option('tantan_fpbPhotos', false); } else { update_option('tantan_fpbPhotos', $photos); update_option('tantan_fpbTimestamp', time()); } } if (is_array($photos)) { return $photos; } else { return array(); } } /* ****************************************************************** Admin options ****************************************************************** */ /* Add hooks for admin page options */ function tantan_fpbAdminOptions() { add_options_page('Flickr Post Bar', 'Flickr Post Bar', 10, __FILE__, 'tantan_fpbAdminPage'); } /* Admin page controller */ function tantan_fpbAdminPage() { if (isset($_POST['tantan_action'])) { update_option('tantan_flickrAPI', $_POST['tantan_flickrAPI']); update_option('tantan_flickrUser', $_POST['tantan_flickrUser']); update_option('tantan_flickrMaxPhotos',$_POST['tantan_flickrMaxPhotos']); update_option('tantan_fpbSize', $_POST['tantan_fpbSize']); update_option('tantan_fbpLinkDest', $_POST['tantan_fbpLinkDest']); update_option('tantan_fbpLinkDestValue', $_POST['tantan_fbpLinkDestValue']); update_option('tantan_fpbAutoLoadDisabled', $_POST['tantan_fpbAutoLoadDisabled']); $status = "Saved settings."; if ($_POST['tantan_clearCache'] == 'yes') { update_option('tantan_fpbPhotos', false); $status .= " Cleared cache."; } } else { $status = ""; } $tantan_flickrAPI = get_option('tantan_flickrAPI'); $tantan_flickrUser = get_option('tantan_flickrUser'); $tantan_flickrMaxPhotos = get_option('tantan_flickrMaxPhotos'); $tantan_fpbSize = get_option('tantan_fpbSize'); $tantan_fbpLinkDest = get_option('tantan_fbpLinkDest'); $tantan_fbpLinkDestValue = get_option('tantan_fbpLinkDestValue'); $tantan_fpbAutoLoadDisabled=get_option('tantan_fpbAutoLoadDisabled'); include(dirname(__FILE__).'/post-bar-admin.html'); } // install hooks add_action('edit_form_advanced', 'tantan_fpbFormDisplay'); add_action('simple_edit_form', 'tantan_fpbFormDisplay'); add_action('edit_page_form', 'tantan_fpbFormDisplay'); add_action('admin_menu', 'tantan_fpbAdminOptions'); ?> Toolkits http://www.otheredge.com.au/klogs/toolkit Mon, 07 Jan 2008 02:36:31 +0000 http://wordpress.org/?v=2.0.1 en Getting the job done: How employers use and value accredited training leading to a qualification http://www.otheredge.com.au/klogs/toolkit/2005/getting-the-job-done-how-employers-use-and-value-accredited-training-leading-to-a-qualification.htm http://www.otheredge.com.au/klogs/toolkit/2005/getting-the-job-done-how-employers-use-and-value-accredited-training-leading-to-a-qualification.htm#comments Thu, 08 Sep 2005 23:12:32 +0000 Kirsty Readings http://www.otheredge.com.au/wordpress/?p=721 http://www.otheredge.com.au/klogs/toolkit/2005/getting-the-job-done-how-employers-use-and-value-accredited-training-leading-to-a-qualification.htm/feed/ Simpler is better? http://www.otheredge.com.au/klogs/toolkit/2005/simpler-is-better.htm http://www.otheredge.com.au/klogs/toolkit/2005/simpler-is-better.htm#comments Thu, 28 Jul 2005 03:58:15 +0000 Kirsty Readings http://www.otheredge.com.au/wordpress/?p=689 http://www.otheredge.com.au/klogs/toolkit/2005/simpler-is-better.htm/feed/ ICT and Creativity Conference http://www.otheredge.com.au/klogs/toolkit/2005/ict-and-creativity-conference.htm http://www.otheredge.com.au/klogs/toolkit/2005/ict-and-creativity-conference.htm#comments Sun, 17 Jul 2005 08:34:46 +0000 Kirsty Readings http://www.otheredge.com.au/wordpress/?p=675 http://www.otheredge.com.au/klogs/toolkit/2005/ict-and-creativity-conference.htm/feed/ electrocomms and energyutilities Industry Skills report - ANTA 2005 http://www.otheredge.com.au/klogs/toolkit/2005/electrocomms-and-energyutilities-industry-skills-report-anta-2005.htm http://www.otheredge.com.au/klogs/toolkit/2005/electrocomms-and-energyutilities-industry-skills-report-anta-2005.htm#comments Tue, 19 Apr 2005 02:26:11 +0000 Kirsty Readings http://www.otheredge.com.au/wordpress/?p=607 http://www.otheredge.com.au/klogs/toolkit/2005/electrocomms-and-energyutilities-industry-skills-report-anta-2005.htm/feed/ Book to buy http://www.otheredge.com.au/klogs/toolkit/2005/book-to-buy.htm http://www.otheredge.com.au/klogs/toolkit/2005/book-to-buy.htm#comments Thu, 24 Feb 2005 05:15:07 +0000 Kirsty Readings http://www.otheredge.com.au/wordpress/?p=560 http://www.otheredge.com.au/klogs/toolkit/2005/book-to-buy.htm/feed/ AUSWEB04 http://www.otheredge.com.au/klogs/toolkit/2004/ausweb04.htm http://www.otheredge.com.au/klogs/toolkit/2004/ausweb04.htm#comments Wed, 22 Sep 2004 01:24:45 +0000 Kirsty Readings http://www.otheredge.com.au/wordpress/?p=495 http://www.otheredge.com.au/klogs/toolkit/2004/ausweb04.htm/feed/ Books http://www.otheredge.com.au/klogs/toolkit/2004/books.htm http://www.otheredge.com.au/klogs/toolkit/2004/books.htm#comments Sun, 01 Aug 2004 22:16:53 +0000 Kirsty Readings http://www.otheredge.com.au/wordpress/?p=484 http://www.otheredge.com.au/klogs/toolkit/2004/books.htm/feed/ Planning Wheel http://www.otheredge.com.au/klogs/toolkit/2004/planning-wheel.htm http://www.otheredge.com.au/klogs/toolkit/2004/planning-wheel.htm#comments Wed, 23 Jun 2004 22:28:09 +0000 Kirsty Readings Learning Design LearnScope http://www.otheredge.com.au/wordpress/?p=476 http://www.otheredge.com.au/klogs/toolkit/2004/planning-wheel.htm/feed/ AVETRA Conference http://www.otheredge.com.au/klogs/toolkit/2004/avetra-conference.htm http://www.otheredge.com.au/klogs/toolkit/2004/avetra-conference.htm#comments Wed, 02 Jun 2004 04:46:56 +0000 Kirsty Readings http://www.otheredge.com.au/wordpress/?p=463 http://www.otheredge.com.au/klogs/toolkit/2004/avetra-conference.htm/feed/ Books book beautiful books, well maybe http://www.otheredge.com.au/klogs/toolkit/2004/books-book-beautiful-books-well-maybe.htm http://www.otheredge.com.au/klogs/toolkit/2004/books-book-beautiful-books-well-maybe.htm#comments Wed, 02 Jun 2004 04:40:48 +0000 Kirsty Readings http://www.otheredge.com.au/wordpress/?p=462 http://www.otheredge.com.au/klogs/toolkit/2004/books-book-beautiful-books-well-maybe.htm/feed/