vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   [RELEASE] Calling In Outter Files Into .PHP (https://vborg.vbsupport.ru/showthread.php?t=8017)

snyx 02-08-2001 11:02 PM

Okay, I know I had this problem, and then fixed it, so I'm passing it along, just in case you might want it. :D

Here is a script that allows you to call any .html or .txt files INTO your forums, or any files that are not .shtml so for all your SSI you can use this code to call it into your forum pages. This is also great for people you want to use banner rotators.

Code:

#!/usr/bin/perl

###########################################################################
##                                                                ##
## The Includer                                                        ##
## ------------                                                        ##
## by Jimmy (wordx@hotmail.com)                                        ##
## http://www.smartCGIs.com                                        ##
##                                                                ##
## This is a free script, if anyone sold it to you please contact me.        ##
## Please DO NOT remove any of the copyrights or links to our site,        ##
## they keep this CGI free for everyone. Thanks!                        ##
##                                                                ##
## (c) copyright 2000 The Mp3eCom Network                                ##
###########################################################################
#
# Instructions:
# ============
# Grab the content of any file and display it using a Javascript tag in the following format:
#
# <script src="/cgi-bin/includer.cgi?../point/to/file.txt"></script>
#
# with file.txt being the file you are grabbing.
# If it's in a different directory, include the full unix path.


$file = $ENV{'QUERY_STRING'};
print "Content-type: text/html\n\n";

if($file eq "/home2/form-kaos/www/insert/menu.html") {
print "document.writeln('<center><font color=red>Includer Error: No File Specified.</font>
');\n";
print "document.writeln('<small>Script by <a href=\"http://www.smartcgis.com\" target=\"_blank\">SmartCGIs.com</a></small></center>');\n";
exit;
}

open(DATA,"$file") || print "document.writeln('<center><font color=red>Includer Error: Could not open $file ($!).</font>
<small>Script by <a href=\"http://www.smartcgis.com\" target=\"_blank\">SmartCGIs.com</a></small></center>');";
@filecontent = <DATA>;
close(DATA);

foreach $line(@filecontent) {
chomp($line);
$line =~ s/\'/\\\'/g;
print "document.writeln('$line');\n";
}


Now copy that into a .txt file, and rename it includer.cgi, set your perl location at the top #/usr/bin/perl (this may be different for some free/pay hosts), upload it, CHMOD 755 (set permissions to 755) and that's it. There is no need to edit this script, calling is done from the code below Now in any page with ANY file extension (html, htm, shtml, shtm, php, php3, cgi, pl, etc..) you include this code:

Code:

<script src="/cgi-bin/includer.cgi?../point/to/file.txt"></script>
That will call the page you asked for into the page. DO NOT remove the ../ from the line. Any questions ask them here, and I will be happy to reply!

Credit to: Jimmy (wordx@hotmail.com) for the creaton of this script.

snyx

02-09-2001 12:02 AM

this could be quite useful for a few things i want to do, thanks.

02-09-2001 10:12 AM

i was searching for something like that for age thanks

i have add your script to my forum and i have edit my bb code so i have done it like this


Code:

[inc] is replaced with <script src="/cgi-bin/includer.cgi?../

[/inc] is replaced with "></script>

but its not work for the moment i will try later but if you see something that i have not see let me know :)

02-09-2001 01:39 PM

Try this is all else fails:

Code:

<script src="http://www.yourname.com/cgi-bin/includer.cgi?../point/to/file.txt"></script>


All times are GMT. The time now is 03:49 PM.

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.01101 seconds
  • Memory Usage 1,722KB
  • 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
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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