|
From: Jon O. <jon...@us...> - 2008-07-13 19:39:09
|
Update of /cvsroot/mxbb/mx_slash/includes/views In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv5579/includes/views Modified Files: NewsViews.php PostingViews.php Log Message: related... Index: NewsViews.php =================================================================== RCS file: /cvsroot/mxbb/mx_slash/includes/views/NewsViews.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** NewsViews.php 30 Jan 2004 20:40:24 -0000 1.1 --- NewsViews.php 13 Jul 2008 19:39:05 -0000 1.2 *************** *** 10,14 **** $this->getView(); } // end constructor ! // getView, transforms the model // for the view --- 10,14 ---- $this->getView(); } // end constructor ! // getView, transforms the model // for the view *************** *** 16,20 **** { global $db, $board_config, $lang; ! $this->assign_vars(array( 'L_POSTER' => $lang['Poster'], --- 16,20 ---- { global $db, $board_config, $lang; ! $this->assign_vars(array( 'L_POSTER' => $lang['Poster'], *************** *** 23,27 **** 'PAGINATION' => (!isset( $article )) ? generate_pagination("?news_id=".$news_id, $topics_count, 10, $start) : '' )); ! for ($i = 0; $i < $this->model->number_news; $i++) { --- 23,27 ---- 'PAGINATION' => (!isset( $article )) ? generate_pagination("?news_id=".$news_id, $topics_count, 10, $start) : '' )); ! for ($i = 0; $i < $this->model->number_news; $i++) { *************** *** 29,33 **** $entry->transform($this->model->news_items[$i]); $this->assign_block_vars('newsitem', $entry->getPostVars()); ! } } // end getView.. } --- 29,33 ---- $entry->transform($this->model->news_items[$i]); $this->assign_block_vars('newsitem', $entry->getPostVars()); ! } } // end getView.. } *************** *** 41,77 **** var $forum_url; var $format_topic_time; ! var $row_color; var $row_class; ! var $post_vars; ! function NewsViewEntry($i = null) { global $lang; $this->post_vars = array(); ! $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !($i % 2) ) ? 'row1' : 'row2'; ! $this->post_vars['ROW_COLOR'] = '#' . $row_color; $this->post_vars['ROW_CLASS'] = $row_class; $this->post_vars['L_REPLIES'] = $lang['Comments']; } // end constructor ! // transforms the news post // to template array function transform(& $obj) { ! global $board_config, $lang, $db, $phpEx; $this->post_vars['L_COMMENTS'] = $lang['Read_More']; $this->post_vars['NEWS_ID'] = $obj->news_id; $this->post_vars['USERNAME'] = $obj->user_name; ! $this->post_vars['NEWS_IMAGE'] = PORTAL_URL . 'modules/mx_slash/images/' . $obj->news_image; $this->post_vars['NEWS_CATEGORY'] = $obj->news_category; ! ! $this->post_vars['POST_TEXT'] = mx_decode($obj->post_text, $obj->bbcode_uid); //$this->post_vars['POST_TEXT'] = $this->trim_news_text($this->post_vars['POST_TEXT']); $this->post_vars['TOPIC_TITLE'] = $obj->topic_title; --- 41,77 ---- var $forum_url; var $format_topic_time; ! var $row_color; var $row_class; ! var $post_vars; ! function NewsViewEntry($i = null) { global $lang; $this->post_vars = array(); ! $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !($i % 2) ) ? 'row1' : 'row2'; ! $this->post_vars['ROW_COLOR'] = '#' . $row_color; $this->post_vars['ROW_CLASS'] = $row_class; $this->post_vars['L_REPLIES'] = $lang['Comments']; } // end constructor ! // transforms the news post // to template array function transform(& $obj) { ! global $board_config, $lang, $db, $phpEx, $mx_bbcode; $this->post_vars['L_COMMENTS'] = $lang['Read_More']; $this->post_vars['NEWS_ID'] = $obj->news_id; $this->post_vars['USERNAME'] = $obj->user_name; ! $this->post_vars['NEWS_IMAGE'] = PORTAL_URL . 'modules/mx_slash/images/' . $obj->news_image; $this->post_vars['NEWS_CATEGORY'] = $obj->news_category; ! ! $this->post_vars['POST_TEXT'] = $mx_bbcode->decode($obj->post_text, $obj->bbcode_uid); //$this->post_vars['POST_TEXT'] = $this->trim_news_text($this->post_vars['POST_TEXT']); $this->post_vars['TOPIC_TITLE'] = $obj->topic_title; *************** *** 84,93 **** $this->post_vars['FORMAT_TOPIC_TIME'] = create_date($board_config['default_dateformat'], $obj->topic_time, $board_config['board_timezone']); ! } // end transform ! function trim_news_text( &$text) { ! if ($number != 0 and strlen($text) > $number) { --- 84,93 ---- $this->post_vars['FORMAT_TOPIC_TIME'] = create_date($board_config['default_dateformat'], $obj->topic_time, $board_config['board_timezone']); ! } // end transform ! function trim_news_text( &$text) { ! if ($number != 0 and strlen($text) > $number) { *************** *** 99,103 **** $split_msg = preg_split('#<img src="'.PHPBB_URL.'images/smiles/spacer.gif" alt="spacer.gif" border="0" />#', $text); $text = $split_msg[0]; ! if ($split_msg[1]) { return true; --- 99,103 ---- $split_msg = preg_split('#<img src="'.PHPBB_URL.'images/smiles/spacer.gif" alt="spacer.gif" border="0" />#', $text); $text = $split_msg[0]; ! if ($split_msg[1]) { return true; *************** *** 109,113 **** } } // end func trim_news_text ! function getPostVars() { --- 109,113 ---- } } // end func trim_news_text ! function getPostVars() { *************** *** 116,123 **** } ! class TopicsView extends BaseView { ! function TopicsView(&$model) { --- 116,123 ---- } ! class TopicsView extends BaseView { ! function TopicsView(&$model) { *************** *** 125,134 **** $this->getView(); } // end constructor ! function getView() { // setup template files $this->set_filenames( array('body' => 'news_topics_body.tpl' ) ); ! $this->assign_vars( array( 'L_NEWS_CATEGORIES' => $lang['News_Categories'] --- 125,134 ---- $this->getView(); } // end constructor ! function getView() { // setup template files $this->set_filenames( array('body' => 'news_topics_body.tpl' ) ); ! $this->assign_vars( array( 'L_NEWS_CATEGORIES' => $lang['News_Categories'] *************** *** 147,173 **** $cat_vars = array( ); $row_class = ( !($count % 2) ) ? 'row1' : 'row2'; ! $cats[$count]['news_url'] = PORTAL_URL . '?news_id=' . $cats[$count]['news_id']; ! if( $cats[$count]['news_image_link'] != '' ) { $cats[$count]['news_href'] = '<a href="' . $cats[$count]['news_url'] . '" border="0">' . $cats[$count]['news_image_link'] .'<br><span class="genmed">'.$cats[$count]['news_name'] .'</span>' . '</a>'; } ! while( $count < $num_cats && list( $k, $v ) = each( $cats[$count] ) ) { $cat_vars[strtoupper($k)] = $v; } ! $cat_vars['ROW_CLASS'] = $row_class; ! $this->assign_block_vars('catrow.catitem', $cat_vars); ! $count++; ! } // end assign block } // end category loop ! } ! // parse the templates function display($fn = null) --- 147,173 ---- $cat_vars = array( ); $row_class = ( !($count % 2) ) ? 'row1' : 'row2'; ! $cats[$count]['news_url'] = PORTAL_URL . '?news_id=' . $cats[$count]['news_id']; ! if( $cats[$count]['news_image_link'] != '' ) { $cats[$count]['news_href'] = '<a href="' . $cats[$count]['news_url'] . '" border="0">' . $cats[$count]['news_image_link'] .'<br><span class="genmed">'.$cats[$count]['news_name'] .'</span>' . '</a>'; } ! while( $count < $num_cats && list( $k, $v ) = each( $cats[$count] ) ) { $cat_vars[strtoupper($k)] = $v; } ! $cat_vars['ROW_CLASS'] = $row_class; ! $this->assign_block_vars('catrow.catitem', $cat_vars); ! $count++; ! } // end assign block } // end category loop ! } ! // parse the templates function display($fn = null) Index: PostingViews.php =================================================================== RCS file: /cvsroot/mxbb/mx_slash/includes/views/PostingViews.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PostingViews.php 30 Jan 2004 20:40:24 -0000 1.1 --- PostingViews.php 13 Jul 2008 19:39:05 -0000 1.2 *************** *** 6,13 **** { $this->model = $model; ! $this->set_filenames(array('body'=>'slash_posting_result.tpl')); $this->assign_var('L_RESULT', $lang['Result']); ! if ($this->model->isTemp()) { --- 6,13 ---- { $this->model = $model; ! $this->set_filenames(array('body'=>'slash_posting_result.tpl')); $this->assign_var('L_RESULT', $lang['Result']); ! if ($this->model->isTemp()) { *************** *** 20,28 **** to the index."; } ! $this->assign_var('MESSAGE', $message); ! } // end constructor ! // parse the templates function display($fn = null) --- 20,28 ---- to the index."; } ! $this->assign_var('MESSAGE', $message); ! } // end constructor ! // parse the templates function display($fn = null) *************** *** 30,37 **** parent::display(); } // end display ! } // end submitView ! class PreviewView extends DefaultSubmitView { function PreviewView(&$model) --- 30,37 ---- parent::display(); } // end display ! } // end submitView ! class PreviewView extends DefaultSubmitView { function PreviewView(&$model) *************** *** 41,50 **** parent::DefaultSubmitView($this->model); } // end constructor ! function loadPreview() { ! global $db, $board_config, $phpEx, $mx_root_path; include_once $mx_root_path . 'includes/mx_functions.php'; ! $message = $this->model->getMessage(); $preview_subject = $this->model->getSubject(); --- 41,50 ---- parent::DefaultSubmitView($this->model); } // end constructor ! function loadPreview() { ! global $db, $board_config, $phpEx, $mx_root_path, $mx_bbcode; include_once $mx_root_path . 'includes/mx_functions.php'; ! $message = $this->model->getMessage(); $preview_subject = $this->model->getSubject(); *************** *** 52,65 **** $bbcode_uid = make_bbcode_uid(); $preview_message = stripslashes(prepare_message(addslashes(unprepare_message($message)), $html_on, $bbcode_on, $smilies_on, $bbcode_uid)); ! $preview_username = $username; ! $preview_message = mx_decode($preview_message, $bbcode_uid); $preview_message = make_clickable($preview_message); $preview_message = str_replace("\n", '<br />', $preview_message); ! $this->set_filenames(array( 'preview' => 'slash_posting_preview.tpl') ); ! $this->assign_vars(array( 'TOPIC_TITLE' => $preview_subject, --- 52,65 ---- $bbcode_uid = make_bbcode_uid(); $preview_message = stripslashes(prepare_message(addslashes(unprepare_message($message)), $html_on, $bbcode_on, $smilies_on, $bbcode_uid)); ! $preview_username = $username; ! $preview_message = $mx_bbcode->decode($preview_message, $bbcode_uid); $preview_message = make_clickable($preview_message); $preview_message = str_replace("\n", '<br />', $preview_message); ! $this->set_filenames(array( 'preview' => 'slash_posting_preview.tpl') ); ! $this->assign_vars(array( 'TOPIC_TITLE' => $preview_subject, *************** *** 68,72 **** 'POST_DATE' => create_date($board_config['default_dateformat'], time(), $board_config['board_timezone']), 'MESSAGE' => $preview_message, ! 'L_GET_SUBJECT' => $lang['Post_subject'], 'L_PREVIEW' => $lang['Preview'], --- 68,72 ---- 'POST_DATE' => create_date($board_config['default_dateformat'], time(), $board_config['board_timezone']), 'MESSAGE' => $preview_message, ! 'L_GET_SUBJECT' => $lang['Post_subject'], 'L_PREVIEW' => $lang['Preview'], *************** *** 76,80 **** $this->assign_var_from_handle('POST_PREVIEW_BOX', 'preview'); } // end loadPreview ! // parse the templates function display($fn = null) --- 76,80 ---- $this->assign_var_from_handle('POST_PREVIEW_BOX', 'preview'); } // end loadPreview ! // parse the templates function display($fn = null) *************** *** 82,96 **** parent::display(); } // end display ! } // end PreviewView class ! class DefaultSubmitView extends BaseView { function DefaultSubmitView(&$model) { $this->model = $model; ! global $lang, $phpEx, $board_config, $userdata; ! $this->set_filenames(array( 'body' => 'slash_posting_body.tpl', --- 82,96 ---- parent::display(); } // end display ! } // end PreviewView class ! class DefaultSubmitView extends BaseView { function DefaultSubmitView(&$model) { $this->model = $model; ! global $lang, $phpEx, $board_config, $userdata; ! $this->set_filenames(array( 'body' => 'slash_posting_body.tpl', *************** *** 101,105 **** $hidden_form_fields .= '<input type="hidden" name="temp_id" value="'.$temp_id.'">'; $hidden_form_fields .= '<input type="hidden" name="user_id" value="'.$this->model->getUserId().'">'; ! $this->assign_block_vars('switch_news_cat', array( 'L_NEWS_CATEGORY' => $lang['Select_News_Category'], --- 101,105 ---- $hidden_form_fields .= '<input type="hidden" name="temp_id" value="'.$temp_id.'">'; $hidden_form_fields .= '<input type="hidden" name="user_id" value="'.$this->model->getUserId().'">'; ! $this->assign_block_vars('switch_news_cat', array( 'L_NEWS_CATEGORY' => $lang['Select_News_Category'], *************** *** 111,120 **** $forum_sel = ''; $forum_list = $this->model->getForumList(); ! foreach ($forum_list as $id => $name) { $forum_sel .= '<option value="' . $id . '">' . $name . '</option>'; } ! $this->assign_block_vars('switch_forum_list', array( 'L_FORUM_LIST' => $lang['Select_Forum'], --- 111,120 ---- $forum_sel = ''; $forum_list = $this->model->getForumList(); ! foreach ($forum_list as $id => $name) { $forum_sel .= '<option value="' . $id . '">' . $name . '</option>'; } ! $this->assign_block_vars('switch_forum_list', array( 'L_FORUM_LIST' => $lang['Select_Forum'], *************** *** 123,128 **** )); } ! ! $this->assign_vars(array( 'USERNAME' => $this->model->username, --- 123,128 ---- )); } ! ! $this->assign_vars(array( 'USERNAME' => $this->model->username, *************** *** 132,136 **** 'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'), 'SMILIES_STATUS' => $smilies_status, ! 'L_SUBJECT' => $lang['Subject'], 'L_USERNAME' => $lang['Username'], --- 132,136 ---- 'BBCODE_STATUS' => sprintf($bbcode_status, '<a href="' . append_sid("faq.$phpEx?mode=bbcode") . '" target="_phpbbcode">', '</a>'), 'SMILIES_STATUS' => $smilies_status, ! 'L_SUBJECT' => $lang['Subject'], 'L_USERNAME' => $lang['Username'], *************** *** 148,152 **** 'L_NOTIFY_ON_REPLY' => $lang['Notify'], 'L_DELETE_POST' => $lang['Delete_post'], ! 'L_BBCODE_B_HELP' => $lang['bbcode_b_help'], 'L_BBCODE_I_HELP' => $lang['bbcode_i_help'], --- 148,152 ---- 'L_NOTIFY_ON_REPLY' => $lang['Notify'], 'L_DELETE_POST' => $lang['Delete_post'], ! 'L_BBCODE_B_HELP' => $lang['bbcode_b_help'], 'L_BBCODE_I_HELP' => $lang['bbcode_i_help'], *************** *** 162,166 **** 'L_BBCODE_F_HELP' => $lang['bbcode_f_help'], 'L_EMPTY_MESSAGE' => $lang['Empty_message'], ! 'L_FONT_COLOR' => $lang['Font_color'], 'L_COLOR_DEFAULT' => $lang['color_default'], --- 162,166 ---- 'L_BBCODE_F_HELP' => $lang['bbcode_f_help'], 'L_EMPTY_MESSAGE' => $lang['Empty_message'], ! 'L_FONT_COLOR' => $lang['Font_color'], 'L_COLOR_DEFAULT' => $lang['color_default'], *************** *** 179,183 **** 'L_COLOR_WHITE' => $lang['color_white'], 'L_COLOR_BLACK' => $lang['color_black'], ! 'L_FONT_SIZE' => $lang['Font_size'], 'L_FONT_TINY' => $lang['font_tiny'], --- 179,183 ---- 'L_COLOR_WHITE' => $lang['color_white'], 'L_COLOR_BLACK' => $lang['color_black'], ! 'L_FONT_SIZE' => $lang['Font_size'], 'L_FONT_TINY' => $lang['font_tiny'], *************** *** 186,197 **** 'L_FONT_LARGE' => $lang['font_large'], 'L_FONT_HUGE' => $lang['font_huge'], ! 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], 'L_STYLES_TIP' => $lang['Styles_tip'], 'L_POST_A' => "Submit News", ! 'U_VIEWTOPIC' => ( $mode == 'reply' ) ? append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postorder=desc") : '', 'U_REVIEW_TOPIC' => ( $mode == 'reply' ) ? append_sid("posting.$phpEx?mode=topicreview&" . POST_TOPIC_URL . "=$topic_id") : '', ! 'S_HTML_CHECKED' => ( !$html_on ) ? 'checked="checked"' : '', 'S_BBCODE_CHECKED' => ( !$bbcode_on ) ? 'checked="checked"' : '', --- 186,197 ---- 'L_FONT_LARGE' => $lang['font_large'], 'L_FONT_HUGE' => $lang['font_huge'], ! 'L_BBCODE_CLOSE_TAGS' => $lang['Close_Tags'], 'L_STYLES_TIP' => $lang['Styles_tip'], 'L_POST_A' => "Submit News", ! 'U_VIEWTOPIC' => ( $mode == 'reply' ) ? append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id&postorder=desc") : '', 'U_REVIEW_TOPIC' => ( $mode == 'reply' ) ? append_sid("posting.$phpEx?mode=topicreview&" . POST_TOPIC_URL . "=$topic_id") : '', ! 'S_HTML_CHECKED' => ( !$html_on ) ? 'checked="checked"' : '', 'S_BBCODE_CHECKED' => ( !$bbcode_on ) ? 'checked="checked"' : '', *************** *** 204,208 **** 'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields) ); ! } // end constructor --- 204,208 ---- 'S_HIDDEN_FORM_FIELDS' => $hidden_form_fields) ); ! } // end constructor *************** *** 212,216 **** parent::display(); } // end display ! } --- 212,216 ---- parent::display(); } // end display ! } |