The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#21
|
|||
|
|||
That's actually what I'd expect to see if the stristr() was never matching anything. Maybe try this:
Code:
... $fp = fopen("output.txt", "w"); fwrite($fp, "User Agent: '" . $user_agent . "'\n"); for ($i=0;$i<$n;$i++) { fwrite($fp, "bots[$i]: '" . $bots[$i] . "'\n"); if (strstr($user_agent,$bots[$i])) { fwrite($fp, "Matched.\n"); banned_redirect('www.google.com.cn/search?hl=zh-CN&q=crystal+light+centrum&meta='); } } fwrite($fp, "\nNothing matched.\n"); } |
#22
|
||||
|
||||
KH99, thanks for that, could you amend the code so that it keeps appending, right now it just gives one set of results which i assume are the last set to be written.
Quote:
|
#23
|
|||
|
|||
Yeah, just change the "w" to "a" in the fopen line, like:
$fp = fopen("output.txt", "a"); and maybe add an extra \n to the "Nothing Matched" message so that there'll be some separation between runs. |
#24
|
||||
|
||||
Well it does seem to be working as intended
Quote:
--------------- Added [DATE]1307551911[/DATE] at [TIME]1307551911[/TIME] --------------- I guess that somehow this particular plugin has to be initiated at first call of the forum so it's in the header as im assuming the page is already loading before this gets executed so no redirect takes place??? What do you think? --------------- Added [DATE]1307555486[/DATE] at [TIME]1307555486[/TIME] --------------- I changed the fwrite line and removed the others to only show matched, and sure enough they still do, i've tried different hooks but no redirect? Quote:
Maybe it is working, ran it for around 15 minutes and BAIDU disappeared!, juts doing some more tests over 30 minutes and will report back --------------- Added [DATE]1307558959[/DATE] at [TIME]1307558959[/TIME] --------------- Yep, found a hook....etc that works, thanks for all your diagnostic help getting the output for each of the actions, thats something i'll always use now --------------- Added [DATE]1307565957[/DATE] at [TIME]1307565957[/TIME] --------------- One more question (honest!) how would i date and time stamp this entry PHP Code:
|
#25
|
||||
|
||||
Quote:
To date it use the php date() function. I would try this: Code:
fwrite($fp, "Matched bots[$i]: . $bots[$i] . \nWith User Agent: . $user_agent . " . date('m-d-Y H:i:s') . " \n\n"); |
#26
|
||||
|
||||
Code changed as requested , ialready tried a version of the date function
PHP Code:
|
#27
|
||||
|
||||
Quote:
|
#28
|
||||
|
||||
Thanks Boofo but i'm not sure what you're referring to , as for the date/time stamp BoP5's suggestion of cutting down my original stamp works, i can't understand why mine gave just 1900 and time 00:00?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|