WP Photo Album Plus - Version 7.2.11.004

Version Description

= 7.2.11 =

  • This version addresses various bug fixes and feature requests.

= 7.2.10 =

  • This version addresses various bug fixes and feature requests.

= 7.2.09 =

  • This version addresses various bug fixes and feature requests.

= 7.2.08 =

  • This version addresses various bug fixes.

= 7.2.07 =

  • This version addresses various bug fixes.

= 7.2.06 =

  • This version addresses various bug fixes and feature requests.
  • This version addresses various security issues.

= 7.2.05 =

  • This version addresses various bug fixes and feature requests.
  • This version addresses various security issues.

= 7.2.04 =

  • This version addresses various bug fixes and feature requests.

= 7.2.03 =

  • This version addresses various bug fixes and feature requests.

= 7.2.02 =

  • This version addresses various bug fixes and feature requests.

= 7.2.01 =

  • This version addresses various bug fixes and feature requests.

= 7.2.00 =

  • This version addresses various bug fixes and feature requests.

= 7.1.11 =

  • This version addresses various bug fixes and feature requests.

= 7.1.10 =

  • This version addresses various bug fixes and feature requests.

= 7.1.09 =

  • This version addresses various bug fixes and feature requests.

= 7.1.08 =

  • This version addresses various bug fixes and feature requests.

= 7.1.07 =

  • This version addresses various bug fixes and feature requests.

= 7.1.06 =

  • This version addresses various bug fixes and feature requests.

= 7.1.05 =

  • This version addresses various security issues.
  • This version addresses various bug fixes.

= 7.1.04 =

  • This version addresses various bug fixes.

= 7.1.03 =

  • This version addresses various security issues.
  • This version addresses various bug fixes.

= 7.1.02 =

  • This version addresses various security issues.
  • This version addresses various bug fixes and feature requests.

= 7.1.01 =

  • This version addresses various bug fixes and feature requests.

= 7.1.00 =

  • This version addresses various bug fixes and feature requests.
  • The Photo Album -> Upload Photos and Import Photos admin pages have been substantially improved. Read the changelog for details.

= 7.0.11 =

  • This version addresses various bug fixes and feature requests.

= 7.0.11 =

  • This version addresses various bug fixes

= 7.0.10 =

  • This version addresses various bug fixes

= 7.0.09 =

  • This version addresses various security issues.
  • This version addresses various bug fixes and feature requests.

= 7.0.08 =

  • This version addresses various security issues.
  • This version addresses various bug fixes

= 7.0.07 =

  • This version addresses various security issues.
  • This version addresses various bug fixes

= 7.0.06 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.05 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 7.0.04 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.03 =

  • This version addresses various minor bug fixes and feature requests.

= 7.0.02 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 7.0.01 =

  • This version addresses various minor bug fixes and feature requests.

= 7.0.00 =

  • Shortcode generators for Gutenberg added.
  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.
  • To prevent spamming and give the users the opportunity to decide when they want us to email them, the mailing system has been revised. Configure Table IX-M to enable various mailing lists, and use the WPPA+ Notify widget for full user flexibility.

= 6.9.21 =

  • This version addresses various bug fixes
  • This version addresses various security issues.

= 6.9.20 =

  • This version addresses various bug fixes

= 6.9.19 =

  • This version addresses various minor bug fixes

= 6.9.18 =

  • This version addresses various minor bug fixes

= 6.9.17 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.16 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.15 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.14 =

  • This version addresses various minor bug fixes and feature requests.
  • This version addresses various security issues.

= 6.9.13 =

  • Security release.

= 6.9.12 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.11 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.10 =

  • This version addresses various minor bug fixes and performance improvements.

= 6.9.09 =

  • Panorama support phase III.

= 6.9.08 =

  • This version addresses various minor bug fixes and feature requests.
  • Panorama support phase II.

= 6.9.07 =

  • This version addresses various minor bug fixes and feature requests.
  • Panorama support phase I.

= 6.9.06 =

  • This version addresses various minor bug fixes and feature requests.

= 6.9.05 =

  • This version addresses various minor bug fixes and feature requests.

= 6.9.04 =

  • This version addresses various minor bug fixes and feature requests.
  • Local CDN functionality has been added.

= 6.9.03 =

  • This version addresses various minor bug fixes and feature requests.

= 6.9.02 =

  • This version addresses various minor bug fixes and feature requests.

= 6.9.01 =

  • This version addresses various minor bug fixes and feature requests.

= 6.9.00 =

  • This version includes the code for the privacy policy requirements.

= 6.8.09

  • This version addresses various bug fixes and code edits.

= 6.8.08 =

  • This version addresses various minor bug fixes and feature requests.
  • This version offers substantial performance improvements when the box in Table IV-A13: Defer Javascript is ticked. This setting is now recommended and set ticked as the default.
  • For more info on performance improvements and compatibility with optimizers: see the changelog.txt

= 6.8.07 =

  • This version addresses various minor bug fixes and enhancements, and a new widget: Statistics.

= 6.8.06 =

  • This version addresses various minor bug fixes and improved cache handling.

= 6.8.05 =

  • This version addresses various minor bug fixes and feture requests.

= 6.8.04 =

  • This version addresses various display issues and a few fixes of bugs that seldom affected the plugins behaviour.
Download this release

Release Info

Developer opajaap
Plugin Icon wp plugin WP Photo Album Plus
Version 7.2.11.004
Comparing to
See all releases

Code changes from version 7.2.11.002 to 7.2.11.004

changelog.txt CHANGED
@@ -3,6 +3,10 @@ WP Photo Album Plus Changelog
3
  = 7.2.11 =
4
 
5
  * Fixed a few missing values in adding new rows to db tables to fix issues with certain sql implementations.
 
 
 
 
6
 
7
  = 7.2.10 =
8
 
3
  = 7.2.11 =
4
 
5
  * Fixed a few missing values in adding new rows to db tables to fix issues with certain sql implementations.
6
+ * Improved lay-out of commentform, especially for mobile devices.
7
+ * Ratings are now saved with the displayname as opposed to login name,
8
+ to make sure that rating needs comment and comment needs rating will work in all situations.
9
+ * New shortcode attributes for type="calendar" calendar="real...: year="2013" month="10" for starting at october 2013.
10
 
11
  = 7.2.10 =
12
 
readme.txt CHANGED
@@ -2,7 +2,7 @@
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
- Version: 7.2.11.002
6
  Stable tag: 7.2.10.013
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
@@ -137,6 +137,10 @@ See for the full changelog: <a href="http://www.wppa.nl/changelog/" >The documen
137
 
138
  == Upgrade Notice ==
139
 
 
 
 
 
140
  = 7.2.10 =
141
 
142
  * This version addresses various bug fixes and feature requests.
2
  Contributors: opajaap
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=OpaJaap@OpaJaap.nl&item_name=WP-Photo-Album-Plus&item_number=Support-Open-Source&currency_code=USD&lc=US
4
  Tags: photo, album, slideshow, video, audio, lightbox, iptc, exif, cloudinary, fotomoto, imagemagick, pdf
5
+ Version: 7.2.11.004
6
  Stable tag: 7.2.10.013
7
  Author: J.N. Breetvelt
8
  Author URI: http://www.opajaap.nl/
137
 
138
  == Upgrade Notice ==
139
 
140
+ = 7.2.11 =
141
+
142
+ * This version addresses various bug fixes and feature requests.
143
+
144
  = 7.2.10 =
145
 
146
  * This version addresses various bug fixes and feature requests.
wppa-ajax.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
- * Version 7.2.10
6
  *
7
  */
8
 
@@ -1003,7 +1003,7 @@ global $wppa_log_file;
1003
 
1004
  $myavgrat = '0'; // Init
1005
 
1006
- $user = wppa_get_user();
1007
 
1008
  // Rate own photo?
1009
  if ( wppa_get_photo_item( $photo, 'owner' ) == $user && ! wppa_switch( 'allow_owner_votes' ) ) {
@@ -1232,7 +1232,8 @@ global $wppa_log_file;
1232
 
1233
  // Compute rating_count and store in the photo info
1234
  $ratcount = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_rating
1235
- WHERE photo = %d", $photo ) );
 
1236
  if ( $ratcount !== false ) {
1237
  $iret = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos
1238
  SET rating_count = %d WHERE id = %d", $ratcount, $photo ) );
2
  /* wppa-ajax.php
3
  *
4
  * Functions used in ajax requests
5
+ * Version 7.2.11
6
  *
7
  */
8
 
1003
 
1004
  $myavgrat = '0'; // Init
1005
 
1006
+ $user = wppa_get_user( 'display' );
1007
 
1008
  // Rate own photo?
1009
  if ( wppa_get_photo_item( $photo, 'owner' ) == $user && ! wppa_switch( 'allow_owner_votes' ) ) {
1232
 
1233
  // Compute rating_count and store in the photo info
1234
  $ratcount = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_rating
1235
+ WHERE photo = %d
1236
+ AND status = 'publish'", $photo ) );
1237
  if ( $ratcount !== false ) {
1238
  $iret = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos
1239
  SET rating_count = %d WHERE id = %d", $ratcount, $photo ) );
wppa-boxes-html.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
- * Version 7.2.10
7
  *
8
  */
9
 
@@ -3533,7 +3533,6 @@ $result .= '<input' .
3533
  // Build the html for the comment box
3534
  function wppa_comment_html( $id, $comment_allowed ) {
3535
  global $wpdb;
3536
- //global $wppa_first_comment_html;
3537
 
3538
  $result = '';
3539
  if ( wppa_in_widget() ) return $result; // NOT in a widget
@@ -3541,6 +3540,12 @@ global $wpdb;
3541
  // Find out who we are either logged in or not
3542
  $vis = is_user_logged_in() ? 'display:none; ' : '';
3543
 
 
 
 
 
 
 
3544
  // Find user
3545
  if ( wppa_get_post( 'comname' ) ) wppa( 'comment_user', wppa_get_post( 'comname' ) );
3546
  if ( wppa_get_post( 'comemail' ) ) wppa( 'comment_email', wppa_get_post( 'comemail' ) );
@@ -3566,63 +3571,62 @@ global $wpdb;
3566
  $color = 'darkgrey';
3567
  if ( wppa_opt( 'fontcolor_box' ) ) $color = wppa_opt( 'fontcolor_box' );
3568
  if ( $comments && ( is_user_logged_in() || ! wppa_switch( 'comment_view_login' ) ) ) {
3569
- $result .= '
3570
- <div' .
3571
- ' id="wppa-comtable-wrap-'.wppa( 'mocc' ).'"' .
3572
- ' style="display:none;"' .
3573
- '>' .
3574
- '<table' .
3575
- ' id="wppacommentstable-' . wppa( 'mocc' ) . '"' .
3576
- ' class="wppa-comment-form"' .
3577
- ' style="margin:0; "' .
3578
- '>' .
3579
- '<tbody>';
3580
-
3581
- foreach( $comments as $comment ) {
3582
-
3583
- // Show a comment either when it is approved, or it is pending and mine or i am a moderator
3584
- if ( $comment['status'] == 'approved' ||
3585
- current_user_can( 'wppa_moderate' ) ||
3586
- current_user_can( 'wppa_comments' ) ||
3587
- ( ( $comment['status'] == 'pending' || $comment['status'] == 'spam' ) &&
3588
- stripslashes( $comment['user'] ) == wppa( 'comment_user' )
3589
- )
3590
- ) {
3591
- $n_comments++;
3592
- $result .= '
3593
- <tr' .
3594
- ' class="wppa-comment-'.$comment['id'].'"' .
3595
- ' valign="top"' .
3596
- ' style="border-bottom:0 none; border-top:0 none; border-left: 0 none; border-right: 0 none; "' .
3597
- ' >' .
3598
- '<td' .
3599
- ' valign="top"' .
3600
- ' class="wppa-box-text wppa-td"' .
3601
- ' style="vertical-align:top; width:30%; border-width: 0 0 0 0; '.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'"' .
3602
- ' >' .
3603
- ( wppa_switch( 'domain_link_buddypress' ) ? wppa_bp_userlink( $comment['email'], false, true ) : esc_js( $comment['user'] ) ) .
3604
- ' ' . __( 'wrote:', 'wp-photo-album-plus' ) .
3605
- '<br />' .
3606
- '<span style="font-size:9px; ">' .
3607
- wppa_get_time_since( $comment['timestamp'] ) .
3608
- '</span>';
3609
-
3610
- // Avatar ?
3611
- if ( wppa_opt( 'comment_gravatar' ) != 'none' ) {
3612
-
3613
- // Find the default
3614
- if ( wppa_opt( 'comment_gravatar' ) != 'url' ) {
3615
- $default = wppa_opt( 'comment_gravatar' );
3616
- }
3617
- else {
3618
- $default = wppa_opt( 'comment_gravatar_url' );
3619
- }
3620
 
3621
- // Find the avatar, init
3622
- $avt = false;
3623
- $usr = false;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3624
 
3625
- // if ( is_user_logged_in() ) {
 
 
3626
 
3627
  // First try to find the user by email address ( works only if email required on comments )
3628
  if ( $comment['email'] ) {
@@ -3654,102 +3658,142 @@ global $wpdb;
3654
  $avt = str_replace( "'", "\"", get_avatar( $usr->ID, wppa_opt( 'gravatar_size' ), $default ) );
3655
  }
3656
  }
3657
- // }
3658
-
3659
- // Global avatars off ? try myself
3660
- if ( ! $avt ) {
3661
- $avt = '
3662
- <img' .
3663
- ' class="wppa-box-text wppa-td"' .
3664
- ' src="http' . ( is_ssl() ? 's' : '' ) . '://www.gravatar.com/avatar/' .
3665
- wppa_get_unique_crypt() .
3666
- // md5( strtolower( trim( $comment['email'] ) ) ) .
3667
- '.jpg?d='.urlencode( $default ) . '&s=' . wppa_opt( 'gravatar_size' ) . '"' .
3668
- ' alt="' . __( 'Avatar', 'wp-photo-album-plus' ) . '"' .
3669
- ' />';
3670
- }
3671
-
3672
- // Compose the html
3673
- $result .= '
3674
- <div class="com_avatar">' .
3675
- $avt .
3676
- '</div>';
3677
- }
3678
- $result .=
3679
- '</td>';
3680
 
3681
- $txtwidth = floor( wppa_get_container_width() * 0.7 ).'px';
3682
- $result .=
3683
- '<td' .
3684
- ' class="wppa-box-text wppa-td"' .
3685
- ' style="width:70%; word-wrap:break-word; border-width: 0 0 0 0;'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'"' .
3686
- ' >'.
3687
- '<p' .
3688
- ' class="wppa-comment-textarea wppa-comment-textarea-'.wppa( 'mocc' ).'"' .
3689
- ' style="' .
3690
- 'margin:0;' .
3691
- 'background-color:transparent;' .
3692
- 'width:' . $txtwidth . ';' .
3693
- 'max-height:90px;' .
3694
- 'overflow:auto;' .
3695
- 'word-wrap:break-word;' .
3696
- wppa_wcs( 'wppa-box-text' ) .
3697
- wppa_wcs( 'wppa-td' ) .
3698
- '"' .
3699
- ' >';
3700
 
3701
- $c = $comment['comment'];
3702
- $c = wppa_convert_smilies( $c );
3703
- $c = stripslashes( $c );
3704
- $c = esc_js( $c );
3705
- $c = html_entity_decode( $c );
3706
- if ( wppa_switch( 'comment_clickable' ) ) {
3707
- $c = make_clickable( $c );
3708
  }
3709
- $result .= $c;
 
3710
 
3711
- if ( $comment['status'] != 'approved' && ( current_user_can( 'wppa_moderate' ) || current_user_can( 'wppa_comments' ) ) ) {
3712
- if ( wppa( 'no_esc' ) ) {
3713
- $result .= wppa_moderate_links( 'comment', $id, $comment['id'] );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3714
  }
3715
- else {
3716
- $result .= wppa_html( esc_js( wppa_moderate_links( 'comment', $id, $comment['id'] ) ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
3717
  }
3718
- }
3719
- elseif ( $comment['status'] == 'pending' && stripslashes( $comment['user'] ) == wppa( 'comment_user' ) ) {
3720
-
3721
- if ( wppa( 'comneedsvote' ) && ! current_user_can( 'wppa_moderate' ) ) {
3722
- $result .=
3723
- '<br /><span style="color:red;" >' .
3724
- htmlentities( __( "Please also give the photo a rating. Your comment will be discarded if you do not. After rating, you can refresh the page or press the Update button to get your comment approved." , 'wp-photo-album-plus' ) ) .
3725
- '</span>';
 
 
 
 
 
 
 
 
 
 
 
3726
  }
3727
- else {
3728
- $result .=
3729
- '<br /><span style="color:red; font-size:9px;" >' .
3730
- __( 'Awaiting moderation', 'wp-photo-album-plus' ) .
3731
- '</span>';
3732
  }
3733
- }
3734
- elseif ( $comment['status'] == 'spam' && stripslashes( $comment['user'] ) == wppa( 'comment_user' ) ) {
3735
- $result .= '<br /><span style="color:red; font-size:9px;" >'.__( 'Marked as spam', 'wp-photo-album-plus' ).'</span>';
3736
- }
3737
 
3738
- $result .=
3739
- '</p>' .
3740
- '</td>' .
3741
- '</tr>' .
3742
- '<tr class="wppa-comment-' . $comment['id'] . '">' .
3743
- '<td colspan="2" style="padding:0">' .
3744
- '<hr style="background-color:' . $color . '; margin:0;" />' .
3745
- '</td>' .
3746
- '</tr>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3747
  }
3748
- }
3749
- $result .=
3750
- '</tbody>' .
3751
- '</table>' .
3752
- '</div>';
3753
  }
3754
 
3755
  // See if we are currently in the process of adding/editing this comment
@@ -3785,131 +3829,357 @@ global $wpdb;
3785
 
3786
  $returnurl .= 'wppa-photo='.$id;
3787
 
3788
- // The comment form
3789
  if ( $comment_allowed ) {
 
3790
  $result .=
3791
  '<div' .
3792
- ' id="wppa-comform-wrap-' . wppa( 'mocc' ) . '"' .
3793
  ' style="display:none;"' .
3794
  ' >' .
 
 
3795
  '<form' .
3796
- ' id="wppa-commentform-' . wppa( 'mocc' ) . '"' .
3797
  ' class="wppa-comment-form"' .
3798
  ' action="' . $returnurl . '"' .
3799
  ' method="post"' .
3800
- ' onsubmit="return wppaValidateComment( ' . wppa( 'mocc' ) . ' )"' .
3801
  ' >' .
3802
- wp_nonce_field( 'wppa-nonce-' . wppa( 'mocc' ) , 'wppa-nonce-' . wppa( 'mocc' ), false, false ) .
 
 
3803
  ( $album ? '<input type="hidden" name="wppa-album" value="' . $album . '" />' : '' ) .
3804
  ( $cover ? '<input type="hidden" name="wppa-cover" value="' . $cover . '" />' : '' ) .
3805
  ( $slide ? '<input type="hidden" name="wppa-slide" value="' . $slide . '" />' : '' ) .
3806
  '<input' .
3807
  ' type="hidden"' .
3808
  ' name="wppa-returnurl"' .
3809
- ' id="wppa-returnurl-' . wppa( 'mocc' ) . '"' .
3810
  ' value="' . $returnurl . '"' .
3811
  ' />' .
3812
  ( $is_current ? '<input' .
3813
  ' type="hidden"' .
3814
- ' id="wppa-comment-edit-' . wppa( 'mocc' ) . '"' .
3815
  ' name="wppa-comment-edit"' .
3816
  ' value="' . wppa( 'comment_id' ) . '"' .
3817
  ' />' : '' ) .
3818
  '<input type="hidden" name="wppa-occur" value="'.wppa( 'occur' ).'" />' .
3819
 
3820
- '<table id="wppacommenttable-'.wppa( 'mocc' ).'" style="margin:0;">' .
3821
- '<tbody>' .
3822
- '<tr valign="top" style="' . $vis . '">' .
3823
- '<td class="wppa-box-text wppa-td" style="width:30%;background-color:transparent;'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'" >' .
3824
- __( 'Your name:', 'wp-photo-album-plus' ) .
3825
- '</td>' .
3826
- '<td class="wppa-box-text wppa-td" style="width:70%;background-color:transparent;'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'" >' .
3827
- '<input' .
3828
- ' type="text"' .
3829
- ' name="wppa-comname"' .
3830
- ' id="wppa-comname-' . wppa( 'mocc' ) . '"' .
3831
- ' style="width:100%; " value="' . esc_js( wppa( 'comment_user' ) ) . '"' .
3832
- ' />' .
3833
- '</td>' .
3834
- '</tr>';
3835
 
3836
- if ( wppa_opt( 'comment_email_required' ) != 'none' ) {
3837
- $result .= '<tr valign="top" style="'.$vis.'">' .
3838
- '<td class="wppa-box-text wppa-td" style="width:30%;background-color:transparent;'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'" >' .
3839
- __( 'Your email:', 'wp-photo-album-plus' ) .
3840
- '</td>' .
3841
- '<td class="wppa-box-text wppa-td" style="width:70%;background-color:transparent;'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'" >' .
3842
- '<input' .
3843
- ' type="text"' .
3844
- ' name="wppa-comemail"' .
3845
- ' id="wppa-comemail-' . wppa( 'mocc' ) . '"' .
3846
- ' style="width:100%;"' .
3847
- ' value="' . wppa( 'comment_email' ) . '"' .
3848
- ' />' .
3849
- '</td>' .
3850
- '</tr>';
3851
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3852
 
3853
- $result .= '<tr valign="top" style="vertical-align:top;">' .
3854
- '<td valign="top" class="wppa-box-text wppa-td" style="vertical-align:top; width:30%;background-color:transparent;'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'" >' .
3855
- __( 'Your comment:', 'wp-photo-album-plus' ) . '<br />' . esc_js( wppa( 'comment_user' ) ) . '<br />';
3856
- if ( ( is_user_logged_in() && wppa_opt( 'comment_captcha' ) == 'all' ) ||
3857
- ( ! is_user_logged_in() && wppa_opt( 'comment_captcha' ) != 'none' ) ) {
3858
- $wid = '20%';
3859
- if ( wppa_opt( 'fontsize_box' ) ) $wid = ( wppa_opt( 'fontsize_box' ) * 1.5 ).'px';
3860
- $captkey = $id;
3861
- if ( $is_current ) {
3862
- $captkey = $wpdb->get_var( $wpdb->prepare( "SELECT timestamp FROM $wpdb->wppa_comments
3863
- WHERE id = %d", wppa( 'comment_id' ) ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3864
  }
3865
- $result .=
3866
- wppa_make_captcha( $captkey ) .
3867
- '<input' .
3868
- ' type="text"' .
3869
- ' id="wppa-captcha-' . wppa( 'mocc' ) . '"' .
3870
- ' name="wppa-captcha"' .
3871
- ' style="width:' . $wid . ';' . wppa_wcs( 'wppa-box-text' ) . wppa_wcs( 'wppa-td' ) . '"' .
3872
- ' />&nbsp;';
3873
- }
3874
 
3875
- $result .=
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3876
  '<input type="button" name="commentbtn" onclick="wppaAjaxComment( '.wppa( 'mocc' ).', /'.wppa_encrypt_photo($id).'/ )" value="'.$btn.'" style="margin:0 4px 0 0;" />' .
3877
- '<img id="wppa-comment-spin-'.wppa( 'mocc' ).'" src="'.wppa_get_imgdir().'spinner.gif" style="display:none;" />' .
3878
- '</td>' .
 
 
 
 
 
 
 
 
 
 
3879
  '<td valign="top" class="wppa-box-text wppa-td" style="vertical-align:top; width:70%;background-color:transparent;'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'" >';
3880
 
3881
  if ( wppa_switch( 'comment_smiley_picker' ) ) {
3882
- $result .= wppa_get_smiley_picker_html( 'wppa-comment-'.wppa( 'mocc' ) );
3883
  }
3884
 
3885
  $result .=
3886
- '<textarea' .
3887
- ' name="wppa-comment"' .
3888
- ' id="wppa-comment-' . wppa( 'mocc' ) . '"' .
3889
- ' style="height:60px; width:98%; "' .
3890
- '>' .
3891
- esc_textarea( stripslashes( $txt ) ) .
3892
- '</textarea>' .
3893
  '</td>' .
3894
  '</tr>' .
3895
- '<tr>' .
 
 
3896
  '<td>' .
3897
- '</td>' .
 
 
3898
  '<td>' .
3899
  ( wppa_switch( 'comment_need_db_agree' ) ?
3900
- '<input type="checkbox" id="db-agree-' . wppa( 'mocc' ) . '" name="db-agree" style="float:left;" >' .
3901
- ' ' .
3902
- '<label for="db-agree-' . wppa( 'mocc' ) . '" style="float:left;" >' .
3903
- '&nbsp;' .
3904
- sprintf( __( 'I agree that the information above will be stored in a database along with my %s', 'wp-photo-album-plus' ),
3905
- is_user_logged_in() ? __( 'login name', 'wp-photo-album-plus' ) : __( 'ip address', 'wp-photo-album-plus' ) ) .
3906
- '</label>' : '' ) .
3907
  '</td>' .
3908
- '</tr>' .
3909
- '</tbody>' .
3910
- '</table>' .
3911
- '</form>' .
3912
- '</div>';
 
 
 
 
 
 
 
3913
  }
3914
  else {
3915
  if ( wppa_switch( 'login_links' ) ) {
@@ -4950,8 +5220,12 @@ function wppa_real_calendar_box() {
4950
  // The calendar container
4951
  wppa_container( 'open' );
4952
 
4953
- $year = wppa_get_get( 'calendar-year' );//0;
4954
- $month = wppa_get_get( 'calendar-month' );//0;
 
 
 
 
4955
 
4956
  wppa_out( '<div' .
4957
  ' id="wppa-calendar-' . wppa( 'mocc' ) . '"' .
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various wppa boxes
6
+ * Version 7.2.11
7
  *
8
  */
9
 
3533
  // Build the html for the comment box
3534
  function wppa_comment_html( $id, $comment_allowed ) {
3535
  global $wpdb;
 
3536
 
3537
  $result = '';
3538
  if ( wppa_in_widget() ) return $result; // NOT in a widget
3540
  // Find out who we are either logged in or not
3541
  $vis = is_user_logged_in() ? 'display:none; ' : '';
3542
 
3543
+ // Mobile?
3544
+ $mob = wppa_is_mobile();
3545
+
3546
+ // Occurrance
3547
+ $mocc = wppa( 'mocc' );
3548
+
3549
  // Find user
3550
  if ( wppa_get_post( 'comname' ) ) wppa( 'comment_user', wppa_get_post( 'comname' ) );
3551
  if ( wppa_get_post( 'comemail' ) ) wppa( 'comment_email', wppa_get_post( 'comemail' ) );
3571
  $color = 'darkgrey';
3572
  if ( wppa_opt( 'fontcolor_box' ) ) $color = wppa_opt( 'fontcolor_box' );
3573
  if ( $comments && ( is_user_logged_in() || ! wppa_switch( 'comment_view_login' ) ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3574
 
3575
+ // Open the existing comments wrapper / table / tbody
3576
+ $result .= '
3577
+ <div
3578
+ id="wppa-comtable-wrap-'.$mocc.'"
3579
+ style="display:none;"
3580
+ >
3581
+ <table
3582
+ id="wppacommentstable-' . $mocc . '"
3583
+ class="wppa-comment-form"
3584
+ style="margin:0; "
3585
+ >
3586
+ <tbody>';
3587
+
3588
+ // Process the exising comments
3589
+ foreach( $comments as $comment ) {
3590
+
3591
+ // Show a comment either when it is approved, or it is pending and mine or i am a moderator
3592
+ if ( $comment['status'] == 'approved' ||
3593
+ current_user_can( 'wppa_moderate' ) ||
3594
+ current_user_can( 'wppa_comments' ) ||
3595
+ ( ( $comment['status'] == 'pending' || $comment['status'] == 'spam' ) &&
3596
+ stripslashes( $comment['user'] ) == wppa( 'comment_user' )
3597
+ )
3598
+ ) {
3599
+
3600
+ // Inc counter
3601
+ $n_comments++;
3602
+
3603
+ // Prepare html
3604
+ $originatorblock = '
3605
+ <td
3606
+ valign="top"
3607
+ class="wppa-box-text wppa-td"
3608
+ style="vertical-align:top; width:30%; border-width: 0 0 0 0; '.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'"
3609
+ >' .
3610
+ ( wppa_switch( 'domain_link_buddypress' ) ? wppa_bp_userlink( $comment['email'], false, true ) : esc_js( $comment['user'] ) ) .
3611
+ ' ' . __( 'wrote', 'wp-photo-album-plus' ) . '
3612
+ <span style="font-size:9px; ">' .
3613
+ wppa_get_time_since( $comment['timestamp'] ) . '
3614
+ </span>';
3615
+
3616
+ // Avatar ?
3617
+ if ( wppa_opt( 'comment_gravatar' ) != 'none' ) {
3618
+
3619
+ // Find the default
3620
+ if ( wppa_opt( 'comment_gravatar' ) != 'url' ) {
3621
+ $default = wppa_opt( 'comment_gravatar' );
3622
+ }
3623
+ else {
3624
+ $default = wppa_opt( 'comment_gravatar_url' );
3625
+ }
3626
 
3627
+ // Find the avatar, init
3628
+ $avt = false;
3629
+ $usr = false;
3630
 
3631
  // First try to find the user by email address ( works only if email required on comments )
3632
  if ( $comment['email'] ) {
3658
  $avt = str_replace( "'", "\"", get_avatar( $usr->ID, wppa_opt( 'gravatar_size' ), $default ) );
3659
  }
3660
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3661
 
3662
+ // Global avatars off ? try myself
3663
+ if ( ! $avt ) {
3664
+ $avt = '
3665
+ <img' .
3666
+ ' class="avatar wppa-box-text wppa-td"' .
3667
+ ' src="http' . ( is_ssl() ? 's' : '' ) . '://www.gravatar.com/avatar/' .
3668
+ wppa_get_unique_crypt() .
3669
+ // md5( strtolower( trim( $comment['email'] ) ) ) .
3670
+ '.jpg?d='.urlencode( $default ) . '&s=' . wppa_opt( 'gravatar_size' ) . '"' .
3671
+ ' alt="' . __( 'Avatar', 'wp-photo-album-plus' ) . '"' .
3672
+ ' />';
3673
+ }
 
 
 
 
 
 
 
3674
 
3675
+ // Compose the html
3676
+ $originatorblock .= '
3677
+ <div
3678
+ class="com_avatar"
3679
+ style="float:left;margin-right:5px;" >' .
3680
+ $avt .
3681
+ '</div>';
3682
  }
3683
+ $originatorblock .= '
3684
+ </td>';
3685
 
3686
+ $commentblock = '
3687
+ <td
3688
+ class="wppa-box-text wppa-td"
3689
+ style="width:70%; word-wrap:break-word; border-width: 0 0 0 0;'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'"
3690
+ >';
3691
+ /*
3692
+ <p
3693
+ class="wppa-comment-textarea wppa-comment-textarea-'.$mocc.'"
3694
+ style="margin:0;background-color:transparent;width:' . ( $mob ? wppa_get_container_width() : round( wppa_get_container_width() * 0.7 ) ) . 'px;max-height:90px;overflow:auto;
3695
+ word-wrap:break-word;' . wppa_wcs( 'wppa-box-text' ) . wppa_wcs( 'wppa-td' ) . '"
3696
+ >';
3697
+ */
3698
+
3699
+ $c = $comment['comment'];
3700
+ $c = wppa_convert_smilies( $c );
3701
+ $c = stripslashes( $c );
3702
+ $c = esc_js( $c );
3703
+ $c = html_entity_decode( $c );
3704
+ if ( wppa_switch( 'comment_clickable' ) ) {
3705
+ $c = make_clickable( $c );
3706
  }
3707
+ $commentblock .= '
3708
+ <blockquote
3709
+ class="wppa-comment-bquote"
3710
+ style="background-color:#eeeeee;padding:5px 0;margin:5px 0 0;width:98%;"
3711
+ >' .
3712
+ $c . '
3713
+ </blockquote>';
3714
+
3715
+ if ( $comment['status'] != 'approved' && ( current_user_can( 'wppa_moderate' ) || current_user_can( 'wppa_comments' ) ) ) {
3716
+ if ( wppa( 'no_esc' ) ) {
3717
+ $commentblock .= wppa_moderate_links( 'comment', $id, $comment['id'] );
3718
+ }
3719
+ else {
3720
+ $commentblock .= wppa_html( esc_js( wppa_moderate_links( 'comment', $id, $comment['id'] ) ) );
3721
+ }
3722
  }
3723
+ elseif ( $comment['status'] == 'pending' && stripslashes( $comment['user'] ) == wppa( 'comment_user' ) ) {
3724
+
3725
+ if ( wppa( 'comneedsvote' ) && ! current_user_can( 'wppa_moderate' ) ) {
3726
+ $commentblock .=
3727
+ '<script>
3728
+ alert(\'' .
3729
+ esc_js( str_replace( '\'', ' ', __( "Please also give the photo a rating to get your comment published." , 'wp-photo-album-plus' ) ) ) .
3730
+ '\');
3731
+ </script>
3732
+ <span style="color:red;" >' .
3733
+ __( 'Not yet published', 'wp-photo-album-plus' ) .
3734
+ '</span>';
3735
+ }
3736
+ else {
3737
+ $commentblock .=
3738
+ '<span style="color:red;" >' .
3739
+ __( 'Awaiting moderation', 'wp-photo-album-plus' ) .
3740
+ '</span>';
3741
+ }
3742
  }
3743
+ elseif ( $comment['status'] == 'spam' && stripslashes( $comment['user'] ) == wppa( 'comment_user' ) ) {
3744
+ $commentblock .= '<br /><span style="color:red; font-size:9px;" >'.__( 'Marked as spam', 'wp-photo-album-plus' ).'</span>';
 
 
 
3745
  }
 
 
 
 
3746
 
3747
+ $commentblock .=
3748
+ // </p>
3749
+ '</td>';
3750
+
3751
+ // The actual addition to the html
3752
+ if ( $mob ) {
3753
+ $result .= '
3754
+ <tr
3755
+ class="wppa-comment-'.$comment['id'].'"
3756
+ valign="top"
3757
+ style="border:0 none;"
3758
+ >' .
3759
+ $originatorblock .
3760
+ '</tr>
3761
+ <tr class="wppa-comment-'.$comment['id'].'"
3762
+ valign="top"
3763
+ style="border:0 none;"
3764
+ >' .
3765
+ $commentblock .
3766
+ '</tr>
3767
+ <tr class="wppa-comment-' . $comment['id'] . '" >
3768
+ <td style="padding:0" >
3769
+ <hr style="background-color:' . $color . '; margin:0;" />
3770
+ </td>
3771
+ </tr>';
3772
+ }
3773
+ else {
3774
+ $result .= '
3775
+ <tr
3776
+ class="wppa-comment-'.$comment['id'].'"
3777
+ valign="top"
3778
+ style="border:0 none;"
3779
+ >' .
3780
+ $originatorblock .
3781
+ $commentblock .
3782
+ '</tr>
3783
+ <tr class="wppa-comment-' . $comment['id'] . '">
3784
+ <td colspan="2" style="padding:0">
3785
+ <hr style="background-color:' . $color . '; margin:0;" />
3786
+ </td>
3787
+ </tr>';
3788
+ }
3789
+
3790
+
3791
+ }
3792
  }
3793
+ $result .= '
3794
+ </tbody>
3795
+ </table>
3796
+ </div>';
 
3797
  }
3798
 
3799
  // See if we are currently in the process of adding/editing this comment
3829
 
3830
  $returnurl .= 'wppa-photo='.$id;
3831
 
3832
+ // Open the actual comment form
3833
  if ( $comment_allowed ) {
3834
+
3835
  $result .=
3836
  '<div' .
3837
+ ' id="wppa-comform-wrap-' . $mocc . '"' .
3838
  ' style="display:none;"' .
3839
  ' >' .
3840
+
3841
+ // The form
3842
  '<form' .
3843
+ ' id="wppa-commentform-' . $mocc . '"' .
3844
  ' class="wppa-comment-form"' .
3845
  ' action="' . $returnurl . '"' .
3846
  ' method="post"' .
3847
+ ' onsubmit="return wppaValidateComment( ' . $mocc . ' )"' .
3848
  ' >' .
3849
+
3850
+ // The hidden fields
3851
+ wp_nonce_field( 'wppa-nonce-' . $mocc , 'wppa-nonce-' . $mocc, false, false ) .
3852
  ( $album ? '<input type="hidden" name="wppa-album" value="' . $album . '" />' : '' ) .
3853
  ( $cover ? '<input type="hidden" name="wppa-cover" value="' . $cover . '" />' : '' ) .
3854
  ( $slide ? '<input type="hidden" name="wppa-slide" value="' . $slide . '" />' : '' ) .
3855
  '<input' .
3856
  ' type="hidden"' .
3857
  ' name="wppa-returnurl"' .
3858
+ ' id="wppa-returnurl-' . $mocc . '"' .
3859
  ' value="' . $returnurl . '"' .
3860
  ' />' .
3861
  ( $is_current ? '<input' .
3862
  ' type="hidden"' .
3863
+ ' id="wppa-comment-edit-' . $mocc . '"' .
3864
  ' name="wppa-comment-edit"' .
3865
  ' value="' . wppa( 'comment_id' ) . '"' .
3866
  ' />' : '' ) .
3867
  '<input type="hidden" name="wppa-occur" value="'.wppa( 'occur' ).'" />' .
3868
 
3869
+ // Table start
3870
+ '<table id="wppacommenttable-'.$mocc.'" style="margin:0;">' .
3871
+ '<tbody>';
 
 
 
 
 
 
 
 
 
 
 
 
3872
 
3873
+ // The commenters name label td
3874
+ $label_html = '
3875
+ <td
3876
+ class="wppa-box-text wppa-td"
3877
+ style="' . ( $mob ? '' : 'width:30%;' ) . 'background-color:transparent;' . wppa_wcs( 'wppa-box-text' ) . wppa_wcs( 'wppa-td' ) . '"
3878
+ >' .
3879
+ __( 'Your name:', 'wp-photo-album-plus' ) .
3880
+ '</td>';
3881
+
3882
+ // The commenters name input td
3883
+ $value_html = '
3884
+ <td
3885
+ class="wppa-box-text wppa-td"
3886
+ style="' . ( $mob ? '' : 'width:70%;' ) . 'background-color:transparent;' . wppa_wcs( 'wppa-box-text' ) . wppa_wcs( 'wppa-td' ) . '"
3887
+ >
3888
+ <input
3889
+ type="text"
3890
+ name="wppa-comname"
3891
+ id="wppa-comname-' . $mocc . '"
3892
+ style="width:98%;
3893
+ " value="' . esc_js( wppa( 'comment_user' ) ) . '"
3894
+ />
3895
+ </td>';
3896
+
3897
+ // Name
3898
+ if ( $mob ) {
3899
+ $result .= '
3900
+ <tr valign="top" style="' . $vis . '">' .
3901
+ $label_html . '
3902
+ </tr >
3903
+ <tr valign="top" style="' . $vis . '">' .
3904
+ $value_html . '
3905
+ </tr >';
3906
+ }
3907
+ else {
3908
+ $result .= '
3909
+ <tr valign="top" style="' . $vis . '">' .
3910
+ $label_html .
3911
+ $value_html . '
3912
+ </tr >';
3913
+ }
3914
+
3915
+ // The commenters email label td
3916
+ $label_html = '
3917
+ <td
3918
+ class="wppa-box-text wppa-td"
3919
+ style="width:30%;background-color:transparent;' . wppa_wcs( 'wppa-box-text' ) . wppa_wcs( 'wppa-td' ) . '"
3920
+ >' .
3921
+ __( 'Your email:', 'wp-photo-album-plus' ) .
3922
+ '</td>';
3923
+
3924
+ // The commenters email input td
3925
+ $value_html = '
3926
+ <td
3927
+ class="wppa-box-text wppa-td"
3928
+ style="width:70%;background-color:transparent;' . wppa_wcs( 'wppa-box-text' ) . wppa_wcs( 'wppa-td' ) . '"
3929
+ >
3930
+ <input
3931
+ type="text"
3932
+ name="wppa-comemail"
3933
+ id="wppa-comemail-' . $mocc . '"
3934
+ style="width:98%;"
3935
+ value="' . wppa( 'comment_email' ) . '"
3936
+ />
3937
+ </td>';
3938
+
3939
+ // Email
3940
+ if ( $mob ) {
3941
+ $result .= '
3942
+ <tr valign="top" style="' . $vis . '">' .
3943
+ $label_html . '
3944
+ </tr >
3945
+ <tr valign="top" style="' . $vis . '">' .
3946
+ $value_html . '
3947
+ </tr >';
3948
+ }
3949
+ else {
3950
+ $result .= '
3951
+ <tr valign="top" style="' . $vis . '">' .
3952
+ $label_html .
3953
+ $value_html . '
3954
+ </tr >';
3955
+ }
3956
+
3957
+ // The comment label
3958
+ $comment_label = __( 'Your comment:', 'wp-photo-album-plus' );
3959
+
3960
+ // The captch label
3961
+ $captcha_label = __( 'Calculate:', 'wp-photo-album-plus' );
3962
+
3963
+ // The captcha input
3964
+ $captkey = ( $is_current ?
3965
+ $wpdb->get_var( $wpdb->prepare( "SELECT timestamp FROM $wpdb->wppa_comments
3966
+ WHERE id = %d", wppa( 'comment_id' ) ) ) :
3967
+ $id );
3968
+
3969
+ $captcha_input =
3970
+ wppa_make_captcha( $captkey ) . '
3971
+ <input
3972
+ type="text"
3973
+ id="wppa-captcha-' . $mocc . '"
3974
+ name="wppa-captcha"
3975
+ style="width:30px;' . wppa_wcs( 'wppa-box-text' ) . wppa_wcs( 'wppa-td' ) . '"
3976
+ />';
3977
+
3978
+ // The Smilypicker
3979
+ $smily_html = wppa_get_smiley_picker_html( 'wppa-comment-'.$mocc );
3980
+
3981
+ // The comment input
3982
+ $comment_input = '
3983
+ <textarea
3984
+ name="wppa-comment"
3985
+ id="wppa-comment-' . $mocc . '"
3986
+ style="height:60px; width:98%; "
3987
+ >' .
3988
+ esc_textarea( stripslashes( $txt ) ) .
3989
+ '</textarea>';
3990
+
3991
+ // DB checkbox and message
3992
+ $dbconfirm_html = '
3993
+ <input
3994
+ type="checkbox"' .
3995
+ ( $is_current ? ' checked="checked"' : '' ) . '
3996
+ id="db-agree-' . $mocc . '"
3997
+ name="db-agree"
3998
+ style="float:left;"
3999
+ />
4000
+ <label
4001
+ for="db-agree-' . $mocc . '"
4002
+ style="float:left;"
4003
+ >
4004
+ &nbsp;' .
4005
+ sprintf( __( 'I agree that the information above will be stored in a database along with my %s', 'wp-photo-album-plus' ),
4006
+ is_user_logged_in() ? __( 'login name', 'wp-photo-album-plus' ) : __( 'ip address', 'wp-photo-album-plus' ) ) . '
4007
+ </label>';
4008
+
4009
+ // Go button
4010
+ $gobutton_html = '
4011
+ <input
4012
+ type="button"
4013
+ name="commentbtn"
4014
+ onclick="wppaAjaxComment(' . $mocc . ', /' . wppa_encrypt_photo( $id ) . '/ )"
4015
+ value="' . $btn . '"
4016
+ style="margin:0 4px 0 0;"
4017
+ />
4018
+ <img
4019
+ id="wppa-comment-spin-' . $mocc . '"
4020
+ src="' . wppa_get_imgdir() . 'spinner.gif"
4021
+ style="display:none;"
4022
+ />';
4023
+
4024
+ $need_captcha = ( is_user_logged_in() && wppa_opt( 'comment_captcha' ) == 'all' ) ||
4025
+ ( ! is_user_logged_in() && wppa_opt( 'comment_captcha' ) != 'none' );
4026
+ // Comment
4027
+ if ( $mob ) {
4028
+ $result .= '
4029
+ <tr>
4030
+ <td
4031
+ class="wppa-box-text wppa-td"
4032
+ style="background-color:transparent;' . wppa_wcs( 'wppa-box-text' ) . wppa_wcs( 'wppa-td' ) . '"
4033
+ >' .
4034
+ $comment_label . '
4035
+ </td>
4036
+ </tr>
4037
+ <tr>
4038
+ <td
4039
+ class="wppa-box-text wppa-td"
4040
+ style="background-color:transparent;' . wppa_wcs( 'wppa-box-text' ) . wppa_wcs( 'wppa-td' ) . '"
4041
+ >' .
4042
+ $smily_html .
4043
+ $comment_input .
4044
+ ( wppa_switch( 'comment_need_db_agree' ) ? $dbconfirm_html : '' ) . '
4045
+ </td>
4046
+ <tr>
4047
+ <tr>
4048
+ <td
4049
+ class="wppa-box-text wppa-td"
4050
+ style="background-color:transparent;' . wppa_wcs( 'wppa-box-text' ) . wppa_wcs( 'wppa-td' ) . '"
4051
+ >';
4052
+ if ( $need_captcha ) {
4053
+
4054
+ $result .=
4055
+ $captcha_label . ' ' .
4056
+ $captcha_input . ' ';
4057
+ }
4058
 
4059
+ $result .=
4060
+ $gobutton_html . '
4061
+ </td>
4062
+ </tr>
4063
+ ';
4064
+ }
4065
+ else {
4066
+ $result .= '
4067
+ <tr
4068
+ valign="top"
4069
+ style="vertical-align:top;"
4070
+ >
4071
+ <td
4072
+ valign="top"
4073
+ class="wppa-box-text wppa-td"
4074
+ style="vertical-align:top; width:30%;background-color:transparent;' . wppa_wcs( 'wppa-box-text' ) . wppa_wcs( 'wppa-td' ).'"
4075
+ >' .
4076
+ $comment_label;
4077
+
4078
+ if ( $need_captcha ) {
4079
+
4080
+ $result .= '
4081
+ <br /><br />' .
4082
+ $captcha_label . '
4083
+ <br />' .
4084
+ $captcha_input;
4085
+ }
4086
+
4087
+ $result .=
4088
+ $gobutton_html . '
4089
+ </td>
4090
+ <td>' .
4091
+ $smily_html .
4092
+ $comment_input .
4093
+ ( wppa_switch( 'comment_need_db_agree' ) ? $dbconfirm_html : '' ) . '
4094
+ </td>
4095
+ </tr>';
4096
+ }
4097
+
4098
+
4099
+
4100
+
4101
+ /*
4102
+
4103
+ if ( ! $mob ) {
4104
+ $result .=
4105
+ '<input type="button" name="commentbtn" onclick="wppaAjaxComment( '.wppa( 'mocc' ).', /'.wppa_encrypt_photo($id).'/ )" value="'.$btn.'" style="margin:0 4px 0 0;" />' .
4106
+ '<img id="wppa-comment-spin-'.wppa( 'mocc' ).'" src="'.wppa_get_imgdir().'spinner.gif" style="display:none;" />';
4107
  }
4108
+ $result .=
4109
+ '</td>';
4110
+ }
 
 
 
 
 
 
4111
 
4112
+
4113
+
4114
+
4115
+ /*
4116
+
4117
+
4118
+
4119
+
4120
+
4121
+ // Your comment?
4122
+ $result .= '
4123
+ <tr valign="top" style="vertical-align:top;">
4124
+ <td valign="top" class="wppa-box-text wppa-td" style="vertical-align:top; width:30%;background-color:transparent;'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'" >' .
4125
+ __( 'Your comment:', 'wp-photo-album-plus' );
4126
+
4127
+ // Captcha?
4128
+ if ( ( is_user_logged_in() && wppa_opt( 'comment_captcha' ) == 'all' ) ||
4129
+ ( ! is_user_logged_in() && wppa_opt( 'comment_captcha' ) != 'none' ) ) {
4130
+
4131
+ /*
4132
+ *//*
4133
+ }
4134
+
4135
+ if ( ! $mob ) {
4136
+ $result .=
4137
  '<input type="button" name="commentbtn" onclick="wppaAjaxComment( '.wppa( 'mocc' ).', /'.wppa_encrypt_photo($id).'/ )" value="'.$btn.'" style="margin:0 4px 0 0;" />' .
4138
+ '<img id="wppa-comment-spin-'.wppa( 'mocc' ).'" src="'.wppa_get_imgdir().'spinner.gif" style="display:none;" />';
4139
+ }
4140
+ $result .=
4141
+ '</td>';
4142
+
4143
+ if ( $mob ) {
4144
+ $result .= '
4145
+ </tr>
4146
+ <tr valign="top" style="vertical-align:top;">';
4147
+ }
4148
+
4149
+ $result .=
4150
  '<td valign="top" class="wppa-box-text wppa-td" style="vertical-align:top; width:70%;background-color:transparent;'.wppa_wcs( 'wppa-box-text' ).wppa_wcs( 'wppa-td' ).'" >';
4151
 
4152
  if ( wppa_switch( 'comment_smiley_picker' ) ) {
4153
+ $result .=
4154
  }
4155
 
4156
  $result .=
4157
+
 
 
 
 
 
 
4158
  '</td>' .
4159
  '</tr>' .
4160
+ '<tr valign="top" style="vertical-align:top;">';
4161
+ if ( ! $mob ) {
4162
+ $result .=
4163
  '<td>' .
4164
+ '</td>';
4165
+ }
4166
+ $result .=
4167
  '<td>' .
4168
  ( wppa_switch( 'comment_need_db_agree' ) ?
4169
+ : '' ) .
 
 
 
 
 
 
4170
  '</td>' .
4171
+ '</tr>';
4172
+
4173
+ if ( $mob ) { // go button
4174
+ $result .= '
4175
+
4176
+ }
4177
+ */
4178
+ $result .= '
4179
+ </tbody>
4180
+ </table>
4181
+ </form>
4182
+ </div>';
4183
  }
4184
  else {
4185
  if ( wppa_switch( 'login_links' ) ) {
5220
  // The calendar container
5221
  wppa_container( 'open' );
5222
 
5223
+ $year = wppa_get_get( 'calendar-year' );
5224
+ $month = wppa_get_get( 'calendar-month' );
5225
+ if ( ! $year && ! $month ) {
5226
+ $year = wppa( 'year' );
5227
+ $month = wppa( 'month' );
5228
+ }
5229
 
5230
  wppa_out( '<div' .
5231
  ' id="wppa-calendar-' . wppa( 'mocc' ) . '"' .
wppa-common-functions.php CHANGED
@@ -2,7 +2,7 @@
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
- * Version 7.2.10
6
  *
7
  */
8
 
@@ -226,6 +226,8 @@ global $thumbs;
226
  'is_combinedsearch' => false,
227
  'delay' => false,
228
  'comneedsvote' => false,
 
 
229
 
230
  );
231
  }
2
  /* wppa-common-functions.php
3
  *
4
  * Functions used in admin and in themes
5
+ * Version 7.2.11
6
  *
7
  */
8
 
226
  'is_combinedsearch' => false,
227
  'delay' => false,
228
  'comneedsvote' => false,
229
+ 'yesr' => '',
230
+ 'month' => '',
231
 
232
  );
233
  }
wppa-filter.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
- * Version 7.2.10
7
  *
8
  */
9
 
@@ -126,6 +126,8 @@ global $wppa_revno;
126
  'timeout' => '',
127
  'button' => '',
128
  'delay' => '',
 
 
129
  ), $xatts );
130
 
131
  // Sanitize input
@@ -316,6 +318,8 @@ global $wppa_revno;
316
  if ( $atts['parent'] ) {
317
  $wppa['start_album'] = wppa_alb_to_enum_children( $atts['parent'] );
318
  }
 
 
319
  break;
320
  case 'stereo':
321
  $wppa['is_stereobox'] = true;
3
  * Package: wp-photo-album-plus
4
  *
5
  * get the albums via shortcode handler
6
+ * Version 7.2.11
7
  *
8
  */
9
 
126
  'timeout' => '',
127
  'button' => '',
128
  'delay' => '',
129
+ 'year' => '',
130
+ 'month' => '',
131
  ), $xatts );
132
 
133
  // Sanitize input
318
  if ( $atts['parent'] ) {
319
  $wppa['start_album'] = wppa_alb_to_enum_children( $atts['parent'] );
320
  }
321
+ $wppa['year'] = strval( intval( $atts['year'] ) );
322
+ $wppa['month'] = strval( intval( $atts['month'] ) );
323
  break;
324
  case 'stereo':
325
  $wppa['is_stereobox'] = true;
wppa-functions.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
- * Version 7.2.10
7
  *
8
  */
9
 
@@ -2293,7 +2293,7 @@ static $user;
2293
  // Make sure $thumb contains our image data
2294
  $thumb = wppa_cache_thumb( $id );
2295
 
2296
- if ( ! $user ) $user = wppa_get_user();
2297
  $photo = wppa_get_get( 'photo' );
2298
  $ratingphoto = wppa_get_get( 'rating-id' );
2299
 
@@ -2712,7 +2712,7 @@ global $wppa_done;
2712
  $iret = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_rating
2713
  WHERE photo = %d
2714
  AND user = %s",
2715
- $photo, wppa_get_user() ) );
2716
  if ( $iret ) {
2717
  $status = 'approved';
2718
  }
@@ -2806,7 +2806,7 @@ global $wppa_done;
2806
 
2807
  if ( $cedit ) {
2808
  if ( wppa_switch( 'commentnotify_added' ) ) {
2809
- echo( '<script id="cme" type="text/javascript">alert( "'.__( 'Comment edited' , 'wp-photo-album-plus').'" );jQuery( "#cme" ).html( "" );</script>' );
2810
  }
2811
  }
2812
  else {
@@ -2844,7 +2844,7 @@ global $wppa_done;
2844
  // if ( wppa_switch( 'vote_needs_comment' ) ) {
2845
  $iret = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_rating
2846
  SET status = 'publish'
2847
- WHERE photo = %d AND user = %s", $id, wppa_get_user() ) );
2848
 
2849
  if ( $iret ) wppa_rate_photo( $id ); // Recalc ratings for this photo
2850
  // }
3
  * Package: wp-photo-album-plus
4
  *
5
  * Various functions
6
+ * Version 7.2.11
7
  *
8
  */
9
 
2293
  // Make sure $thumb contains our image data
2294
  $thumb = wppa_cache_thumb( $id );
2295
 
2296
+ if ( ! $user ) $user = wppa_get_user( 'display' );
2297
  $photo = wppa_get_get( 'photo' );
2298
  $ratingphoto = wppa_get_get( 'rating-id' );
2299
 
2712
  $iret = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*) FROM $wpdb->wppa_rating
2713
  WHERE photo = %d
2714
  AND user = %s",
2715
+ $photo, wppa_get_user( 'display' ) ) );
2716
  if ( $iret ) {
2717
  $status = 'approved';
2718
  }
2806
 
2807
  if ( $cedit ) {
2808
  if ( wppa_switch( 'commentnotify_added' ) ) {
2809
+ echo( '<script id="cme" type="text/javascript">alert( "'.__( 'Comment updated' , 'wp-photo-album-plus').'" );jQuery( "#cme" ).html( "" );</script>' );
2810
  }
2811
  }
2812
  else {
2844
  // if ( wppa_switch( 'vote_needs_comment' ) ) {
2845
  $iret = $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_rating
2846
  SET status = 'publish'
2847
+ WHERE photo = %d AND user = %s", $id, wppa_get_user( 'display' ) ) );
2848
 
2849
  if ( $iret ) wppa_rate_photo( $id ); // Recalc ratings for this photo
2850
  // }
wppa-setup.php CHANGED
@@ -616,6 +616,11 @@ global $wppa_error;
616
  if ( $old_rev <= '7203' ) {
617
  $wpdb->query( "UPDATE $wpdb->wppa_albums SET timestamp = modified WHERE timestamp = ''" );
618
  }
 
 
 
 
 
619
  }
620
 
621
  // Set Defaults
616
  if ( $old_rev <= '7203' ) {
617
  $wpdb->query( "UPDATE $wpdb->wppa_albums SET timestamp = modified WHERE timestamp = ''" );
618
  }
619
+
620
+ if ( $old_rev <= '7211' ) {
621
+ $wpdb->query( "UPDATE $wpdb->wppa_rating SET status = 'publish' WHERE status = 'pending'" );
622
+ $wpdb->query( "UPDATE $wpdb->wppa_comments SET status = 'approved' WHERE status = 'pending'" );
623
+ }
624
  }
625
 
626
  // Set Defaults
wppa-utils.php CHANGED
@@ -3,7 +3,7 @@
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
- * Version 7.2.09
7
  *
8
  */
9
 
@@ -2448,7 +2448,8 @@ global $wpdb;
2448
  // Get rating(like)count
2449
  $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*)
2450
  FROM $wpdb->wppa_rating
2451
- WHERE photo = %d", $id ) );
 
2452
 
2453
  // Update photo
2454
  $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos
@@ -2464,7 +2465,7 @@ global $wpdb;
2464
  $ratings = $wpdb->get_results( $wpdb->prepare( "SELECT value
2465
  FROM $wpdb->wppa_rating
2466
  WHERE photo = %d
2467
- AND status = %s", $id, 'publish' ), ARRAY_A );
2468
 
2469
  // Init
2470
  $the_value = '0';
3
  * Package: wp-photo-album-plus
4
  *
5
  * Contains low-level utility routines
6
+ * Version 7.2.11
7
  *
8
  */
9
 
2448
  // Get rating(like)count
2449
  $count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(*)
2450
  FROM $wpdb->wppa_rating
2451
+ WHERE photo = %d
2452
+ AND status = 'publish'", $id ) );
2453
 
2454
  // Update photo
2455
  $wpdb->query( $wpdb->prepare( "UPDATE $wpdb->wppa_photos
2465
  $ratings = $wpdb->get_results( $wpdb->prepare( "SELECT value
2466
  FROM $wpdb->wppa_rating
2467
  WHERE photo = %d
2468
+ AND status = 'publish'", $id ), ARRAY_A );
2469
 
2470
  // Init
2471
  $the_value = '0';
wppa.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
- * Version: 7.2.11.002
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
@@ -23,7 +23,7 @@ global $wp_version;
23
 
24
  /* WPPA GLOBALS */
25
  global $wppa_revno; $wppa_revno = '7211'; // WPPA db version
26
- global $wppa_api_version; $wppa_api_version = '7.2.11.002'; // WPPA software version
27
 
28
  /* Init page js data */
29
  global $wppa_js_page_data; $wppa_js_page_data = '';
2
  /*
3
  * Plugin Name: WP Photo Album Plus
4
  * Description: Easily manage and display your photo albums and slideshows within your WordPress site.
5
+ * Version: 7.2.11.004
6
  * Author: J.N. Breetvelt a.k.a. OpaJaap
7
  * Author URI: http://wppa.opajaap.nl/
8
  * Plugin URI: http://wordpress.org/extend/plugins/wp-photo-album-plus/
23
 
24
  /* WPPA GLOBALS */
25
  global $wppa_revno; $wppa_revno = '7211'; // WPPA db version
26
+ global $wppa_api_version; $wppa_api_version = '7.2.11.004'; // WPPA software version
27
 
28
  /* Init page js data */
29
  global $wppa_js_page_data; $wppa_js_page_data = '';