PageRenderTime 61ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/plugins/wp-photo-album-plus/wppa.php

https://bitbucket.org/antonyravel/cape-resorts
PHP | 117 lines | 70 code | 15 blank | 32 comment | 10 complexity | 97e1a4b11af5516910432c5420045521 MD5 | raw file
  1. <?php
  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: 5.0.10
  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/
  9. */
  10. /* See explanation on activation hook in wppa-setup.php */
  11. register_activation_hook(__FILE__, 'wppa_activate_plugin');
  12. /* GLOBALS */
  13. global $wpdb;
  14. /* This is the database revision number
  15. /* It is incremented when the table defs are changed,
  16. /* when new options are added and when the wppa_setup() routine
  17. /* must be called right after update for any other reason.
  18. */
  19. global $wppa_revno; $wppa_revno = '5010';
  20. /* CONSTANTS
  21. /*
  22. /* Check for php version
  23. /* PHP_VERSION_ID is available as of PHP 5.2.7, if our
  24. /* version is lower than that, then emulate it
  25. */
  26. //
  27. global $wppa_starttime; $wppa_starttime = microtime(true);
  28. global $wppa_loadtime; $wppa_loadtime = - microtime(true);
  29. if ( ! defined( 'PHP_VERSION_ID' ) ) {
  30. $version = explode( '.', PHP_VERSION );
  31. define( 'PHP_VERSION_ID', ( $version[0] * 10000 + $version[1] * 100 + $version[2] ) );
  32. }
  33. /* To run WPPA+ on a multisite in single site mode, add to wp-config.php: define('WPPA_MULTISITE_GLOBAL', true); */
  34. if ( ! defined('WPPA_MULTISITE_GLOBAL') ) define ('WPPA_MULTISITE_GLOBAL', false);
  35. if ( is_multisite() && WPPA_MULTISITE_GLOBAL ) $wppa_prefix = $wpdb->base_prefix; else $wppa_prefix = $wpdb->prefix;
  36. define( 'WPPA_ALBUMS', $wppa_prefix . 'wppa_albums' );
  37. define( 'WPPA_PHOTOS', $wppa_prefix . 'wppa_photos' );
  38. define( 'WPPA_RATING', $wppa_prefix . 'wppa_rating' );
  39. define( 'WPPA_COMMENTS', $wppa_prefix . 'wppa_comments' );
  40. define( 'WPPA_IPTC', $wppa_prefix . 'wppa_iptc' );
  41. define( 'WPPA_EXIF', $wppa_prefix . 'wppa_exif' );
  42. define( 'WPPA_INDEX', $wppa_prefix . 'wppa_index' );
  43. // Standard examples
  44. define( 'WPPA_FILE', basename( __FILE__ ) ); // wppa.php
  45. define( 'WPPA_PATH', dirname( __FILE__ ) ); // /.../wp-content/plugins/wp-photo-album-plus
  46. define( 'WPPA_NAME', basename( dirname( __FILE__ ) ) ); // wp-photo-album-plus
  47. define( 'WPPA_URL', plugins_url() . '/' . WPPA_NAME ); // http://...../wp-photo-album-plus
  48. define( 'WPPA_NONCE' , 'wppa-update-check');
  49. define( 'WPPA_DEBUG', false); // true: produces success/fale messages during setup
  50. /* LOAD SIDEBAR WIDGETS */
  51. require_once 'wppa-potd-widget.php';
  52. require_once 'wppa-search-widget.php';
  53. require_once 'wppa-topten-widget.php';
  54. require_once 'wppa-featen-widget.php';
  55. require_once 'wppa-slideshow-widget.php';
  56. require_once 'wppa-gp-widget.php';
  57. require_once 'wppa-comment-widget.php';
  58. require_once 'wppa-thumbnail-widget.php';
  59. require_once 'wppa-lasten-widget.php';
  60. require_once 'wppa-album-widget.php';
  61. require_once 'wppa-qr-widget.php';
  62. require_once 'wppa-tagcloud-widget.php';
  63. require_once 'wppa-multitag-widget.php';
  64. require_once 'wppa-upload-widget.php';
  65. /* COMMON FUNCTIONS */
  66. require_once 'wppa-common-functions.php';
  67. require_once 'wppa-utils.php';
  68. require_once 'wppa-exif-iptc-common.php';
  69. require_once 'wppa-index-common.php';
  70. /* SET UP $wppa[], $wppa_opt[], URL and PATH constants and LANGUAGE */
  71. add_action('init', 'wppa_initialize_runtime', '100');
  72. /* DO THE ADMIN/NON ADMIN SPECIFIC STUFF */
  73. if ( is_admin() ) require_once 'wppa-admin.php';
  74. else require_once 'wppa-non-admin.php';
  75. /* ADD AJAX */
  76. require_once 'wppa-ajax.php';
  77. $wppa_loadtime += microtime(true);
  78. /* This is for the changelog text when an update is available */
  79. global $pagenow;
  80. if ( 'plugins.php' === $pagenow )
  81. {
  82. // Changelog update message
  83. $file = basename( __FILE__ );
  84. $folder = basename( dirname( __FILE__ ) );
  85. $hook = "in_plugin_update_message-{$folder}/{$file}";
  86. add_action( $hook, 'wppa_update_message_cb', 20, 2 ); // hook for function below
  87. }
  88. function wppa_update_message_cb( $plugin_data, $r )
  89. {
  90. $output = '<span style="margin-left:10px;color:#FF0000;">Please Read the <a href="http://wppa.opajaap.nl/changelog/" target="_blank" >Changelog</a> Details Before Upgrading.</span>';
  91. return print $output;
  92. }
  93. /* This function will add "donate" link to main plugins page */
  94. function wppa_donate_link($links, $file) {
  95. if ( $file == plugin_basename(__FILE__) ) {
  96. $donate_link_usd = '<a target="_blank" title="Paypal" href="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">Donate USD</a>';
  97. $donate_link_eur = '<a target="_blank" title="Paypal" href="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=EUR&lc=US">Donate EUR</a>';
  98. $docs_link = '<a target="_blank" href="http://wppa.opajaap.nl/" title="Docs & Demos" >Documentation and examples</a>';
  99. $links[] = $donate_link_usd . ' | ' . $donate_link_eur . ' | ' . $docs_link;
  100. }
  101. return $links;
  102. } add_filter('plugin_row_meta', 'wppa_donate_link', 10, 2);