ich weis zwar jetzt nicht mehr ganz genau was wo schon vorhanden war, aber hier folgt nun die Modifikation der Modifikation

Code: Alles auswählen
----------öffne modcp.php
-----------Suche
//
// Continue var definitions
//
-------------einfügen danach
$edit = ( isset($HTTP_POST_VARS['edit']) ) ? TRUE : FALSE;
-----------Suche (kommt gleich danach)
if ( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
{
$mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
}
else
{
if ( $delete )
{
$mode = 'delete';
}
------------Füge danach ein
//kategorien EDIT
else if ( $edit )
{
$mode = 'edit';
}
//Kategorien EDIT
--------Suche
message_die(GENERAL_MESSAGE, $lang['Topics_Unlocked'] . '<br /><br />' . $message);
break;
----------Füge ein danach (MODIFIFZIERT !!!)
//kategorien
case 'edit':
if (!$is_auth['auth_cat'])
{
message_die(MESSAGE, sprintf($lang['Sorry_auth_cat'], $is_auth['auth_cat_type']));
}
$page_title = $lang['Mod_CP'];
include($phpbb_root_path . 'includes/page_header.'.$phpEx);
$kategorie = $_POST['kategorie']; $kat_old = $_POST['kat_old'];
$kat_del = $_POST['kat_del']; $add_cat = $_POST['add_cat'];
$total_kat= count($kategorie);
$j=0;
$i=0;
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);
}
}
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)) )
{
echo $add_cat;
echo $sql_k_u;
message_die(GENERAL_ERROR, 'Could not Insert Category table', '', __LINE__, __FILE__, $sql);
}
}
$c_del_k= count($kat_del);
if($c_del_k){
$j=0;
$i=0;
while($j < $c_del_k){
$sql_del="Delete From " . TOPIC_KAT ." where k_id=" .$kat_del[$i];
$j++;
$i++;
if ( !($result = $db->sql_query($sql_del)) )
{
message_die(GENERAL_ERROR, 'Could not Del Category ', '', __LINE__, __FILE__, $sql);
}
}
}
$redirect_page = "$PHP_SELF?f=$forum_id&sid=$sid";
$message= $lang['akt_kat'];
$message.="<br>";
$message.="<a href=\"$redirect_page\">" . $lang['Previous'] . "</a>";
message_die(GENERAL_MESSAGE, $message);
break;
//kategorien
-------------------Suche
'L_SELECT' => $lang['Select'],
------------Füge danach ein
//kategorien
'L_ADD_KAT' =>$lang['new_kat'],
'L_KAT' => $lang['Category'],
'L_KATE' =>$lang['kat'],
'L_DEL_KATE' => $lang['Delete'],
//kategorien
----------------suche
message_die(GENERAL_ERROR, 'Could not obtain topic information', '', __LINE__, __FILE__, $sql);
}
while ( $row = $db->sql_fetchrow($result) )
{
-------------------Füge danach ein
//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
--------------------Suche
'L_TOPIC_FOLDER_ALT' => $folder_alt)
);
}
------------------Füge danach ein
//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
---------------Öffne posting.php
----------Suche
$params = array('submit' => 'post', 'confirm' => 'confirm', 'preview' => 'preview', 'delete' => 'delete', 'poll_delete' => 'poll_delete', 'poll_add' => 'add_poll_option', 'poll_edit' => 'edit_poll_option', 'mode' => 'mode');
------------Ersetze durch
$params = array('submit' => 'post', 'confirm' => 'confirm', 'preview' => 'preview', 'delete' => 'delete', 'poll_delete' => 'poll_delete', 'poll_add' => 'add_poll_option', 'poll_edit' => 'edit_poll_option', 'mode' => 'mode', 'k_id' => 'k_id');
-----------Suche
else
{
$$var = '';
}
}
------------Füge ein danach
// Kategorie Mod
if (!$k_id)
$k_id = 0;
------------Suche
switch ( $mode )
{
case 'newtopic':
if ( empty($forum_id) )
{
message_die(GENERAL_MESSAGE, $lang['Forum_not_exist']);
}
$sql = "SELECT *
FROM " . FORUMS_TABLE . "
WHERE forum_id = $forum_id";
-------------------Füge ein danach
//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= "<select size=\"1\" name=\"k_id\">";
$first.="<option value=\"0\">$kat[kategorie]</option>";
while($kat = $db->sql_fetchrow($result)){
$first.="<option value=\"" . $kat[k_id] . "\">$kat[kategorie]</option>";
}
$first.="</select>";
$kat=$first;
}else{
$kat="<input type=\"hidden\" name=\"k_id\" value=\"0\">";
}
$template->assign_vars(array(
'TOPIC_CAT' => $kat,
));
}
//kategorien
--------------Suche
else if ( $mode == 'quote' || $mode == 'editpost' )
{
$subject = ( $post_data['first_post'] ) ? $post_info['topic_title'] : $post_info['post_subject'];
$message = $post_info['post_text'];
if ( $mode == 'editpost' )
{
-----------Füge ein danach
//kategorien
$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= "<select size=\"1\" name=\"k_id\">";
$first.="<option value=\"0\" $s>$kat[kategorie]</option>";
while($kat = $db->sql_fetchrow($result)){
if(($post_info['k_id'])==$kat['k_id'])
{
$s="selected";
}else
{
$s="";
}
$first.="<option value=\"" . $kat[k_id] . "\" $s>$kat[kategorie]</option>";
}
$first.="</select>";
$kat=$first;
}else{
$kat="<input type=\"hidden\" name=\"k_id\" value=\"0\">";
}
$template->assign_vars(array(
'TOPIC_CAT' => $kat,
));
}
//kategorien
----------------öffne viewtopic.php
----------------suche
$l_edited_by = '<br /><br />' . sprintf($l_edit_time_total, $poster, create_date($board_config['default_dateformat'], $postrow[$i]['post_edit_time'], $board_config['board_timezone']), $postrow[$i]['post_edit_count']);
}
else
{
$l_edited_by = '';
}
------------Füge ein danach
kategorien
if ( $postrow[$i]['k_id'] != 0 ) {
$sql="select kategorie FROM " . TOPIC_KAT . " where k_id=" .$postrow[$i]['k_id'];
if ( $result = $db->sql_query($sql) ){
$kat2 = $db->sql_fetchrow($result);
$topic_kat="[" .$kat2['kategorie'] . "]";
$template->assign_vars(array(
'TOPIC_CAT' => $topic_kat,
));
}
}
//kategorien
--------------------öffne admin/admin_forum_auth.php
------------Suche
$forum_auth_fields = array('auth_view', 'auth_read', 'auth_post', 'auth_reply', 'auth_edit', 'auth_delete', 'auth_sticky', 'auth_announce', 'auth_vote', 'auth_pollcreate');
-----------Ersetze durch
$forum_auth_fields = array('auth_view', 'auth_read', 'auth_post', 'auth_reply', 'auth_edit', 'auth_delete', 'auth_sticky', 'auth_announce', 'auth_vote', 'auth_pollcreate', 'auth_cat');
----------Suche
'auth_vote' => $lang['Vote'],
'auth_pollcreate' => $lang['Pollcreate'],
------------Füge ein danach
'auth_cat' => $lang['kat']);
-----------öffne includes/auth.php
--------Suche
function auth($type, $forum_id, $userdata, $f_access = '')
--------Suche darin
case AUTH_ALL:
------------Ersetze danach
$a_sql = 'a.auth_view, a.auth_read, a.auth_post, a.auth_reply, a.auth_edit, a.auth_delete, a.auth_sticky, a.auth_announce, a.auth_vote, a.auth_pollcreate;
$auth_fields = array('auth_view', 'auth_read', 'auth_post', 'auth_reply', 'auth_edit', 'auth_delete', 'auth_sticky', 'auth_announce', 'auth_vote', 'auth_pollcreate');
-------------durch
$a_sql = 'a.auth_view, a.auth_read, a.auth_post, a.auth_reply, a.auth_edit, a.auth_delete, a.auth_sticky, a.auth_announce, a.auth_vote, a.auth_pollcreate, a.auth_cat';
$auth_fields = array('auth_view', 'auth_read', 'auth_post', 'auth_reply', 'auth_edit', 'auth_delete', 'auth_sticky', 'auth_announce', 'auth_vote', 'auth_pollcreate', 'auth_cat');
-----------Suche
case AUTH_VOTE:
$a_sql = 'a.auth_vote';
$auth_fields = array('auth_vote');
break;
----------Füge ein danach
case AUTH_CAT:
$a_sql = 'a.auth_cat';
$auth_fields = array('auth_cat');
break;
--------------öffne include/functions_post.php
------------Suche
function submit_post(
----------Suche darin
&$poll_length
-------------Füge danach ein
, &$k_id
-----------Suche in der Funktion
if ($mode == 'newtopic' || ($mode == 'editpost' && $post_data['first_post']))
{
$topic_vote = (!empty($poll_title) && count($poll_options) >= 2) ? 1 : 0;
----------------füge danach ein (VERY WICHTIG !)
// KATEGORIE !!!!!!
$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 k_id = $k_id, topic_title = '$post_subject', topic_type = $topic_type " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";
// KATEGORIE !!!!!
----------------------öffne includes/constants.php
------------suche
define('VOTE_USERS_TABLE', $table_prefix.'vote_voters');
----------füge ein danach
//kategorien
define('TOPIC_KAT', $table_prefix.'topic_cat');
//kategorien
-----------------öffne Template | modcp_body.tpl
------------ Suche
<td class="row1" align="center" valign="middle"><span class="postdetails"><b>{L_DEL_KATE}</b></span> </td>
</tr>
-------------Füge danach ein
<!-- BEGIN forum_katrow -->
<tr>
<td class="row1" align="center" valign="middle"><span class="postdetails">{L_KAT}:</span> </td>
<td class="row1" align="center" valign="middle"><span class="postdetails"><input type="text" name="kategorie[]" class="post" size="20" value="{forum_katrow.FORUM_KAT}"></span>
<td class="row1" align="center" valign="middle"><span class="postdetails"><input type="checkbox" name="kat_del[]" value="{forum_katrow.K_ID}"></span> </td>
<input type="hidden" name="kat_old[]" value="{forum_katrow.K_ID}">
</td>
</tr>
<!-- END forum_katrow -->
----------------öffne language/<sprache>_main.php
------------Suche
$lang['Sorry_auth_vote'] = "In diesem Forum knen sich %s an Abstimmungen beteiligen.";
------------füge danach ein
$lang['Sorry_auth_cat'] = "Nur %s haben die Berechtigung die Kategorien bearbeiten.";
-------------Suche
// That's all Folks!
-------------Füge danach ein
$lang['akt_kat']="Kategorie(n) erfolgreich Aktualisiert.";
$lang['new_kat']="Neue Kategorie hinzuf・en:";
$lang['kat']="Kategorien Controlpanel";
--------------------öffne SQL Oberfläche
CREATE TABLE phpbb_categories (
cat_id mediumint(8) unsigned NOT NULL auto_increment,
cat_title varchar(100) default NULL,
cat_order mediumint(8) unsigned NOT NULL default '0',
PRIMARY KEY (cat_id),
KEY cat_order (cat_order)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
ALTER TABLE `phpbb_auth_access` ADD `auth_cat` `auth_cat` TINYINT( 1 ) DEFAULT '0' NOT NULL;
ALTER TABLE `phpbb_forums` ADD `auth_cat` `auth_cat` TINYINT( 1 ) DEFAULT '0' NOT NULL;
Das war's eigentlich
gibt's ein Danke ?!
