okay ich hatte noch einges zu ändern mich MYBB_ROOT. dann gings... also ist aktiviert, das problem ist ich sehe nichts im header bzw da wo es sein sollte... ?? :~
ich poste mal das plugin rein wie es jetzt aussieht:
vlt kann mir jemand sagen was ich ändern muss damit es oben erscheint
ich poste mal das plugin rein wie es jetzt aussieht:
Zitat:<?php
/**
* Mod Name: Show Unanwsered Threads
* Copyright Zaher1988 - http://techex.techindo.com
*/
function sua_info()
{
return array(
"name" => "Zeige unbeantwortete Themen",
"description" => "Zeigt alle Themen ohne Antworten.",
"website" => "http://www.thetechex.net",
"author" => "Zaher1988",
"authorsite" => "mailto:zaher1988@gmail.com",
"version" => "1.0",
);
}
function sua_activate()
{
global $db, $mybb, $lang, $templates;
$language = $mybb->settings['bblanguage'];
$tlurl = MYBB_ROOT."inc/languages/deutsch_du/global.lang.php";
//edit txt file
$fh = fopen($tlurl, "r") or cperror("Could not open file!"); //OPEN FILE
$data = fread($fh, filesize($tlurl)) or cperror("Could not read file!"); //MAKE TEMPORARY STRING
fclose($fh); //CLOSE FILE AGAIN
$newdata = preg_replace('#'.preg_quote('$l[\'welcome_todaysposts\']').'#','$l[\'welcome_unanswered\'] = "View Unanswered Threads";
$l[\'welcome_todaysposts\']',$data); //REPLACE IN STRING
$fw = fopen($tlurl, "w") or cperror('Could not open file!'); //OPEN FILE AGAIN
$fb = fwrite($fw, $newdata) or cperror('Could not write to file'); //WRITE STRING TO FILE
fclose($fw); //CLOSE FILE AGAIN
//Let's edit search
$fh = fopen(MYBB_ROOT.'/search.php', "r") or cperror("Could not open file!"); //OPEN FILE
$data = fread($fh, filesize(MYBB_ROOT.'/search.php')) or cperror("Could not read file!"); //MAKE TEMPORARY STRING
fclose($fh); //CLOSE FILE AGAIN
$newdata = preg_replace('#'.preg_quote('elseif($mybb->input[\'action\'] == "do_search")').'#','elseif($mybb->input[\'action\'] == "unanswered")
{
$wheresql = "1=1";
$wheresql .= " AND t.replies=\'0\'";
$searcharray = array(
"uid" => $mybb->user[\'uid\'],
"dateline" => time(),
"ipaddress" => $ipaddress,
"wheresql" => addslashes($wheresql),
"lookin" => "p.message",
"showposts" => 1
);
$db->insert_query(TABLE_PREFIX."searchlog", $searcharray);
$plugins->run_hooks("search_do_search_process");
$sid = $db->insert_id();
eval("\\\$redirect = \"".$templates->get("redirect_searchresults")."\";");
redirect("search.php?action=results&sid=$sid", $lang->redirect_searchresults);
}
elseif($mybb->input[\'action\'] == "do_search")',$data); //REPLACE IN STRING
$fw = fopen(MYBB_ROOT.'/search.php', "w") or cperror('Could not open file!'); //OPEN FILE AGAIN
$fb = fwrite($fw, $newdata) or cperror('Could not write to file'); //WRITE STRING TO FILE
fclose($fw); //CLOSE FILE AGAIN
require MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("header_welcomeblock_member", '#'.preg_quote('<a href="search.php?action=getdaily">$lang->welcome_todaysposts</a> |').'#', '<a href="search.php?action=getdaily">$lang->welcome_todaysposts</a> | <a href="search.php?action=unanswered">\$lang->welcome_unanswered</a> |');
}
function sua_deactivate()
{
global $db, $mybb, $lang, $templates;
$language = $mybb->settings['bblanguage'];
$tlurl = MYBB_ROOT."inc/languages/deutsch_du/global.lang.php";
//edit txt file
$fh = fopen($tlurl, "r") or cperror("Could not open file!"); //OPEN FILE
$data = fread($fh, filesize($tlurl)) or cperror("Could not read file!"); //MAKE TEMPORARY STRING
fclose($fh); //CLOSE FILE AGAIN
$newdata = preg_replace('#'.preg_quote('$l[\'welcome_unanswered\'] = "Unbeantwortete Themen";
$l[\'welcome_todaysposts\']').'#','$l[\'welcome_todaysposts\']',$data); //REPLACE IN STRING
$fw = fopen($tlurl, "w") or cperror('Could not open file!'); //OPEN FILE AGAIN
$fb = fwrite($fw, $newdata) or cperror('Could not write to file'); //WRITE STRING TO FILE
fclose($fw); //CLOSE FILE AGAIN
//Remove
$fh = fopen(MYBB_ROOT.'/search.php', "r") or cperror("Could not open file!"); //OPEN FILE
$data = fread($fh, filesize(MYBB_ROOT.'/search.php')) or cperror("Could not read file!"); //MAKE TEMPORARY STRING
fclose($fh); //CLOSE FILE AGAIN
$newdata = preg_replace('#'.preg_quote('elseif($mybb->input[\'action\'] == "unanswered")
{
$wheresql = "1=1";
$wheresql .= " AND t.replies=\'0\'";
$searcharray = array(
"uid" => $mybb->user[\'uid\'],
"dateline" => time(),
"ipaddress" => $ipaddress,
"wheresql" => addslashes($wheresql),
"lookin" => "p.message",
"showposts" => 1
);
$db->insert_query(TABLE_PREFIX."searchlog", $searcharray);
$plugins->run_hooks("search_do_search_process");
$sid = $db->insert_id();
eval("\\\$redirect = \"".$templates->get("redirect_searchresults")."\";");
redirect("search.php?action=results&sid=$sid", $lang->redirect_searchresults);
}
elseif($mybb->input[\'action\'] == "do_search")').'#','elseif($mybb->input[\'action\'] == "do_search")',$data); //REPLACE IN STRING
$fw = fopen('./search.php', "w") or cperror('Could not open file!'); //OPEN FILE AGAIN
$fb = fwrite($fw, $newdata) or cperror('Could not write to file'); //WRITE STRING TO FILE
fclose($fw); //CLOSE FILE AGAIN
require MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("header_welcomeblock_member", '#'.preg_quote('<a href="search.php?action=getdaily">$lang->welcome_todaysposts</a> | <a href="search.php?action=unanswered">$lang->welcome_unanswered</a> |').'#', '<a href="search.php?action=getdaily">$lang->welcome_todaysposts</a> |');
}
?>
vlt kann mir jemand sagen was ich ändern muss damit es oben erscheint