Changeset 2987229
- Timestamp:
- 11/01/2023 07:42:12 AM (2 years ago)
- Location:
- yet-another-movie/trunk
- Files:
-
- 9 edited
-
admin/editor/movieHelperEditor.php (modified) (1 diff)
-
admin/js/editor.js (modified) (3 diffs)
-
admin/movie-helper-settings-misc.php (modified) (1 diff)
-
admin/movieHelper.php (modified) (4 diffs)
-
admin/movieHelperGetSettings.php (modified) (4 diffs)
-
admin/movieHelperScripts.php (modified) (2 diffs)
-
admin/movieHelperSettingsPage.php (modified) (10 diffs)
-
movie-helper.php (modified) (3 diffs)
-
readme.md (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
yet-another-movie/trunk/admin/editor/movieHelperEditor.php
r2848387 r2987229 38 38 public function addMetaboxes () { 39 39 //Default post type where display metabox 40 $post_types = array('post', 'page');40 $post_types = ['post', 'page']; 41 41 42 42 //get the custom post type -
yet-another-movie/trunk/admin/js/editor.js
r2848387 r2987229 199 199 let targetBlank = ''; 200 200 201 if(JSON.parse(movieHelperCommonData.t mdb.target_blank) === true) {201 if(JSON.parse(movieHelperCommonData.target_blank) === true) { 202 202 targetBlank = 'target="_blank"'; 203 203 } … … 281 281 282 282 /** 283 * When button insert is clicked, create a core/paragrap gh block and insert blockMovieList.innerHTML283 * When button insert is clicked, create a core/paragraph block and insert blockMovieList.innerHTML 284 284 * 285 285 * @param event … … 292 292 293 293 /** 294 * Return the Year from a date, or athe string N/A if date is not set294 * Return the Year from a date, or the string N/A if date is not set 295 295 * 296 296 * @param date {string} -
yet-another-movie/trunk/admin/movie-helper-settings-misc.php
r2848387 r2987229 23 23 24 24 function movie_helper_customize_links_description () { 25 $name = esc_html__('Customize links', 'movie-helper');25 $name = esc_html__('Customize content', 'movie-helper'); 26 26 27 27 $div_desc = '<div class="moviehelper-settings-description">'; 28 $description = esc_html__('Custom text to show after a link','movie-helper');28 //$description = esc_html__('Custom text to show after a link','movie-helper'); 29 29 $end_div = '.</div>'; 30 30 31 return $name . $div_desc . $ description . $end_div;31 return $name . $div_desc . $end_div; 32 32 } -
yet-another-movie/trunk/admin/movieHelper.php
r2905485 r2987229 224 224 225 225 //define mh settings 226 define('MOVIEHELPER_TEXT_AFTER_LINKS', $mh_options['txt_after_links']); 226 define('MOVIEHELPER_TEXT_AFTER_LINKS', $mh_options['txt_after_links']); 227 define('MOVIEHELPER_TARGET_BLANK', $mh_options['target_blank']); 228 227 229 } 228 230 … … 237 239 238 240 //define tmdb settings 239 define('MOVIEHELPER_TMDB_TARGET_BLANK', $tmdb_options['target_blank']);240 241 define('MOVIEHELPER_TMDB_ADULT', $tmdb_options['include_adult']); 241 242 define('MOVIEHELPER_TMDB_CUSTOM_APIKEY', $tmdb_options['api_key']); … … 261 262 $error = $valid_api; 262 263 } 263 $transient_value = array(264 $transient_value = [ 264 265 'error' => true, 265 266 'message' => $error 266 );267 ]; 267 268 set_transient('tmdb_api_key', $transient_value, DAY_IN_SECONDS); 268 269 return $error; 269 270 } 270 271 271 $transient_value = array(272 $transient_value = [ 272 273 'error' => false, 273 274 'api_key' => $api_key 274 );275 ]; 275 276 276 277 set_transient('tmdb_api_key', $transient_value, DAY_IN_SECONDS); … … 325 326 */ 326 327 public static function getCustomPostTypes() { 327 $args = array(328 $args = [ 328 329 'public' => true, 329 330 '_builtin' => false 330 );331 ]; 331 332 332 333 $output = 'names'; // names or objects, note names is the default -
yet-another-movie/trunk/admin/movieHelperGetSettings.php
r2905485 r2987229 17 17 */ 18 18 public function mh () { 19 $mh_settings = get_option('moviehelper_settings', array());19 $mh_settings = get_option('moviehelper_settings', []); 20 20 21 21 if(!isset($mh_settings['txt_after_links'])) { … … 23 23 } 24 24 25 $mh_settings['target_blank'] = $this->mhGetTarget($mh_settings); 26 25 27 return $mh_settings; 26 }27 28 /**29 * Return a cleaned array of tmdb options30 *31 * @author Dario Curvino <@dudo>32 * @since 1.1.233 * @return array|mixed34 */35 public function tmdb () {36 $tmdb_options = get_option('moviehelper_tmdb_settings', array());37 38 $tmdb_options['target_blank'] = $this->tmdbGetTarget($tmdb_options);39 $tmdb_options['include_adult'] = $this->includeAdult($tmdb_options);40 41 //If apy_key is not set, initialize it on false42 if(!isset($tmdb_options['api_key'])) {43 $tmdb_options['api_key'] = false;44 }45 46 return $tmdb_options;47 28 } 48 29 … … 58 39 * @return bool 59 40 */ 60 private function tmdbGetTarget($options) {41 private function mhGetTarget($options) { 61 42 $target_blank = false; 62 43 … … 67 48 68 49 return $target_blank; 50 } 51 52 /** 53 * Return a cleaned array of tmdb options 54 * 55 * @author Dario Curvino <@dudo> 56 * @since 1.1.2 57 * @return array|mixed 58 */ 59 public function tmdb () { 60 $tmdb_options = get_option('moviehelper_tmdb_settings', []); 61 62 $tmdb_options['include_adult'] = $this->includeAdult($tmdb_options); 63 64 //If apy_key is not set, initialize it on false 65 if(!isset($tmdb_options['api_key'])) { 66 $tmdb_options['api_key'] = false; 67 } 68 69 return $tmdb_options; 69 70 } 70 71 -
yet-another-movie/trunk/admin/movieHelperScripts.php
r2905485 r2987229 65 65 'moviehelper-editor', 66 66 MOVIEHELPER_JS_DIR . 'editor.js', 67 array('themoviedb', 'wp-i18n'),67 ['themoviedb', 'wp-i18n'], 68 68 MOVIEHELPER_VERSION_NUM, 69 69 true … … 95 95 96 96 $mh_common_data = json_encode( 97 array(97 [ 98 98 'guten_page' => movieHelper::isGutenPage(), 99 99 'img_dir' => MOVIEHELPER_IMG_DIR, 100 100 'lang' => str_replace('_', '-', get_locale()), 101 101 'custom_text_link' => json_encode(wp_kses_post(MOVIEHELPER_TEXT_AFTER_LINKS)), 102 't mdb' => array(103 'target_blank' => json_encode(MOVIEHELPER_TMDB_TARGET_BLANK),102 'target_blank' => json_encode(MOVIEHELPER_TARGET_BLANK), 103 'tmdb' => [ 104 104 'include_adult' => MOVIEHELPER_TMDB_ADULT, //leave this as a string 105 105 'api_key' => MOVIEHELPER_TMDB_CUSTOM_APIKEY 106 )107 )106 ] 107 ] 108 108 ); 109 109 -
yet-another-movie/trunk/admin/movieHelperSettingsPage.php
r2848387 r2987229 127 127 ); 128 128 129 130 129 add_settings_field( 131 130 'moviehelper_customize_links', … … 188 187 ?> 189 188 <div class="moviehelper-general-settings"> 189 <label for="moviehelper-custom-links"> 190 <strong> 191 <?php echo esc_html__('Customize links', 'movie-helper') ?> 192 </strong> 193 </label> 194 <p></p> 190 195 <input 191 196 type="text" … … 195 200 placeholder="<?php echo esc_html__('(%vote_average%), %year% ')?>" 196 201 > 197 <label for="moviehelper-custom-links">198 </label>199 202 <p></p> 200 <div class="moviehelper-element-description" style="margin-top: 10px ">201 <span> <strong>Allowed Variables:</strong></span>202 <p >203 <div class="moviehelper-element-description" style="margin-top: 10px;"> 204 <span>Custom text to show after a link, allowed variables:</span> 205 <p style="margin-left: 10px;"> 203 206 <strong>%year%</strong> - Display the year <br /> 204 207 <strong>%vote_average%</strong> - Display the vote average <br /> … … 207 210 </div> 208 211 212 <div> 213 <strong><?php esc_html_e('Open link in new tab?', 'movie-helper') ?></strong> 214 <p></p> 215 <div class="moviehelper-onoffswitch-big"> 216 <input type="checkbox" name="moviehelper_settings[target_blank]" 217 <?php if (MOVIEHELPER_TARGET_BLANK === true){ echo 'checked="checked"'; }?> 218 value="true" 219 class="moviehelper-onoffswitch-checkbox" 220 id="moviehelper-target-blank" 221 /> 222 <label class="moviehelper-onoffswitch-label" for="moviehelper-target-blank"> 223 <span class="moviehelper-onoffswitch-inner"></span> 224 <span class="moviehelper-onoffswitch-switch"></span> 225 </label> 226 </div> 227 </div> 228 209 229 </div> 210 230 … … 218 238 public function tmdbSettingsFilterAdult() { 219 239 ?> 220 221 <div>222 <strong><?php esc_html_e('Open link in new tab?', 'movie-helper') ?></strong>223 <p></p>224 <div class="moviehelper-onoffswitch-big">225 <input type="checkbox" name="moviehelper_tmdb_settings[target_blank]"226 <?php if (MOVIEHELPER_TMDB_TARGET_BLANK === true){ echo 'checked="checked"'; }?>227 value="true"228 class="moviehelper-onoffswitch-checkbox"229 id="moviehelper-target-blank"230 />231 <label class="moviehelper-onoffswitch-label" for="moviehelper-target-blank">232 <span class="moviehelper-onoffswitch-inner"></span>233 <span class="moviehelper-onoffswitch-switch"></span>234 </label>235 </div>236 </div>237 238 <p> </p>239 240 <div> 240 241 <strong><?php esc_html_e('Include adult content?', 'movie-helper') ?></strong> … … 313 314 public function sanitizeTMDBSettings($options) { 314 315 // Create our array for storing the validated options 315 $output = array();316 $output = []; 316 317 317 318 // Loop through each of the incoming options … … 403 404 $text .= '<div class="moviehelper-donate-title">' . __('You may also like...', 'movie-helper') .'</div>'; 404 405 $text .= '<div class="moviehelper-donate-content">'; 405 $text .= $this->yasr();406 $text .= '</p><hr />';407 406 $text .= $this->cnrt(); 408 407 $text .= '</div>'; //second div … … 413 412 414 413 /** 415 * Yasr Box414 * CNRT box 416 415 * 417 416 * @author Dario Curvino <@dudo> … … 419 418 * @return string 420 419 */ 421 private function yasr() {422 $url = add_query_arg(423 array(424 'tab' => 'plugin-information',425 'plugin' => 'yet-another-stars-rating',426 'TB_iframe' => 'true',427 'width' => '772',428 'height' => '670'429 ),430 network_admin_url( 'plugin-install.php' )431 );432 $text = '<h4>Yet Another Stars Rating</h4>';433 $text .= '<div style="margin-top: 15px;">';434 $text .= esc_html__('Boost the way people interact with your site with an easy WordPress stars rating system!435 With Schema.org rich snippets YASR will improve your SEO!', 'movie-helper');436 $text .= '</div>';437 $text .= '<div style="margin-top: 15px;">438 <a href="'. esc_url( $url ).'" class="install-now button thickbox open-plugin-details-modal" target="_blank">'439 . __( 'Install', 'movie-helper' ).'</a>';440 $text .= '</div>';441 442 return $text;443 }444 445 /**446 * CNRT box447 *448 * @author Dario Curvino <@dudo>449 * @since 1.0.2450 * @return string451 */452 420 private function cnrt() { 453 421 $url = add_query_arg( 454 array(422 [ 455 423 'tab' => 'plugin-information', 456 424 'plugin' => 'comments-not-replied-to', … … 458 426 'width' => '772', 459 427 'height' => '670' 460 ),428 ], 461 429 network_admin_url( 'plugin-install.php' ) 462 430 ); -
yet-another-movie/trunk/movie-helper.php
r2905485 r2987229 5 5 * Plugin URI: https://dariocurvino.it 6 6 * Description: Movie Helper allows you to easily add links to movie and tv shows, just by searching them while you're writing your content. Search, click, done! 7 * Version: 1.2. 27 * Version: 1.2.3 8 8 * Requires at least: 5.0 9 9 * Requires PHP: 5.4 … … 39 39 40 40 if(is_admin()) { 41 define('MOVIEHELPER_VERSION_NUM', '1.2. 2');41 define('MOVIEHELPER_VERSION_NUM', '1.2.3'); 42 42 43 43 require 'admin/movieHelper.php'; … … 47 47 } 48 48 49 //this add a link under the plugin name, must be in the main plugin file49 //this adds a link under the plugin name, must be in the main plugin file 50 50 add_filter('plugin_action_links_' . plugin_basename( __FILE__ ), static function ($links){ 51 51 $settings_link='<a href="' . admin_url( 'options-general.php?page=moviehelper_settings_page' ) . '">General Settings</a>'; 52 52 53 //array_unshi t adds to the beginof array53 //array_unshift adds to the beginning of array 54 54 array_unshift($links, $settings_link); 55 55 -
yet-another-movie/trunk/readme.md
r2956755 r2987229 5 5 Requires at least: 5.0 6 6 Contributors: Dudo 7 Tested up to: 6. 38 Stable tag: 1.2. 27 Tested up to: 6.4 8 Stable tag: 1.2.3 9 9 License: GPL2 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 33 33 ## Video Tutorial 34 34 35 [youtube https://www.youtube.com/watch?v= d3PI8si-fS4]35 [youtube https://www.youtube.com/watch?v=QOdCeV7-TR4] 36 36 37 37 Follow development on [GitHub](https://github.com/Dudo1985/Movie-Helper) … … 40 40 41 41 1. Navigate to Dashboard -> Plugins -> Add New and search for Movie Helper 42 2. Click on "Install Now" and th an "Activate"42 2. Click on "Install Now" and then "Activate" 43 43 44 44 ## Frequently Asked Questions … … 69 69 ## Changelog 70 70 71 = 1.2.3 = 72 * Minor changes 73 71 74 = 1.2.2 = 72 75 * TWEAKED: Minor Changes
Note: See TracChangeset
for help on using the changeset viewer.