Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 02-08-2001, 11:02 PM
snyx's Avatar
snyx snyx is offline
 
Join Date: Oct 2001
Location: Vancouver (whistler.2010)
Posts: 556
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

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
Reply With Quote
  #2  
Old 02-09-2001, 12:02 AM
Guest
 
Posts: n/a
Default

this could be quite useful for a few things i want to do, thanks.
Reply With Quote
  #3  
Old 02-09-2001, 10:12 AM
Guest
 
Posts: n/a
Default

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
Reply With Quote
  #4  
Old 02-09-2001, 01:39 PM
Guest
 
Posts: n/a
Default

Try this is all else fails:

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:19 AM.


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.03189 seconds
  • Memory Usage 2,181KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (4)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (4)post_thanks_box
  • (4)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (4)post_thanks_postbit_info
  • (4)postbit
  • (1)postbit_onlinestatus
  • (4)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete