|
From: Jon O. <jon...@us...> - 2008-04-27 18:43:03
|
Update of /cvsroot/mxbb/core/includes In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv11813 Modified Files: mx_functions_core.php mx_functions_style.php mx_functions_tools.php Log Message: Includes/ updates. - general fixes (will be discussed in the forums later) - styling buttons Index: mx_functions_core.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_core.php,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -d -r1.87 -r1.88 *** mx_functions_core.php 14 Mar 2008 20:39:24 -0000 1.87 --- mx_functions_core.php 27 Apr 2008 18:42:56 -0000 1.88 *************** *** 3524,3528 **** global $mx_root_path, $phpbb_root_path, $phpEx; ! $path = PORTAL_BACKEND == 'internal' || $force_shared ? $mx_root_path . 'includes/shared/' . PORTAL_BACKEND . '/includes/' : $phpbb_root_path . 'includes/'; if (file_exists($path . $file.'.'.$phpEx)) --- 3524,3544 ---- global $mx_root_path, $phpbb_root_path, $phpEx; ! if (PORTAL_BACKEND == 'internal' || $force_shared) ! { ! switch (PORTAL_BACKEND) ! { ! case 'internal': ! case 'phpbb2': ! $path = $mx_root_path . 'includes/shared/phpbb2/includes/'; ! break; ! case 'phpbb3': ! $path = $mx_root_path . 'includes/shared/phpbb3/includes/'; ! break; ! } ! } ! else ! { ! $path = $phpbb_root_path . 'includes/'; ! } if (file_exists($path . $file.'.'.$phpEx)) Index: mx_functions_style.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_style.php,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** mx_functions_style.php 27 Mar 2008 16:32:42 -0000 1.68 --- mx_functions_style.php 27 Apr 2008 18:42:57 -0000 1.69 *************** *** 402,405 **** --- 402,409 ---- define('MX_IMAGES_NONE' , 60); define('MX_LANG_CUSTOM' , 70); + + define('MX_BUTTON_IMAGE' , 10); + define('MX_BUTTON_TEXT' , 20); + define('MX_BUTTON_GENERIC' , 30); /**#@-*/ *************** *** 874,882 **** break; } ! if (empty($this->template_name)) { ! $row['head_stylesheet'] = $this->template_name = 'subSilver'; } $this->current_template_path = $this->template_path . $this->template_name; --- 878,888 ---- break; } ! ! /* Until discussed... if (empty($this->template_name)) { ! $row['head_stylesheet'] = $this->template_name = 'subSilver'; } + */ $this->current_template_path = $this->template_path . $this->template_name; *************** *** 1159,1163 **** { global $images, $board_config, $template, $phpbb_root_path, $mx_root_path, $theme, $current_module_images; ! global $mx_block; //unset($GLOBALS['MX_TEMPLATE_CONFIG']); --- 1165,1169 ---- { global $images, $board_config, $template, $phpbb_root_path, $mx_root_path, $theme, $current_module_images; ! global $mx_block, $mx_user; //unset($GLOBALS['MX_TEMPLATE_CONFIG']); *************** *** 1643,1646 **** --- 1649,1730 ---- } + /** + * Create buttons. + * + * You can create code for buttons: + * 1) Simple textlinks (MX_BUTTON_TEXT) + * 2) Standard image links (MX_BUTTON_IMAGE) + * 3) Generic buttons, with spanning text on top background image (MX_BUTTON_GENERIC) + * + * Note: The rollover feature is done using a css shift technique, so you do not need separate images + * + * @param unknown_type $type + * @param unknown_type $label + * @param unknown_type $url + * @param unknown_type $img + */ + function create_button($key, $label, $url) + { + global $images; + + switch($images['buttontype'][$key]) + { + case MX_BUTTON_TEXT: + return '<a class="textbutton" href="'. $url .'"><span>' . $label . '</span></a>'; + break; + + case MX_BUTTON_IMAGE: + return '<a class="imagebutton" href="'. $url .'"><img src = "' . $images[$key] . '" alt="' . $label . '" title="' . $label . '" border="0"></a>'; + break; + + case MX_BUTTON_GENERIC: + return '<a class="genericbutton" href="'. $url .'"><span>' . $label . '</span></a>'; + break; + + default: + return '<a class="imagebutton" href="'. $url .'"><img src = "' . $images[$key] . '" alt="' . $label . '" title="' . $label . '" border="0"></a>'; + break; + } + } + + /** + * Create icons. + * + * You can create code for icons: + * 1) Simple textlinks (MX_BUTTON_TEXT) + * 2) Standard image links (MX_BUTTON_IMAGE) + * 3) Generic buttons, with spanning text on top background image (MX_BUTTON_GENERIC) + * + * Note: The rollover feature is done using a css shift technique, so you do not need separate images + * + * @param unknown_type $type + * @param unknown_type $label + * @param unknown_type $url + * @param unknown_type $img + */ + function create_icon($key, $label, $url) + { + global $images; + + switch($images['buttontype'][$key]) + { + case MX_BUTTON_TEXT: + return '<a class="textbutton" href="'. $url .'"><span>' . $label . '</span></a>'; + break; + + case MX_BUTTON_IMAGE: + return '<a class="imagebutton" href="'. $url .'"><img src = "' . $images[$key] . '" alt="' . $label . '" title="' . $label . '" border="0"></a>'; + break; + + case MX_BUTTON_GENERIC: + return '<a class="genericbutton" href="'. $url .'"><span>' . $label . '</span></a>'; + break; + + default: + return '<a class="imagebutton" href="'. $url .'"><img src = "' . $images[$key] . '" alt="' . $label . '" title="' . $label . '" border="0"></a>'; + break; + } + } + } // class mx_user ?> \ No newline at end of file Index: mx_functions_tools.php =================================================================== RCS file: /cvsroot/mxbb/core/includes/mx_functions_tools.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** mx_functions_tools.php 21 Mar 2008 20:12:45 -0000 1.26 --- mx_functions_tools.php 27 Apr 2008 18:42:57 -0000 1.27 *************** *** 3634,3637 **** --- 3634,3638 ---- var $images = array('icon_minipost'=>'', 'comment_post'=>'', 'icon_edit'=>'', 'icon_delpost'=>''); + var $u_post = ''; var $u_delete = ''; *************** *** 3753,3757 **** function display_internal_comments() { ! global $template, $lang, $board_config, $phpEx, $db, $userdata, $images; global $mx_root_path, $module_root_path, $phpbb_root_path, $is_block, $phpEx, $mx_request_vars, $portal_config; --- 3754,3758 ---- function display_internal_comments() { ! global $template, $lang, $board_config, $phpEx, $db, $userdata, $images, $mx_user; global $mx_root_path, $module_root_path, $phpbb_root_path, $is_block, $phpEx, $mx_request_vars, $portal_config; *************** *** 3913,3917 **** 'L_COMMENT_EDIT' => $lang['Comment_edit'], 'U_COMMENT_EDIT' => $this->u_edit($this->comments_row['comments_id']), ! 'EDIT_IMG' => $this->images['icon_edit'], )); } --- 3914,3919 ---- 'L_COMMENT_EDIT' => $lang['Comment_edit'], 'U_COMMENT_EDIT' => $this->u_edit($this->comments_row['comments_id']), ! 'EDIT_IMG' => $images[$this->images['icon_edit']], ! 'B_EDIT_IMG' => $mx_user->create_button($this->images['icon_edit'], $lang['Comment_edit'], $this->u_edit($this->comments_row['comments_id'])), )); } *************** *** 3922,3926 **** 'L_COMMENT_DELETE' => $lang['Comment_delete'], 'U_COMMENT_DELETE' => $this->u_delete($this->comments_row['comments_id']), ! 'DELETE_IMG' => $this->images['icon_delpost'], )); } --- 3924,3929 ---- 'L_COMMENT_DELETE' => $lang['Comment_delete'], 'U_COMMENT_DELETE' => $this->u_delete($this->comments_row['comments_id']), ! 'DELETE_IMG' => $images[$this->images['icon_delpost']], ! 'B_DELETE_IMG' => $mx_user->create_button($this->images['icon_delpost'], $lang['Comment_delete'], $this->u_delete($this->comments_row['comments_id'])), )); } *************** *** 3933,3937 **** 'L_COMMENT_ADD' => $lang['Comment_add'], 'U_COMMENT_POST' => $this->u_post(), ! 'REPLY_IMG' => $this->images['comment_post'], )); } --- 3936,3941 ---- 'L_COMMENT_ADD' => $lang['Comment_add'], 'U_COMMENT_POST' => $this->u_post(), ! 'REPLY_IMG' => $images[$this->images['comment_post']], ! 'B_REPLY_IMG' => $mx_user->create_button($this->images['comment_post'], $lang['Comment_add'], $this->u_post()), )); } *************** *** 3957,3961 **** function display_phpbb_comments( ) { ! global $template, $lang, $board_config, $phpEx, $db, $userdata, $images; global $mx_root_path, $module_root_path, $phpbb_root_path, $is_block, $phpEx, $mx_request_vars, $portal_config; --- 3961,3965 ---- function display_phpbb_comments( ) { ! global $template, $lang, $board_config, $phpEx, $db, $userdata, $images, $mx_user; global $mx_root_path, $module_root_path, $phpbb_root_path, $is_block, $phpEx, $mx_request_vars, $portal_config; *************** *** 4150,4154 **** 'L_COMMENT_EDIT' => $lang['Comment_edit'], 'U_COMMENT_EDIT' => $this->u_edit($this->comments_row['post_id']), ! 'EDIT_IMG' => $this->images['icon_edit'], )); } --- 4154,4159 ---- 'L_COMMENT_EDIT' => $lang['Comment_edit'], 'U_COMMENT_EDIT' => $this->u_edit($this->comments_row['post_id']), ! 'EDIT_IMG' => $images[$this->images['icon_edit']], ! 'B_EDIT_IMG' => $mx_user->create_button($this->images['icon_edit'], $lang['Comment_edit'], $this->u_edit($this->comments_row['post_id'])), )); } *************** *** 4159,4163 **** 'L_COMMENT_DELETE' => $lang['Comment_delete'], 'U_COMMENT_DELETE' => $this->u_delete($this->comments_row['post_id']), ! 'DELETE_IMG' => $this->images['icon_delpost'], )); } --- 4164,4169 ---- 'L_COMMENT_DELETE' => $lang['Comment_delete'], 'U_COMMENT_DELETE' => $this->u_delete($this->comments_row['post_id']), ! 'DELETE_IMG' => $images[$this->images['icon_delpost']], ! 'B_DELETE_IMG' => $mx_user->create_button($this->images['icon_delpost'], $lang['Comment_delete'], $this->u_delete($this->comments_row['post_id'])), )); } *************** *** 4170,4174 **** 'L_COMMENT_ADD' => $lang['Comment_add'], 'U_COMMENT_POST' => $this->u_post(), ! 'REPLY_IMG' => $this->images['comment_post'], )); } --- 4176,4181 ---- 'L_COMMENT_ADD' => $lang['Comment_add'], 'U_COMMENT_POST' => $this->u_post(), ! 'REPLY_IMG' => $images[$this->images['comment_post']], ! 'B_REPLY_IMG' => $mx_user->create_button($this->images['comment_post'], $lang['Comment_add'], $this->u_post()), )); } |