vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Form Hack question: parsing BBCode in variables (https://vborg.vbsupport.ru/showthread.php?t=168068)

IdealExchange 01-18-2008 01:17 AM

Form Hack question: parsing BBCode in variables
 
I'm trying to edit the Form Hack mod such that it will parse BBCode and line breaks in the $formpurpose variable. I'll admit right now that while I do have a few years of programming experience under my belt, I'm quite new to PHP, so my apologies if this is a stupid question.

I have found that there is a function called bbcodeparse(), contained in functions.php, that does this. In order to use it, I must include global.php. So, I tried inserting the following code before the eval statement:
Code:

require('./global.php');
$formpurpose=bbcodeparse($formpurpose);

eval('print_output("' . fetch_template("$maintemplate") . '");');

No good; I get an undefined function error. So, newbie question though it may be, what am I doing wrong? Can someone show me the proper way to have Form Hack parse BBCode in the $formpurpose variable?

Your help is appreciated!

MoT3rror 01-18-2008 02:15 AM

I did not find a function called bbcodeparse in the functions file.

The files you need to look at would be class_bbcode.php and functions_wysiwyg.php in the includes folder.

Try the convert_wysiwyg_html_to_bbcode function in the functions_wysiwyg.php.

IdealExchange 01-18-2008 03:45 AM

Okay, so I tried this:
Code:

require('./global.php');
require('./class_bbcode.php');
require('./functions_wysiwyg.php');
convert_wysiwyg_html_to_bbcode ($formpurpose);

...with no luck; it's telling me that the libraries are not defined. Of course, I'm quite sure I went about it completely wrong; as I've already admitted, I'm new to PHP and have no idea what syntax I should be using. If it's not too much trouble, might someone supply some sample code so I can see what I need to be doing?

Dismounted 01-18-2008 03:49 AM

I believe there is an article that explains things like this.

IdealExchange 01-18-2008 04:56 AM

Well, there's a 51-page thread on the Form Hack mod, if that's what you mean. Beyond that, I've read through various PHP tutorials (including the one linked in the sticky about coding). That's how I've managed to make the modifications that I have. This is the only one remaining that's giving me trouble.

I've been poking at this problem for a while, and figured it wouldn't be any skin off the forum's back to help me out with what I thought was a relatively simple question; I was led to believe it was the official forum for support. My apologies.

Dismounted 01-18-2008 05:41 AM

<a href="https://vborg.vbsupport.ru/showthread.php?t=82693" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=82693</a>

It's wonders what a simple search can do...


All times are GMT. The time now is 12:03 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.01723 seconds
  • Memory Usage 1,720KB
  • 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)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