PDA

View Full Version : plugin php -noob-!


checkmail
01-04-2007, 12:55 AM
im trying to make a plugin this isnt it but its an example of what wont work!


$string = $vbulletin->GPC['message'];

$Pos = strpos($string,"hello");

$vbulletin->GPC['message'] = $Pos;



it wont display the postion if i enter in hello as a message. this is for
Hook Location : newthread_start

what am i doing wrong?

Guest190829
01-04-2007, 01:00 AM
im trying to make a plugin this isnt it but its an example of what wont work!


$string = $vbulletin->GPC['message'];

$Pos = strpos($string,"hello");

$vbulletin->GPC['message'] = $Pos;

it wont display the postion if i enter in hello as a message. this is for
Hook Location : newthread_start

what am i doing wrong?

That code is setting the $vbulletin->GPC['message'] to the first numerical occurence of "hello" in the $string.

It is not echoing or displaying anything.

checkmail
01-04-2007, 01:11 AM
if i enter

$vbulletin->GPC['message'] = "dododo";

then try to post something it will only post "dododo" so i dont understand why i cant get it to post 15 or whatever for the numerical occurence for hello.

Guest190829
01-04-2007, 01:31 AM
Try:

$vbulletin->GPC['message'] = strpos($vbulletin->GPC['message'], 'hello');

In hook: newthread_post_start

checkmail
01-04-2007, 01:37 AM
it changes it to hai: no matter what i do. even if i put hello or dont in the post

Guest190829
01-04-2007, 01:59 AM
I tested the code and it works, make sure you:

1.) Are creating a new thread, a reply wont work.

2.) It is in the correct hook location.

checkmail
01-04-2007, 02:02 AM
oh shoot it does work thanks so much for the help!!