trigger_hook('index_top'); // define meta tags & common variables if ('' != $config['homepage_title']) { $meta_title = $config['homepage_title']; } else { $meta_title = sprintf($lang['homepage_title'], _SITENAME); } $meta_keywords = $config['homepage_keywords']; $meta_description = $config['homepage_description']; // end $top_videos = top_videos($config['top_videos_sort'], _TOPVIDS); $new_videos = get_video_list('added', 'desc', 0, _NEWVIDS); $voth = make_voth(); $video = request_video($voth, "index"); $voth_title = ''. $video['video_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); } // Get latest articles if (_MOD_ARTICLE) { $articles = art_load_articles(0, $config['article_widget_limit']); if ( ! array_key_exists('type', $articles)) { foreach ($articles as $id => $article) { $articles[$id]['title'] = fewchars($article['title'], 55); } $smarty->assign('articles', $articles); } } $playingnow = videosplaying($config['playingnow_limit']); $total_playingnow = (is_array($playingnow)) ? count($playingnow) : 0; if ($config['player_autoplay'] == '0' && $video['video_player'] != 'embed' && $video['source_id'] != 3) { // don't update site_views for this video. It will be updated when the user hits the play button. } else { // in all other cases, update site_views on page load. update_view_count($video['id'], $video['site_views'], false); } // pre-roll [static] ads serve_preroll_ad('index', $video); $smarty->assign('total_playingnow', $total_playingnow); $smarty->assign('playingnow', $playingnow); $smarty->assign('voth_title', $voth_title); $smarty->assign('video_data', $video); $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_keywords', $meta_keywords); $smarty->assign('meta_description', $meta_description); $smarty->assign('template_dir', $template_f); $modframework->trigger_hook('index_bottom'); $smarty->display('index.tpl'); ?>