root/trunk/cgi-bin/lj-bml-init.pl @ 941

Revision 941, 1.2 KB (checked in by bradfitz, 11 years ago)

mart was right: having the scheme set the content type is lame.
so i moved it up a layer so all schemes benefit.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1#!/usr/bin/perl
2#
3
4require 'ljconfig.pl';
5
6BML::register_block("DOMAIN", "S", $LJ::DOMAIN);
7BML::register_block("IMGPREFIX", "S", $LJ::IMGPREFIX);
8BML::register_block("SITEROOT", "S", $LJ::SITEROOT);
9BML::register_block("SITENAME", "S", $LJ::SITENAME);
10BML::register_block("ADMIN_EMAIL", "S", $LJ::ADMIN_EMAIL);
11BML::register_block("SUPPORT_EMAIL", "S", $LJ::SUPPORT_EMAIL);
12
13{
14    my $dl = "<a href=\"$LJ::SITEROOT/files/%%DATA%%\">HTTP</a>";
15    if ($LJ::FTPPREFIX) {
16        $dl .= " - <a href=\"$LJ::FTPPREFIX/%%DATA%%\">FTP</a>";
17    }
18    BML::register_block("DL", "DS", $dl);
19}
20
21BML::register_hook("startup", sub { LJ::start_request() });
22
23if ($LJ::UNICODE) {
24    BML::set_default_content_type("text/html; charset=utf-8");
25}
26
27# pre-load common libraries so we don't have to load them in BML files (slow)
28package BMLCodeBlock;
29use LJ::TextMessage;
30use LJ::TagGenerator ':html4';
31use Digest::MD5 qw(md5_hex);
32require 'imageconf.pl';
33require 'propparse.pl';
34require 'supportlib.pl';
35require 'ljlib.pl';
36require 'ljprotocol.pl';
37require 'cleanhtml.pl';
38require 'emailcheck.pl';
39require 'portal.pl';
40require 'talklib.pl';
41require 'topiclib.pl';
42require 'ljtodo.pl';
43require 'directorylib.pl';
44
45
461;
Note: See TracBrowser for help on using the browser.