Plugin Directory

Changeset 167851


Ignore:
Timestamp:
10/28/2009 01:07:34 AM (16 years ago)
Author:
aaron_guitar
Message:
  • Initial creation of Colorbox style
  • Fixed bug where some photos were repeated in the Lighbox
Location:
fotobook/trunk
Files:
23 added
4 edited

Legend:

Unmodified
Added
Removed
  • fotobook/trunk/fotobook.php

    r167834 r167851  
    77Author: Aaron Harp
    88Author URI: http://www.aaronharp.com/
    9 Version: 3.1.7
     9Version: 3.2
    1010*/
    1111
     
    3434define('FB_POSTS_TABLE', $table_prefix.'posts');
    3535define('FB_PLUGIN_PATH', ABSPATH.'/wp-content/plugins/fotobook/');
    36 define('FB_PLUGIN_URL', get_option('siteurl').'/wp-content/plugins/fotobook/');
    37 define('FB_STYLE_URL',  FB_PLUGIN_URL.'styles/'.get_option('fb_style').'/');
    38 define('FB_STYLE_PATH', FB_PLUGIN_PATH.'styles/'.get_option('fb_style').'/');
    39 define('FB_MANAGE_URL', (get_bloginfo('version') >= 2.7 ? 'media-new.php' : 'edit.php') .'?page=fotobook/manage-fotobook.php');
     36define('FB_PLUGIN_URL', get_option('siteurl').'/wp-content/plugins/fotobook/');
     37define('FB_STYLE_URL', FB_PLUGIN_URL.'styles/'.get_option('fb_style').'/');
     38define('FB_STYLE_PATH', FB_PLUGIN_PATH.'styles/'.get_option('fb_style').'/');
     39define('FB_MANAGE_URL', (get_bloginfo('version') >= 2.7 ? 'media-new.php' : 'edit.php') .'?page=fotobook/manage-fotobook.php');
    4040define('FB_OPTIONS_URL', 'options-general.php?page=fotobook/options-fotobook.php');
    41 define('FB_WEBSITE',        'http://www.aaronharp.com/dev/wp-fotobook/');
    42 define('FB_VERSION',         3.17);
    43 define('FB_DONATE',         'https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=aaron%40freshwebs%2enet&item_name=Fotobook%20Donation&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8');
     41define('FB_WEBSITE', 'http://www.aaronharp.com/dev/wp-fotobook/');
     42define('FB_VERSION', 3.2);
     43define('FB_DONATE', 'https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=aaron%40freshwebs%2enet&item_name=Fotobook%20Donation&no_shipping=0&no_note=1&tax=0&currency_code=USD&lc=US&bn=PP%2dDonationsBF&charset=UTF%2d8');
    4444
    4545// facebook configuration variables
     
    8484   
    8585    function FacebookAPI() {
    86         include_once('facebook-platform/facebook.php');
     86        if(!class_exists('Facebook'))
     87            include_once('facebook-platform/facebook.php');
    8788       
    8889        $this->facebook  = new Facebook(FB_API_KEY, FB_API_SECRET, null, true);
     
    831832                        WHERE ".FB_PHOTO_TABLE.".aid = ".FB_ALBUM_TABLE.".aid AND ".FB_ALBUM_TABLE.".hidden = 0
    832833                        ORDER BY ".FB_PHOTO_TABLE.".created DESC LIMIT ".$count;
    833     $photos = $wpdb->get_results($query, ARRAY_A); 
     834    $photos = $wpdb->get_results($query, ARRAY_A);
    834835    for($i = 0; $i < count($photos); $i++) {
    835836        $photos[$i]['link'] = fb_get_photo_link($photos[$i]);
     
    852853    switch (get_option('fb_style')) {
    853854        case 'lightbox':
     855        case 'colorbox':
    854856            $page_link .= strstr($page_link, '?') ? '&' : '?';
    855857            $page_link .= 'album_p='.$album_p;
     
    10591061    // buttons in lightbox will display these images as well
    10601062    $hidden_top = ''; $hidden_bottom = '';
    1061     for($i = 1; $i <= $first_photo; $i++) {
    1062         $hidden_top .= "<a href=\"{$photos[$i]['src_big']}\" rel=\"lightbox[fotobook]\" title=\"{$photos[$i]['caption']}\"></a>";
     1063    for($i = 1; $i < $first_photo; $i++) {
     1064        $hidden_top .= "<a href=\"{$photos[$i]['src_big']}\" rel=\"fotobook\" title=\"{$photos[$i]['caption']}\"></a>";
    10631065    }
    10641066    for($i = $last_photo+1; $i <= $photo_count; $i++) {
    1065         $hidden_bottom .= "<a href=\"{$photos[$i]['src_big']}\" rel=\"lightbox[fotobook]\" title=\"{$photos[$i]['caption']}\"></a>";
     1067        $hidden_bottom .= "<a href=\"{$photos[$i]['src_big']}\" rel=\"fotobook\" title=\"{$photos[$i]['caption']}\"></a>";
    10661068    }
    10671069   
     
    11741176}
    11751177
    1176 function fb_head() {
     1178function fb_display_scripts() {
     1179    if(defined('WP_ADMIN'))
     1180        return;
     1181    if(get_option('fb_style') == 'colorbox') {
     1182        wp_enqueue_script('jquery');
     1183        wp_enqueue_script('jquery-colorbox', FB_STYLE_URL . 'js/colorbox.js', array('jquery'));
     1184        wp_enqueue_script('fotobook-style', FB_STYLE_URL . 'js/init.js', array('jquery'));
     1185    }
     1186    if(is_active_widget('fb_photos_widget')) {
     1187        wp_enqueue_script('fotobook-widget', FB_PLUGIN_URL.'js/widget.js');
     1188    }
     1189}
     1190
     1191function fb_display_styles() {
    11771192    $post = $GLOBALS['post'];
    11781193    $albums_page = get_option('fb_albums_page');
     
    11821197    if(is_active_widget('fb_photos_widget')) {
    11831198        echo '<link rel="stylesheet" href="'.FB_PLUGIN_URL.'styles/sidebar-style.css" type="text/css" media="screen" charset="utf-8" />'."\r\n";
    1184         echo '<script type="text/javascript" src="'.FB_PLUGIN_URL.'js/widget.js"></script>';
    11851199    }
    11861200}
     
    14821496add_filter('the_content', 'fb_display');
    14831497add_action('widgets_init', 'fb_widget_init');
    1484 add_action('wp_head', 'fb_head');
     1498add_action('init', 'fb_display_scripts');
     1499add_action('wp_head', 'fb_display_styles');
    14851500add_action('wp_ajax_fotobook', 'fb_ajax_handler');
    14861501
  • fotobook/trunk/js/admin.js

    r167834 r167851  
    1616        // submit apply permissions form when Thickbox closes
    1717        $j('#grant-permissions').click(function() {
    18             setTimeout(function() {
     18            $j(this).css('opacity', 0.5).css('cursor', 'pointer');
     19            setTimeout(function() {
    1920                $j('#TB_window').unload(function() {
    2021                    $j('#apply-permissions').submit();
  • fotobook/trunk/options-fotobook.php

    r167834 r167851  
    7878
    7979// get options to fill in input fields
    80 $fb_session              = get_option('fb_facebook_session');
    81 $fb_albums_page      = get_option('fb_albums_page');
    82 $fb_number_rows      = get_option('fb_number_rows');
    83 $fb_number_cols      = get_option('fb_number_cols');
    84 $fb_album_cmts          = get_option('fb_album_cmts');
    85 $fb_thumb_size          = get_option('fb_thumb_size');
     80$fb_session        = get_option('fb_facebook_session');
     81$fb_albums_page    = get_option('fb_albums_page');
     82$fb_number_rows    = get_option('fb_number_rows');
     83$fb_number_cols    = get_option('fb_number_cols');
     84$fb_album_cmts      = get_option('fb_album_cmts');
     85$fb_thumb_size      = get_option('fb_thumb_size');
    8686$fb_albums_per_page = get_option('fb_albums_per_page');
    87 $fb_style                    = get_option('fb_style');
    88 $fb_embedded_width  = get_option('fb_embedded_width');
    89 $fb_hide_pages          = get_option('fb_hide_pages');
    90 
    91 ?>                       
     87$fb_style          = get_option('fb_style');
     88$fb_embedded_width  = get_option('fb_embedded_width');
     89$fb_hide_pages      = get_option('fb_hide_pages');
     90
     91?>
    9292
    9393<style type="text/css">
  • fotobook/trunk/readme.txt

    r167815 r167851  
    8383
    8484* PHP 4 is now longer supported
     85* Added a new Colorbox style which which works out of the box
     86* Fixed bug where the first photo would show twice in the Lightbox
    8587* Thickbox is used for account activation to make things less confusing
    8688* Upgraded to latest version of the Facebook PHP Client (which kills support for PHP4)
     89* Fotobook plays better with other plugins using the Facebook API
    8790
    8891= 3.1.7 =
Note: See TracChangeset for help on using the changeset viewer.