Change Log of Joomsport: [VIEW]晉級圖-主席盃、碟及盾:给match表增加三个字段:grp_id,ordering,level(synchronized with ser
来源:互联网 发布:企业秀软件下载 编辑:程序博客网 时间:2024/06/08 16:41
Target:
For extended functionalities of [赛事晋级图]. Match table should have at least more 3 fields: grp_id, ordering and level.
grp_id: the match belongs to witch Group: A组, B组...
ordering: the order of the matches within the same group
level: the level of the match, 四分之一决赛(quarterfinal),半决赛(semi-final),决赛(final match)
let's add these fields to database:
The type of 'level' is ENUM, which is the first time I use it, just for using it, because never tried.
PHP Change:
/administrator/components/com_joomsport/admin.joomsport.class.php:
note the lines following coment:
class JTableMatch extends JTable{var $id= null;var $m_id = null;var $team1_id = null;var $team2_id= null;var $score1 = null;var $score2 = null;var $match_descr= null;var $published= null;var $is_extra= null;var $m_played= null;var $m_date= null;var $m_time= null;var $m_location= null;var $bonus1= null;var $bonus2= null;var $m_remark= null;//added by Vincent 5th Dec 2011var $grp_id= null;var $ordering= null;var $level= null;function __construct( &$db ){parent::__construct( '#__bl_match', 'id', $db );}}
go to: /administrator/components/com_joomsport/admin.joomsport.php
add lines to function 'BL_MatchEdit':
// added by Vincent Zhang 6th-Dec-2011$levels = array();$levels[] = JHTML::_('select.option', 0, JText::_('選擇比賽級別'), 'id', 'lev_name' );$levels[] = JHTML::_('select.option', 1, JText::_('八強賽'), 'id', 'lev_name' );$levels[] = JHTML::_('select.option', 2, JText::_('四強賽'), 'id', 'lev_name' );$levels[] = JHTML::_('select.option', 3, JText::_('決賽'), 'id', 'lev_name' );$lists['levels'] = $levels;// end
and we can leave function 'BL_MatchSave' definition as it be.
add lines to function 'bl_editMatch':
<!-- level added by Vincent 6th-Dec-2011 --><tr><td><?php echo JText::_( "級別" ); ?></td><td><?phpecho JHTML::_('select.genericlist',$lists['levels'],'level','class="inputbox"','id','lev_name',( (isset($row->level)) ? $row->level : 0 )); ?></td></tr>
For 'grp_id', add lines to function 'BL_MatchEdit':
$is_groups = array();$query = "SELECT id, group_name FROM #__bl_groups WHERE s_id = ".$season_id;$db->setQuery($query);$groups = $db->loadObjectList();$is_groups[] = JHTML::_('select.option', 0, JText::_('BLBE_SELGROUP'), 'id', 'group_name' );$groupis = array_merge($is_groups, $groups);$lists['groups'] = JHTML::_('select.genericlist', $groupis, 'grp_id', 'class="inputbox" size="1"', 'id', 'group_name', ( (isset($row->grp_id)) ? $row->grp_id : 0 ));
Please note that:
1. the last parameter passed to JHTML::_ is the field name in database table: group_name, otherwise, the drop-down list item doesn't have label;
2. the 3rd parameter passed ot JHTML::_('select.genericlist') is the field name, namely the member variable's name of this match class: 'grp_id', it must be the same, because it is used as this HTML input control's name.
/administrator/components/com_joomsport/admin.joomsport.html.php:
<!-- ordering added by Vincent 6th-Dec-2011 --><tr><td width="100"><?php echo JText::_( 'BLBE_GROUPNAME' ); ?></td><td><?php echo $lists['groups'];?></td></tr><!-- ordering added by Vincent 6th-Dec-2011 --><tr><td><?php echo JText::_('BLBE_ORDERING');?></td><td><input type="text" maxlength="1" size="2" name="ordering" value="<?php echo htmlspecialchars($row->ordering);?>" /></td></tr>
- Change Log of Joomsport: [VIEW]晉級圖-主席盃、碟及盾:给match表增加三个字段:grp_id,ordering,level(synchronized with ser
- Change Log of Joomsport: [VIEW]晉級圖-淘汰盃:增加字段number_label1,number_label2到match表(synchronized with ser)
- Change Log of Joomsport: [VIEW]晉級圖-淘汰盃 增加comment1, comment2到match表(synchronized with server)
- Change Log of Joomsport:[VIEW]晉級圖: 增加ranking_alias字段到team,重新使用match的match_descr字段(synchronized)
- Change Log of Joomsport: Error in Joomsport (Synchronized with Server)
- Change Log of Joomsport: 改變[VIEW]賽事編排的mon參數(Synchronized with server)
- Change Log of Joomsport: Remove Undesired HTML(Synchronized with Server)
- Change Log of Joomsport: Create view 'arrangement' with parameter 'month'
- Change Log of Joomsport: Add more fields to season (Synchronized with Server)
- Change Log of Joomsport: Add One Field 'm_remark' to match
- Change Log for Bug-Fixing of Joomsport
- Change Log of Joomsport: Overwrite the CSS
- Change Log of Joomsport: 增加赛事晋级图第二至第四阶段布局
- Change Log for Joomsport: [VIEW] 成績龍虎榜(Ranking List) SQL Programming
- Change Log for Joomsport: [VIEW] - Shooter Ranking (金靴射手榜)
- Change Log for Pruning Undesired Code of Joomsport
- Change Log of Joomsport: Adding 't_type' field for Tournament
- Change Log of Joomsport: Add two fields to season table
- 语音 识别 MFCC DTW 初谈
- 多个控件共用一个响应
- MFC 中获取各种类指针的方法
- 通过注册表修改WINCE系统IP参数
- 基于iptables的NAT转发模块(java版)
- Change Log of Joomsport: [VIEW]晉級圖-主席盃、碟及盾:给match表增加三个字段:grp_id,ordering,level(synchronized with ser
- 引用类型——object类型({'name':'Nicholas'},对象字面常量)
- 获取SD卡视频文件缩略图
- checkbox
- FCLK HCLK PCLK的关系
- Helios版本eclipse 下部署tomcat 非MyEclipse
- flash builder 4.6 ios本机扩展(nae)注意事项
- 数据绑定(三)为Binding指定绑定源的几种方法
- javascript eval函数解析json数据时为什加上圆括号eval("("+data+")")