Hallo, Gast! (Registrieren)

Letzte Ankündigung: MyBB 1.8.38 veröffentlicht (30.04.24)


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste
Plugin: Zeige unbeantwortete Themen
#21
bitteschön...

vlt kannst du ja auch mal das lugin oben anschauen ob man nicht eifach da was machen kann??
Hey ih habs hinbekommen...juhuuuuuuuuuuuuuuuuuuuuuuuuuuu Big Grin

schau so sieht jetzt der code aus und die suchfunktion geht auch und alles klappt

Zitat: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\'] = "Unbeantwortete Themen";
$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

$search_url = MYBB_ROOT."search.php";
$fh = fopen($search_url, "r") or cperror("Could not open file!"); //OPEN FILE
$data = fread($fh, filesize($search_url)) 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" && $mybb->request_method == "post")').'#','elseif($mybb->input[\'action\'] == "unanswered")
{
$where_sql = "1=1";
$where_sql .= " AND t.replies=\'0\'";

$sid = md5(uniqid(microtime(), 1));
$searcharray = array(
"sid" => $db->escape_string($sid),
"uid" => $mybb->user[\'uid\'],
"dateline" => time(),
"ipaddress" => $db->escape_string($session->ipaddress),
"threads" => \'\',
"posts" => \'\',
"searchtype" => "titles",
"resulttype" => "threads",
"querycache" => $db->escape_string($where_sql),
);

$plugins->run_hooks("search_do_search_process");
$db->insert_query(TABLE_PREFIX."searchlog", $searcharray);
redirect("search.php?action=results&sid=".$sid, $lang->redirect_searchresults);
}
elseif($mybb->input[\'action\'] == "do_search" && $mybb->request_method == "post")',$data); //REPLACE IN STRING
$fw = fopen($search_url, "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 Sad

$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(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=unanswered">$lang->welcome_unanswered</a> |').'#', '<a href="search.php?action=getdaily">$lang->welcome_todaysposts</a> |');
}


Angehängte Dateien
.php   search.php (Größe: 35,88 KB / Downloads: 1)
Zitieren


Möglicherweise verwandte Themen…
Thema Verfasser Antworten Ansichten Letzter Beitrag
  View Unread Posts & Zeige ältere Beiträge und Themen Dwarf 7 2.322 16.12.2014, 14:59
Letzter Beitrag: Dwarf
  unbeantwortete themen für 1.4? reisender 12 4.667 11.12.2014, 21:25
Letzter Beitrag: reisender
  Plugin: Suche unbeantwortete Beiträge Grauer-Magier 0 1.470 24.01.2009, 11:58
Letzter Beitrag: Grauer-Magier
Question Zeige Benutzergruppe: --Wenn verfügbar, sekundäre Benutzergruppe-- Rookie-Doo 11 4.628 30.12.2007, 13:31
Letzter Beitrag: Rookie-Doo
  Unbeantwortete Themen anzeigen Grauer-Magier 15 5.915 26.12.2006, 18:23
Letzter Beitrag: Sebijk