vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Plug in (https://vborg.vbsupport.ru/showthread.php?t=217016)

James Birkett 06-24-2009 12:07 PM

Plug in
 
Before it is mentioned - I realise how seriously unsecure this is but I will take the necessary precautions.

I was hoping to create a plug in using the bbcode_fetch_tags which parses PHP script in the bbcode tags. I wanted to use this for such pranks like
[phpparsecode]echo "$_SERVER['REMOTE_ADDR']"[/phpparsecode]
I realise a lot of you probably feel like this is pointless or whatever but i'd like to create this.

How would I go about creating the bbcode tags and hooking it to the plug in?

Dismounted 06-25-2009 05:38 AM

The example will not work with the standard BB code system, as posts are fully parsed, then cached for X amount of time. You are better off doing an eval() at a plugin at postbit_display_complete.

I can't stress enough how dangerous this is!

James Birkett 06-25-2009 02:55 PM

Does the eval() function parse the PHP as it is displayed? Thus displaying all PHP codes as it is parsed?

Also, how would I call the input using eval(), I am not familiar with vBulletin's global variables.

Dismounted 06-26-2009 06:24 AM

<a href="http://www.php.net/manual/en/function.eval.php" target="_blank">http://www.php.net/manual/en/function.eval.php</a>

James Birkett 06-27-2009 06:57 PM

I have tried reading and understanding the use of eval(), with no success.
Could anyone help me implement this into my vBulletin?

Andreas 06-28-2009 07:58 AM

Honestly, if you don't understand how PHP (or specifically eval()) does work you should not code such an Add-on (in fact nobody should anyway).


All times are GMT. The time now is 01:17 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.00964 seconds
  • Memory Usage 1,711KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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