// +------------------------------------------------------------------------+
// | PHP Melody version 1.5.3
// +------------------------------------------------------------------------+
// | PHP Melody IS NOT FREE SOFTWARE
// | If you have downloaded this software from a website other
// | than www.phpsugar.com or if you have received
// | this software from someone who is not a representative of
// | phpSugar, it's likely that you are involved in an illegal activity.
// | ---
// | In such case, please contact: support@phpsugar.com.
// +------------------------------------------------------------------------+
// | Developed by: phpSugar (www.phpsugar.com) / support@phpsugar.com
// | Copyright: (c) 2004-2009 PhpSugar.com. All rights reserved.
// +------------------------------------------------------------------------+
session_start();
if( file_exists("install.php")) {
die("Please delete the file install.php from your root directory after installation.
If you haven't installed the site yet, please proceed to the installation process.");
}
require('config.php');
if($_POST['select_language'] == 1 || (strcmp($_POST['select_language'],"1") == 0))
{
require_once('include/settings.php');
$l_id = (int) $_POST['lang_id'];
if( ! array_key_exists($l_id, $langs) )
{
$l_id = 1;
}
setcookie(COOKIE_LANG, $l_id, time()+COOKIE_TIME, COOKIE_PATH);
exit();
}
//require_once('include/functions.php');
require_once('include/user_functions.php');
require_once('include/islogged.php');
// define meta tags & common variables
$meta_title = sprintf($lang['homepage_title'], _SITENAME);
$meta_description = '';
// end
$top_videos = top_videos('', _TOPVIDS);
$new_videos = list_videos('added', _NEWVIDS);
$voth = make_voth();
$voth_title = show_voth_title();
if($config['show_tags'] == 1)
{
$tag_cloud = tag_cloud(0, $config['tag_cloud_limit'], $config['shuffle_tags']);
$smarty->assign('tags', $tag_cloud);
$smarty->assign('show_tags', 1);
}
if($config['show_stats'] == 1)
{
$stats = stats();
$smarty->assign('stats', $stats);
$smarty->assign('show_stats', 1);
}
$playingnow = videosplaying(9); // LIMIT TO 4 VIDEOS
preg_match_all("/<\/li>/", $playingnow, $matches);
$total_playingnow = count($matches[0]);
$smarty->assign('total_playingnow', $total_playingnow);
$smarty->assign('playingnow', $playingnow);
$smarty->assign('voth_title', $voth_title);
$smarty->assign('voth', $voth);
$smarty->assign('new_videos', $new_videos);
$smarty->assign('top_videos', $top_videos);
// --- DEFAULT SYSTEM FILES - DO NOT REMOVE --- //
$smarty->assign('meta_title', $meta_title);
$smarty->assign('meta_description', $meta_description);
$smarty->assign('template_dir', $template_f);
$smarty->display('index.tpl');
?>