Changeset 945283
- Timestamp:
- 07/08/2014 11:42:39 PM (12 years ago)
- Location:
- pondol-bbs/trunk
- Files:
-
- 3 added
- 6 edited
-
includes/class.pondol.bbs.admin.php (modified) (1 diff)
-
includes/class.pondol.bbs.controller.php (modified) (1 diff)
-
includes/class.pondol.bbs.templates.php (modified) (1 diff)
-
includes/func.bbs.php (modified) (2 diffs)
-
pondolbbs.php (modified) (3 diffs)
-
readme.txt (modified) (1 diff)
-
templates_widget (added)
-
templates_widget/default (added)
-
templates_widget/default/widget_module.php (added)
Legend:
- Unmodified
- Added
- Removed
-
pondol-bbs/trunk/includes/class.pondol.bbs.admin.php
r944228 r945283 105 105 } 106 106 107 107 function print_widget_option($instance){ 108 $categoris = $this->ctrl->func->get_bbs_categoris(); 109 $tmplList = $this->ctrl->func->read_dir(PONDOL_BBS_PATH."/templates_widget/"); 110 111 $str = '* first check categoris where you want to take items and put a number as listing numbers </br>'; 112 $str .= 'title : <input class="widefat" id="'.$this->ctrl->super->get_field_id('title').'" name="'.$this->ctrl->super->get_field_name('title').'" value="'.$instance['title'].'"/></br>'; 113 $str .= 'category : </br>'; 114 if(is_array($categoris)) foreach($categoris as $key => $val){ 115 $checked = in_array($val->term_id, $instance['category']) ? " checked":""; 116 $str .= '<input type="checkbox" name="'.$this->ctrl->super->get_field_name('category][').'" value="'.$val->term_id.'"'.$checked.'>'.$val->name.' </br> '; 117 } 118 $str .= '</br>'; 119 $str .= 'list count : </br><input style="width:30px" id="'.$this->ctrl->super->get_field_id('listCnt').'" name="'.$this->ctrl->super->get_field_name('listCnt').'" value="'.$instance['listCnt'].'"/></br>'; 120 $str .='skin : </br>'; 121 $str .='<select name="'.$this->ctrl->super->get_field_name('templates_widget').'">'; 122 123 foreach($tmplList as $key =>$val){ 124 $selected = $instance['templates_widget'] == $val["name"] ? " selected":""; 125 $str .= '<option value="'.$val["name"].'"'.$selected.'>'.$val["name"].'</option>'; 126 } 127 $str .="</select>"; 128 echo $str; 129 } 108 130 } -
pondol-bbs/trunk/includes/class.pondol.bbs.controller.php
r943236 r945283 9 9 public $view, $model, $tmpl; 10 10 11 function __construct() { 11 function __construct($super=null) { 12 $this->super = $super; 12 13 $this->bbs = new Pondol_BBS($this); 13 14 $this->model = new Pondol_BBS_Model($this); -
pondol-bbs/trunk/includes/class.pondol.bbs.templates.php
r943236 r945283 219 219 get_footer( ); 220 220 } 221 222 public function templates_widget_view($instance){ 223 global $wpdb; 224 $rows = $wpdb->get_results(" 225 select 226 p.*, t.term_taxonomy_id, b.USER_NAME, b.COUNT 227 from 228 ".$this->ctrl->model->get_table_name("board")." b 229 left join 230 ".$wpdb->prefix . "posts p 231 on 232 b.POST_ID = p.ID 233 left join 234 ".$wpdb->prefix . "term_relationships t 235 on 236 b.POST_ID = t.object_id 237 where 238 t.term_taxonomy_id in ('".implode("','", $instance[category])."') 239 order by 240 FID desc, THREAD asc 241 limit 242 0, ".$instance["listCnt"] 243 244 ); 245 //print_r($rows); 246 @include_once PONDOL_BBS_PATH.'templates_widget/'.$instance["templates_widget"].'/widget_module.php'; 247 } 221 248 } 222 249 -
pondol-bbs/trunk/includes/func.bbs.php
r943236 r945283 29 29 30 30 31 function get_bbs_categoris($arg){ 32 33 31 function get_bbs_categoris($arg=null){ 34 32 $args = array( 35 33 'type' => 'post', … … 43 41 'include' => '', 44 42 'number' => '', 45 'taxonomy' => 'board',43 'taxonomy' => PONDOL_BBS_TAXO, 46 44 'pad_counts' => false 47 45 ); 48 46 49 $args = array_replace($args, $arg); 50 47 if($arg) $args = array_replace($args, $arg); 51 48 $categories = get_categories( $args ); 49 //print_r($categories); 52 50 return $categories; 53 51 } 54 52 55 53 function get_bbs_category(){ 56 57 58 54 $categoris = $this->get_bbs_categoris(); 59 55 if(is_array($categoris)) foreach($categoris as $key => $val){ -
pondol-bbs/trunk/pondolbbs.php
r944228 r945283 5 5 Description: General BBS Program 6 6 Author: Pondol 7 Version: 1.1. 37 Version: 1.1.4 8 8 Author URI: http://www.shop-wiz.com/wp/plugins/pondol_bbs 9 9 License: GPL2 … … 21 21 define('PONDOL_URL', 'http://www.shop-wiz.com'); 22 22 define('PONDOL_EMAIL', '[email protected]'); 23 define('PONDOL_BBS_VERSION', '1.1 ');23 define('PONDOL_BBS_VERSION', '1.1.4'); 24 24 define('PONDOL_BBS', 'bbs'); 25 25 define('PONDOL_BBS_TAXO', 'board'); … … 83 83 */ 84 84 $bbs = new PondolBBS_Plugin(); 85 86 /** 87 * PONDOL BBS Widget Start 88 */ 89 class PondolBBS_Widget extends WP_Widget { 90 91 function __construct() { 92 parent::__construct( false, 'pondol bbs widget' ); 93 $this->init(); 94 } 95 96 public function init() { 97 //$this->ctrl = new PondolWidget_Visitor_Controller($this); 98 $this->ctrl = new Pondol_BBS_Controller($this); 99 if ( is_admin() ) 100 { 101 //$this->ctrl->admin->admin_init(); 102 //add_action( 'wp_ajax_pondol_visitor_saveoption', array($this->ctrl->model, 'save_option')); 103 }else{ 104 105 } 106 } 107 108 function widget( $args, $instance ) {//display to frontend 109 $this->ctrl->tmpl->templates_widget_view($instance); 110 } 111 112 function update( $new_instance, $old_instance ) {//save widget option 113 $instance = array(); 114 $instance['title'] = ( ! empty( $new_instance['title'] ) ) ? strip_tags( $new_instance['title'] ) : ''; 115 $instance['listCnt'] = ( ! empty( $new_instance['listCnt'] ) ) ? strip_tags( $new_instance['listCnt'] ) : ''; 116 $instance["category"] = $new_instance['category']; 117 $instance['templates_widget'] = $new_instance['templates_widget']; 118 119 120 121 //echo "saved.."; 122 return $instance; 123 } 124 125 function form( $instance ) {//back-end widget form this will be shown where admin > widgeht > option 126 $this->ctrl->admin->print_widget_option($instance); 127 } 128 } 129 130 131 function pondolbbs_register_widgets() { 132 register_widget( 'PondolBBS_Widget' ); 133 } 134 135 add_action( 'widgets_init', 'pondolbbs_register_widgets' ); -
pondol-bbs/trunk/readme.txt
r944231 r945283 35 35 36 36 == Changelog == 37 = 1.1.4 = 38 add widget 39 40 = 1.1.3 = 41 modify gallery form 42 37 43 = 1.1.2 = 38 44 fix bug : when create or edit posts in back-end, did not inserted in bbs database
Note: See TracChangeset
for help on using the changeset viewer.