PDA

View Full Version : prob with vbull


DPoole
06-04-2003, 10:51 PM
try to download this hack and check out the error u get

u can view pages 2 and 3 but not page 1

http://www.vbulletin.org/hacks/index.php?action=showhack&hackid=197

Erwin
06-04-2003, 11:01 PM
I can see page 1 fine:

https://vborg.vbsupport.ru/showthread.php?s=&threadid=28193&perpage=15&display=&pagenumber=1

DPoole
06-05-2003, 12:05 AM
maybe cause you are admin Erwin

Let some others try it - it dont work

Fatal error: Maximum execution time of 15 seconds exceeded in /www/vbulletin.org/htdocs/forum/admin/functions.php on line 2856

Dan
06-05-2003, 12:14 AM
Fatal error: Maximum execution time of 15 seconds exceeded in /www/vbulletin.org/htdocs/forum/admin/functions.php on line 2856

Confirmed

Gary King
06-05-2003, 02:18 AM
Actually, this seems to happen on several hack threads - not too sure on why, though.

Erwin
06-05-2003, 02:51 AM
Mmm... it's to do with the PHP code boxes, and a hack that's not working properly... it's a known bug. I will let Stefan know.

Xenon
06-05-2003, 04:54 AM
yeah, it has to do with the show function names as links.
you should disable that option in your usercp if you get those errors..

Dean C
06-05-2003, 01:55 PM
Or completely remove the hack? It's not really necessary is it :)?

- miSt

Boofo
06-05-2003, 02:08 PM
I can see page 1 just fine.

Xenon
06-05-2003, 02:10 PM
Dean, Erwin and me are discussing that already, but if it's needed is the question for user not for us, as we don't need it, but there might be users which needs it ;)

Boofo
06-05-2003, 02:55 PM
I had that turned off in my usercp. Now that I turn it on, it get the same error. Does that only happen when it is the first post in the thread? I have never had that happen on my site.

Xenon
06-05-2003, 03:55 PM
nope, the problem is on how much codeboxes are there.....

the algorithm seems to be very intense...

Boofo
06-05-2003, 03:58 PM
Is there any way to fix it? I don't want to run into this same thing on down the road.

Xenon
06-05-2003, 06:58 PM
nope, no way, at least i didn't found one till now.
i already optimized it as strong as possible, but now the str_replace with a large array of replacement vars gives it the rest... ;)

Boofo
06-05-2003, 07:14 PM
So, you found a fix or you haven't? I just tried it again and I still get the error.

Xenon
06-06-2003, 10:42 AM
nope i didn't find a fix.

the bug occures more often in the past, i heve fixed it in a way that it doesn't occure as much as it was at first, but i can't fix it totally

Boofo
06-06-2003, 05:35 PM
Can you tell me what you did to make it better than it was?

Xenon
06-06-2003, 09:41 PM
do you use the hack yourself?

i thought it wasn't released???

well i have rewritet it a bit, to use a cache, so it would not create the functions names array with each post as it did before

Boofo
06-06-2003, 09:56 PM
Today at 05:41 PM Xenon said this in Post #18 (https://vborg.vbsupport.ru/showthread.php?postid=405328#post405328)
do you use the hack yourself?

i thought it wasn't released???

well i have rewritet it a bit, to use a cache, so it would not create the functions names array with each post as it did before

I think Firefly released this a long time back. Can you share the re-write? ;)

Xenon
06-06-2003, 10:03 PM
i don't know the original coding anymore but this is the function we use now:

function showfunclinks($buffer)
{
global $allfuncs;
static $searchfuncarray, $replacfuncarray;
if (!isset($searchfuncarray))
{
$searchfuncarray = array();
$replacfuncarray = array();
foreach ($allfuncs['internal'] as $name)
{
$searchfuncarray[] = "/([^a-z])$name(<\/font><font color=\"" . ini_get('highlight.keyword') . "\">){0,1}( {0,1})\(<\/font>/i";
$replacfuncarray[] = "\\1<a href=\"http://www.php.net/$name\" target=\"_blank\">$name</a>\\2\\3(</font>";
}
}
$buffer = preg_replace($searchfuncarray, $replacfuncarray, $buffer);
return $buffer;
}

Boofo
06-06-2003, 10:33 PM
Here's the original code I have:

/* Highlight function names in [php] */
$allfuncs = get_defined_functions();
$searches = array();
$replaces = array();
foreach ($allfuncs['internal'] as $name) {
$searches[] = "/([^a-z])$name(<\/font><font color=\"" . ini_get('highlight.keyword') . "\">){0,1}( {0,1})\(<\/font>/i";
$replaces[] = "\\1<a href=\"http://www.php.net/$name\" target=\"_blank\">$name</a>\\2\\3(</font>";
}
$buffer = preg_replace($searches, $replaces, $buffer);
/* end Highlight function names in [php] */

There's the:

// ###################### Start phphighlite #######################
function phphighlite($code) {
//PHP 4 only

above it with some more code. What do I need to replace?

Xenon
06-07-2003, 08:45 AM
replace the whole first php code with $buffer = showfunclinks($buffer);

and add the function i posted above into your functions.php :)

Boofo
06-07-2003, 09:18 AM
I did what you said above and got this error at the top of the page:

Warning: Invalid argument supplied for foreach() in /home/bear/public_html/forum/admin/functions.php on line 1266

and the links were not there.

Xenon
06-07-2003, 09:51 AM
ah i see, you have a differnte structure than we have here ;)

put $allfuncs = get_defined_functions();

at the end of functions.php before the ending ?> :)

Boofo
06-07-2003, 10:45 AM
Well, that got rid of the error, but still no links in the php code. ;)

Xenon
06-07-2003, 02:06 PM
then i can't help ya more, that's how it works here.

Davey
06-20-2003, 12:34 PM
06-05-03 at 06:54 AM Xenon said this in Post #7 (https://vborg.vbsupport.ru/showthread.php?postid=404645#post404645)
yeah, it has to do with the show function names as links.
you should disable that option in your usercp if you get those errors..
perhaps a link to the part where you edit this option would be handy since i can't find it..

Xenon
06-20-2003, 12:40 PM
it's in the user options :)