Seite 1 von 2
Advanced Topic Type 1.0.1 funzt nur für Admin und Mods?!
Verfasst: 21.08.2005 08:59
von Scenic-Forum
Hallo Forum
ich habe den
Advanced Topic Type Mod eingebaut, was soweit kein Problem war (ich habe auch die db_update.php nicht vergessen

). Trotzdem komme ich nicht weiter
ACP funzt, wenn ich als Admin oder Moderator ein neues oder bestehendes Thema dann "stempeln" möchte, geht das auch. Nur wenn ich als normaler User eingeloggt bin, wird das Dropdownfeld auch angezeigt und ich kann eine Aufwahl treffen, jedoch tritt nach dem Absenden des Beitrags keine Änderung bzw. Markierung ein. Es scheint, als hätten normale User nicht die Rechte das auszuführen, obwohl es im ACP für "Alle" erlaubt wurde. Wie gesagt, als Admin oder Mod eingeloggt kann ich es aber nutzen wie es soll. Die Mitglieder sollen aber auch selber die Auswahl treffen können.
Hintergrund: Mein phpBB (2.0.17) behandelt ein Auto, für das es mehrere Baureihen/Phasen gibt. Die User sollen eine einfache und schnelle Möglichkeit haben, neue Themen so zu markieren das es sofort zu erkennen ist um welche Phase es sich im geschilderten Problem handelt.
Da ich die Quelle des Problems dort vermute, hier die verlinkte
posting.php
Hat eine(r) eine Idee?
Danke!

Verfasst: 23.08.2005 00:35
von Scenic-Forum
*push*
Mit sind auch Ideen und Gedanken willkommen, aus denen die L�sung folgen k�nnte *liebguck*
Verfasst: 23.08.2005 01:47
von Scenic-Forum
Mal was neues (ganz frisch):
Wähle ich nun mit einem Testaccount ein mit dem Mod erstelltes Topictype aus, erhalte ich diese schöne Meldung:
Code: Alles auswählen
Error in posting
DEBUG MODE
SQL Error : 1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' 0)' at line 1
INSERT INTO phpbb_topics (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('TEST 2', 53, 1124753982, 3, 0, , 0)
Line : 276
File : functions_post.php
Wie nett auch

Ich komme absolut nicht weiter. In der DB scheint alles ok zu sein.
Weil sie in o.g. Fehlermeldung genannt ist, hier die verlinkte
functions_post.php
Zeile 273 kommt mir spanisch vor:
Code: Alles auswählen
$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 $topic_type_active " . (($post_data['edit_vote'] || !empty($poll_title)) ? ", topic_vote = " . $topic_vote : "") . " WHERE topic_id = $topic_id";
Besonders das " topic_type = $topic_type $topic_type_active". Was sagt ihr?
Verfasst: 27.08.2005 00:27
von Scenic-Forum
Ok, offenbar weiß niemand weiter?!
Kennt denn jemand eine Alternative zum o.g. Mod, der dann vielleicht besser funktioniert?
Verfasst: 27.08.2005 02:40
von Einste1n
aus der fehlermeldung von oben würde ich darauf tippen, das dort irgendwo ein komma oder ähnliches fehlt oder zuviel ist ... da hilft nur buchstabe für buchstabe umdrehen
Edit : vorallem das letze komma in der fehlermeldung, vor der 0 erscheint mir falsch (also da sind zwei, normal ist das eins zuviel) ... kann die stelle in der befehlszeile aber irgendwie nicht finden
Verfasst: 29.08.2005 00:36
von Scenic-Forum
Hallo
du meinst das hier?
Ok, aber wie bekomme ich das überzählige Komma weg? Das ist mir leider zu hoch

Oder ist das Komma richtig, aber es fehlt etwas?
Verfasst: 29.08.2005 00:49
von S2B
Das Komma ist auf jeden Fall nicht zu viel. Es liegt vielmehr daran, dass aus der posting.php nicht der korrekte TopicType-Wert an die function weitergegeben wird, anders kann ich mir das nicht erklären.
Verlinke doch mal bitte die posting.php.

Verfasst: 29.08.2005 00:53
von Scenic-Forum
S2B hat geschrieben:
Verlinke doch mal bitte die posting.php.

Gerne doch!
posting.php
Vielen Dank.
Verfasst: 29.08.2005 01:04
von S2B
So auf den ersten und auch den zweiten Blick konnte ich nichts erkennen...
Hast du schon mal die Veränderungen des MODs in der posting.php überprüft? Vielleicht hast du ja irgendwas vergessen...
Ich hatte ganz übersehen, dass du die posting.php oben schon einmal verlinkt hattest.
Verfasst: 29.08.2005 01:09
von Scenic-Forum
S2B hat geschrieben:So auf den ersten und auch den zweiten Blick konnte ich nichts erkennen...
Hast du schon mal die Veränderungen des MODs in der posting.php überprüft? Vielleicht hast du ja irgendwas vergessen...
Ich habe es mehrmals geprüft. Alles so, wie es nach den Anweisungen des Mod sein sollte

Nur das Ergebnis eben leider nicht...
Ich hatte ganz übersehen, dass du die posting.php oben schon einmal verlinkt hattest.
Kein Problem!
Hier mal die Anweisungen in Bezug auf die posting.php
Code: Alles auswählen
#
#-----[ OPEN ]----------------------------------------------
#
posting.php
#-----[ FIND ]----------------------------------------------
#
//
// Topic type selection
//
$topic_type_toggle = '';
if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) )
{
$template->assign_block_vars('switch_type_toggle', array());
if( $is_auth['auth_sticky'] )
{
$topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_STICKY . '"';
if ( $post_data['topic_type'] == POST_STICKY || $topic_type == POST_STICKY )
{
$topic_type_toggle .= ' checked="checked"';
}
$topic_type_toggle .= ' /> ' . $lang['Post_Sticky'] . ' ';
}
if( $is_auth['auth_announce'] )
{
$topic_type_toggle .= '<input type="radio" name="topictype" value="' . POST_ANNOUNCE . '"';
if ( $post_data['topic_type'] == POST_ANNOUNCE || $topic_type == POST_ANNOUNCE )
{
$topic_type_toggle .= ' checked="checked"';
}
$topic_type_toggle .= ' /> ' . $lang['Post_Announcement'] . ' ';
}
if ( $topic_type_toggle != '' )
{
$topic_type_toggle = $lang['Post_topic_as'] . ': <input type="radio" name="topictype" value="' . POST_NORMAL .'"' . ( ( $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL ) ? ' checked="checked"' : '' ) . ' /> ' . $lang['Post_Normal'] . ' ' . $topic_type_toggle;
}
}
#
#-----[ REPLACE WITH ]----------------------------------------------
#
// BEGIN Advanced Topic Type MOD
//
// Topic type selection
//
$topic_type_toggle = '';
if ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) )
{
$template->assign_block_vars('switch_type_toggle', array());
$topic_type_toggle .= '<select name="topictype">';
$topic_type_toggle .= '<option value="'. POST_NORMAL .'"' . ( ( $post_data['topic_type'] == POST_NORMAL || $topic_type == POST_NORMAL ) ? ' selected' : '' ) . '>'. $lang['Post_Normal'] .'</option>';
if( $is_auth['auth_sticky'] )
{
$topic_type_toggle .= '<option value="' . POST_STICKY . '"';
if ( $post_data['topic_type'] == POST_STICKY || $topic_type == POST_STICKY )
{
$topic_type_toggle .= ' selected';
}
$topic_type_toggle .= '>'. $lang['Post_Sticky'] . '</option>';
}
if( $is_auth['auth_announce'] )
{
$topic_type_toggle .= '<option value="' . POST_ANNOUNCE . '"';
if ( $post_data['topic_type'] == POST_ANNOUNCE || $topic_type == POST_ANNOUNCE )
{
$topic_type_toggle .= ' selected';
}
$topic_type_toggle .= '>'. $lang['Post_Announcement'] . '</option>';
}
$sql_tt = "SELECT * FROM ". TOPIC_ADD_TYPE_TABLE ." ORDER BY topic_type_order DESC";
$result_tt = $db->sql_query($sql_tt);
while( $add_type = $db->sql_fetchrow($result_tt) )
{
if( ( ( $userdata['user_level'] >= $add_type['topic_type_auth'] && $add_type['topic_type_auth'] != ADMIN ) || $userdata['user_level'] == ADMIN ) && ( $add_type['topic_type_name'] != 'announce' && $add_type['topic_type_name'] != 'sticky' ) )
{
$topic_add_type = intval( $add_type['topic_type_order'] + POST_ADD_TYPE );
$topic_type_toggle .= '<option value="' . $topic_add_type . '"';
if ( $post_data['topic_type'] == $topic_add_type || $topic_type == $topic_add_type )
{
$topic_type_toggle .= ' selected';
}
$topic_type_toggle .= '>'. stripslashes($add_type['topic_type_name']) . '</option>';
}
}
$topic_type_toggle .= '</select>';
$topic_type_toggle = $lang['Post_topic_as'] . ': '. $topic_type_toggle;
}
// END Advanced Topic Type MOD
#