/*
Plugin Name: WP Flickr Post Bar
Plugin URI: http://tantannoodles.com/toolkit/wp-flickr-post-bar/
Description: Displays a Flickr bar at the top of your edit screen, which allows you to easily add Flickr photos to your posts with one click. 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 =
"
";
// $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');
?>
Warning: Cannot modify header information - headers already sent by (output started at /home/other/public_html/klogs/toolkit/wp-content/plugins/tantan/tantan_flickrPostBar.php:153) in /home/other/public_html/klogs/toolkit/wp-rss2.php on line 9
Toolkits
http://www.otheredge.com.au/klogs/toolkit
Mon, 07 Jan 2008 02:36:31 +0000http://wordpress.org/?v=2.0.1enStarting anew
http://www.otheredge.com.au/klogs/toolkit/2008/starting-anew.htm
http://www.otheredge.com.au/klogs/toolkit/2008/starting-anew.htm#commentsFri, 04 Jan 2008 00:16:02 +0000KirstySnippetshttp://www.otheredge.com.au/klogs/toolkit/2008/starting-anew.htmhttp://www.otheredge.com.au/klogs/toolkit/2008/starting-anew.htm/feed/On Hiatus
http://www.otheredge.com.au/klogs/toolkit/2007/intro-to-blogging.htm
http://www.otheredge.com.au/klogs/toolkit/2007/intro-to-blogging.htm#commentsMon, 25 Jun 2007 07:02:13 +0000KirstyPD Resources and ApproachesSnippetshttp://www.otheredge.com.au/klogs/toolkit/2007/intro-to-blogging.htmhttp://www.otheredge.com.au/klogs/toolkit/2007/intro-to-blogging.htm/feed/Resources and References from Jay Cross
http://www.otheredge.com.au/klogs/toolkit/2007/resources-and-references-from-jay-cross.htm
http://www.otheredge.com.au/klogs/toolkit/2007/resources-and-references-from-jay-cross.htm#commentsTue, 08 May 2007 20:18:07 +0000KirstyPD Resources and ApproachesSnippetshttp://www.otheredge.com.au/klogs/toolkit/2007/resources-and-references-from-jay-cross.htmhttp://www.otheredge.com.au/klogs/toolkit/2007/resources-and-references-from-jay-cross.htm/feed/Workshop Resources from New Practices Projects
http://www.otheredge.com.au/klogs/toolkit/2007/workshop-resources-from-new-practices-projects.htm
http://www.otheredge.com.au/klogs/toolkit/2007/workshop-resources-from-new-practices-projects.htm#commentsTue, 08 May 2007 19:54:40 +0000KirstyPD Resources and ApproachesResource Development ToolsToolshttp://www.otheredge.com.au/klogs/toolkit/2007/workshop-resources-from-new-practices-projects.htmhttp://www.otheredge.com.au/klogs/toolkit/2007/workshop-resources-from-new-practices-projects.htm/feed/Podcasting from Uni of Wisconsin
http://www.otheredge.com.au/klogs/toolkit/2007/podcasting-from-uni-of-wisconsin.htm
http://www.otheredge.com.au/klogs/toolkit/2007/podcasting-from-uni-of-wisconsin.htm#commentsSat, 28 Apr 2007 11:34:10 +0000KirstyPD Resources and ApproachesResource Development ToolsToolshttp://www.otheredge.com.au/klogs/toolkit/2007/podcasting-from-uni-of-wisconsin.htmhttp://www.otheredge.com.au/klogs/toolkit/2007/podcasting-from-uni-of-wisconsin.htm/feed/Internode - Unmetered Content
http://www.otheredge.com.au/klogs/toolkit/2007/internode-unmetered-content.htm
http://www.otheredge.com.au/klogs/toolkit/2007/internode-unmetered-content.htm#commentsSat, 28 Apr 2007 10:39:12 +0000KirstyTech StuffResources/ LOshttp://www.otheredge.com.au/klogs/toolkit/2007/internode-unmetered-content.htmhttp://www.otheredge.com.au/klogs/toolkit/2007/internode-unmetered-content.htm/feed/Andys Black Hole: Are you seriously Mobile ???
http://www.otheredge.com.au/klogs/toolkit/2007/andys-black-hole-are-you-seriously-mobile.htm
http://www.otheredge.com.au/klogs/toolkit/2007/andys-black-hole-are-you-seriously-mobile.htm#commentsWed, 11 Apr 2007 03:39:26 +0000KirstyLeadership, Change and OrganisationsInnovation, Ideashttp://www.otheredge.com.au/klogs/toolkit/2007/andys-black-hole-are-you-seriously-mobile.htmhttp://www.otheredge.com.au/klogs/toolkit/2007/andys-black-hole-are-you-seriously-mobile.htm/feed/Staff Induction about Australian Apprenticeships
http://www.otheredge.com.au/klogs/toolkit/2006/staff-induction-about-australian-apprenticeships.htm
http://www.otheredge.com.au/klogs/toolkit/2006/staff-induction-about-australian-apprenticeships.htm#commentsTue, 07 Nov 2006 22:40:07 +0000KirstyPD Resources and ApproachesWorkplace LearningResources/ LOshttp://www.otheredge.com.au/klogs/toolkit/2006/staff-induction-about-australian-apprenticeships.htmhttp://www.otheredge.com.au/klogs/toolkit/2006/staff-induction-about-australian-apprenticeships.htm/feed/Six Word Learning Plans
http://www.otheredge.com.au/klogs/toolkit/2006/six-word-learning-plans.htm
http://www.otheredge.com.au/klogs/toolkit/2006/six-word-learning-plans.htm#commentsThu, 02 Nov 2006 03:57:40 +0000KirstyLearning DesignSnippetshttp://www.otheredge.com.au/klogs/toolkit/2006/six-word-learning-plans.htmhttp://www.otheredge.com.au/klogs/toolkit/2006/six-word-learning-plans.htm/feed/Online Enrolments
http://www.otheredge.com.au/klogs/toolkit/2006/online-enrolments.htm
http://www.otheredge.com.au/klogs/toolkit/2006/online-enrolments.htm#commentsWed, 18 Oct 2006 04:50:29 +0000KirstySnippetsLearnScopehttp://www.otheredge.com.au/klogs/toolkit/2006/online-enrolments.htmhttp://www.otheredge.com.au/klogs/toolkit/2006/online-enrolments.htm/feed/
Deprecated: Function split() is deprecated in /home/other/public_html/klogs/toolkit/wp-includes/cache.php on line 216
Deprecated: Function split() is deprecated in /home/other/public_html/klogs/toolkit/wp-includes/cache.php on line 216
Deprecated: Function split() is deprecated in /home/other/public_html/klogs/toolkit/wp-includes/cache.php on line 216
Deprecated: Function split() is deprecated in /home/other/public_html/klogs/toolkit/wp-includes/cache.php on line 216