From 69ed6e95b7f8e817ab34ae10dd2b48d480e849bb Mon Sep 17 00:00:00 2001 From: John Bintz Date: Tue, 14 Jul 2009 22:24:31 -0400 Subject: [PATCH] get bookmark widget working --- addons/BookmarkWidget/BookmarkWidget.inc | 33 +++++++++++++++++++++--- addons/BookmarkWidget/temp.js | 4 +-- classes/ComicPress.inc | 13 ++++++++-- 3 files changed, 43 insertions(+), 7 deletions(-) diff --git a/addons/BookmarkWidget/BookmarkWidget.inc b/addons/BookmarkWidget/BookmarkWidget.inc index fc07c60..a6bfed0 100644 --- a/addons/BookmarkWidget/BookmarkWidget.inc +++ b/addons/BookmarkWidget/BookmarkWidget.inc @@ -1,13 +1,40 @@ __('Let your readers save their place via a cookie.', 'comicpress'))); + + $this->comicpress = $comicpress; + + add_action('wp_head', array(&$this, 'wp_head')); + $this->comicpress->additional_javascripts[] = '/js/bookmark.js'; + } + + function wp_head() { + $last_comic = $this->comicpress->get_last_comic(); ?> + + +
+ +
+ /images/3a.gif'; //no comic tagged, clear not possible var imgGotoOff = '/images/2a.gif'; //no comic tagged, goto not possible var imgClearOn = '/images/3.gif'; //clear a tag, shows when comic previously tagged - var imgGotoOn = '/2.gif'; //shows when a comic is tagged - var imgInfo = '/4.gif'; //img that displays the help + var imgGotoOn = '/images/2.gif'; //shows when a comic is tagged + var imgInfo = '/images/4.gif'; //img that displays the help var comicDir = '/'; //alter this if you run multiple comics in different directories on your site. /* Now write out the applicable links */ diff --git a/classes/ComicPress.inc b/classes/ComicPress.inc index 1ff74c7..f576abc 100644 --- a/classes/ComicPress.inc +++ b/classes/ComicPress.inc @@ -15,6 +15,8 @@ class ComicPress { ); var $additional_stylesheets = array(); + var $additional_javascripts = array(); + var $comic_post_attachments_cache = array(); var $category_tree = array(); @@ -54,6 +56,9 @@ class ComicPress { foreach ($this->additional_stylesheets as $uri) { ?> additional_javascripts as $uri) { ?> + + ID; + + $categories = wp_get_post_categories($post_id_to_use); if (is_array($categories)) { foreach ($this->category_tree as $node) { if (in_array(end(explode("/", $node)), $categories)) {