-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.php
59 lines (51 loc) · 1.57 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* XDCC Parser
* |- Index
*
* This software is free software and you are permitted to
* modify and redistribute it under the terms of the GNU General
* Public License version 3 as published by the Free Sofware
* Foundation.
*
* @link http://xdccparser.is-fabulo.us/
* @version 1.2.0
* @author Alex 'xshadowfire' Yu <[email protected]>
* @author DrX
* @copyright 2008-2009 Alex Yu and DrX
*/
require_once 'core.php';
require_once 'smarty/libs/Smarty.class.php';
//initialize smarty
$s = new Smarty();
$s->caching = false;
$s->template_dir = "./tpl";
$s->compile_dir = "./templates_c";
//figure out url, if needed.
if(!URL) {
$uri = explode("/",$_SERVER['REQUEST_URI']);
array_pop($uri);
$_s = '';
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != '' && $_SERVER['HTTPS'] != 'off')
$_s = 's';
define('_URL', "http$_s://".$_SERVER['SERVER_NAME'].implode("/",$uri)."/");
} else {
define('_URL', URL);
}
//assign our vars
$s->assign("url", _URL);
$s->assign("skin", $_REQUEST['skin'] ? $_REQUEST['skin'] : SKIN);
$s->assign("display_sc", DISPLAY_SC);
$s->assign("bots", xp_get("bots"));
$s->assign("bookmarks", xp_get("bookmarks"));
$_GET['search'] ? $s->assign("search", htmlentities(stripslashes($_GET['search']))) : null;
$_GET['nick'] ? $s->assign("nick", $_GET['nick']) : null;
if(IRC) {
$s->assign("irc_chan", IRC_CHANNEL);
$s->assign("irc_net", IRC_NETWORK);
}
$s->display("packlist.tpl");
//how old is our cache?
if(time() > xp_get("time")+UPDATE_FREQ)
file_get_contents(_URL.'refresh.php',0,stream_context_create(array('http' => array('timeout' => 0))));
?>