vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [vBulletin 4] Simple way of including an external PHP file (https://vborg.vbsupport.ru/showthread.php?t=242454)

MMODisneyForums 02-02-2011 03:22 AM

Ok, I tried that out. The first one did indeed echo, but the second one didn't. So this means I need to go into the php.ini config file and change something? I can't seem to find this php.ini. Should I be looking somewhere?

Edit: It works now! Before in my plugin I was putting the entire path in (http://www.yoursite.com/forum/test.php). So I just changed it to "../forum/test.php" and it works! So it must be a problem with the php.ini. I looked around and it sounds like it is a real huge pain to mess with. Unless it is simple, I will just remember to not put the full path in.

risestar 02-02-2011 07:06 PM

Yes, theres a setting in php.ini to allow scripts to be passed over http

I'm not sure exactly where it is, but I had to do the same before some of my scripts would run properly on my server

You need to set php to include through HTTP , ie: allowing remote files to be included

Some info is available here. http://www.php.net/manual/en/features.remote-files.php

BirdOPrey5 02-02-2011 07:57 PM

You can't include a php file using it's remote (http) address EVER. It will never work that way. PHP files are executed when viewed by http, the code is never shown or known to the browser. You can include using full or relative paths on your server, examples:

Code:

/includes/myfile.php
or
/home/yoursite/public_html/forums/includes/myfile.php


MMODisneyForums 02-04-2011 04:25 AM

Thank you guys so much for all the help, everything is working like a charm now! :D

Schoelle 02-08-2011 07:46 PM

Ok i need your help please!

I have created four pages according to this How-To:
https://vborg.vbsupport.ru/showthread.php?t=228112

I have also 4 external php scripts that i want to include.
I have created 4 templates and 4 plugins.

I have change the php_include to
php_include_1 to php_include_4 and also changed this accordingly in the templates.

Code:

ob_start();
  require_once('../vbtest/test_1.php');
  $php_include_1 = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('template_1',array('php_include_1' => $php_include_1));

It works als long as i only activate 1 of those 4 plugins.
As soon as i activate 2,3 or 4 plugins i get this:

Warnung: require_once(../vbtest/test_1.php) [function.require-once]: failed to open stream: No such file or directory in [path]/includes/class_bootstrap.php(122) : eval()'d code (Zeile 7)

Fatal error: require_once() [function.require]: Failed opening required '../vbtest/test_1.php' (include_path='.:/usr/share/php:/usr/share/pear') in /home/b/b0000009/weball/vbtest/includes/class_bootstrap.php(122) : eval()'d code on line 7

The file which is mentioned as missing here is there and it is producing output as long as i only activate 1 of the modules!

I guess it maybe is because of the hook i've chosen?
As i was not sure which one, and most of the ones i expected to be the right ones did not work at all i've chosen 'global_bootstrap_init_complete'

Any ideas? Which would be the correct hook?
Thanks for any help,

regards,
Matthias

Boofo 02-14-2011 08:37 AM

Where are you wanting the info to show up at? Every page?

Schoelle 02-14-2011 01:24 PM

Ok, i'll explain what i want to achieve, and hopefully you guys can help me.
I'm very new to vBulletin and my knowledge of php is also not 'the' best :)

I have a php script that is creating a linklist from files within a directory.
At the end of the script i have an echo statement to display the list.

What i want is to have this showing up inside a vbulletin page.
The only thing i have achieved so far is including this script in the new page i have created according to this: https://vborg.vbsupport.ru/showthread.php?t=228112

I have put
PHP Code:

require_once('./script.php'); 

This end up in showing the created list above the forum header!


So what i want to achive is:
Including the output of several php scripts in several vbulletin pages.
www.mysite.com/script1.php > www.mysite.com/page1.php
www.mysite.com/script2.php > www.mysite.com/page2.php
and so forth.

Boofo 02-14-2011 03:34 PM

Of course you will see the created list if you use echo in the file. You need to use the function from the file to show the listing formatted to whatever template you set up for it.

Schoelle 02-15-2011 02:43 PM

Ok, lack of vbulletin knowledge + only very basic php knowledge = fail :)

I have now changed my script.php file so that the output is now a function.
When i include the script.php in a simple php script like this it works. So no problem in the script.
PHP Code:

<?php
require_once('script.php');
myfunction();
?>

Now let's include this not in the simple script but in a vbulletin page!

I have a page.php file and a matching template.
These i have created after reading this tutorial:
https://vborg.vbsupport.ru/showthread.php?t=228112

In the page.php file i include script.php after global.php
require_once('./global.php');
require_once('./script.php');

What i still don't understand is where i now have to put "myfunction();" to show the output in a vbulletin page.
In the template? In a plugin?

Thanks for your help! Really appreciated!


Schoelle

cric2k 03-01-2011 03:59 PM

I'm using this and it works, only I want to pass a variable (GLOBALS.foruminfo.title_clean) from my template to my PHP script.

I am attempting to pass the current Forum title and with my own PHP generate CSS to have a specific image for that forum in the background.

My Plugin code:
Code:

ob_start();
$stringPath = "/var/www/vhosts/***/httpdocs/includes/getForumImage.php";
$PageTitle = $GLOBALS.foruminfo.title_clean;
require_once($stringPath);
$php_include = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('headinclude',array('php_include' => $php_include));

My problem is that $PageTitle = $GLOBALS.foruminfo.title_clean; doesn't populate in this place, I need to populate it in the template 'headinclude' any ideas?

--------------- Added [DATE]1299018239[/DATE] at [TIME]1299018239[/TIME] ---------------

figured it out, didnt have to use the global variable - just used foruminfo[title_clean] which worked instead.

drjamescook 03-05-2011 06:43 PM

I am using this hack to include a few php pages as it is intended. Everything works great, other than I cannot get form submits to work. I get a "Your submission could not be processed because a security token was missing."

I've looked around on the forum trying to find an answer, but I can't seem to find one. How can I correct this? Thanks.

Baylyns 03-12-2011 09:28 AM

Hello,

I'm on 4.1.2 and I used the code mentioned above to vb 4

PHP Code:

ob_start();
   include(
'/var/www/eo/www/dix_dernieres.php');
   
$includedphp_main ob_get_contents();
ob_end_clean();

$preRegister['includedphp_main'] = $includedphp_main;
 
vB_Template:: PreRegister('navbar'$preRegister); 

in the navbar template I added:

PHP Code:

{vb:raw includedphp_main

By activating the module, I get a blank page.
Or is the problem?

Thank you

nick_h 03-14-2011 05:47 PM

Can i put a VB variable in that php file such as {vb:raw totalthreads} ? I tried but not sucess

BirdOPrey5 03-14-2011 06:48 PM

Quote:

Originally Posted by nick_h (Post 2173325)
Can i put a VB variable in that php file such as {vb:raw totalthreads} ? I tried but not sucess

In a plugin or php file it would be $totalthreads. The {vb:raw ...} is only for use when displaying contents in a template.

Muffin89 03-28-2011 10:23 AM

I could also use some help on including php file into a template.

I have a template with an header, a navbar, the forum/content, footer and a fixed right bar. I wan't to insert this php code(for now) into the right bar:

userbox.php
PHP Code:

<?php
echo '<a href="login.php?$session[sessionurl]do=logout&amp;logouthash=$bbuserinfo[logouthash]">Logga ut</a>';
?>

userbox plugin:
PHP Code:

ob_start();
include(
'userbox.php');
$userboxinsertob_get_contents();
ob_end_clean();
vB_Template::preRegister('footer',array('php_include' => $php_include)); 

Inside the footer template I have made a div that is fixed and I call the plugin with this code:
PHP Code:

{vb:raw userboxinsert

But it doesn't output my desired string.

The HOOK is parse_templates.

When i in the plugin write echo $userboxinsert; the userbox get's inserted but at the top of the screen, so the link works.

Would be very happy if someone could help me with this problem!

karlm 04-07-2011 06:20 AM

Total programming n00b here... asking for help :)


I just came here find out how to get a php-script to run, and was really glad to see you guys already had a page on the issue.

My idea is fairly simple:

I picked up a rotator script (php) and will upload to it's own directory (/rotator). I intend to have several copies (e.g. games.php, religion.php, cars.php, gadgets.php) and each script points to a different sub-directory, e.g. /games, /religion, /cars, /gadgets, etc.)

From there, in the last post of every thread I want to call it but will use an IF THEN to dictate which version it calls.

(e.g. IF forum=12 then call cars.php, else if forum=15 then call gadgets.php)
<vb:if condition="$GLOBALS['forumid'] == 63 OR $GLOBALS['forumid'] == 54 OR $GLOBALS['forumid'] == 56">
[not sure what to put here in order to call 'games.php']
<vb:if>
<vb:if condition="$GLOBALS['forumid'] == 3">
[not sure what to put here to call 'cars.php']
<vb:if>

This in turn should then reflect relevant files for specific forum content.

I suspect the IF THEN will be placed in the template 'ad_thread_last_post_content' (or via the Advertising/Manage Ads script within ACP).

I'm uncertain what hook I could use for this (these would only show on SHOWTHREAD templates - or is postbit_legacy as it's only in the last post?). I will later be adding a similar function to the bottom of specific forums to show different rotator scripts (different sized affiliates).


Any chance of a bit advice for getting this off the ground?

BirdOPrey5 04-07-2011 10:17 AM

When you say "call" do you mean "display"? Is cars.php a page you can view with content if you browse to it?

If so I think what you are looking for is an IFRAME... the basic syntax would be:

Code:

<IFRAME SRC="http://domain.com/rotator/cars/cars.php" WIDTH="100%" HEIGHT="50"></IFRAME>
That would embed the output from the php file into your existing page.

You can search google for more options on the IFRAME tag.

karlm 04-07-2011 11:20 AM

Although an iframe would suffice (thanks, I hadn't even given it a thought), I was under the impression I could an external php file from within a template..?

I'd prefer to do it as a display/call than within an iframe (which would not show to some browsers).

In worst case scenario though, i'll go with an iframe. :)

BirdOPrey5 04-07-2011 11:44 AM

I just don't know what you mean by "call" a php file then... You can't do that from a template. You could do it from a plugin but again you're not "calling" a file. You can call a function in a file, but if you want to display output from the php file in a specific location you need to make a template for that file.

karlm 04-07-2011 08:10 PM

Quote:

Originally Posted by BirdOPrey5 (Post 2181934)
I just don't know what you mean by "call" a php file then... You can't do that from a template. You could do it from a plugin but again you're not "calling" a file. You can call a function in a file, but if you want to display output from the php file in a specific location you need to make a template for that file.

I may be using wrong terminology when i say "call"... I'm thinking old BASIC programming when you would call a subroutine.

Anyway, my idea is to:
1) breakdown forum into separate categories (e.g. religion, cars, games, etc.)

2) in the last post, 'refer to' a specific script.
2a) e.g. religion forum would refer to a script renamed as 'religion.php'
2b) cars forum would refer to a script renamed as 'cars.php'

3) the scripts within each above file would be the same, but refer to different text files.

4) the cars forum & script would then extract data from the text file for cars, which would ultimately show to the end-user as a affiliate image/link specific to cars.
4b) exactly the same as 4) but with religion context instead, so 'christian stuff' would show up in the religion forum (and other religions too).

so when a guest comes to my forum and visits the car section, they'll see links and/or images in the final post which will be pertinent to cars... if they swap over to the religion forum (or games or anything else) they will see the last post giving links/images relevant to those forums too.

BirdOPrey5 04-07-2011 11:26 PM

What I'm not understanding is why you would make several different php files when you could do the same with a single plugin or really even just template conditionals?

Can you give an example of the HTML code you want displayed from a php file?

karlm 04-08-2011 10:46 AM

OK, I'm doing it this way because I'm not a PHP guru... I'm doing it in a way I can understand.

So what I've done now is in the 'manage ads' area of the ACP, i've enabled a 'last post only' ad-spot.

While testing, it shows only to admins (once it goes live, i'll change this to show only to guests instead).

The content of this ad-code is:

Code:

<style type="text/css">
<!--
#adspot {
    width: 358px;
    height: 268px;
    border: none;
}
-->
</style>

<table style="text-align: left; width: 100%;" border="0" cellpadding="4"
cellspacing="4">
<tbody>
<tr align="center">
<td style="vertical-align: middle; text-align: center;">

<!-- GAMETAP  // UNDER 'PLAY ARCADE GAMES HERE' FORUM-->
<vb:if condition="$GLOBALS['forumid'] == 63 OR $GLOBALS['forumid'] == 54 OR $GLOBALS['forumid'] == 56">
<iframe src="/ads/gaming/rotate.php" frameborder="0" align="center" name="adspot" id="adspot" marginheight="0"><p>Your browser does not support iframes.</p></iframe> 
</vb:if>


<!-- CHRISTIAN STORE random sizes  // UNDER 'Religion & spirituality' FORUM-->
<vb:if condition="$GLOBALS['forumid'] == 3">
<iframe src="/ads/religion/rotate.php" frameborder="0" align="center" name="adspot" id="adspot" marginheight="0"><p>Your browser does not support iframes.</p></iframe> 
</vb:if>


<!-- MUSIC STORE random sizes  // UNDER 'music' FORUM-->
<vb:if condition="$GLOBALS['forumid'] == 52">
<iframe src="/ads/music/rotate.php" frameborder="0" align="center" name="adspot" id="adspot" marginheight="0"><p>Your browser does not support iframes.</p></iframe> 
</vb:if>

<!-- SPORTS STORE random sizes  // UNDER 'sports' FORUM-->
<vb:if condition="$GLOBALS['forumid'] == 55">
<iframe src="/ads/sports/rotate.php" frameborder="0" align="center" name="adspot" id="adspot" marginheight="0"><p>Your browser does not support iframes.</p></iframe> 
</vb:if>
</td>
</tr>
<tr align="center">
<td style="vertical-align: top;"><small><small><span
style="font-weight: bold;">Please <a href="/register.php" target="_parent">register</a> or sign in to remove these
advertisements.</span></small></small><br>
</td>
</tr>
</tbody>
</table>

In each directory is a series of text files with affiliate codes and the rotator picks a random file each time a viewer reads a thread.

I'm sure I could somehow move the /rotate.php file into the parent directory and have it refer to different sub-directories according to what forumID is being viewed... I have no doubt that can be done.

But - I don't know how to. So I'm trying to keep things simple for myself.

BirdOPrey5 04-09-2011 12:32 AM

Yeah I honestly can't see it getting any better than an IFRAME as you have it without making life A LOT for difficult.

In the unlikely event someone has a browser that doesn't allow IFRAMEs is there some static content you can put between the <IFRAME> and </IFRAME> tags besides "your browser does not support iframes" ? Maybe pick one of the codes you'll be randomizing so it's better than nothing?

karlm 04-10-2011 01:07 PM

Just wanted to add, as I said previously, I'm not guru where coding is concerned... However, after a quick flick through the vbmanual, I've managed to condense my code using <vb:else if xyz /> statements and an additional <vb:else />. This means, now, it will check to see if viewer is in forum x,y,z and show appropriate php files - otherwise (if not in the above mentioned forums) it will show a google-adsense post instead.

WIN!

iwpg 04-17-2011 05:02 AM

I am planning on getting my entire site converted to take adbantage VB 4. I have more than 50,000 pages, so basically, I cannot use the global_start hook, since I would have hundreds of files / scripts loading on every page. This would not be good...

I thought about using global_start with one product (php master file), and then using conditionals within the script to decide which file to load. But decided to wait until I get some advice on this. One thing I did notice: If you have a php file loaded with global_start, every VB page may or may not use those variables. For example, I created a PHP script that looked for the last 5 forum posts, used a variable called $threadid. It happens to be that $threadid is also used within VB. So the last threadid that was called within my custom script forced VB to use that variable! All links on the forum loaded my own script's variable $threadid. Is this normal behavior? I did change my variable name to something unique, but I'm getting a little paranoid about this, because I may have more than this variable that is also used by VB.

This is what I plan... Any feedback would be great.

Product Example:

ob_start();
include('Masterfile.php');
$masterfile = ob_get_contents();
ob_end_clean();

vB_Template::preRegister('customfiletemplate',arra y('loadexternalscripts' => $masterfile));

----------------------------------

Masterfile.php Example:
PHP Code:

if ($_GET['file']=='aboutus'){
include_once 
"aboutus.html";
}
elseif (
$_GET['file']=='otherpage'){
include_once 
"otherpage.php";


----------------------------------
Template:
{vb: raw loadexternalscripts}

The files would then be loaded like customfilepage.php?file=aboutus and Mod-rewrite would do the trick with bringing basic filenames to the request.

BirdOPrey5 04-17-2011 03:42 PM

I'm pretty sure I've heard the global_start hook isn't called on CMS pages anyway. They were going to remove that hook but kept it to keep compatibility with older mods, but didn't add it to the "new" parts of VB4.

I really can't image trying to work on 50,000 pages... good luck with that.

But using the same variable names is a concern. Not only should you avoid the variable names used by vBulletin but also names other people have used in mods you have installed. When I make a mod I'll usually call my variables $bop_post or $bop_thread for example to know I'm not changing data used elsewhere.

iwpg 04-18-2011 02:56 AM

Thanks for the info Joe, do you think the method that I plan would work? This way, only one hook is created and loaded, waiting for $_GET instructions to fire off scripts.

BirdOPrey5 04-18-2011 03:25 AM

Quote:

Originally Posted by iwpg (Post 2185834)
Thanks for the info Joe, do you think the method that I plan would work? This way, only one hook is created and loaded, waiting for $_GET instructions to fire off scripts.

I'm really not understanding what you are really doing... surely you don't plan to write a php elseif statement with 50,000 options... :confused:

iwpg 04-19-2011 03:55 AM

I am using VB to include 1 PHP file that is open to requests. These requests load the appropriate files if that's the page being requested. So, this allows a hook to be placed in global_start without actually loading a script and consuming enormous amounts of system resources. The 50,000+ pages are generated from about 10 scripts/programs.

In other words, I am using this script as a hook on global_start with a custom template that has the vb raw variable.

This is my PHP code (Master.php). Seems to work very well so far.
PHP Code:

<?php
global $fnuser,$fnuserid,$msxtotal;
$csl $_GET['csl']; // Custom Script Location - Single Files with no directories. Mod rewrite on
    
if ($csl=='About-Us') {
    require 
"C/about.shtml";
    
$fglink "About Us";
    
$fgptitle "About Our Business";
    }
    elseif (
$csl=='Sitemap') {
    require 
"C/sitemap.php";
    
$fglink "Sitemap";
    
$fgptitle "Website Sitemap";
    }

mysql_select_db(vb);//Want to select back to VB database just in case another database was selected
?>

Included script on the hook (M.php):
PHP Code:

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################

define('THIS_SCRIPT''Master');
define('CSRF_PROTECTION'true);  
// change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array('CustomMaster',
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$navbits construct_navbits(array('' => $fglink));
$navbar render_navbar_template($navbits);

$templater vB_Template::create('CustomMaster');
$templater->register_page_templates();
$templater->register('navbar'$navbar);
$templater->register('pagetitle'$fgptitle);
$templater->register('sidebarext'$sidebarext);
$templater->register('sidebaropen'$sidebaropen);  
print_output($templater->render());

?>

Mod-Rewrite Code:
Code:

RewriteRule ^C/([^/]+).php$ /FN/M.php?csl=$1 [QSA,L]
Then call it like M.php?csl=About-Us
Mod-Rewrite generates About-Us.php and you're done.

angelcosta 08-06-2011 08:55 PM

Thank you so freakin much!

The file get contents worked!

absofts 12-23-2011 09:09 AM

I include a file but its showing me this error

Quote:

Fatal error: Call to a member function query_read_slave() on a non-object in /home/content/i/c/o/icompany/html/forum/verified.php on line 4
--------------- Added [DATE]1324635016[/DATE] at [TIME]1324635016[/TIME] ---------------

My file code is

PHP Code:

<?php
require_once('includes/class_paid_subscription.php');

$susers $db->query_read_slave("
    SELECT *
    FROM " 
TABLE_PREFIX "subscriptionlog
    WHERE status = 1
    AND userid = " 
$vbulletin->userinfo['userid']
);
$isPremium $db->num_rows($susers);
if (
$isPremium != 0){
    
$st '1';
}else{
    
$st '0';
}
    echo 
$st;

?>


iwpg 12-23-2011 06:13 PM

I''m not sure where query_read_slave is loaded. Did you try loading the hook in global_start?

BirdOPrey5 12-23-2011 06:17 PM

You should be using $vbulletin->db... to access queries, data, and the like... try this code:

PHP Code:

<?php
global $vbulletin;

require_once(
'includes/class_paid_subscription.php');

$susers $vbulletin->db->query_read_slave("
    SELECT *
    FROM " 
TABLE_PREFIX "subscriptionlog
    WHERE status = 1
    AND userid = " 
$vbulletin->userinfo['userid']
);
$isPremium $vbulletin->db->num_rows($susers);
if (
$isPremium != 0){
    
$st '1';
}else{
    
$st '0';
}
    echo 
$st;

?>


iiFragyyHD 03-18-2012 09:30 PM

Can I add 2 plugins like this?

--------------- Added [DATE]1332106295[/DATE] at [TIME]1332106295[/TIME] ---------------

Nevermind, got it. All you have to do is change bot $php_include variables and the array name to the same thing.

zero477 03-21-2012 02:05 AM

Thanks it works perfectly, they should update or make more clear the vBulletin manual...

--------------- Added [DATE]1332297428[/DATE] at [TIME]1332297428[/TIME] ---------------

Hello Crimm,

Thanks very much for your post about including PHP files ... It was much more clear than in the manual.

I followed your instructions and everything works fine for the forum, but in the CMS the PHP file is not included.

I tried to fix it by adding:

PHP Code:

 ob_start();
  require_once(
'plugins/rightsidebar.php');
  
$php_include ob_get_contents();
ob_end_clean();
vB_Template::preRegister('footer',array('php_include' => $php_include)); 

To global_start of the CMS. But it still does not work... Can you help me?

zero477 06-26-2012 03:18 PM

Hello,

If would like to use many PHP files on URL can we do something like:

PHP Code:

ob_start();
  require_once(
'LOCATION OF EXTERNAL FILE');
  
$php_include ob_get_contents();

  require_once(
'LOCATION OF EXTERNAL OF SECOND FILE');
  
$php_include_SECOND_FILE ob_get_contents();

ob_end_clean();
vB_Template::preRegister('TEMPLATE YOU ARE USING',array('php_include' => $php_include));
vB_Template::preRegister('TEMPLATE YOU ARE USING FOR SECOND FILE',array('php_include' => $$php_include_SECOND_FILE)); 


??????????

kh99 06-26-2012 05:21 PM

You should be able to do this (use ob_get_clean() instead of ob_get_contents()):

Code:

ob_start();
  require_once('LOCATION OF EXTERNAL FILE');
  $php_include = ob_get_clean();

  require_once('LOCATION OF EXTERNAL OF SECOND FILE');
  $php_include_SECOND_FILE = ob_get_clean();

ob_end_clean();
vB_Template::preRegister('TEMPLATE YOU ARE USING',array('php_include' => $php_include));
vB_Template::preRegister('TEMPLATE YOU ARE USING FOR SECOND FILE',array('php_include' => $$php_include_SECOND_FILE));


I think if you want you could also put a preRegister call after each call to ob_get_clean() so you wouldn't need a bunch of different variables.

RivaCom 06-29-2012 07:54 PM

I've tried the following code. But whenever you click a user thread, no matter what thread you click, it always brings us to the same thread.

Code:

ob_start();
  require_once('/home/ihatejob/revenantgaming.com/forum/modules/slidermodule.php');
$php_include = ob_get_clean();

ob_end_clean();
vB_Template::preRegister('adv_portal',array('php_include' => $php_include));

any help?

zero477 06-29-2012 08:11 PM

Hello guys,

I finally achieved it!! I did a small tutorial about making External PHP files that can be used as Widgets in vBulletin CMS.

I do not know if I can post links here ... but here is the tutorial ... I think someone might find it useful in the future.

http://www.hyperlinkbuilding.org/con...idget-Tutorial

Greetings,
Eddie

--------------- Added [DATE]1341004474[/DATE] at [TIME]1341004474[/TIME] ---------------

I have to say something else ... Thanks a lot for trying helping me!! I will help others whenever I can.

hqlman 07-23-2012 12:58 PM

I am helping a friend out to try and display his wordpress header above his vb forums header, im using the code below in the plugin and calling it in the header template:

Code:

ob_start();
  require_once('http://al-hussain.co.uk/wp-
content/themes/Karma/header.php');
  $php_include = ob_get_contents();
ob_end_clean();
vB_Template::preRegister('Test',array('php_include' => $php_include));

but get the following errors:

Code:

Warning: require_once() [function.require-once]: http:// wrapper is disabled in the server configuration by allow_url_include=0 in [path]/includes/class_bootstrap.php(106) : eval()'d code on line 3

Warning: require_once(http://al-hussain.co.uk/wp- content/themes/Karma/header.php) [function.require-once]: failed to open stream: no suitable wrapper could be found in [path]/includes/class_bootstrap.php(106) : eval()'d code on line 3

Fatal error: require_once() [function.require]: Failed opening required 'http://al-hussain.co.uk/wp- content/themes/Karma/header.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/alhussai/public_html/forum/includes/class_bootstrap.php(106) : eval()'d code on line 3

Im running Wordpress 3.4.1 and vb 4.1.12, any ideas how to solve this?


All times are GMT. The time now is 07:16 PM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03414 seconds
  • Memory Usage 1,934KB
  • 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
  • (10)bbcode_code_printable
  • (14)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete