forked from pellcorp/opendb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
whatsnew.php
85 lines (76 loc) · 2.67 KB
/
whatsnew.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
/*
Open Media Collectors Database
Copyright (C) 2001,2013 by Jason Pell
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// This must be first - includes config.php
require_once("./include/begin.inc.php");
include_once("./lib/database.php");
include_once("./lib/auth.php");
include_once("./lib/whatsnew.php");
include_once("./lib/javascript.php");
/**
* This class is designed to execute under a public access enabled site if you want to embed it in
* other sites.
*
* You must copy the following javascript to your site and put it into a script/ directory:
*
* script/common.js
* script/marquee.js
*
* You can use the following PHP to embed this into your site (assuming you have Snoopy.class.php
* available):
*
* <?php
* include_once("./Snoopy.class.php");
* $snoopy = new Snoopy();
* $snoopy->fetch("http://127.0.0.1/jason/opendb/whatsnew.php");
* if($snoopy->status >= 200 && $snoopy->status<300)
* {
* echo $snoopy->results;
* }
* ?>
*/
if (is_site_enabled()) {
if (is_opendb_valid_session() || is_site_public_access()) {
$HTTP_VARS['op'] = ifempty($HTTP_VARS['op'], 'marquee');
if ($HTTP_VARS['op'] == 'marquee') {
echo (get_javascript('common.js'));
echo (get_javascript('marquee.js'));
echo ("\n<div id=\"lastitemlist-container\">"
. get_last_item_list_marquee(
get_last_item_list(get_opendb_config_var('welcome.last_items_list', 'total_num_items'), NULL, //$owner_id
NULL, //$s_item_type
NULL, //$update_on
NULL, //$not_owner_id
get_site_url(), //$site_url_prefix
TRUE)) . //$is_popup_item_display
"\n</div>");
echo ("\n<script language=\"JavaScript\">
addEvent(
window,
'load',
function(){startMarquee('lastitemlist-container', 'lastitemlist-item', 2000);} );
</script>");
}
} else {
// invalid login, so login instead.
redirect_login($PHP_SELF, $HTTP_VARS);
}
} else { //if(is_site_enabled())
opendb_site_disabled();
}
// Cleanup after begin.inc.php
require_once("./include/end.inc.php");
?>