コード例 #1
0
 function nv_block_videos_groups_tabs($block_config)
 {
     global $module_array_cat, $module_info, $site_mods, $module_config, $global_config, $db, $nv_Cache;
     $module = $block_config['module'];
     $show_no_image = $module_config[$module]['show_no_image'];
     if (empty($show_no_image)) {
         $show_no_image = 'themes/default/images/' . $module . '/' . 'video_placeholder.png';
     }
     $blockwidth = $module_config[$module]['blockwidth'];
     if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/videos/block_groups_tabs.tpl')) {
         $block_theme = $global_config['module_theme'];
     } else {
         $block_theme = 'default';
     }
     $xtpl = new XTemplate('block_groups_tabs.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/videos');
     $sql = 'SELECT * FROM ' . NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'] . '_block_cat WHERE bid=' . $block_config['blockid'];
     $list = $nv_Cache->db($sql, '', $module);
     foreach ($list as $l) {
         $block_select = $l;
     }
     $db->sqlreset()->select('t1.id, t1.catid, t1.title, t1.alias, t1.homeimgfile, t1.homeimgthumb,t1.hometext,t1.publtime')->from(NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'] . '_rows t1')->join('INNER JOIN ' . NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'] . '_block t2 ON t1.id = t2.id')->where('t2.bid= ' . $block_config['blockid'] . ' AND t1.status= 1')->order('t2.weight ASC')->limit($block_config['numrow']);
     $list = $nv_Cache->db($db->sql(), '', $module);
     if (!empty($list)) {
         foreach ($list as $l) {
             $l['link'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module . '&' . NV_OP_VARIABLE . '=' . $module_array_cat[$l['catid']]['alias'] . '/' . $l['alias'] . '-' . $l['id'] . $global_config['rewrite_exturl'];
             if ($l['homeimgthumb'] == 1 or $l['homeimgthumb'] == 2) {
                 $l['thumb'] = videos_thumbs($l['id'], $l['homeimgfile'], $module, $module_config[$module]['homewidth'], $module_config[$module]['homeheight'], 90);
             } elseif ($l['homeimgthumb'] == 3) {
                 $l['thumb'] = $l['homeimgfile'];
             } elseif (!empty($show_no_image)) {
                 $l['thumb'] = NV_BASE_SITEURL . $show_no_image;
             } else {
                 $l['thumb'] = '';
             }
             $l['blockwidth'] = $blockwidth;
             $l['title'] = nv_clean60($l['title'], $block_config['title_length']);
             $xtpl->assign('ROW', $l);
             if (!empty($l['thumb'])) {
                 $xtpl->parse('main.group.loop.img');
             }
             $xtpl->parse('main.group.loop');
         }
         $xtpl->assign('BLOCK_NAME', $block_select['title']);
         $xtpl->parse('main.group');
     }
     $db->sqlreset()->select('*')->from(NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'] . '_rows')->where('status= 1')->order('publtime DESC')->limit($block_config['numrow']);
     $last = $nv_Cache->db($db->sql(), '', $module);
     if (!empty($last)) {
         foreach ($last as $ls) {
             $ls['link'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module . '&' . NV_OP_VARIABLE . '=' . $module_array_cat[$ls['catid']]['alias'] . '/' . $ls['alias'] . '-' . $ls['id'] . $global_config['rewrite_exturl'];
             if ($ls['homeimgthumb'] == 1 or $ls['homeimgthumb'] == 2) {
                 $ls['thumb'] = videos_thumbs($ls['id'], $ls['homeimgfile'], $module, $module_config[$module]['homewidth'], $module_config[$module]['homeheight'], 90);
             } elseif ($ls['homeimgthumb'] == 3) {
                 $ls['thumb'] = $ls['homeimgfile'];
             } elseif (!empty($show_no_image)) {
                 $ls['thumb'] = NV_BASE_SITEURL . $show_no_image;
             } else {
                 $ls['thumb'] = '';
             }
             $ls['blockwidth'] = $blockwidth;
             $ls['title'] = nv_clean60($ls['title'], $block_config['title_length']);
             $xtpl->assign('NEWS', $ls);
             if (!empty($ls['thumb'])) {
                 $xtpl->parse('main.latest.loop.img');
             }
             $xtpl->parse('main.latest.loop');
         }
         $xtpl->parse('main.latest');
     }
     $xtpl->parse('main');
     return $xtpl->text('main');
 }
コード例 #2
0
ファイル: user-video.php プロジェクト: nukeplus/videos
    }
} elseif (defined('NV_IS_USER')) {
    $page = 1;
    if (isset($array_op[1]) and substr($array_op[1], 0, 5) == 'page-') {
        $page = intval(substr($array_op[1], 5));
    }
    $contents = "<div style=\"border: 1px solid #ccc;margin: 10px; font-size: 15px; font-weight: bold; text-align: center;\"><a href=\"" . $base_url . "&amp;contentid=0&checkss=" . md5("0" . $client_info['session_id'] . $global_config['sitekey']) . "\">" . $lang_module['add_content'] . "</a></h1></div>";
    $array_catpage = array();
    $db->sqlreset()->select('COUNT(*)')->from(NV_PREFIXLANG . '_' . $module_data . '_rows')->where('admin_id= ' . $user_info['userid']);
    $num_items = $db->query($db->sql())->fetchColumn();
    if ($num_items) {
        $db->select('id, catid, listcatid, admin_id, admin_name, author, artist, sourceid, addtime, edittime, status, publtime, title, alias, hometext, vid_path, homeimgfile, homeimgalt, homeimgthumb, allowed_rating, hitstotal, hitscm, total_rating, click_rating')->order('id DESC')->limit($per_page)->offset(($page - 1) * $per_page);
        $result = $db->query($db->sql());
        while ($item = $result->fetch()) {
            if ($item['homeimgthumb'] == 1 or $item['homeimgthumb'] == 2) {
                $item['imghome'] = videos_thumbs($item['id'], $item['homeimgfile'], $module_upload, $module_config[$module_name]['homewidth'], $module_config[$module_name]['homeheight'], 90);
            } elseif ($item['homeimgthumb'] == 3) {
                $item['imghome'] = $item['homeimgfile'];
            } else {
                $item['imghome'] = NV_BASE_SITEURL . 'themes/default/images/' . $module_name . '/' . 'video_placeholder.png';
            }
            $item['is_edit_content'] = (empty($item['status']) or $array_post_user['editcontent']) ? 1 : 0;
            $item['is_del_content'] = (empty($item['status']) or $array_post_user['delcontent']) ? 1 : 0;
            $catid = $item['catid'];
            $item['link'] = $global_array_cat[$catid]['link'] . '/' . $item['alias'] . '-' . $item['id'] . $global_config['rewrite_exturl'];
            $item['title_cut'] = nv_clean60($item['title'], $module_config[$module_name]['titlecut'], true);
            $array_catpage[] = $item;
        }
        // parse content
        $xtpl = new XTemplate('viewcat_page.tpl', NV_ROOTDIR . '/themes/' . $module_info['template'] . '/modules/' . $module_file);
        $xtpl->assign('LANG', $lang_module);
コード例 #3
0
 function nv_block_news_cat($block_config)
 {
     global $module_array_cat, $module_info, $site_mods, $module_config, $global_config, $db, $nv_Cache;
     $module = $block_config['module'];
     $show_no_image = $module_config[$module]['show_no_image'];
     if (empty($show_no_image)) {
         $show_no_image = 'themes/default/images/' . $module . '/' . 'video_placeholder.png';
     }
     $blockwidth = $module_config[$module]['blockwidth'];
     if (empty($block_config['catid'])) {
         return '';
     }
     $catid = implode(',', $block_config['catid']);
     $db->sqlreset()->select('id, catid, title, alias, homeimgfile, homeimgthumb, hometext, publtime')->from(NV_PREFIXLANG . '_' . $site_mods[$module]['module_data'] . '_rows')->where('status= 1 AND catid IN(' . $catid . ')')->order('publtime DESC')->limit($block_config['numrow']);
     $list = $nv_Cache->db($db->sql(), '', $module);
     if (!empty($list)) {
         if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/videos/block_news_cat.tpl')) {
             $block_theme = $global_config['module_theme'];
         } else {
             $block_theme = 'default';
         }
         $xtpl = new XTemplate('block_news_cat.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/videos');
         foreach ($list as $l) {
             $l['link'] = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module . '&amp;' . NV_OP_VARIABLE . '=' . $module_array_cat[$l['catid']]['alias'] . '/' . $l['alias'] . '-' . $l['id'] . $global_config['rewrite_exturl'];
             if ($l['homeimgthumb'] == 1 or $l['homeimgthumb'] == 2) {
                 $l['thumb'] = videos_thumbs($l['id'], $l['homeimgfile'], $module, $module_config[$module]['homewidth'], $module_config[$module]['homeheight'], 90);
             } elseif ($l['homeimgthumb'] == 3) {
                 $l['thumb'] = $l['homeimgfile'];
             } elseif (!empty($show_no_image)) {
                 $l['thumb'] = NV_BASE_SITEURL . $show_no_image;
             } else {
                 $l['thumb'] = '';
             }
             $l['blockwidth'] = $blockwidth;
             $l['hometext'] = nv_clean60($l['hometext'], $block_config['tooltip_length'], true);
             if (!$block_config['showtooltip']) {
                 $xtpl->assign('TITLE', 'title="' . $l['title'] . '"');
             }
             $xtpl->assign('ROW', $l);
             if (!empty($l['thumb'])) {
                 $xtpl->parse('main.loop.img');
             }
             if ($block_config['showtooltip']) {
                 $xtpl->assign('TOOLTIP_POSITION', $block_config['tooltip_position']);
                 $xtpl->parse('main.loop.tooltip');
             }
             $xtpl->parse('main.loop');
         }
         $xtpl->parse('main');
         return $xtpl->text('main');
     }
 }
コード例 #4
0
        $where .= ' AND publtime >=' . mktime(0, 0, 0, $m[2], $m[1], $m[3]);
    }
    if ($catid > 0) {
        $table_search = NV_PREFIXLANG . '_' . $module_data . '_' . $catid;
    } else {
        $table_search = NV_PREFIXLANG . '_' . $module_data . '_rows';
    }
    $db->sqlreset()->select('COUNT(*)')->from($table_search . ' as tb1 ' . $tbl_src)->where('tb1.status=1 ' . $where);
    $numRecord = $db->query($db->sql())->fetchColumn();
    $db->select('tb1.id,tb1.title,tb1.alias,tb1.catid,tb1.hometext,tb1.author,tb1.publtime,tb1.homeimgfile, tb1.homeimgthumb,tb1.sourceid')->order('tb1.publtime DESC')->limit($per_page)->offset(($page - 1) * $per_page);
    $result = $db->query($db->sql());
    $array_content = array();
    $show_no_image = $module_config[$module_name]['show_no_image'];
    while (list($id, $title, $alias, $catid, $hometext, $author, $publtime, $homeimgfile, $homeimgthumb, $sourceid) = $result->fetch(3)) {
        if ($homeimgthumb == 1 or $homeimgthumb == 2) {
            $img_src = videos_thumbs($id, $homeimgfile, $module_upload, $module_config[$module_name]['homewidth'], $module_config[$module_name]['homeheight'], 90);
        } elseif ($homeimgthumb == 3) {
            $img_src = $homeimgfile;
        } elseif (!empty($show_no_image)) {
            $img_src = NV_BASE_SITEURL . $show_no_image;
        } else {
            $img_src = '';
        }
        $array_content[] = array('id' => $id, 'title' => $title, 'alias' => $alias, 'catid' => $catid, 'hometext' => $hometext, 'author' => $author, 'publtime' => $publtime, 'homeimgfile' => $img_src, 'sourceid' => $sourceid);
    }
    $contents .= search_result_theme($key, $numRecord, $per_page, $page, $array_content, $catid);
}
if (empty($key)) {
    $page_title = $lang_module['search_title'] . ' ' . NV_TITLEBAR_DEFIS . ' ' . $module_info['custom_title'];
} else {
    $page_title = $key . ' ' . NV_TITLEBAR_DEFIS . ' ' . $lang_module['search_title'];
コード例 #5
0
 function nv_news_block_tophits($block_config, $mod_data)
 {
     global $module_array_cat, $site_mods, $module_info, $db, $module_config, $global_config;
     $module = $block_config['module'];
     $mod_file = $site_mods[$module]['module_file'];
     $blockwidth = $module_config[$module]['blockwidth'];
     $show_no_image = $module_config[$module]['show_no_image'];
     if (empty($show_no_image)) {
         $show_no_image = 'themes/default/images/' . $module . '/' . 'video_placeholder.png';
     }
     $publtime = NV_CURRENTTIME - $block_config['number_day'] * 86400;
     $array_block_news = array();
     $db->sqlreset()->select('id, catid, publtime, exptime, title, alias, homeimgthumb, homeimgfile, hometext')->from(NV_PREFIXLANG . '_' . $mod_data . '_rows')->order('hitstotal DESC')->limit($block_config['numrow']);
     if (empty($block_config['nocatid'])) {
         $db->where('status= 1 AND publtime > ' . $publtime);
     } else {
         $db->where('status= 1 AND publtime > ' . $publtime . ' AND catid NOT IN (' . implode(',', $block_config['nocatid']) . ')');
     }
     $result = $db->query($db->sql());
     while (list($id, $catid, $publtime, $exptime, $title, $alias, $homeimgthumb, $homeimgfile, $hometext) = $result->fetch(3)) {
         if ($homeimgthumb == 1 or $homeimgthumb == 2) {
             $imgurl = videos_thumbs($id, $homeimgfile, $module, $module_config[$module]['homewidth'], $module_config[$module]['homeheight'], 90);
         } elseif ($homeimgthumb == 3) {
             $imgurl = $homeimgfile;
         } elseif (!empty($show_no_image)) {
             $imgurl = NV_BASE_SITEURL . $show_no_image;
         } else {
             $imgurl = '';
         }
         $link = NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module . '&amp;' . NV_OP_VARIABLE . '=' . $module_array_cat[$catid]['alias'] . '/' . $alias . '-' . $id . $global_config['rewrite_exturl'];
         $array_block_news[] = array('id' => $id, 'title' => $title, 'link' => $link, 'imgurl' => $imgurl, 'width' => $blockwidth, 'hometext' => $hometext);
     }
     if (file_exists(NV_ROOTDIR . '/themes/' . $global_config['module_theme'] . '/modules/' . $mod_file . '/block_tophits.tpl')) {
         $block_theme = $global_config['module_theme'];
     } else {
         $block_theme = 'default';
     }
     $xtpl = new XTemplate('block_tophits.tpl', NV_ROOTDIR . '/themes/' . $block_theme . '/modules/' . $mod_file);
     foreach ($array_block_news as $array_news) {
         $array_news['hometext'] = nv_clean60($array_news['hometext'], $block_config['tooltip_length'], true);
         $xtpl->assign('blocknews', $array_news);
         if (!empty($array_news['imgurl'])) {
             $xtpl->parse('main.newloop.imgblock');
         }
         if (!$block_config['showtooltip']) {
             $xtpl->assign('TITLE', 'title="' . $array_news['title'] . '"');
         }
         $xtpl->parse('main.newloop');
     }
     if ($block_config['showtooltip']) {
         $xtpl->assign('TOOLTIP_POSITION', $block_config['tooltip_position']);
         $xtpl->parse('main.tooltip');
     }
     $xtpl->parse('main');
     return $xtpl->text('main');
 }