Changeset 215119
- Timestamp:
- 03/08/2010 08:41:07 PM (16 years ago)
- Location:
- wp-photocontest/trunk
- Files:
-
- 7 edited
-
lib/wp-photocontest.functions.php (modified) (1 diff)
-
photocontest-settings.php (modified) (5 diffs)
-
play.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
viewimg.php (modified) (1 diff)
-
wp-photocontest-config.php (modified) (4 diffs)
-
wp-photocontest.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-photocontest/trunk/lib/wp-photocontest.functions.php
r192621 r215119 1 1 <?php 2 function wppc_getTemplate( )3 { 4 $template_file = WP_PLUGIN_DIR . '/wp-photocontest/skins/'.CONTESTS_SKIN.'/ template.tpl';2 function wppc_getTemplate($tpl_name='template',$tpl_data=array()) 3 { 4 $template_file = WP_PLUGIN_DIR . '/wp-photocontest/skins/'.CONTESTS_SKIN.'/'.$tpl_name.'.tpl'; 5 5 if (file_exists($template_file)) 6 6 { -
wp-photocontest/trunk/photocontest-settings.php
r213614 r215119 53 53 "VISIBLE_UPLOAD"=>"", 54 54 "N_PHOTO_X_PAGE"=>"", 55 "SKIP_CAPTHA"=>"", 55 56 ); 56 57 … … 76 77 $ROLE_UPLOAD = wppc_checkOptions($_REQUEST['ROLE_UPLOAD'], $user_roles,ROLE_UPLOAD); 77 78 $VIEWIMG_BOX = wppc_checkInteger($_REQUEST['VIEWIMG_BOX'], VIEWIMG_BOX); 78 $VISIBLE_UPLOAD = wppc_check Integer($_REQUEST['VISIBLE_UPLOAD'],VISIBLE_UPLOAD);79 $VISIBLE_UPLOAD = wppc_checkOptions($_REQUEST['VISIBLE_UPLOAD'], array('0','1'),VISIBLE_UPLOAD); 79 80 $N_PHOTO_X_PAGE = wppc_checkInteger($_REQUEST['N_PHOTO_X_PAGE'], N_PHOTO_X_PAGE); 81 $SKIP_CAPTHA = wppc_checkOptions($_REQUEST['SKIP_CAPTHA'], array('0','1'),SKIP_CAPTHA); 82 80 83 $EDIT_DATE = date('Y-m-d h:m:i'); 81 82 84 83 85 ### Add some vars … … 128 130 'VISIBLE_UPLOAD' => $VISIBLE_UPLOAD, 129 131 'N_PHOTO_X_PAGE' => $N_PHOTO_X_PAGE, 132 'SKIP_CAPTHA' => $SKIP_CAPTHA, 130 133 'edit_date' => $EDIT_DATE, 131 134 ), … … 153 156 $show_form = false; 154 157 } 158 159 wppc_printDatabaseError(); 155 160 156 161 break; … … 483 488 </td> 484 489 </tr> 485 486 </table> 490 <tr> 491 <th width="20%" scope="row" valign="top"><?php _e('SKIP_CAPTHA', 'wp-photocontest') ?>:</th> 492 <td width="80%"> 493 <?php 494 $skipcpatha_values = array('1'=>'True','0'=>'False'); 495 $selectstring = '<select name="SKIP_CAPTHA">'; 496 foreach ($skipcpatha_values as $status_k=>$status_v) 497 { 498 $_selected = ''; 499 if ($options_array['SKIP_CAPTHA'] == $status_k) 500 { 501 $_selected = ' selected="selected"'; 502 } 503 $selectstring .= '<option value="'.$status_k.'" '.$_selected.'>'.$status_v.'</option>'; 504 } 505 $selectstring .= '</select>'; 506 echo $selectstring; 507 unset($selectstring); 508 ?> 509 <br /> 510 <?php _e('Set to true if you do not want to use captha when voting.', 'wp-photocontest');?> 511 </td> 512 </tr> </table> 487 513 488 514 <p style="text-align: center;"><input type="submit" name="do" value="<?php _e('Save settings', 'wp-photocontest'); ?>" class="button" /> <input type="button" name="cancel" value="<?php _e('Cancel', 'wp-photocontest'); ?>" class="button" onclick="javascript:history.go(-1)" /></p> -
wp-photocontest/trunk/play.php
r194948 r215119 386 386 else 387 387 { 388 if (isset($current_user->ID)) 389 { 390 $currentuser_id = $current_user->ID; 391 } 392 if (isset($current_user->data->ID)) 393 { 394 $currentuser_id = $current_user->data->ID; 395 } 396 397 $currentuser_email = ''; 398 if (isset($current_user->data->user_email)) 399 { 400 $currentuser_email = $current_user->data->user_email; 401 } 402 388 403 if (function_exists('get_the_author_meta')) 389 404 { 390 $display_name = get_the_author_meta('display_name', $current _user->data->ID);405 $display_name = get_the_author_meta('display_name', $currentuser_id); 391 406 } 392 407 else 393 408 { 394 $display_name = get_author_name($current _user->data->ID);409 $display_name = get_author_name($currentuser_id); 395 410 } 396 411 ?> … … 412 427 <td class="otherCol"> 413 428 <div class="feedback hidden" id="error_upload_email"><?php _e('Error:', 'wp-photocontest');?> <?php _e("No email provided", 'wp-photocontest');?></div> 414 <input type="text" name="upload_email" id="upload_email" value="<?php echo $current _user->user_email; ?>" />429 <input type="text" name="upload_email" id="upload_email" value="<?php echo $currentuser_email; ?>" /> 415 430 </td> 416 431 </tr> -
wp-photocontest/trunk/readme.txt
r211853 r215119 4 4 Tags: photocontest, images, photos, photo contest, contest, thumbnail, pictures, post, automatic, voting, vote 5 5 Requires at least: 2.7 6 Tested up to: 2.9. 17 Stable tag: 1.4. 2.16 Tested up to: 2.9.2 7 Stable tag: 1.4.3 8 8 9 9 This plugin automatically turns a WordPress-page into a photo contest. … … 176 176 177 177 == Changelog == 178 = 1.4.3 - 06.03.2010 = 179 * Fix for "You do not have sufficient permissions to access this page" error. (Open settingspage and click on the link) 180 * Fix a can't vote twice error 181 * Visible upload not working. Fix a saving to database error. 182 * Added option to skip the captha 183 * Fixed a saving setting bug after upgrading 184 * Fixed a strange thing, that after activating the plugin php-errors are shown on your site 185 178 186 = 1.4.2.1 - 12.01.2010 = 179 187 * Fix for "There is no object with id upload_email" error. -
wp-photocontest/trunk/viewimg.php
r213518 r215119 592 592 echo '<input type="hidden" name="wppc_vote" id="vote" value="1" />'; 593 593 } 594 595 if (SKIP_CAPTHA) 596 { 597 ?> 598 <input type="hidden" name="wppc_captcha" value="<?php echo $captchatext;?>" id="captcha" size="5"> 599 <? 600 } 601 else 602 { 603 604 ?> 605 <tr> 606 <td class="firstCol"><?php _e('Captcha', 'wp-photocontest');?>:</td> 607 <td class="secondCol"> </td> 608 <td class="otherCol"> 609 <div class="feedback hidden" id="error_captcha"><?php _e('Error:', 'wp-photocontest');?> <?php _e("No captcha provided", 'wp-photocontest');?></div> 610 <img src="<?php echo $capthcadata;?>" align="left" /> <input type="text" name="wppc_captcha" id="captcha" size="5"> 611 </td> 612 </tr> 613 <?php 614 } 594 615 ?> 595 <tr>596 <td class="firstCol"><?php _e('Captcha', 'wp-photocontest');?>:</td>597 <td class="secondCol"> </td>598 <td class="otherCol">599 <div class="feedback hidden" id="error_captcha"><?php _e('Error:', 'wp-photocontest');?> <?php _e("No captcha provided", 'wp-photocontest');?></div>600 <img src="<?php echo $capthcadata;?>" align="left" /> <input type="text" name="wppc_captcha" id="captcha" size="5">601 </td>602 </tr>603 616 <tr> 604 617 <td class="firstCol"></td> -
wp-photocontest/trunk/wp-photocontest-config.php
r193137 r215119 35 35 'VISIBLE_UPLOAD' => 1, 36 36 'N_PHOTO_X_PAGE' => 9, 37 'SKIP_CAPTHA' => 0, 37 38 'edit_date' => date('Y-m-d h:m:i') 38 39 ); … … 47 48 $default_array, 48 49 array( 49 '%d', '%s', '%d', '%s', '%s', '%s', '%d', '%s', '%d', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%d' 50 '%d', '%s', '%d', '%s', '%s', '%s', '%d', '%s', '%d', '%s', '%s', '%s', '%s', '%s', '%d', '%d', '%s', '%d', '%d' 50 51 ) 51 52 ); … … 117 118 define('N_PHOTO_X_PAGE',$options_array['N_PHOTO_X_PAGE']); 118 119 120 //True hides the captha when voting 121 define('SKIP_CAPTHA',$options_array['SKIP_CAPTHA']); 119 122 120 123 //Don't change this. This helps upgrading the plugin 121 define('PC_DB_VERSION','1.4. 2.1');122 define('PC_PL_VERSION','1.4. 2.1');124 define('PC_DB_VERSION','1.4.3'); 125 define('PC_PL_VERSION','1.4.3'); 123 126 124 127 ### Set some debug vars … … 131 134 } 132 135 } 136 else 137 { 138 error_reporting(E_ERROR); 139 ini_set("display_errors", 0); 140 } 133 141 134 142 ### Add the lib classes -
wp-photocontest/trunk/wp-photocontest.php
r213614 r215119 4 4 Plugin URI: http://www.vanderstad.nl/wordpress/plugins/wp-photocontest 5 5 Description: Adds a photo contest to your post or page. Note: Only apply auto-upgrade when you don't care about losing your contests!! (and if you do: Backup you tables, 'CONTEST_FOLDER'- and 'skins'-directories!) 6 Version: 1.4. 2.16 Version: 1.4.3 7 7 Author: Frank van der Stad 8 8 Author URI: http://www.vanderstad.nl/wordpress/ … … 198 198 VISIBLE_UPLOAD int(5) NOT NULL default '1', 199 199 N_PHOTO_X_PAGE int(5) NOT NULL default '9', 200 SKIP_CAPTHA int(5) NOT NULL default '1', 200 201 edit_date timestamp NOT NULL default CURRENT_TIMESTAMP, 201 202 UNIQUE KEY options (option_id, WP_USE_THEMES), … … 284 285 unset($structure); 285 286 286 $table_name = $wpdb->prefix . "photocontest_config"; 287 $table_name = $wpdb->prefix . "photocontest_config"; 287 288 $structure = "CREATE TABLE ".$table_name." ( 288 289 option_id int(5) unsigned NOT NULL, … … 295 296 DEFAULT_PAGENAME varchar(255) NOT NULL, 296 297 DEFAULT_TYPE enum('page','post') NOT NULL default 'page', 298 DEFAULT_PARENT int(5) NOT NULL default '0', 297 299 DEFAULT_COMMENTS enum('open','closed') NOT NULL default 'closed', 298 300 VOTING_METHOD enum('star5','star10','option5','option10','hidden') NOT NULL default 'star5', 301 ROLE_VOTING varchar(255), 302 ROLE_UPLOAD varchar(255) default 'subscriber', 299 303 VIEWIMG_BOX int(5) NOT NULL default '442', 300 UNIQUE KEY options (option_id), 304 VISIBLE_UPLOAD int(5) NOT NULL default '1', 305 N_PHOTO_X_PAGE int(5) NOT NULL default '9', 306 SKIP_CAPTHA int(5) NOT NULL default '1', 307 edit_date timestamp NOT NULL default CURRENT_TIMESTAMP, 308 UNIQUE KEY options (option_id, WP_USE_THEMES), 301 309 PRIMARY KEY (option_id) 302 310 );"; … … 381 389 //delete_option('PC_DB_VERSION'); 382 390 //delete_option('PC_PL_VERSION'); 391 //delete_option('widget_wp-photocontest-widget'); 383 392 384 393 } // end function photocontest_deinstall … … 453 462 do_action( 'admin_upgrade_backup_notices', $error_text); 454 463 } 455 chmod($plugin_upload_dir, 0755);456 rmdir($upgrade_upload_dir);464 @chmod($plugin_upload_dir, 0755); 465 @rmdir($upgrade_upload_dir); 457 466 } 458 467 … … 464 473 do_action( 'admin_upgrade_backup_notices', $error_text); 465 474 } 466 chmod($plugin_skins_dir, 0755);467 rmdir($upgrade_skins_dir);475 @chmod($plugin_skins_dir, 0755); 476 @rmdir($upgrade_skins_dir); 468 477 } 469 478
Note: See TracChangeset
for help on using the changeset viewer.