hallo, ich habe ein problem, ich will eine phpbb datei in ein anderes (darunterliegendes) verzeichnis zu includen, es kommt immer ein fehler... was soll ich tun??
phpbb datei includen
-
-
moin,
schreib uns doch mal den fehler dann können wir dir sicher helfen
und am besten noch den quellcode .. -
ok warte mal kurz
-
das ist der code der datei die ich includen will
shoutbox.php
PHP
Alles anzeigen<?php /*************************************************************************** * shoutbox.php * ------------------- * begin : Friday, Jul 12, 2003 * copyright : (C) 2003 Przemo ( http://www.przemo.org ) * email : [email]przemo@przemo.org[/email] * version : 1.4 * ***************************************************************************/ define('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); ?> <frameset rows="77%, 13%" cols="*" scrolling=NO noresize framespacing=0 frameborder=NO border="0"> <frame src="shoutbox_view.php" name="ekran" noresize marginwidth="0" marginheight="0"> <frame src="shoutbox_send.php" scrolling="no" name="sender" noresize marginwidth="0" marginheight="0"> </frameset> </frameset> <noframes> <body>Sie können keine Frames anzeigen!</body> </noframes> </html>
das ist die datei1 im frame:
shoutbox_send.php:
PHP
Alles anzeigen<?php /*************************************************************************** * shoutbox_send.php * ------------------- * begin : Friday, Jul 12, 2003 * copyright : (C) 2003 Przemo ( http://www.przemo.org ) * email : [email]przemo@przemo.org[/email] * version : 1.4 * ***************************************************************************/ define('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); $hide_txt = '[url='' . append_sid(']' . $lang['sb_hide'] . '[/url]'; if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) { $mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode']; } if ( $mode == "hide" ) { @setcookie('shoutbox',off , (time()+3600*9000), $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); $hide_txt = $lang['sb_hide_done']; } $template->set_filenames(array( 'body' => 'shoutbox_send_body.tpl') ); $template->assign_vars(array( 'S_CONTENT_ENCODING' => $lang['ENCODING'], 'L_SEND' => $lang['Submit'], 'L_GG_MES' => $lang['gg_mes'], 'NICK' => $userdata['username'], 'MAXLENGHT' => $shoutbox_config['text_lenght'], 'SB_USER_ID' => $userdata['user_id'], 'SB_HIDE' => $hide_txt, 'SHOUTBOX_ACTION' => append_sid('shoutbox_view.'.$phpEx)) ); $template->pparse('body'); ?>
frame 2
shoutbox_view.php
PHP
Alles anzeigen<?php /*************************************************************************** * shoutbox_view.php * ------------------- * begin : Friday, Jul 12, 2003 * copyright : (C) 2003 Przemo * website : http://www.przemo.org * email : [email]przemo@przemo.org[/email] * version : 1.4 * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ define('IN_PHPBB', true); $phpbb_root_path = './'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'common.'.$phpEx); include_once($phpbb_root_path . 'includes/bbcode.'.$phpEx); $userdata = session_pagestart($user_ip, PAGE_INDEX); init_userprefs($userdata); if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) { $mode = ( isset($HTTP_GET_VARS['mode']) ) ? $HTTP_GET_VARS['mode'] : $HTTP_POST_VARS['mode']; } if ( isset($HTTP_GET_VARS['name']) || isset($HTTP_POST_VARS['name']) ) { $name = ( isset($HTTP_GET_VARS['name']) ) ? $HTTP_GET_VARS['name'] : $HTTP_POST_VARS['name']; } if ( isset($HTTP_GET_VARS['message']) || isset($HTTP_POST_VARS['message']) ) { $message = ( isset($HTTP_GET_VARS['message']) ) ? $HTTP_GET_VARS['message'] : $HTTP_POST_VARS['message']; } if ( isset($HTTP_GET_VARS['msg']) || isset($HTTP_POST_VARS['msg']) ) { $msg = ( isset($HTTP_GET_VARS['msg']) ) ? $HTTP_GET_VARS['msg'] : $HTTP_POST_VARS['msg']; } if ( isset($HTTP_GET_VARS['id']) || isset($HTTP_POST_VARS['id']) ) { $id = ( isset($HTTP_GET_VARS['id']) ) ? $HTTP_GET_VARS['id'] : $HTTP_POST_VARS['id']; } if ( isset($HTTP_GET_VARS['del_sb_id']) || isset($HTTP_POST_VARS['del_sb_id']) ) { $del_sb_id = ( isset($HTTP_GET_VARS['del_sb_id']) ) ? $HTTP_GET_VARS['del_sb_id'] : $HTTP_POST_VARS['del_sb_id']; } if ( isset($HTTP_GET_VARS['name_id']) || isset($HTTP_POST_VARS['name_id']) ) { $name_id = ( isset($HTTP_GET_VARS['name_id']) ) ? $HTTP_GET_VARS['name_id'] : $HTTP_POST_VARS['name_id']; } if ( isset($HTTP_GET_VARS['date_edit']) || isset($HTTP_POST_VARS['date_edit']) ) { $date_edit = ( isset($HTTP_GET_VARS['date_edit']) ) ? $HTTP_GET_VARS['date_edit'] : $HTTP_POST_VARS['date_edit']; } if ( isset($HTTP_GET_VARS['name_edit']) || isset($HTTP_POST_VARS['name_edit']) ) { $name_edit = ( isset($HTTP_GET_VARS['name_edit']) ) ? $HTTP_GET_VARS['name_edit'] : $HTTP_POST_VARS['name_edit']; } if ( isset($HTTP_GET_VARS['clean_msg']) || isset($HTTP_POST_VARS['clean_msg']) ) { $clean_msg = ( isset($HTTP_GET_VARS['clean_msg']) ) ? $HTTP_GET_VARS['clean_msg'] : $HTTP_POST_VARS['clean_msg']; } if ( isset($HTTP_GET_VARS['submit_button']) || isset($HTTP_POST_VARS['submit_button']) ) { $submit_button = ( isset($HTTP_GET_VARS['submit_button']) ) ? $HTTP_GET_VARS['submit_button'] : $HTTP_POST_VARS['submit_button']; } $sb_user_id = $userdata['user_id']; if ( $mode == "show" ) { @setcookie('shoutbox',on , (time()+3600*9000), $board_config['cookie_path'], $board_config['cookie_domain'], $board_config['cookie_secure']); header("Location: " . append_sid("index.$phpEx?redirect=shoutbox_view.$phpEx", true)); } if ( $mode == "submit" && $msg ) { if ( !$shoutbox_config['allow_guest'] && !$userdata['session_logged_in'] ) { echo '<body onload="window.scrollTo(0,0);" /> <table align="center"><tr><td align="left"><span class="gensmall"> [b]' . $lang['login_to_shoutcast'] . '[/b]</span></td></tr></table>'; } $check_lenght=explode(" ",$msg); $total=sizeof($check_lenght); for($i=0; $total > $i; $i++) if (strlen($check_lenght[$i])>$shoutbox_config['word_lenght']) { $too_long = true; echo '<body onload="window.scrollTo(0,0);" /> <table align="center"><tr><form name="post" action="shoutbox_view.php" method="POST"><td align="left"><span class="gensmall"> [b]' . $lang['too_long_word'] . '[/b]</span></td></tr></table>'; } $current_time = time(); $sql = "SELECT MAX(timestamp) AS last_msg_time FROM " . SHOUTBOX_TABLE . " WHERE sb_user_id = $sb_user_id"; if ( $result = $db->sql_query($sql) ) { if ( $row = $db->sql_fetchrow($result) ) { if ( $row['last_msg_time'] > 0 && ( $current_time - $row['last_msg_time'] ) < $board_config['flood_interval'] ) { $flood_msg = true; echo '<body onload="window.scrollTo(0,0);" /> <table align="center"><tr><td align="left"><span class="gensmall"> ' . $lang['Flood_Error'] . '</span></td></tr></table>'; } } } $shoutbox_config['banned_user_id'] = $GLOBALS['shoutbox_config']['banned_user_id']; if( strstr($shoutbox_config['banned_user_id'], ',') ) { $fids = explode(',', $shoutbox_config['banned_user_id']); while( list($foo, $id) = each($fids) ) { $fid[] = intval( trim($id) ); } } else { $fid[] = intval( trim($shoutbox_config['banned_user_id']) ); } reset($fid); if ( in_array($sb_user_id, $fid) != false ) { echo '<body onload="window.scrollTo(0,0);" /> <table align="center"><tr><td align="left"><span class="gensmall"> ' . $lang['sb_banned_send'] . '</span></td></tr></table>'; $shoutbox_banned = true; } if ( !$too_long && !$flood_msg && !$shoutbox_banned ) if ( $shoutbox_config['allow_guest'] || $userdata['session_logged_in'] ) { $sql = "INSERT INTO " . SHOUTBOX_TABLE . " VALUES('', '$sb_user_id', '$msg', '".time()."', '$name')"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not insert shoutbox message', '', __LINE__, __FILE__, $sql); } $start = time() - $shoutbox_config['delete_days'] * 86400; $sql = "DELETE FROM " . SHOUTBOX_TABLE . " WHERE timestamp < $start"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not delete shoutbox messages', '', __LINE__, __FILE__, $sql); } } } if ( $shoutbox_config['allow_edit_all'] && $username != Anonymous ) $aedit = 1; else $aedit = 0; if ( $shoutbox_config['allow_delete_all'] && $username != Anonymous ) $adel = 1; else $adel = 0; if ( $shoutbox_config['allow_edit'] ) if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN ) $aedit = 1; if ( $shoutbox_config['allow_delete'] ) if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN ) $adel = 1; else $del_mod = "AND sb_user_id = $sb_user_id"; if ( $mode == "delete" && $adel ) { $sql = "DELETE FROM " . SHOUTBOX_TABLE . " WHERE id = $id $del_mod"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not delete shoutbox message', '', __LINE__, __FILE__, $sql); } } if ( $mode == "edit" && $aedit ) { echo '<body onload="window.scrollTo(0,0);" /> <table><tr><form name="post" action="shoutbox_view.php" method="POST"><td align="left"><span class="gensmall"> ' . $lang['Edit_pm'] . ': <input type="text" name="message" style="height:15px" size="60" maxlength="150" " value="' . $clean_msg . '" class="editbox"><input type="hidden" name="mode" value="edited_msg"><input type="hidden" name="id" value="' . $id . '"><input type="hidden" name="name_edit" value="' . $name_edit . '"> <input type="hidden" name="date_edit" value="' . $date_edit . '"> <input type="hidden" name="name_id" value="' . $name_id . '"> <input type="submit" name="submit_button" value="' . $lang['Submit'] . '" style="font-size:9px; height:16px;" class="button"></span></td> </form></tr></table>'; } if ( $mode == "edited_msg" && $aedit ) { $sql = "REPLACE INTO " . SHOUTBOX_TABLE . " VALUES('$id', '$name_id', '$message', '$date_edit', '$name_edit')"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not replace shoutbox message', '', __LINE__, __FILE__, $sql); } } $template->set_filenames(array( 'body' => 'shoutbox_view_body.tpl') ); $shoutbox_config['banned_user_id_view'] = $GLOBALS['shoutbox_config']['banned_user_id_view']; if( strstr($shoutbox_config['banned_user_id_view'], ',') ) { $fids = explode(',', $shoutbox_config['banned_user_id_view']); while( list($foo, $id) = each($fids) ) { $fid[] = intval( trim($id) ); } } else { $fid[] = intval( trim($shoutbox_config['banned_user_id_view']) ); } reset($fid); if ( in_array($sb_user_id, $fid) != false ) { $shoutbox_banned_view = true; } if ( $shoutbox_config['shoutbox_on'] && $shoutbox != "off" && !$shoutbox_banned_view ) if ( $shoutbox_config['allow_guest'] || $shoutbox_config['allow_guest_view'] || $userdata['session_logged_in'] ) { function get_shout_msg() { global $db; $sql = "SELECT COUNT(id) AS total FROM " . SHOUTBOX_TABLE . ""; if ( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query shoutbox count messages', '', __LINE__, __FILE__, $sql); } $row = $db->sql_fetchrow($result); return $row['total']; } $msg_count = get_shout_msg(); $number = $shoutbox_config['count_msg']; $start = $msg_count - $number; if ( $msg_count < $number ) $start = 0; $sql = "SELECT id, sb_user_id, msg, timestamp, sb_username FROM " . SHOUTBOX_TABLE . " ORDER by timestamp LIMIT $start, $number"; if( !($result = $db->sql_query($sql)) ) { message_die(GENERAL_ERROR, 'Could not query shoutbox messages', '', __LINE__, __FILE__, $sql); } if ( $row = $db->sql_fetchrow($result) ) { $i = 0; do { $name_id = $row['sb_user_id']; $username = $row['sb_username']; $username = stripslashes(htmlspecialchars(trim($username))); if ( $shoutbox_config['links_names'] ) $name = '[url='' . append_sid(']' . $username . '[/url]'; else $name = $username; if ( $username == Anonymous ) $name = '' . $lang['Guest'] . ''; $row_color = ( !($i % 2) ) ? $theme['td_color1'] : $theme['td_color2']; $row_class = ( !($i % 2) ) ? $theme['td_class1'] : $theme['td_class2']; if ( $shoutbox_config['date_on'] ) { $make_date = create_date($shoutbox_config['date_format'], $row['timestamp'], $board_config['board_timezone']); $date = '[' . $make_date . ']'; } $msg = $row['msg']; $msg = htmlspecialchars(trim($msg)); if ( $shoutbox_config['allow_smilies'] ) { $msg = smilies_pass($msg); $msg = preg_replace('/images\/smiles/', 'images/smiles', $msg); } if ( $shoutbox_config['make_links'] ) $msg = make_clickable($msg); if ( $shoutbox_config['allow_bbcode'] ) { $msg = str_replace("[/i]","[/i]",$msg); $msg = str_replace("[i]","[i]",$msg); $msg = str_replace("[/b]","[/b]",$msg); $msg = str_replace("[b]","[b]",$msg); $msg = str_replace("[/u]","</u>",$msg); $msg = str_replace("[u]","<u>",$msg); } else { $msg = str_replace("[/i]","",$msg); $msg = str_replace("[i]","",$msg); $msg = str_replace("[/b]","",$msg); $msg = str_replace("[b]","",$msg); $msg = str_replace("[/u]","",$msg); $msg = str_replace("[u]","",$msg); } $id = $row['id']; if ( $shoutbox_config['allow_edit_all'] && $username != Anonymous && $sb_user_id == $name_id ) $aedit = 1; else $aedit = 0; if ( $shoutbox_config['allow_delete_all'] && $username != Anonymous && $sb_user_id == $name_id ) $adel = 1; else $adel = 0; if ( $shoutbox_config['allow_edit'] ) if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN ) $aedit = 1; if ( $shoutbox_config['allow_delete'] ) if ( $userdata['user_level'] == MOD || $userdata['user_level'] == ADMIN ) $adel = 1; if ( $adel ) { $temp_url = append_sid("shoutbox_view.$phpEx?mode=delete&id=$id&del_sb_id=$sb_user_id"); $delmsg = '[url='' . $temp_url . ''][b]X[/b][/url]'; } else { $delmsg = ''; } if ( $aedit ) { $date_edit = $row['timestamp']; $name_edit = $row['sb_username']; $clean_msg = $row['msg']; $temp_url_e = append_sid("shoutbox_view.$phpEx?mode=edit&id=$id&name_id=$name_id&date_edit=$date_edit&name_edit=$name_edit&clean_msg=$clean_msg"); $editmsg = '[url='' . $temp_url_e . ''][b]E[/b][/url]'; } else { $editmsg = ''; } $template->assign_block_vars('shoutrow', array( 'DELMSG' => $delmsg, 'EDITMSG' => $editmsg, 'ROW_CLASS' => $row_class, 'NAME' => $name, 'DATE' => $date, 'MSG' => $msg ) ); $i++; } while ( $row = $db->sql_fetchrow($result) ); } } $template->assign_vars(array( 'S_CONTENT_ENCODING' => $lang['ENCODING']) ); $template->pparse('body'); ?>
es kommt immer folgender fehler:
ZitatWarning: main(./extension.inc): failed to open stream: No such file or directory in /usr/export/www/vhosts/funnetwork/hosting/froozingphp/phpBB2/shoutbox.php on line 14
Warning: main(): Failed opening './extension.inc' for inclusion (include_path='.:') in /usr/export/www/vhosts/funnetwork/hosting/froozingphp/phpBB2/shoutbox.php on line 14
Warning: main(./common.): failed to open stream: No such file or directory in /usr/export/www/vhosts/funnetwork/hosting/froozingphp/phpBB2/shoutbox.php on line 15
Warning: main(): Failed opening './common.' for inclusion (include_path='.:') in /usr/export/www/vhosts/funnetwork/hosting/froozingphp/phpBB2/shoutbox.php on line 15
Fatal error: Call to undefined function: session_pagestart() in /usr/export/www/vhosts/funnetwork/hosting/froozingphp/phpBB2/shoutbox.php on line 16
das mach eich mit diesem code:
weiß wer ne antwort
(es geht übrigens mit garkeiner datei von phpbb
-
dir fehlen die datein:
extension.inc
common.php -
-
ja das ganze ehist bloß, das sich die datein im selben ordner befinden müssen wie die datein die du im browser aufrufst
-
gibts nicht was besseres als include?
-
wiso was gefällt dir daran nicht?
-
weil ich keine luist habe etwas an den verzeichnissen zu ändern - ich hab genug anderes zu tun da hab ich keine zeit alles in ein verzeichnis zu tun - außerdem = unübersichtlich
-
tja dann hst du ein problem!!!
Den was wähe dann für dich besser?
-
ich dachte du wüsstest das...
ich bins schließlich noch unerfahren jung
-
tja include geht halt als standart pfad angabe von der auf zu rufenden datei aus, Also wenn die wechselt must du halt mit absulten pfad includen.
z.B /srv/www/htdocs/web100/html/shoutbox usw...
den erfährt man duchr <?=dirname(_FILE_)?>