Plugin Directory

Changeset 215119


Ignore:
Timestamp:
03/08/2010 08:41:07 PM (16 years ago)
Author:
frekel
Message:

Ready for version 1.4.3

Location:
wp-photocontest/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • wp-photocontest/trunk/lib/wp-photocontest.functions.php

    r192621 r215119  
    11<?php
    2 function wppc_getTemplate()
    3 {
    4     $template_file = WP_PLUGIN_DIR . '/wp-photocontest/skins/'.CONTESTS_SKIN.'/template.tpl';
     2function wppc_getTemplate($tpl_name='template',$tpl_data=array())
     3{
     4    $template_file = WP_PLUGIN_DIR . '/wp-photocontest/skins/'.CONTESTS_SKIN.'/'.$tpl_name.'.tpl';
    55    if (file_exists($template_file))
    66    {
  • wp-photocontest/trunk/photocontest-settings.php

    r213614 r215119  
    5353                    "VISIBLE_UPLOAD"=>"",
    5454                    "N_PHOTO_X_PAGE"=>"",
     55                    "SKIP_CAPTHA"=>"",
    5556                );
    5657
     
    7677$ROLE_UPLOAD                = wppc_checkOptions($_REQUEST['ROLE_UPLOAD'], $user_roles,ROLE_UPLOAD);
    7778$VIEWIMG_BOX                = wppc_checkInteger($_REQUEST['VIEWIMG_BOX'], VIEWIMG_BOX);
    78 $VISIBLE_UPLOAD             = wppc_checkInteger($_REQUEST['VISIBLE_UPLOAD'], VISIBLE_UPLOAD);
     79$VISIBLE_UPLOAD             = wppc_checkOptions($_REQUEST['VISIBLE_UPLOAD'], array('0','1'),VISIBLE_UPLOAD);
    7980$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
    8083$EDIT_DATE                  = date('Y-m-d h:m:i');
    81 
    8284
    8385### Add some vars
     
    128130                    'VISIBLE_UPLOAD' => $VISIBLE_UPLOAD,
    129131                    'N_PHOTO_X_PAGE' => $N_PHOTO_X_PAGE,
     132                    'SKIP_CAPTHA' => $SKIP_CAPTHA,
    130133                    'edit_date' => $EDIT_DATE,
    131134                ),
     
    153156                $show_form = false;         
    154157            }
     158           
     159            wppc_printDatabaseError();
    155160           
    156161        break;
     
    483488            </td>
    484489        </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>
    487513   
    488514    <p style="text-align: center;"><input type="submit" name="do" value="<?php _e('Save settings', 'wp-photocontest'); ?>"  class="button" />&nbsp;&nbsp;<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  
    386386            else
    387387            {
     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
    388403                if (function_exists('get_the_author_meta'))
    389404                {
    390                     $display_name = get_the_author_meta('display_name', $current_user->data->ID);
     405                    $display_name = get_the_author_meta('display_name', $currentuser_id);
    391406                }
    392407                else
    393408                {
    394                     $display_name = get_author_name($current_user->data->ID);
     409                    $display_name = get_author_name($currentuser_id);
    395410                }
    396411                ?>         
     
    412427                                            <td class="otherCol">
    413428                                            <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; ?>" />
    415430                                            </td>
    416431                                        </tr>
  • wp-photocontest/trunk/readme.txt

    r211853 r215119  
    44Tags: photocontest, images, photos, photo contest, contest, thumbnail, pictures, post, automatic, voting, vote
    55Requires at least: 2.7
    6 Tested up to: 2.9.1
    7 Stable tag: 1.4.2.1
     6Tested up to: 2.9.2
     7Stable tag: 1.4.3
    88
    99This plugin automatically turns a WordPress-page into a photo contest.
     
    176176
    177177== 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
    178186= 1.4.2.1 - 12.01.2010  =
    179187* Fix for "There is no object with id upload_email" error.
  • wp-photocontest/trunk/viewimg.php

    r213518 r215119  
    592592                                                echo '<input type="hidden" name="wppc_vote" id="vote" value="1" />';
    593593                                            }
     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">&nbsp;</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" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="wppc_captcha" id="captcha" size="5">
     611                                                    </td>
     612                                                </tr>
     613                                                <?php
     614                                            }
    594615                                            ?>
    595                                             <tr>
    596                                                 <td class="firstCol"><?php _e('Captcha', 'wp-photocontest');?>:</td>
    597                                                 <td class="secondCol">&nbsp;</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" />&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="wppc_captcha" id="captcha" size="5">
    601                                                 </td>
    602                                             </tr>
    603616                                            <tr>
    604617                                                <td class="firstCol"></td>
  • wp-photocontest/trunk/wp-photocontest-config.php

    r193137 r215119  
    3535                    'VISIBLE_UPLOAD' => 1,
    3636                    'N_PHOTO_X_PAGE' => 9,
     37                    'SKIP_CAPTHA' => 0,
    3738                    'edit_date' => date('Y-m-d h:m:i')
    3839                );
     
    4748                $default_array,
    4849                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'
    5051                )
    5152            );
     
    117118define('N_PHOTO_X_PAGE',$options_array['N_PHOTO_X_PAGE']);
    118119
     120//True hides the captha when voting
     121define('SKIP_CAPTHA',$options_array['SKIP_CAPTHA']);
    119122
    120123//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');
     124define('PC_DB_VERSION','1.4.3');
     125define('PC_PL_VERSION','1.4.3');
    123126
    124127### Set some debug vars
     
    131134    }
    132135}
     136else
     137{
     138    error_reporting(E_ERROR);
     139    ini_set("display_errors", 0);
     140}
    133141
    134142### Add the lib classes
  • wp-photocontest/trunk/wp-photocontest.php

    r213614 r215119  
    44Plugin URI: http://www.vanderstad.nl/wordpress/plugins/wp-photocontest
    55Description: 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.1
     6Version: 1.4.3
    77Author: Frank van der Stad
    88Author URI: http://www.vanderstad.nl/wordpress/
     
    198198        VISIBLE_UPLOAD int(5) NOT NULL default '1',
    199199        N_PHOTO_X_PAGE int(5) NOT NULL default '9',
     200        SKIP_CAPTHA int(5) NOT NULL default '1',
    200201        edit_date timestamp NOT NULL default CURRENT_TIMESTAMP,     
    201202        UNIQUE KEY options (option_id, WP_USE_THEMES),
     
    284285        unset($structure);
    285286
    286         $table_name = $wpdb->prefix . "photocontest_config";
     287        $table_name = $wpdb->prefix . "photocontest_config";       
    287288        $structure = "CREATE TABLE ".$table_name." (
    288289        option_id int(5) unsigned NOT NULL,
     
    295296        DEFAULT_PAGENAME varchar(255) NOT NULL,
    296297        DEFAULT_TYPE enum('page','post') NOT NULL default 'page',
     298        DEFAULT_PARENT int(5) NOT NULL default '0',     
    297299        DEFAULT_COMMENTS enum('open','closed') NOT NULL default 'closed',
    298300        VOTING_METHOD enum('star5','star10','option5','option10','hidden') NOT NULL default 'star5',
     301        ROLE_VOTING varchar(255),
     302        ROLE_UPLOAD varchar(255) default 'subscriber',
    299303        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),
    301309        PRIMARY KEY  (option_id) 
    302310        );";
     
    381389    //delete_option('PC_DB_VERSION');
    382390    //delete_option('PC_PL_VERSION');
     391    //delete_option('widget_wp-photocontest-widget');
    383392   
    384393} // end function photocontest_deinstall
     
    453462                do_action( 'admin_upgrade_backup_notices', $error_text);
    454463        }
    455         chmod($plugin_upload_dir, 0755);
    456         rmdir($upgrade_upload_dir);     
     464        @chmod($plugin_upload_dir, 0755);
     465        @rmdir($upgrade_upload_dir);       
    457466    }
    458467   
     
    464473                do_action( 'admin_upgrade_backup_notices', $error_text);
    465474        }
    466         chmod($plugin_skins_dir, 0755);
    467         rmdir($upgrade_skins_dir);
     475        @chmod($plugin_skins_dir, 0755);
     476        @rmdir($upgrade_skins_dir);
    468477    }   
    469478
Note: See TracChangeset for help on using the changeset viewer.