Strona 1 z 1
Zła linijka
: 14 kwietnia 2006, 12:17
autor: Betrayal
Mam pytanie, w instrukcji do modu PlusMinus 1.0 pisze tak:
Kod: Zaznacz cały
#
#--[ FIND ]--
# full text: VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $_POST['forumname']) . "', " . intval($_POST[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $_POST['forumdesc']) . "', $next_order, " . intval($_POST['forumstatus']) . ", " . intval($_POST['prune_enable']) . $value_sql . ")";
#
VALUES ('" . $next_id
#
#--[ IN-LINE FIND ]--
#
intval($_POST['forumstatus']) . ", "
#
#--[ IN-LINE AFTER, ADD ]--
#
. intval($_POST['enable_plus']) . ", " . intval($_POST['enable_minus']) . ", "
A tak zrobiłem:
Kod: Zaznacz cały
VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " intval($_POST['forumstatus']) . ", ". intval($_POST['enable_plus']) . ", " . intval($_POST['enable_minus']) . ", ". intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
Wydaje się, żę wszystko dobrze zrobiłem, mimo tego w PA pisze:
Kod: Zaznacz cały
Parse error: parse error in /data/members/free/tripod/uk/g/t/a/gtatown/htdocs/phpbb2/admin/admin_forums.php on line 404
Czy możecie mi pomóc?
: 14 kwietnia 2006, 12:31
autor: TrAvIkK
Wykonaj
Kod: Zaznacz cały
# -- ZNAJDŹ --
VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " intval($_POST['forumstatus']) . ", ". intval($_POST['enable_plus']) . ", " . intval($_POST['enable_minus']) . ", ". intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
# -- ZAMIEŃ NA --
VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " intval($HTTP_POST_VARS['forumstatus']) . ", ". intval($HTTP_POST_VARS['enable_plus']) . ", " . intval($HTTP_POST_VARS['enable_minus']) . ", ". intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
: 14 kwietnia 2006, 12:35
autor: Betrayal
To nic nie dało, i tak to wyskakuje.

: 14 kwietnia 2006, 12:36
autor: TrAvIkK
Sorry nie poprawiłem wszystkiego, teraz w poście powyżej jest już poprawnie.
Poprostu masz zamienić $_POST na $HTTP_POST_VARS
: 14 kwietnia 2006, 12:39
autor: Betrayal
Hmmm... Cały czas jest źle.

: 14 kwietnia 2006, 13:07
autor: TrAvIkK
A pokaż linijki od 400 do 410
: 14 kwietnia 2006, 13:10
autor: Betrayal
Oto one:
Kod: Zaznacz cały
}
// There is no problem having duplicate forum names so we won't check for it.
$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, enable_pluspoints, enable_minuspoints, prune_enable" . $field_sql . ")
VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " intval($HTTP_POST_VARS['forumstatus']) . ", ". intval($HTTP_POST_VARS['enable_plus']) . ", " . intval($HTTP_POST_VARS['enable_minus']) . ", ". intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
if( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, "Couldn't insert row in forums table", "", __LINE__, __FILE__, $sql);
}
if( $HTTP_POST_VARS['prune_enable'] )
: 14 kwietnia 2006, 13:17
autor: TrAvIkK
Ehh aś Pan nakombinował...
Kod: Zaznacz cały
# -- ZNAJDŹ --
VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " intval($HTTP_POST_VARS['forumstatus']) . ", ". intval($HTTP_POST_VARS['enable_plus']) . ", " . intval($HTTP_POST_VARS['enable_minus']) . ", ". intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
# -- ZAMIEŃ NA --
VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['enable_plus']) . ", " . intval($HTTP_POST_VARS['enable_minus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
: 14 kwietnia 2006, 13:19
autor: Betrayal
Dzięki, teraz działa ok.
P.S. Okazało się coś jeszcze, jak klikam na nick usera to nie wyświetla mi się ile user ma pochwal, ostrzeżeń i link Pokaż listę pochwał/ostrzeżeń użytkownika. Proszę mi pomóc
