Esempio n. 1
0
    $total_pages = $pagination->getTotalPages();
    $page = $page >= $total_pages ? $total_pages : $page;
    $private_img = '<img alt="" style="position: absolute; left: 0px; top: +15px; width: 160px; height: 120px;" src="' . $config['BASE_URL'] . '/templates/frontend/' . $config['template'] . '/images/' . private_photo('game') . '" />';
    foreach ($games as $game) {
        $code[] = '<div class="video_box_related">';
        $code[] = '<a href="' . $config['BASE_URL'] . '/game/' . $game['GID'] . '/' . prepare_string($game['title']) . '">';
        $code[] = '<span class="font-13 font-bold">' . htmlspecialchars(truncate($game['title'], 20), ENT_QUOTES, 'UTF-8') . '</span><br />';
        $code[] = '<img src="' . $config['BASE_URL'] . '/media/games/tmb/' . $game['GID'] . '.jpg" title="' . htmlspecialchars($game['title'], ENT_QUOTES, 'UTF-8') . '" alt="' . htmlspecialchars($game['title'], ENT_QUOTES, 'UTF-8') . '" width="160" height="120" /><br />';
        if ($game['type'] == 'private') {
            $code[] = $private_img;
        }
        $code[] = '</a>';
        $code[] = '<div class="vbox_rel_left">';
        $code[] = time_range($game['addtime']);
        $code[] = '</div>';
        $code[] = '<div class="vbox_rel_right">';
        $code[] = video_rating_small($game['rate']);
        $code[] = '<div class="clear_right"></div>';
        $views = $game['total_plays'] == '1' ? $lang['global.play'] : $lang['global.plays'];
        $code[] = $game['total_plays'] . ' ' . $views;
        $code[] = '</div>';
        $code[] = '<div class="clear"></div>';
        $code[] = '</div>';
    }
    $data['page'] = $page;
    $data['status'] = $total_pages > 1 ? 1 : 0;
    $data['games'] = implode("\n", $code);
    $data['pages'] = $total_pages;
}
echo json_encode($data);
die;
Esempio n. 2
0
    $page = $page >= $total_pages ? $total_pages : $page;
    $private_img = '<img alt="" style="position: absolute; left: 0px; top: +0px; width: 160px; height: 120px;" src="' . $config['BASE_URL'] . '/templates/frontend/' . $config['template'] . '/images/' . private_photo('video') . '" />';
    foreach ($videos as $video) {
        $code[] = '<div class="video_box_related">';
        $code[] = '<a href="' . $config['BASE_URL'] . '/video/' . $video['VID'] . '/' . prepare_string($video['title']) . '">';
        $code[] = '<span class="font-13 font-bold">' . htmlspecialchars(truncate($video['title'], 21), ENT_QUOTES, 'UTF-8') . '</span><br />';
        $code[] = '<img src="' . $config['BASE_URL'] . '/media/videos/tmb/' . $video['VID'] . '/' . $video['thumb'] . '.jpg" title="' . htmlspecialchars($video['title'], ENT_QUOTES, 'UTF-8') . '" alt="' . htmlspecialchars($video['title'], ENT_QUOTES, 'UTF-8') . '" width="160" height="120" id="rotate_' . $video['VID'] . '" /><br />';
        if ($video['type'] == 'private') {
            $code[] = $private_img;
        }
        $code[] = '</a>';
        $code[] = '<div class="vbox_rel_left">';
        $code[] = duration($video['duration']) . '<br />';
        $code[] = time_range($video['addtime']);
        $code[] = '</div>';
        $code[] = '<div class="vbox_rel_right">';
        $code[] = video_rating_small($video['rate']);
        $code[] = '<div class="clear_right"></div>';
        $views = $video['viewnumber'] == '1' ? $lang['global.view'] : $lang['global.views'];
        $code[] = $video['viewnumber'] . ' ' . $views;
        $code[] = '</div>';
        $code[] = '<div class="clear"></div>';
        $code[] = '</div>';
    }
    $data['page'] = $page;
    $data['status'] = $total_pages > 1 ? 1 : 0;
    $data['videos'] = implode("\n", $code);
    $data['pages'] = $total_pages;
}
echo json_encode($data);
die;