View Full Version : Run one CGI from within another?
Justin
03-05-1999, 09:59 AM
I want to be able to run my banner script from the UBB. It won't parse for SSI's, so there has to be a way to call another Perl script so that the banners will show up in the UBB - I can't find where though. I don't want to end up putting static banners in or hard coding the banner script into the UBB.
Anyone know how to do this?
------------------
Justin Nelson, SFE Software
www.vdj.net (http://www.vdj.net)
Terra
03-05-1999, 02:33 PM
Hmmmm, this is a tough one without requiring too much overhead... Also you want to keep the banner program variables and stuff totally seperate from the UBB...
This is off top of my head and not confirmed to work or not... These are only fringe ideas that might spawn inspiration... http://www.aota.net/ubb/wink.gif
Expensive and not secure (NOT recommended):
$banner=`perl /xxx/xxx/xxx/cgi-bin/banner.pl`;
Using packages to seperate namespace, but not sure if UBB would see the lexical $banner:
{ Package Banner; $banner=do "/xxx/xxx/xxx/cgi-bin/banner.pl"; }
Require() would muck up the namespace... Hmmmm..
How about wrapping it in a BEGIN block and packaging it...
In the UBB at the top...
BEGIN {
Package Banner;
require "/x/x/x/cgi-bin/banner";
blah blah blah
}
$banner=Banner::do_banner();
======
I would have to muck around figuring out the best way to do this... What you need is very easy in concept, but can be difficult to implement due to namespace polution... The UBB is a volatile product that can lead to hours of head pounding when it doesn't work just right...
The above is just myself hashing out a few ideas, I hope it's enough to point you in some half-a$$ed direction leading to the solution... http://www.aota.net/ubb/supergrin.gif
--
Terra
--The Confused Coder--
FutureQuest
Jacob Stetser
03-05-1999, 04:23 PM
Frame it!
Use a static bottom frame that reloads every once in a while, and just call an empty page with a banner on it.
That'll save you the trouble of mucking with UBB.
Unless, of course, you absolutely despise frames. I don't like em, but I don't despise em http://www.aota.net/ubb/smile.gif
Jake
Justin
03-05-1999, 05:59 PM
I do despise frames... to an extent. I do hate when I go to a site that has a frame just for the purpose of advertising though.
Hm, I'll eventually figure something out. Meanwhile I just have no ads in the UBB. It's not really popular anyway, so I'm not that worried about it. I do want to figure it out eventually though.
Like the http://www.aota.net/ubb/supergrin.gif a lot! Cool http://www.aota.net/ubb/biggrin.gif
------------------
Justin Nelson, SFE Software
www.vdj.net (http://www.vdj.net)
Kayge
03-09-1999, 01:39 PM
In the top of the coding for the forum .cgi files is an area where is says "require {" and some file names. Add the name of your banner program into that list. Then, wherever you want your banners to show up, just call the sub that makes the output for the banners.
require {
forumdisplay.cgi;
ubbmisc.cgi;
something.cgi;
banner.cgi; ## your script name here
}
Then just call it like normal using "&Display;"(or whatever the sub in banner.cgi is called) wherever you want the banner to appear.
vBulletin® v3.6.8, Copyright ©2000-2013, Jelsoft Enterprises Ltd.