The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
|||
|
|||
Can you write files via php on your server? I like to debug stuff by printing things to a file then looking at it after loading the page. Like sometimes I just throw in a
Code:
fwrite(fopen("output.txt", "w"), print_r($var, true)); ...I think that actually shouldn't work on a "live" server ( unless you put in a path to a different directory) because the web server user usually doesn't have write access. But anyway the point is that it will probably save time if you can figure out some way to see what's going on in there. |
#12
|
||||
|
||||
I have dedicated so have all the access i need!, do i just use that line like that or does it need modifying to suit?
|
#13
|
|||
|
|||
You'd want to replace $var with the variable you want to see (or any message you want to print out). And of course you could put a path on the file name if you need to. And if you want to print out in more than one place you can separate the fopen() from fwrite()s. (like $fp = fopen("output.txt", "w"); fwrite($fp, "Hello World"); etc)
That the kind of thing I've been using, but maybe someone else has a better idea. |
#14
|
||||
|
||||
lol, now you've lost me!, firstly the line does work on a live server , i've changed it to this (if its correct) fwrite(fopen("output.txt", "w"), print_r($bots[$i], true)); and put it ight after the redirect statement. Below is what it gave:
MOZILLA/5.0 (COMPATIBLE; BAIDUSPIDER/2.0; +HTTP://WWW.BAIDU.COM/SEARCH/SPIDER.HTML) Does that mean the plugin is working? |
#15
|
|||
|
|||
At least you know that the plugin is running. I'm not sure exactly where you put the line.
The way that line is above, if you fopen with "w" it will truncate the file, so if you put it in a loop you're only seeing the last time through the loop. You can change it to "a" to append, but then it will add to the file every time you run it. (I guess the thing to do is to put one in at the beginning with "w" and if you put it in more than once, make the others "a"). Anyway, I'm sure you get the idea. You can see what code's executing and what the string values are and you should be able to figure out where it's failing (unless it's working and just not doing what you expect) |
#16
|
||||
|
||||
Thanks very much for this help, thats really useful
|
#17
|
|||
|
|||
Oh, I see now you said that you put the line right after the redirect (I guess its too late for me to be thinking). Do you mean after the call to banned_redirect()? Then I guess strstr() isn't matching or else it wouldn't get there.
Anyway, let us know how it goes. |
#18
|
||||
|
||||
Right, i put the line like below and tried different variations:
PHP Code:
PHP Code:
Quote:
--------------- Added [DATE]1307508696[/DATE] at [TIME]1307508696[/TIME] --------------- It's 6am here and im off home to bed in a couple of hours, maybe i'll catch you later |
#19
|
|||
|
|||
Oh right, there's no newline in that fwrite so you're just getting multiple prints coming out on the same line. And I think what I said earlier wasn't exactly correct - if you want to print out a string you don't need the print_r. And I find when printing out strings it's a little less confusing if you put some quotes in there. So you'd probably want something like:
fwrite(fopen("output.txt", "a"), "'" . stristr($user_agent,$bots[$i]) . "'\n"); |
#20
|
||||
|
||||
For some reason all i get with that line is '' on many lines but no info?
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|