Seite 1 von 2

[Problem] nach einbau von mod messageicon

Verfasst: 06.02.2003 20:54
von Thoman
hallo

bekomme seit einabu des mods folgende fehlermeldung:

Error in posting

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near ')' at line 1

INSERT INTO phpbb_topics (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote, topic_icon) VALUES ('test', 2, 1044560479, 1, 0, 0, 0, )

Line : 256
File : /home/dasmedbb/www.das-megaei.de/Forum/includes/functions_post.php


in der zeile habe ich jedoch nix verändert.

hier die besagte zeile:

message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);

hier mal die zeilen die man ändern soll in der includes/function_post.php

hpBB2/includes/functions_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, &$MsgIcon)

#
#-----[ FIND ]------------------------------------------
#

$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_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, topic_icon) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote, $MsgIcon)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type, topic_vote = $topic_vote, topic_icon = $MsgIcon WHERE topic_id = $topic_id";

#
#-----[ FIND ]------------------------------------------
#

$sql = ( $mode != "editpost" ) ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)" : "UPDATE " . POSTS_TABLE . " SET enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . " WHERE post_id = $post_id";

#
#-----[ REPLACE WITH ]------------------------------------------
#

$sql = ( $mode != "editpost" ) ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig, post_icon) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig, $MsgIcon)" : "UPDATE " . POSTS_TABLE . " SET enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . ", post_icon = $MsgIcon WHERE post_id = $post_id";


wer kann mir da mal weiterhelfen ?

Verfasst: 06.02.2003 20:55
von Thoman
nachtrag das stand ganz oben in der beschreibung noch:

ALTER TABLE phpbb_posts ADD COLUMN post_icon TINYINT (2) UNSIGNED DEFAULT '1' NOT NULL;
ALTER TABLE phpbb_topics ADD COLUMN topic_icon TINYINT (2) UNSIGNED DEFAULT '1' NOT NULL;

Verfasst: 06.02.2003 23:13
von biototo
Dasproblem liegt hier

Code: Alles auswählen

 INSERT INTO phpbb_topics (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote, topic_icon) VALUES ('test', 2, 1044560479, 1, 0, 0, 0, ) 
und zwar darf am ende kein KOmma stehen sondern, da muss ein wert stehen. Aufgrund der Tatsache, das da nichts steht, aber was stehen sollte, weil es 8 Spalten sind aber nur 7 werte, solltest du ncohmal nachschauen, ob du auch wirklich alles korrekt verändert hast, weiles scheint, als wenn in $MsgIcon ncihts drin steht .... check das mal !!!

Verfasst: 06.02.2003 23:46
von Thoman
also das heisst der fehler muss nicht in der includes/functions_post.php stehen sondern kann in einer der anderen stecken ?

templates/subSilver/posting_body.tpl
posting.php
viewforum.php
templates/subSilver/viewforum_body.tpl
viewtopic.php
templates/subSilver/viewtopic_body.tpl

na toll :) wo ich auch sogut mit den sachen klar komme naja also die functions_post.php habe ich nochmal überarbeitet da steht jetzt alles so wie es sein soll.
somit bleiben noch 6 dateien die ich kontrollieren muss :-?

Verfasst: 07.02.2003 00:02
von Thoman
so ich muss was wissen zum einbau (so langsam komme ich mir vor wei ein spammer)

es heisst zb

phpBB2/posting.php

#
#-----[ FIND ]------------------------------------------
#

$refresh = $preview || $poll_add || $poll_edit || $poll_delete;

#
#-----[ AFTER, ADD ]------------------------------------------
#

if ($MsgIcon)
$MsgIconChecked = $MsgIcon;
else
$MsgIconChecked = 1;


so meine frage danach einfügen...das if ($MsgIcon) usw inter dem ; oder das ganze zwischen delete und ;

ich frage lieber so als wenn ich alles wieder verkehrt mache

Verfasst: 07.02.2003 00:07
von Acid
..nach der kompletten Zeile.

Code: Alles auswählen

$refresh = $preview || $poll_add || $poll_edit || $poll_delete;
Übrigens, sollte der Fehler in der functions_post.php zu finden sein.

Verfasst: 07.02.2003 00:22
von Thoman
hehe das sagst jetz wo ich voll dabei bin die posting.php durchsuche
inder der functions_post.php versteh ich nicht denke alles soweit richtig gemacht zu haben :roll:

http://www.ssmf.net/functions_post.rar da hab ich die mal abgelegt.

also wenn du so gut wärst und könntest evtl bitte mal nachsehen ?
und mir den fehler sagen den ich gemacht haben soll ? :oops:

Verfasst: 07.02.2003 00:48
von Acid
...die Datei schaut gut aus, geh ma doch die posting.php durch. :D

Verfasst: 07.02.2003 01:47
von Thoman
:o :o :o :o
naja ich werds probieren

original sieht so aus

$html_on = ( $post_info['enable_html'] ) ? true : false;
$bbcode_on = ( $post_info['enable_bbcode'] ) ? true : false;
$smilies_on = ( $post_info['enable_smilies'] ) ? true : false;
}
else
{

und jetzt soll das hier rein

#
#-----[ FIND ]------------------------------------------
#

$smilies_on = ( $post_info['enable_smilies'] ) ? true : false;

#
#-----[ AFTER, ADD ]------------------------------------------
#

switch ($post_info['post_icon']) {
case 2 : $MsgIconChecked = 2; break;
case 3 : $MsgIconChecked = 3; break;
case 4 : $MsgIconChecked = 4; break;
case 5 : $MsgIconChecked = 5; break;
case 6 : $MsgIconChecked = 6; break;
case 7 : $MsgIconChecked = 7; break;
case 8 : $MsgIconChecked = 8; break;
case 9 : $MsgIconChecked = 9; break;
case 10 : $MsgIconChecked = 10; break;
case 11 : $MsgIconChecked = 11; break;
case 12 : $MsgIconChecked = 12; break;
case 13 : $MsgIconChecked = 13; break;
case 14 : $MsgIconChecked = 14; break;
default : $MsgIconChecked = 1; break;
}

so wenn ich das hinter dieses false; einfüge dann habe ich am ende von den ganzen...2 mal diese klammer }
soll das so richtig sein ?

manman in der anleitung steht 20 minuten
und wie lange sitze ich an diesen einen mod :roll:
egal hauptsache funktioniert :D

Verfasst: 07.02.2003 02:23
von Acid
...is scho richtig (nach false;), denn bei..

Code: Alles auswählen

 switch ($post_info['post_icon'])  {
..findet sich ja die erste Klammer, somit das Ganze dann geschlossen wäre.