vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   plugin php -noob-! (https://vborg.vbsupport.ru/showthread.php?t=135471)

checkmail 01-04-2007 12:55 AM

plugin php -noob-!
 
im trying to make a plugin this isnt it but its an example of what wont work!

Code:

$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

Quote:

Originally Posted by checkmail (Post 1150295)
im trying to make a plugin this isnt it but its an example of what wont work!

Code:

$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:

PHP Code:

$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!!


All times are GMT. The time now is 11:22 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00934 seconds
  • Memory Usage 1,725KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete