################################################################# ## Mod Title: Title Categorie / Prefix to Title ## Mod Version: 1.1.3 ## PHPBB Version 2.0.21 ## Author: Ta Lun - http://www.talun.de for Updates ## Description: Add Titel categories to you Forums. You can see it in the viewforums.php ## and viewtopic.php. You can edit it for each post. ## For each forum you can select you own categories with a CP in the ModCP (modcp.php) ## The Optional Filterinstall for the Forumoverview is found after the primary Install ## Installation Level: Medium ## Installation Time: 30 Minutes / Addon 15 Minutes ## Files To Edit: PHP = viewtopic,viewforum,modcp,posting,constans,lang_main,functions_post ## tpl = viewtopic,viewforum,modcp,posting_body ## ## DEMO forum.talun.de ## ## ## APPEAL: If you have a Forum with this mod you can send me a Mail with your Forum URL for a ## List of Forums who use it. I´m pleased about ## ## ################################################################# ## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites ################################################################# ## ## ################################################################# ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ################################################################# ### Revision History: ## v1.1.2 (2006/08/12) ## Bugfix Addon and Check the PHPBB 2.0.21 ## v1.1.2(2006/05/10) ## Bugfix the Paginationerror for the Addon ## ADD filter for Searchoptions. ## v1.1.1(2006/04/18) ## Run under PHPBB 2.0.20 ## Add Filter Addon for the viewforum ## v1.1.0(2005/11/27) ## Bugfix in the Viewtopic.php ## Revision History: ## v1.0.9(2005/11/14) ## Added post Subject in viewtopic ## Added Searchresults ## Revision History: ## v1.0.8(2005/11/10) ## Run under PHPBB 2.0.18 ## v1.0.7(2005/10/22) ## Run under PHPBB 2.0.17 ##NEW: If on delete from a Prefix/cat all Topics with this Prefix will reset to "without a Prefix" ##Bugfix: Topic-Preview has loose the Prefix so that you must choose it again. Now it not loose it. ## v1.0.6(2005/03/09) ## Topic-Preview loose the Prefix so that you must choose it again ## Run under PHPBB 2.0.13 ## v1.0.5 (2003/07/31) ## Run under Phpbb 2.0.5 small bug fixes (Preview, Change the Categorie to Null in Polls etc.) ## v1.0.3 (2003/03/07) ## Add Categories in List of Modcp (thanks to dookie for the idea) ## Works under phpbb Version 2.0.4 ## v1.0.2 (2002/05/10) ## Some Bugfixes like ## - If No Categorie you cant Post ## - You can choose no Kategories ## v1.0.0 ## - First Release and Final. ## ################################################################# --------Add Table in your Mysql DB---------- CREATE TABLE `phpbb_topic_cat` ( `k_id` INT(11) AUTO_INCREMENT PRIMARY KEY, `forum_id` INT(11), `kategorie` TEXT ); ALTER TABLE `phpbb_topics` ADD `k_id` INT(10) DEFAULT '0'; (Change the name if you want. Then you must change the entries in the constans.php) --------------------------- ########################################################################################## open your lang_main.php (Change it for every Language you have. German and Englisch included) ###----Find---- // // That's all Folks! ##---Add before German---- //KATEGORIEN $lang['akt_kat']="Prefix erfolgreich Aktualisiert."; $lang['new_kat']="Neues Prefix hinzufügen:"; $lang['kat']="Prefix Controlpanel"; $lang['prefix']="Topic Prefix"; ##---Add before Englisch---- //KATEGORIEN $lang['akt_kat']="Prefix Updated"; $lang['new_kat']="Add New Prefix:"; $lang['kat']="Prefix Controlpanel"; $lang['prefix']="Topic Prefix"; ##------------------------------------------ Save and Close lang_main.php ########################################################################################## Open includes/constants.php ##----Find---- define('VOTE_DESC_TABLE', $table_prefix.'vote_desc'); define('VOTE_RESULTS_TABLE', $table_prefix.'vote_results'); define('VOTE_USERS_TABLE', $table_prefix.'vote_voters'); ##-----After Add----- //kategorien define('TOPIC_KAT', $table_prefix.'topic_cat'); //kategorien ##--------------------------- Save and close the constans.php ########################################################################################## open includes/function_post.php ##------Find---- function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length) ##----Replace with----- function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, $post_username, $post_subject, $post_message, $poll_title, &$poll_options, &$poll_length, &$k_id) ##----------------------------- ##----FIND in function submit_post------ $sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id"; ##----Replace with---- $sql = ($mode != "editpost") ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote,k_id) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote, $k_id)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . ", k_id=$k_id WHERE topic_id = $topic_id"; ##-------------------- Save an close the function_post.php ########################################################################################## open /search.php ##------Find---- $search_forum = ( isset($HTTP_POST_VARS['search_forum']) ) ? intval($HTTP_POST_VARS['search_forum']) : -1; ##----ADD, After---- //KATEGORIE MOD $search_prefix = ( isset($HTTP_POST_VARS['search_prefix']) ) ? $HTTP_POST_VARS['search_prefix'] : -1; // KATEGORIE MOD ENDE ##------Find---- if ( $show_results == 'posts' ) { $sql = "SELECT pt.post_text, pt.bbcode_uid, pt.post_subject, p.*, f.forum_id, f.forum_name, t.*, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt WHERE p.post_id IN ($search_results) AND pt.post_id = p.post_id AND f.forum_id = p.forum_id AND p.topic_id = t.topic_id AND p.poster_id = u.user_id"; } else { $sql = "SELECT t.*, f.forum_id, f.forum_name, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2 WHERE t.topic_id IN ($search_results) AND t.topic_poster = u.user_id AND f.forum_id = t.forum_id AND p.post_id = t.topic_first_post_id AND p2.post_id = t.topic_last_post_id AND u2.user_id = p2.poster_id"; } ##----Replace With----- //Kategorien MOD //Laden der search_prefix Daten. $search_pre=""; if($search_prefix !=-1){ $sql_pre="SELECT * from ".TOPIC_KAT." where kategorie='".$search_prefix."' order by k_id"; $result_pre = $db->sql_query($sql_pre); $search_pre.=" AND t.k_id IN ( "; while( $row_pre = $db->sql_fetchrow($result_pre) ){ $search_pre_id[]=$row_pre['k_id']; } $search_pre.= implode(",", $search_pre_id); $search_pre.=")"; }//Ende if -1 //Kategorien if ( $show_results == 'posts' ) { $sql = "SELECT pt.post_text,k.kategorie, pt.bbcode_uid, pt.post_subject, p.*, f.forum_id, f.forum_name, t.*, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid FROM " . FORUMS_TABLE . " f, " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TEXT_TABLE . " pt LEFt JOIN " .TOPIC_KAT. " as k ON t.k_id=k.k_id WHERE p.post_id IN ($search_results) AND pt.post_id = p.post_id AND f.forum_id = p.forum_id AND p.topic_id = t.topic_id AND p.poster_id = u.user_id $search_pre"; } else { $sql = "SELECT t.*, f.forum_id, f.forum_name, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time, k.kategorie FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2 LEFT JOIN ". TOPIC_KAT. " as k ON t.k_id=k.k_id WHERE t.topic_id IN ($search_results) AND t.topic_poster = u.user_id AND f.forum_id = t.forum_id AND p.post_id = t.topic_first_post_id AND p2.post_id = t.topic_last_post_id AND u2.user_id = p2.poster_id $search_pre"; } //Kategorien ##----FIND------ $topic_title = $searchset[$i]['topic_title']; ##----Add After---- //KATEGORIEN if($searchset[$i]['kategorie'] !=""){ $topic_cat ="[".$searchset[$i]['kategorie']."] "; }else{ $topic_cat=""; } //Kategorien ##----FIND------ $template->assign_block_vars("searchresults", array( 'TOPIC_TITLE' => $topic_title, ##----Replace With---- $template->assign_block_vars("searchresults", array( //Kategorien 'TOPIC_CAT' => $topic_cat, //Kategorien 'TOPIC_TITLE' => $topic_title, ##----FIND------ $template->assign_block_vars('searchresults', array( 'FORUM_NAME' => $searchset[$i]['forum_name'], 'FORUM_ID' => $forum_id, ##----Replace With---- $template->assign_block_vars('searchresults', array( 'FORUM_NAME' => $searchset[$i]['forum_name'], 'FORUM_ID' => $forum_id, //Kategorien 'TOPIC_CAT' => $topic_cat, //Kategorien ##----Find--- // // Number of chars returned // $s_characters = ''; $s_characters .= ''; $s_characters .= ''; $s_characters .= ''; ##----Add, before---- //Kategorie MOD //Kategorien listen $sql_kats= "SELECT kategorie from ".TOPIC_KAT." group by kategorie"; $result_kats = $db->sql_query($sql_kats); $s_prefix = ''; while( $row_k = $db->sql_fetchrow($result_kats) ){ $s_prefix .= ''; } ##----Find--- 'L_CATEGORY' => $lang['Category'], ##----Add, After---- 'L_PREFIX' => $lang['prefix'], ###----Find---- 'S_CATEGORY_OPTIONS' => $s_categories, ##----Add, After--- 'S_PREFIX_OPTIONS' => $s_prefix, Save an close the search.php ########################################################################################## Open viewtopic.php ##----Find---- else { $delpost_img = ''; $delpost = ''; } } $post_subject = ( $postrow[$i]['post_subject'] != '' ) ? $postrow[$i]['post_subject'] : ''; ##---Replace with---- else { $delpost_img = ''; $delpost = ''; } } //kategorien if($postrow[$i]['kategorie'] !=""){ $postka= "[" .$postrow[$i]['kategorie']. "] "; }else{ $postka= ""; } if ($postrow[$i]['post_id'] ==$forum_topic_data['topic_first_post_id']){ $post_subject = ( $postrow[$i]['post_subject'] != '' ) ? $postka.$postrow[$i]['post_subject'] : ''; }else{ $post_subject = ( $postrow[$i]['post_subject'] != '' ) ? $postrow[$i]['post_subject'] : ''; } $template->assign_vars(array( 'TOPIC_CAT' => $postka )); //kategorien ##----Find----- // // Go ahead and pull all data for this topic // $sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid, FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt WHERE p.topic_id = $topic_id $limit_posts_time AND pt.post_id = p.post_id AND u.user_id = p.poster_id ORDER BY p.post_time $post_time_order LIMIT $start, ".$board_config['posts_per_page']; ##----Replace with--- // // Go ahead and pull all data for this topic // $sql = "SELECT u.username, u.user_id, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid, k.kategorie FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt, " . TOPICS_TABLE. " t LEFT Join " .TOPIC_KAT. " as k ON t.k_id=k.k_id WHERE p.topic_id = $topic_id $limit_posts_time AND pt.post_id = p.post_id AND u.user_id = p.poster_id AND t.topic_id = $topic_id ORDER BY p.post_time $post_time_order LIMIT $start, ".$board_config['posts_per_page']; ##----------------- Save an Close viewtopic.php ########################################################################################## Open viewforum.php ##---Find---- if( ( $replies + 1 ) > $board_config['posts_per_page'] ) { ##----Add Before----- //kategorien if($topic_rowset[$i]['k_id'] !=0) { $sql="select kategorie FROM " . TOPIC_KAT ." where k_id=" . $topic_rowset[$i]['k_id']; if ( $result = $db->sql_query($sql) ) { $kat = $db->sql_fetchrow($result); $topic_kat="[" .$kat['kategorie'] . "]"; } }else{ $topic_kat=""; } //kategorien ##------------ ##----Find---- $template->assign_block_vars('topicrow', array( 'ROW_COLOR' => $row_color, ##---Replace with----- $template->assign_block_vars('topicrow', array( 'TOPIC_KAT' => $topic_kat, 'ROW_COLOR' => $row_color, ##-------------------- Save and Close viewforum.php ########################################################################################## Open modcp.php ##----Find---- else if ( $unlock ) { $mode = 'unlock'; } ##---Add after--- //kategorien EDIT else if ( $edit ) { $mode = 'edit'; } //Kategorien EDIT ##--------- ##---Find---- // // Obtain relevant data // if ( !empty($topic_id) ) { $sql = "SELECT f.forum_id, f.forum_name, f.forum_topics FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f WHERE t.topic_id = " . $topic_id . " AND f.forum_id = t.forum_id"; ##---Replace with---- // // Obtain relevant data // if ( !empty($topic_id) ) { $sql = "SELECT f.forum_id, f.forum_name, f.forum_topics,t.k_id FROM " . TOPICS_TABLE . " t, " . FORUMS_TABLE . " f WHERE t.topic_id = " . $topic_id . " AND f.forum_id = t.forum_id"; ##------------------- ##----Find---ATTETION there are three very close $template->assign_vars(array( 'META' => '') ); message_die(GENERAL_MESSAGE, $lang['Topics_Locked'] . '

' . $message); break; ##---Add After------ //kategorien case 'edit': $page_title = $lang['Mod_CP']; include($phpbb_root_path . 'includes/page_header.'.$phpEx); //VAlues auslesen $kategorie = ( !empty($HTTP_POST_VARS['kategorie']) ) ? $HTTP_POST_VARS['kategorie'] : array($kategorie); $kat_old = ( isset($HTTP_POST_VARS['kat_old']) ) ? $HTTP_POST_VARS['kat_old'] : array($kat_old); $add_cat = ( isset($HTTP_POST_VARS['add_cat']) ) ? $HTTP_POST_VARS['add_cat'] : ''; $kat_del = ( isset($HTTP_POST_VARS['kat_del']) ) ? $HTTP_POST_VARS['kat_del'] : array($kat_del); //Kategorien Updaten $total_kat= count($kategorie); $j=0; $i=0; if($total_kat>1) { while($j < $total_kat){ $kategorie[$i]=addslashes($kategorie[$i]); $sql="Update " . TOPIC_KAT ." set kategorie='$kategorie[$i]' WHERE k_id=" .$kat_old[$i]; $j++; $i++; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not update Category table', '', __LINE__, __FILE__, $sql); } } } //Kategorie hinzufügen if(!empty($add_cat)) { $add_cat= addslashes($add_cat); $sql_k_u="INSERT INTO " . TOPIC_KAT ." (k_id, forum_id, kategorie) VALUES ('', $forum_id, '$add_cat')"; if (!($result = $db->sql_query($sql_k_u))) { message_die(GENERAL_ERROR, 'Could not Insert Category table', '', __LINE__, __FILE__, $sql_k_u); } } //Kategorie Löschen $c_del_k= count($kat_del); if($c_del_k >1){ $j=0; $i=0; while($j < $c_del_k){ $sql_del="Delete From " . TOPIC_KAT ." where k_id=" .$kat_del[$i]; $sql_del_t="Update ". TOPICS_TABLE ." SET k_id='0' where k_id=" .$kat_del[$i]; $j++; $i++; if ( !($result = $db->sql_query($sql_del)) ) { message_die(GENERAL_ERROR, 'Could not Del Category in Kat Table ', '', __LINE__, __FILE__, $sql_del); } if ( !($result = $db->sql_query($sql_del_t)) ) { message_die(GENERAL_ERROR, 'Could not Del Category in Topic Table ', '', __LINE__, __FILE__, $sql_del); } } } $redirect_page = "modcp.$phpEx?" . POST_FORUM_URL . "=$forum_id&sid=" . $userdata['session_id']; //$message = sprintf($lang['akt_kat'], '', ''); $message= $lang['akt_kat']; $message.="
"; $message.="" . $lang['Previous'] . ""; message_die(GENERAL_MESSAGE, $message); break; //kategorien ##-------------- ##---Find----- 'L_REPLIES' => $lang['Replies'], 'L_LASTPOST' => $lang['Last_Post'], 'L_SELECT' => $lang['Select'], ##----Add after----- //kategorien 'L_ADD_KAT' => $lang['new_kat'], 'L_KAT' => $lang['Category'], 'L_KATE' => $lang['kat'], 'L_DEL_KATE' => $lang['Delete'], //kategorien ##-------- ##----Find---- $topic_title = ''; if ( $row['topic_status'] == TOPIC_LOCKED ) { ##---Add before (i mean before $topic_title="; ok friends? ;-)----- //kategorien if($row['k_id'] !=0){ $sql2="select kategorie FROM " . TOPIC_KAT ." where k_id=".$row['k_id']; if ( $result2 = $db->sql_query($sql2) ) { $kat = $db->sql_fetchrow($result2); $topic_kat="[" .$kat['kategorie'] . "]"; } }else{ $topic_kat=""; } //kategorien ##-------------- ##----Find----- 'TOPIC_ID' => $topic_id, 'L_TOPIC_FOLDER_ALT' => $folder_alt) ); } ##----Bevore ADD----- 'TOPIC_KAT' => $topic_kat, ##----Find the same again----- 'TOPIC_ID' => $topic_id, 'L_TOPIC_FOLDER_ALT' => $folder_alt) ); } ##----Add After---- //kategorien $sql_forum_k="select kategorie,k_id FROM " . TOPIC_KAT ." where forum_id=".$forum_id; if ( $result_f = $db->sql_query($sql_forum_k) ) { while($kat2 = $db->sql_fetchrow($result_f)) { $template->assign_block_vars('forum_katrow', array( 'FORUM_KAT' => $kat2['kategorie'], 'K_ID' => $kat2['k_id']) ); } } //kategorien ##--------------- ##-----Find---- $lock = ( isset($HTTP_POST_VARS['lock']) ) ? TRUE : FALSE; $unlock = ( isset($HTTP_POST_VARS['unlock']) ) ? TRUE : FALSE; ##----Add after---- $edit = ( isset($HTTP_POST_VARS['edit']) ) ? TRUE : FALSE; ##--------- Save and close modcp.php ########################################################################################## open posting.php ##-----Find---- case 'newtopic': if ( empty($forum_id) ) { message_die(GENERAL_MESSAGE, $lang['Forum_not_exist']); } $sql = "SELECT * FROM " . FORUMS_TABLE . " WHERE forum_id = $forum_id"; ##----Add after---- //kategorien $sql_kat="select * FROM " . TOPIC_KAT . " where forum_id=" .$forum_id. " ORDER BY kategorie" ; if ( $result = $db->sql_query($sql_kat) ){ $result2 = $db->sql_query($sql_kat); $kat33 = $db->sql_fetchrow($result2); $to_result=count($kat33); if($to_result >=2){ $first= " "; $kat=$first; }else{ $kat=""; } $template->assign_vars(array( 'TOPIC_CAT' => $kat, )); } //kategorien ##--------- ##----find---- $message = $post_info['post_text']; if ( $mode == 'editpost' ) { ##----Add After---- //kategorien if($post_id ==$post_info['topic_first_post_id']) { $sql_kat2="select * FROM " . TOPIC_KAT . " where forum_id=" .$forum_id. " ORDER BY kategorie" ; if ($result = $db->sql_query($sql_kat2)){ $result2 = $db->sql_query($sql_kat2); $kat33 = $db->sql_fetchrow($result2); $to_cat=count($kat33); if($to_cat >1){ $first= ""; $kat=$first; }else{ $kat=""; } $template->assign_vars(array( 'TOPIC_CAT' => $kat, )); } } //kategorien ##-------- ##------Find---- $username = ( !empty($HTTP_POST_VARS['username']) ) ? $HTTP_POST_VARS['username'] : ''; $subject = ( !empty($HTTP_POST_VARS['subject']) ) ? trim($HTTP_POST_VARS['subject']) : ''; ##----Add before---- $k_id = $HTTP_POST_VARS['k_id']; ##---- ##------Find---- submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length); ##---Replace with---- submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length, $k_id); ##---- ##----Find--- $select_sql = (!$submit) ? ', t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid' : ''; ##---Replace with---- $select_sql = (!$submit) ? ', t.topic_title, t.k_id, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig, u.user_sig_bbcode_uid' : ''; ##-------- ##----Find--- $preview_subject = $subject; $preview_username = $username; ##----Add After---- //kategorien $k_id = $HTTP_POST_VARS['k_id']; //kategorien ##-------- ##----Find--- else if( $error_msg != '' ) { $template->set_filenames(array( 'reg_header' => 'error_body.tpl') ); $template->assign_vars(array( 'ERROR_MESSAGE' => $error_msg) ); $template->assign_var_from_handle('ERROR_BOX', 'reg_header'); } ##----Add After---- //kategorien if($k_id>=0) { $sql_kat2="select * FROM " . TOPIC_KAT . " where forum_id=" .$forum_id. " ORDER BY kategorie" ; if ($result = $db->sql_query($sql_kat2)){ $result2 = $db->sql_query($sql_kat2); $kat33 = $db->sql_fetchrow($result2); $to_cat=count($kat33); if($to_cat >1){ $first= ""; $kat=$first; }else{ $kat=""; } $template->assign_vars(array( 'TOPIC_CAT' => $kat, )); } } //kategorien ##-------- Save and Close Posting.php ########################################################################################## open posting_body.tpl ##----find--- ##----Add Before---- {TOPIC_CAT} ##------- Save and Close posting_body.tpl ########################################################################################## Open modcp_body.tpl ##----Find---- {topicrow.TOPIC_TITLE} ##----Add before---- {topicrow.TOPIC_KAT} ##----Find----   ##----Add After----
{L_KATE} {L_DEL_KATE}
{L_KAT}:
{L_ADD_KAT}
{S_HIDDEN_FIELDS}
##----------------------------------- Save and Close modcp_body.tpl ########################################################################################## open viewtopic_body.tpl ##---Find--- {TOPIC_TITLE}
##----Replace with----- {TOPIC_CAT} {TOPIC_TITLE}
Save and close viewtopic_body.tpl ########################################################################################## Open viewforum_body.tpl ##----Find in the topicrow---- {topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}{topicrow.TOPIC_TITLE}
##---Replace with---- {topicrow.NEWEST_POST_IMG}{topicrow.TOPIC_TYPE}{topicrow.TOPIC_KAT}{topicrow.TOPIC_TITLE}
##------------ Save and close viewforum_body.tpl ########################################################################################## Open search_result_posts.tpl ##----Find in the topicrow----   {L_TOPIC}: {searchresults.TOPIC_TITLE} ##---Replace with----   {L_TOPIC}: {searchresults.TOPIC_CAT} {searchresults.TOPIC_TITLE} ##------------ Save and close search_result_posts.tpl ########################################################################################## Open search_result_topics.tpl ##----Find in the topicrow---- {searchresults.NEWEST_POST_IMG}{searchresults.TOPIC_TYPE}{searchresults.TOPIC_TITLE}
{searchresults.GOTO_PAGE} ##---Replace with---- {searchresults.NEWEST_POST_IMG}{searchresults.TOPIC_TYPE}{searchresults.TOPIC_CAT}{searchresults.TOPIC_TITLE}
{searchresults.GOTO_PAGE} ##------------ Save and close search_result_topics.tpl Open search_body.tpl ##----Find--- {L_CATEGORY}:  {L_SORT_BY}: 
{L_SORT_ASCENDING}
{L_SORT_DESCENDING}
  ##---Add, After--- {L_PREFIX}:      ##---------- Safe and Close the search_body.tpl ########################################################################################## Done with the primary Install have Fun ADD ON ##Description: You can Filter you Prefixes over a Drobdown in the Forum overview Open your lang_main.php (Change it for every Language you have. German and Englisch included) ##----Find---- $lang['kat']="Categories Controlpanel"; ##----Add after for english---- $lang['noprefix']="No Prefix"; ##----Add after for German---- $lang['noprefix']="Kein Prefix"; ##----- Save and Close the lang_main.php Open viewforum.php ##-----Find---- // // End initial var setup // ##----Bevore Add---- //Kategorie if(isset($HTTP_GET_VARS[k_id])){ $k_id=$HTTP_GET_VARS[k_id]; } if(isset($HTTP_POST_VARS[k_id])){ $k_id=$HTTP_POST_VARS[k_id]; } if(isset($HTTP_POST_VARS[buttongo])){ $buttongo=$HTTP_POST_VARS[buttongo]; } if(isset($HTTP_GET_VARS[buttongo])){ $buttongo=$HTTP_GET_VARS[buttongo]; } //Kategorie ##----Find---- $sql = "SELECT * FROM " . FORUMS_TABLE . " WHERE forum_id = $forum_id"; ##----Replace with---- //Kategorie if($buttongo=="Send" && $k_id !=-1) { $sql = "SELECT * FROM " . FORUMS_TABLE . " WHERE forum_id = $forum_id"; $sql2="SELECT count(k_id) as forum_topics FROM ". TOPICS_TABLE. " where k_id= " .$k_id; if ( !($result2 = $db->sql_query($sql2)) ) { message_die(GENERAL_ERROR, 'Could not obtain Prefix information', '', __LINE__, __FILE__, $sql); } }else{ $sql = "SELECT * FROM " . FORUMS_TABLE . " WHERE forum_id = $forum_id"; } //Kategorie ##----Find---- $topics_count = ( $forum_row['forum_topics'] ) ? $forum_row['forum_topics'] : 1; ##----Replace with---- //Kategorie if($buttongo=="Send" && $k_id !=-1) { $row2 = $db->sql_fetchrow($result2); $topics_count = $row2[forum_topics]; }else{ $topics_count = ( $forum_row['forum_topics'] ) ? $forum_row['forum_topics'] : 1; } //Kategorie ##---Find---- // Grab all the basic data (all topics except announcements) // for this forum // $sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2 WHERE t.forum_id = $forum_id AND t.topic_poster = u.user_id AND p.post_id = t.topic_first_post_id AND p2.post_id = t.topic_last_post_id AND u2.user_id = p2.poster_id AND t.topic_type <> " . POST_ANNOUNCE . " $limit_topics_time ORDER BY t.topic_type DESC, t.topic_last_post_id DESC LIMIT $start, ".$board_config['topics_per_page']; ##----Replace with---- //Kategorie if($buttongo=="Send" && $k_id !=-1) { // Grab all the basic data (all topics except announcements) // for this forum // $sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2 WHERE t.forum_id = $forum_id AND t.topic_poster = u.user_id AND p.post_id = t.topic_first_post_id AND p2.post_id = t.topic_last_post_id AND u2.user_id = p2.poster_id AND t.k_id= $k_id AND t.topic_type <> " . POST_ANNOUNCE . " $limit_topics_time ORDER BY t.topic_type DESC, t.topic_last_post_id DESC LIMIT $start, ".$board_config['topics_per_page']; }else{ // Grab all the basic data (all topics except announcements) // for this forum // $sql = "SELECT t.*, u.username, u.user_id, u2.username as user2, u2.user_id as id2, p.post_username, p2.post_username AS post_username2, p2.post_time FROM " . TOPICS_TABLE . " t, " . USERS_TABLE . " u, " . POSTS_TABLE . " p, " . POSTS_TABLE . " p2, " . USERS_TABLE . " u2 WHERE t.forum_id = $forum_id AND t.topic_poster = u.user_id AND p.post_id = t.topic_first_post_id AND p2.post_id = t.topic_last_post_id AND u2.user_id = p2.poster_id AND t.topic_type <> " . POST_ANNOUNCE . " $limit_topics_time ORDER BY t.topic_type DESC, t.topic_last_post_id DESC LIMIT $start, ".$board_config['topics_per_page']; } //Kategorie ##---Find---- if( ( $replies + 1 ) > $board_config['posts_per_page'] ) { $total_pages = ceil( ( $replies + 1 ) / $board_config['posts_per_page'] ); $goto_page = ' [ ' . $lang['Goto_page'] . '' . $lang['Goto_page'] . ': '; $times = 1; ##----Add Before---- //kategorien $sql_kat="select * FROM " . TOPIC_KAT . " where forum_id=" .$forum_id. " ORDER BY kategorie" ; if ( $result = $db->sql_query($sql_kat) ){ $result2 = $db->sql_query($sql_kat); $kat33 = $db->sql_fetchrow($result2); $to_result=count($kat33); if($to_result >=2){ $first= "
"; $first.= " "; $first.=""; $first.="
"; $kat=$first; }else{ $kat=""; } $template->assign_vars(array( 'TOPIC_CAT2' => $kat, )); } //kategorien ##---Find---- 'PAGINATION' => generate_pagination("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start), ##----Replace with---- 'PAGINATION' =>generate_pagination("viewforum.$phpEx?" . POST_FORUM_URL . "=$forum_id&topicdays=$topic_days", $topics_count, $board_config['topics_per_page'], $start, $k_id), ##------------ Save and close viewforum.php Open include/functions.php ##----Find---- function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = TRUE) { ##---to---- $page_string = $lang['Goto_page'] . ' ' . $page_string; return $page_string; } ##----Replace all with follow---- function generate_pagination($base_url, $num_items, $per_page, $start_item,$k_id=FALSE, $add_prevnext_text = TRUE) { global $lang; if($k_id==False){ $k_id=-1; } $total_pages = ceil($num_items/$per_page); if ( $total_pages == 1 ) { return ''; } $on_page = floor($start_item / $per_page) + 1; $page_string = ''; if ( $total_pages > 10 ) { $init_page_max = ( $total_pages > 3 ) ? 3 : $total_pages; for($i = 1; $i < $init_page_max + 1; $i++) { $page_string .= ( $i == $on_page ) ? '' . $i . '' : '' . $i . ''; if ( $i < $init_page_max ) { $page_string .= ", "; } } if ( $total_pages > 3 ) { if ( $on_page > 1 && $on_page < $total_pages ) { $page_string .= ( $on_page > 5 ) ? ' ... ' : ', '; $init_page_min = ( $on_page > 4 ) ? $on_page : 5; $init_page_max = ( $on_page < $total_pages - 4 ) ? $on_page : $total_pages - 4; for($i = $init_page_min - 1; $i < $init_page_max + 2; $i++) { $page_string .= ($i == $on_page) ? '' . $i . '' : '' . $i . ''; if ( $i < $init_page_max + 1 ) { $page_string .= ', '; } } $page_string .= ( $on_page < $total_pages - 4 ) ? ' ... ' : ', '; } else { $page_string .= ' ... '; } for($i = $total_pages - 2; $i < $total_pages + 1; $i++) { $page_string .= ( $i == $on_page ) ? '' . $i . '' : '' . $i . ''; if( $i < $total_pages ) { $page_string .= ", "; } } } } else { for($i = 1; $i < $total_pages + 1; $i++) { $page_string .= ( $i == $on_page ) ? '' . $i . '' : '' . $i . ''; if ( $i < $total_pages ) { $page_string .= ', '; } } } if ( $add_prevnext_text ) { if ( $on_page > 1 ) { $page_string = ' ' . $lang['Previous'] . '  ' . $page_string; } if ( $on_page < $total_pages ) { $page_string .= '  ' . $lang['Next'] . ''; } } $page_string = $lang['Goto_page'] . ' ' . $page_string; return $page_string; } ###----------- Save and Close the function.php Open the viewforum_body.tpl ##----Find---    {L_INDEX} -> {FORUM_NAME} ##----Replace with----    {L_INDEX} -> {FORUM_NAME}   {TOPIC_CAT2} ##------ Save and Close the viewforum_body.tpl EOF