Seite 1 von 1

Anti Bot Question Mod Problem

Verfasst: 16.08.2007 14:04
von Bulwyief
Hallo @ alle :)

habe heute auf einem anderen Forum den "Anti Spam Bot" Mod installiert...nun habe ich folgende Fehlermeldung im Admin panel:
Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/www/web16/html/wow/admin/admin_users.php on line 1054
Dies sind die Zeilen des Mods in der betroffenen Datei:

// Anti Bot Question Mod - Start
if ($abq_config['abq_register'])
{
$abq_email_variable_name = $abq_config['email_variable_name'];
}
else
{
$abq_email_variable_name = 'email';
}
// Anti Bot Question Mod - End
Grüsse und Dannke im Vorraus
Buly

Verfasst: 16.08.2007 14:10
von Bulwyief
Und gleich noch was^^

Beim testen ob das Registrieren geht folgenede Fehlermeldung:
Parse error: syntax error, unexpected T_ELSE in /home/www/web16/html/wow/includes/usercp_register.php on line 381
Betroffene Zeile 381=rot
include($phpbb_root_path . 'includes/usercp_avatar.'.$phpEx);

$passwd_sql = '';
if ( $mode == 'editprofile' )
{
if ( $user_id != $userdata['user_id'] )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Wrong_Profile'];
}
}
// Anti Bot Question Mod - Start
ABQ_CheckAnswer('Registration');
// Anti Bot Question Mod - End
else if ( $mode == 'register' )
{
if ( empty($username) || empty($new_password) || empty($password_confirm) || empty($email) )
{
$error = TRUE;
$error_msg .= ( ( isset($error_msg) ) ? '<br />' : '' ) . $lang['Fields_empty'];
}
}

Verfasst: 16.08.2007 14:15
von Bulwyief
Oh wei...hört gar nicht mehr auf mit Fehlern....ist die Installation veraltet von dem Mod ? -.-

Folgende Fehler:
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/www/web16/html/wow/db/mysql4.php on line 318

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/www/web16/html/wow/db/mysql4.php on line 318

Warning: Cannot modify header information - headers already sent by (output started at /home/www/web16/html/wow/db/mysql4.php:318) in /home/www/web16/html/wow/includes/page_header.php on line 506

Warning: Cannot modify header information - headers already sent by (output started at /home/www/web16/html/wow/db/mysql4.php:318) in /home/www/web16/html/wow/includes/page_header.php on line 508

Warning: Cannot modify header information - headers already sent by (output started at /home/www/web16/html/wow/db/mysql4.php:318) in /home/www/web16/html/wow/includes/page_header.php on line 509
Zeilen 506-509
header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
}
header ('Expires: 0');
header ('Pragma: no-cache');

$template->pparse('overall_header');

?>

Verfasst: 23.08.2007 18:33
von Troublemaker.name
habe das selbe problem... kann mal jemand sagen ob es an der version liegt oder wo der fehler sein könnte? büddö :)

also fehler bei copy&paste hab ich nicht gemacht.... ;)

Verfasst: 23.08.2007 19:01
von Troublemaker.name
Bulwyief hat geschrieben:Oh wei...hört gar nicht mehr auf mit Fehlern....ist die Installation veraltet von dem Mod ? -.-

Folgende Fehler:
Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/www/web16/html/wow/db/mysql4.php on line 318

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/www/web16/html/wow/db/mysql4.php on line 318

Warning: Cannot modify header information - headers already sent by (output started at /home/www/web16/html/wow/db/mysql4.php:318) in /home/www/web16/html/wow/includes/page_header.php on line 506

Warning: Cannot modify header information - headers already sent by (output started at /home/www/web16/html/wow/db/mysql4.php:318) in /home/www/web16/html/wow/includes/page_header.php on line 508

Warning: Cannot modify header information - headers already sent by (output started at /home/www/web16/html/wow/db/mysql4.php:318) in /home/www/web16/html/wow/includes/page_header.php on line 509
Zeilen 506-509
header ('Cache-Control: private, pre-check=0, post-check=0, max-age=0');
}
header ('Expires: 0');
header ('Pragma: no-cache');

$template->pparse('overall_header');

?>
zu deinem problem:
datei: db/mysql4.php
suche:
Code:
mysql_free_result($query_id);


ersetzte mit:
Code:
@mysql_free_result($query_id);


ich hab nur noch dieses problem auf der registrierung:
Parse error: parse error, unexpected T_ELSE in /srv/www/vhosts/isa-arena.com/httpdocs/forum/includes/usercp_register.php on line 289
wobei die zeile 289 "ELSE" ist im folgenden code abschnitt (rot markiert):
//
// Check and initialize some variables if needed
//
if (
isset($HTTP_POST_VARS['submit']) ||
isset($HTTP_POST_VARS['avatargallery']) ||
isset($HTTP_POST_VARS['submitavatar']) ||
isset($HTTP_POST_VARS['cancelavatar']) ||
$mode == 'register' )
{
include($phpbb_root_path . 'includes/functions_validate.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/functions_post.'.$phpEx);

if ( $mode == 'editprofile' )
{
$user_id = intval($HTTP_POST_VARS['user_id']);
$current_email = trim(htmlspecialchars($HTTP_POST_VARS['current_email']));
}
// Anti Bot Question Mod - Start
if ($abq_config['abq_register'])
{
$abq_email_variable_name = $abq_config['email_variable_name'];
}
else
{
$abq_email_variable_name = 'email';
}
// Anti Bot Question Mod - End

$strip_var_list = array('email' => $abq_email_variable_name, 'icq' => 'icq', 'aim' => 'aim', 'msn' => 'msn', 'yim' => 'yim', 'website' => 'website', 'location' => 'location', 'occupation' => 'occupation', 'interests' => 'interests', 'confirm_code' => 'confirm_code', 'abq_aw' => $abq_config['abq_variable_name'], 'idabq' => 'idabq');

// Strip all tags from data ... may p**s some people off, bah, strip_tags is
// doing the job but can still break HTML output ... have no choice, have
// to use htmlspecialchars ... be prepared to be moaned at.
while( list($var, $param) = @each($strip_var_list) )
{
if ( !empty($HTTP_POST_VARS[$param]) )
{
$$var = trim(htmlspecialchars($HTTP_POST_VARS[$param]));
}
}

$username = ( !empty($HTTP_POST_VARS['username']) ) ? phpbb_clean_username($HTTP_POST_VARS['username']) : '';

$trim_var_list = array('cur_password' => 'cur_password', 'new_password' => 'new_password', 'password_confirm' => 'password_confirm', 'signature' => 'signature');

while( list($var, $param) = @each($trim_var_list) )
{
if ( !empty($HTTP_POST_VARS[$param]) )
{
$$var = trim($HTTP_POST_VARS[$param]);
}
}

$signature = (isset($signature)) ? str_replace('<br />', "\n", $signature) : '';
$signature_bbcode_uid = '';

// Run some validation on the optional fields. These are pass-by-ref, so they'll be changed to
// empty strings if they fail.
validate_optional_fields($icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature);

$viewemail = ( isset($HTTP_POST_VARS['viewemail']) ) ? ( ($HTTP_POST_VARS['viewemail']) ? TRUE : 0 ) : 0;
$allowviewonline = ( isset($HTTP_POST_VARS['hideonline']) ) ? ( ($HTTP_POST_VARS['hideonline']) ? 0 : TRUE ) : TRUE;
$notifyreply = ( isset($HTTP_POST_VARS['notifyreply']) ) ? ( ($HTTP_POST_VARS['notifyreply']) ? TRUE : 0 ) : 0;
$notifypm = ( isset($HTTP_POST_VARS['notifypm']) ) ? ( ($HTTP_POST_VARS['notifypm']) ? TRUE : 0 ) : TRUE;
$popup_pm = ( isset($HTTP_POST_VARS['popup_pm']) ) ? ( ($HTTP_POST_VARS['popup_pm']) ? TRUE : 0 ) : TRUE;
$sid = (isset($HTTP_POST_VARS['sid'])) ? $HTTP_POST_VARS['sid'] : 0;

if ( $mode == 'register' )
{
$attachsig = ( isset($HTTP_POST_VARS['attachsig']) ) ? ( ($HTTP_POST_VARS['attachsig']) ? TRUE : 0 ) : $board_config['allow_sig'];

$allowhtml = ( isset($HTTP_POST_VARS['allowhtml']) ) ? ( ($HTTP_POST_VARS['allowhtml']) ? TRUE : 0 ) : $board_config['allow_html'];
$allowbbcode = ( isset($HTTP_POST_VARS['allowbbcode']) ) ? ( ($HTTP_POST_VARS['allowbbcode']) ? TRUE : 0 ) : $board_config['allow_bbcode'];
$allowsmilies = ( isset($HTTP_POST_VARS['allowsmilies']) ) ? ( ($HTTP_POST_VARS['allowsmilies']) ? TRUE : 0 ) : $board_config['allow_smilies'];
}
else
{
$attachsig = ( isset($HTTP_POST_VARS['attachsig']) ) ? ( ($HTTP_POST_VARS['attachsig']) ? TRUE : 0 ) : $userdata['user_attachsig'];

$allowhtml = ( isset($HTTP_POST_VARS['allowhtml']) ) ? ( ($HTTP_POST_VARS['allowhtml']) ? TRUE : 0 ) : $userdata['user_allowhtml'];
$allowbbcode = ( isset($HTTP_POST_VARS['allowbbcode']) ) ? ( ($HTTP_POST_VARS['allowbbcode']) ? TRUE : 0 ) : $userdata['user_allowbbcode'];
$allowsmilies = ( isset($HTTP_POST_VARS['allowsmilies']) ) ? ( ($HTTP_POST_VARS['allowsmilies']) ? TRUE : 0 ) : $userdata['user_allowsmile'];
}

$user_style = ( isset($HTTP_POST_VARS['style']) ) ? intval($HTTP_POST_VARS['style']) : $board_config['default_style'];

if ( !empty($HTTP_POST_VARS['language']) )
{
if ( preg_match('/^[a-z_]+$/i', $HTTP_POST_VARS['language']) )
{
$user_lang = htmlspecialchars($HTTP_POST_VARS['language']);
}
else
{
$error = true;
$error_msg = $lang['Fields_empty'];
}
}
// Anti Bot Question Mod - Start
ABQ_CheckAnswer('Registration');
// Anti Bot Question Mod - End
else
{
$user_lang = $board_config['default_lang'];
}

$user_timezone = ( isset($HTTP_POST_VARS['timezone']) ) ? doubleval($HTTP_POST_VARS['timezone']) : $board_config['board_timezone'];

$sql = "SELECT config_value
FROM " . CONFIG_TABLE . "
WHERE config_name = 'default_dateformat'";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not select default dateformat', '', __LINE__, __FILE__, $sql);
}
$row = $db->sql_fetchrow($result);
$board_config['default_dateformat'] = $row['config_value'];
$user_dateformat = ( !empty($HTTP_POST_VARS['dateformat']) ) ? trim(htmlspecialchars($HTTP_POST_VARS['dateformat'])) : $board_config['default_dateformat'];

$user_avatar_local = ( isset($HTTP_POST_VARS['avatarselect']) && !empty($HTTP_POST_VARS['submitavatar']) && $board_config['allow_avatar_local'] ) ? htmlspecialchars($HTTP_POST_VARS['avatarselect']) : ( ( isset($HTTP_POST_VARS['avatarlocal']) ) ? htmlspecialchars($HTTP_POST_VARS['avatarlocal']) : '' );
$user_avatar_category = ( isset($HTTP_POST_VARS['avatarcatname']) && $board_config['allow_avatar_local'] ) ? htmlspecialchars($HTTP_POST_VARS['avatarcatname']) : '' ;

$user_avatar_remoteurl = ( !empty($HTTP_POST_VARS['avatarremoteurl']) ) ? trim(htmlspecialchars($HTTP_POST_VARS['avatarremoteurl'])) : '';
$user_avatar_upload = ( !empty($HTTP_POST_VARS['avatarurl']) ) ? trim($HTTP_POST_VARS['avatarurl']) : ( ( $HTTP_POST_FILES['avatar']['tmp_name'] != "none") ? $HTTP_POST_FILES['avatar']['tmp_name'] : '' );
$user_avatar_name = ( !empty($HTTP_POST_FILES['avatar']['name']) ) ? $HTTP_POST_FILES['avatar']['name'] : '';
$user_avatar_size = ( !empty($HTTP_POST_FILES['avatar']['size']) ) ? $HTTP_POST_FILES['avatar']['size'] : 0;
$user_avatar_filetype = ( !empty($HTTP_POST_FILES['avatar']['type']) ) ? $HTTP_POST_FILES['avatar']['type'] : '';

$user_avatar = ( empty($user_avatar_local) && $mode == 'editprofile' ) ? $userdata['user_avatar'] : '';
$user_avatar_type = ( empty($user_avatar_local) && $mode == 'editprofile' ) ? $userdata['user_avatar_type'] : '';

if ( (isset($HTTP_POST_VARS['avatargallery']) || isset($HTTP_POST_VARS['submitavatar']) || isset($HTTP_POST_VARS['cancelavatar'])) && (!isset($HTTP_POST_VARS['submit'])) )
{
$username = stripslashes($username);
$email = stripslashes($email);
$cur_password = htmlspecialchars(stripslashes($cur_password));
$new_password = htmlspecialchars(stripslashes($new_password));
$password_confirm = htmlspecialchars(stripslashes($password_confirm));

$icq = stripslashes($icq);
$aim = stripslashes($aim);
$msn = stripslashes($msn);
$yim = stripslashes($yim);

$website = stripslashes($website);
$location = stripslashes($location);
$occupation = stripslashes($occupation);
$interests = stripslashes($interests);
$signature = htmlspecialchars(stripslashes($signature));

$user_lang = stripslashes($user_lang);
$user_dateformat = stripslashes($user_dateformat);

if ( !isset($HTTP_POST_VARS['cancelavatar']))
{
$user_avatar = $user_avatar_category . '/' . $user_avatar_local;
$user_avatar_type = USER_AVATAR_GALLERY;
}
}
}
gibts da eine lösung? und ja ich hab die suchfunktion genutzt, aber irgendwann nach jede menge spaß und seiten hatte ich keine lust mehr zu suchen... :(

Verfasst: 27.08.2007 11:17
von Troublemaker.name
hm keine hilfe? :(

Verfasst: 27.08.2007 12:04
von gn#36
Auch wenn es schon ein wenig her ist: Für das Hinzufügen neuer Informationen gibt es den [ externes Bild ] (Edit-Button) mit welchem sehr leicht Beiträge bearbeitet werden können, ohne das Thema unübersichtlich zu machen.

Bei diesem Fehler:
Parse error: syntax error, unexpected T_ELSE in /home/www/web16/html/wow/includes/usercp_register.php on line 381
liegt eindeutig ein Fehler beim Modeinbau vor. Es ist sehr wichtig die Klammerung zu beachten wenn man einen Mod einbaut. Ohne den Mod jetzt genauer zu kennen würde ich vermuten, dass der Einbau entweder vor der vorherigen schließenden Klammer erfolgen sollte (das wäre allerdings dann unsinnig weil der Mod ja bei der Registrierung aktiv werden sollte und nicht beim bearbeiten des Profils denke ich) oder aber erst nach dem else if(...){

Gleiches gilt auch für den 2. Fehler mit T_ELSE, ob der Einbau hier vor der schließenden oder nach dem else und der öffnenden Klammer erfolgen sollte kann ich nicht genau sagen, am besten noch mal in der Anleitung nachsehen, da ist in jedem Fall falsch (Meine Vermutung wäre hier vor der schließenden Klammer direkt davor).

Außerdem: Du hast zuviel Code gepostet, was das Thema unnötig in die Länge zieht und unübersichtlich macht.
Es wäre besser die Datei bzw. den Code als .txt Datei abzuspeichern und dann hier einen Link zu posten - siehe auch KB:datei .

Bitte passe deinen Beitrag an, lies Dir sowohl den phpBB.de-Knigge als auch den Hinweis zu Fragestellung und Rechtschreibung sorgfältig durch. Danke.

Bei diesem Fehler würde ich ein ähnliches Problem vermuten:
Parse error: syntax error, unexpected T_DOUBLE_ARROW in /home/www/web16/html/wow/admin/admin_users.php on line 1054
Um das genauer sagen zu können reichen die Informationen aber nicht aus, denn die geposteten Zeilen sind fehlerfrei, der Fehler resultiert aus einer falschen Stelle oder einem Fehler vorher.

Verfasst: 28.08.2007 00:58
von Troublemaker.name
danköööööööööööööööööööööööööööööööööööö

habs gefunden... hätte mir ja auch selber auffallen sollen mit der klammer..... naja vor lauter wald sieht man den baum nicht mehr....

es war auch falsch eingefügt.... hätte 100 zeilen darunter gehört...

aber dankööö und das mit edit is so eine sache... da erscheint ja das thema nicht mehr ganz oben um gesehen zu werden ;)

Verfasst: 03.09.2007 14:00
von gulliver

Code: Alles auswählen

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /mnt/web6/33/45/5842045/htdocs/phpBB2/db/mysql4.php on line 318
Nach Einbau des ABQ-Mods sieht alles erst mal relaiv gut aus, jedoch kommt beim Registrieren die obige Meldung 2 mal nacheinander, das Registrierungsformular wird aber auch (glaub ich) korrekt angezeigt. Der Hinweis:
Troublemaker.name hat geschrieben:zu deinem problem:
datei: db/mysql4.php
suche:
Code:
mysql_free_result($query_id);


ersetzte mit:
Code:
@mysql_free_result($query_id);
bringt bereits beim Aufruf des Bords viele neue Fehler, also habe ich das sofort wieder verworfen. :gruebel:

edit:

Nochmal ganz gründlich, gleiches Ergebnis:

Code: Alles auswählen

ss sql_db } // if ... define ?>
Warning: Cannot modify header information - headers already sent by (output started at /mnt/web6/33/45/5842045/htdocs/phpBB2/db/mysql4.php:344) in /mnt/web6/33/45/5842045/htdocs/phpBB2/includes/sessions.php on line 366

Warning: Cannot modify header information - headers already sent by (output started at /mnt/web6/33/45/5842045/htdocs/phpBB2/db/mysql4.php:344) in /mnt/web6/33/45/5842045/htdocs/phpBB2/includes/sessions.php on line 367

Warning: Cannot modify header information - headers already sent by (output started at /mnt/web6/33/45/5842045/htdocs/phpBB2/db/mysql4.php:344) in /mnt/web6/33/45/5842045/htdocs/phpBB2/includes/page_header.php on line 483

Warning: Cannot modify header information - headers already sent by (output started at /mnt/web6/33/45/5842045/htdocs/phpBB2/db/mysql4.php:344) in /mnt/web6/33/45/5842045/htdocs/phpBB2/includes/page_header.php on line 485

Warning: Cannot modify header information - headers already sent by (output started at /mnt/web6/33/45/5842045/htdocs/phpBB2/db/mysql4.php:344) in /mnt/web6/33/45/5842045/htdocs/phpBB2/includes/page_header.php on line 486
Das kommt bevor die Indexseite des Forums angezeigt wird und bleibt darüber auch zu sehen, wenn die Indexseite aufgebaut ist. Wird die Codeänderung wieder rausgenommen aus der mysql4.php, ist die Indexseite wieder sauber.