PDA

View Full Version : fetching html file using plugin


Senti.Jatt
08-18-2009, 11:49 AM
hey guys
im trying to use this in global_start hook

hello guyim trying to use this in global_start hook

$hello = $vboptions['mod_hello_active'];

$something = implode('', file('$hello']'));

when i put $something in forumhome it's not working:mad:

Dismounted
08-18-2009, 12:11 PM
You're probably wanting this:
$something = implode('', file($vbulletin->options['mod_hello_active']));

Andreas
08-18-2009, 12:42 PM
You probably want this:


require_once(DIR . '/includes/class_vurl.php');

$vurl = new vB_vURL($vbulletin);
$something = $vurl->fetch_body($vbulletin->options['mod_hello_active'], 0, false, false);


:D

Otherwise you rely on allow_url_fopen being on, which is not necessarly the case.
Also, reading a file into an array and imploding it afterwards seems rather unnecessary overhead -> file_get_contents().

Senti.Jatt
08-18-2009, 12:43 PM
what about for PHP?

ob_start();
include('$vbulletin->options['mod_hello_active']');
$includedphp = ob_get_contents();
ob_end_clean();

--------------- Added 1250603071 at 1250603071 ---------------

The one that dismounted told me works...
Not i have problem with php

Andreas
08-18-2009, 02:41 PM
Uuh ... remotely including PHP is extraordinary dangerous ... do you know 150% what you are doing?

Senti.Jatt
08-18-2009, 03:08 PM
Yes i do can you please help?