Changeset 914

Show
Ignore:
Timestamp:
02/26/08 17:38:56 (9 months ago)
Author:
_ck_
Message:

bug fix for warning on new poll saving (topic_id is null)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bbpress-polls/trunk/bb-polls.php

    r852 r914  
    66Author: _ck_ 
    77Author URI: http://bbShowcase.org 
    8 Version: 0.31 
     8Version: 0.33 
    99 
    1010License: CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/ 
     
    36360.30    : enhancement so admin can edit any poll (don't change the order of questions, it's a simple edit for now). Vote count edits, etc. coming later. 
    37370.31    : bug fix to also track/re-save change of poll type (multiple/single) on edit 
     380.33    : bug fix on null topic_id saving poll setup 
    3839         
    3940To Do:  
    40         : admin menu (coming soon - edit plugin directly for now, many options) 
    41         : administrative editing/deleting of existing polls.     
     41        : admin menu (coming soon - edit plugin directly for now, many options)  
    4242        : display a poll anywhere within bbpress templates 
    43         : display all polls on a single page 
     43        : list all polls on a single page 
    4444*/ 
    4545//      edit these lines below (until an Admin menu is made) 
     
    7777        $bb_polls['label_cancel_text']=__("Cancel");  // default "CANCEL" = text to show for CANCEL button 
    7878        $bb_polls['label_edit_text']=__("Edit");  // default "EDIT" = text to show for Edit button 
    79         $bb_polls['label_delete_text']=__("Delete");  // default "DELETE" = text to show for Edit button 
     79        $bb_polls['label_delete_text']=__("Delete");  // default "DELETE" = text to show for Delete button 
    8080        $bb_polls['label_option_text']=__("option");  // default "option" = text to show for options 
    8181        $bb_polls['label_question_text']=__("poll question"); 
     
    8585        $bb_polls['label_warning_text']=__("This cannot be undone. Are you sure to delete?"); 
    8686                 
    87         $bb_polls['style']="#bb_polls {list-style: none; width:350px; margin-left:-10px; line-height:120%; padding:5px; border:1px solid #ADADAD;  font-size:85%; color:#000; background:#eee; } 
     87        $bb_polls['style']="#bb_polls {list-style: none; width:350px; line-height:120%; margin:5px 0; padding:5px; border:1px solid #ADADAD;  font-size:85%; color:#000; background:#eee; } 
    8888                        #bb_polls .submit {cursor: pointer; cursor: hand; text-align:center; padding:2px 5px;} 
    8989                        #bb_polls .nowrap {white-space:nowrap;} 
     
    283283} 
    284284 
    285 function bb_polls_save_poll_setup($topic_id) { 
     285function bb_polls_save_poll_setup($topic_id=0) { 
    286286global $bb_polls,$topic,$poll_options; 
    287287if (bb_current_user_can('administrate') || bb_current_user_can($bb_polls['minimum_add_level'])) { 
     
    336336function bb_polls_add_header() {  
    337337        if (isset($_POST['poll_question'])) {   // save new poll setup from _post data  
    338                 bb_polls_save_poll_setup();                            
     338                bb_polls_save_poll_setup(0);                           
    339339                // header("HTTP/1.1 307 Temporary redirect"); 
    340340                wp_redirect($GLOBALS["HTTP_SERVER_VARS"]["REQUEST_URI"]);       // I *really* don't like this technique but it's the only way to clear post data?