05.09.2006, 20:40
Wie lautet die Fehlermeldung? Bitte beachte, dass das <?php aufgrund eines Fehlers immer angezeigt wird, aber nicht zum Code gehört, der eingefügt werden muss.
Michael schrieb:...beachte, dass das <?php aufgrund eines Fehlers immer angezeigt wird, aber nicht zum Code gehört, der eingefügt werden muss.
if(basename($_SERVER['PHP_SELF']) == "showthread.php") {
$tid = addslashes(intval($mybb->input['tid']));
$query = $db->query("SELECT subject FROM ".TABLE_PREFIX."threads WHERE tid = ".$tid."");
$threaddescription = $db->fetch_array($query);
$metadescription = "<meta name=\"description\" content=\"".$threaddescription['subject']."\" />";
}
if(basename($_SERVER['PHP_SELF']) == "showthread.php") {
$tid = intval($mybb->input['tid']);
$query = $db->query("SELECT message FROM ".TABLE_PREFIX."posts WHERE tid = ".$tid." AND visible = '1' ORDER BY dateline ASC LIMIT 0,1");
$threaddescription['message'] = str_replace("\"", "", $threaddescription['message']);
$threaddescription['message'] = htmlentities(str_replace("\"", "", $threaddescription['message']));
if (strlen($threaddescription['message']) > 100) {
$forum = substr($threaddescription['message'], 0, 100) . "...";
$metadescription = "<meta name=\"description\" content=\"".$threaddescription['message']."\" />";
}
$threaddescription['message'] = str_replace("\"", "", $threaddescription['message']);
$threaddescription = $db->fetch_array($query);
if(basename($_SERVER['PHP_SELF']) == "showthread.php") {
$tid = intval($mybb->input['tid']);
$query = $db->query("SELECT message FROM ".TABLE_PREFIX."posts WHERE tid = ".$tid." AND visible = '1' ORDER BY dateline ASC LIMIT 0,1");
$threaddescription = $db->fetch_array($query);
$threaddescription['message'] = str_replace("\"", "", $threaddescription['message']);
$threaddescription['message'] = htmlentities(str_replace("\"", "", $threaddescription['message']));
if (strlen($threaddescription['message']) > 100) {
$forum = substr($threaddescription['message'], 0, 100) . "...";
$metadescription = "<meta name=\"description\" content=\"".$threaddescription['message']."\" />";
}
Parse error: parse error, unexpected $ in /var/www/global.php on line 391
if(basename($_SERVER['PHP_SELF']) == "showthread.php") {
$tid = intval($mybb->input['tid']);
$query = $db->query("SELECT message FROM ".TABLE_PREFIX."posts WHERE tid = ".$tid." AND visible = '1' ORDER BY dateline ASC LIMIT 0,1");
$threaddescription = $db->fetch_array($query);
$threaddescription['message'] = str_replace("\"", "", $threaddescription['message']);
$threaddescription['message'] = htmlentities(str_replace("\"", "", $threaddescription['message']));
if (strlen($threaddescription['message']) > 100) {
$forum = substr($threaddescription['message'], 0, 100) . "...";
$metadescription = "<meta name=\"description\" content=\"".$threaddescription['message']."\" />";
}
if(basename($_SERVER['PHP_SELF']) == "showthread.php") {
$tid = addslashes(intval($mybb->input['tid']));
$query = $db->query("SELECT subject FROM ".TABLE_PREFIX."threads WHERE tid = ".$tid."");
$threaddescription = $db->fetch_array($query);
$metadescription = "<meta name=\"description\" content=\"".$threaddescription['subject']."\" />";
}
if(basename($_SERVER['PHP_SELF']) == "showthread.php") {
$tid = intval($mybb->input['tid']);
$query = $db->query("SELECT subject,message FROM ".TABLE_PREFIX."posts WHERE tid = ".$tid." AND visible = '1' ORDER BY dateline ASC LIMIT 0,1");
$threaddescription = $db->fetch_array($query);
$subject = htmlentities($threaddescription['subject']);
if (strlen($threaddescription['message']) > 100) {
$threaddescription['message'] = substr($threaddescription['message'], 0, 100) . "...";
}
$description = htmlentities(str_replace("\"", "", $threaddescription['message']));
$metadescription = "<meta name=\"description\" content=\"".$subject." | ".$description."\" />";
}
<meta name="description" content="DAS IST MEIN TOPIC! | ... und hier kommt mein Beitrag ;)" />