Example #1
0
 * 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, NULL, NULL, NULL, get_site_url(), TRUE)) . "\n</div>";
            echo "\n<script language=\"JavaScript\">\n\t\t\taddEvent(\n\t\t\t\twindow, \n\t\t\t\t'load', \n\t\t\t\tfunction(){startMarquee('lastitemlist-container', 'lastitemlist-item', 2000);} );\n\t\t\t</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";
Example #2
0
function get_welcome_last_item_list($update_on, $user_id)
{
    $last_items_list_conf_r = get_opendb_config_var('welcome.last_items_list');
    if ($last_items_list_conf_r['enable'] !== FALSE) {
        if ($last_items_list_conf_r['exclude_current_user'] !== TRUE) {
            $user_id = NULL;
        }
        if ($last_items_list_conf_r['restrict_last_login'] !== TRUE) {
            $update_on = NULL;
        }
        return get_last_item_list($last_items_list_conf_r['total_num_items'], NULL, NULL, $update_on, $user_id, NULL, FALSE);
    } else {
        return NULL;
    }
}