View Full Version : 2 almost identical plug-ins, one is working other is not.
webmaster74
04-07-2008, 12:45 AM
I add an external php file to the common-template "header" of each style
$includedphpheader
and this works smoothly.
In the same way, I added $includedineverypost in the postbit template.
and a plug-in hooked to Product : vBulletin
plug-in title ineverypost
Hook global_start
Plugin PHP Code
ob_start();
include('/home/domain/public_html/php/includes/ineverypost.inc.php');
$includedineverypost = ob_get_contents();
ob_end_clean();
Plugin is Active YES
but $includedphpheader is not being parsed.
What am I missing? :confused::confused:
Dismounted
04-07-2008, 05:13 AM
Access your file directly to see if it exists, can be read, and outputs something.
webmaster74
04-07-2008, 10:53 AM
Access your file directly to see if it exists, can be read, and outputs something.
http://mydomain/php/includes/ineverypost.inc.php
it does output the expected html code.
I went further to chown me:me. ; chmod 775 -cvR . to all files in /php/includes/
still ineverypost.inc.php is not parsed in the posts
webmaster74
04-08-2008, 06:08 PM
F1 !!!!
Opserty
04-08-2008, 06:26 PM
Try $GLOBALS[includedineverypost] in the template.
webmaster74
04-08-2008, 07:34 PM
Try $GLOBALS[includedineverypost] in the template.
to my big furstration yes this works.
why does $includedineverypost not work when $GLOBALS[includedineverypost] does?
it does help me to know that what I did was correct, and per the manual I cared to read ....
note: I DID hook my plug-in to global start..... that did not help
Dismounted
04-09-2008, 05:51 AM
The postbit is parsed inside a function outside the scope of a variable set at global_start. If you placed your plugin at postbit_display_complete it would work, but would waste server resources by including that file on every post.
webmaster74
04-09-2008, 12:30 PM
The postbit is parsed inside a function outside the scope of a variable set at global_start. If you placed your plugin at postbit_display_complete it would work, but would waste server resources by including that file on every post.
thank you very much
I appreciate your help
your answer tells me that my original complaint on vbulletin.com (http://www.vbulletin.com/forum/showthread.php?p=1536117)that the documentation is lacking, was in fact correct. The documentation is not clear enough on including external php files.
webmaster74
06-16-2008, 12:46 AM
thank you again Dismounted for this kind help
gfxhelp.com
08-15-2008, 07:31 PM
I'm trying to call some code for an ad in the header of my forum.
I first tested it without an include and it works correctly. I then cut the code and put it in a new file and put
<include('/home/domain/public_html/ads/file.php');>
in it's place, but it isn't working. Is my format correct and do I need to do anything else to make my include work?
Thanks
SEOvB
08-15-2008, 07:58 PM
you need to create a plugin to include outside files. you can't post that directly into the templates.
Opserty
08-15-2008, 08:41 PM
I'm trying to call some code for an ad in the header of my forum.
I first tested it without an include and it works correctly. I then cut the code and put it in a new file and put
<include('/home/domain/public_html/ads/file.php');>
in it's place, but it isn't working. Is my format correct and do I need to do anything else to make my include work?
Thanks
Including External Files (http://www.vbulletin.com/docs/html/main/templates_externalfiles)
gfxhelp.com
08-15-2008, 08:51 PM
Thanks for the info.
bosal
07-22-2009, 02:22 PM
How can I import, a php or HTML file form exteranal URL ?
Marco van Herwaarden
07-22-2009, 02:51 PM
Is that question related to the topic in this thread?
bosal
07-22-2009, 03:28 PM
Yep, this is the same function :)
Marco van Herwaarden
07-22-2009, 04:10 PM
See post #12
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.