예제 #1
0
<?php

/**
 * @Project NUKEVIET 3.0
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
 * @Createdate 2-9-2010 14:43
 */
if (!defined('NV_IS_ALBUMS_ADMIN')) {
    die('Stop!!!');
}
$id = $nv_Request->get_int('id', 'post,get');
$result = false;
$adb = new albumdb();
if ($id) {
    $aID = $adb->getAlbumIDByPicID($id);
    $aid = $db->sql_fetchrow($aID);
    $num = $db->sql_numrows($adb->getAlbumImgsOBW($aid['albumid']));
    $result = $adb->deletePictrueByID($id);
    if ($result) {
        $result = $adb->updateAlbumPicsNum($aid['albumid'], intval($num - 1));
    }
    $albs = $adb->getAlbumImgsOBW($aid['albumid']);
    $i = 1;
    while ($ab = $db->sql_fetchrow($albs)) {
        $adb->chageImgWByID($ab['pictureid'], $i);
        $i++;
    }
}
if ($result) {
    echo $lang_module['delalbum_success'];
예제 #2
0
<?php

/**
 * @Project NUKEVIET 3.0
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
 * @Createdate 7-17-2010 14:43
 */
if (!defined('NV_SYSTEM')) {
    die('Stop!!!');
}
define('NV_IS_MOD_ALBUMS', true);
require_once NV_ROOTDIR . "/modules/" . $module_name . '/albumdb.php';
$adb = new albumdb();
$result = $adb->getAllNonMapAlbum();
$albums = array();
$aID = isset($array_op[1]) ? intval($array_op[1]) : 0;
while ($rs = $db->sql_fetchrow($result)) {
    $listimg = array();
    $albums[] = array('albumid' => $rs['albumid'], 'name' => $rs['name'], 'description' => $rs['description'], 'createddate' => $rs['createddate'], 'num_photo' => $rs['num_photo'], 'path_img' => $rs['path_img'], 'num_view' => $rs['num_view'], 'alias' => $rs['alias'], 'listimg' => $listimg);
    $act = $rs['albumid'] == $aID ? 1 : 0;
    $url_link = NV_BASE_SITEURL . "?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . '&amp;' . NV_OP_VARIABLE . "=view/" . $rs['albumid'] . "/" . $rs['alias'];
    $nv_vertical_menu[] = array($rs['name'], $url_link, $act, 'submenu' => array());
}
function nv_news_page($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = true)
{
    global $lang_global;
    $total_pages = ceil($num_items / $per_page);
    if ($total_pages == 1) {
        return '';
    }
예제 #3
0
<?php

/**
* @Project NUKEVIET 3.0
* @Author VINADES., JSC (contact@vinades.vn)
* @Copyright (c) 2010 VINADES ., JSC. All rights reserved
* @Createdate Aug 9, 2010 2:09:19 PM
*/
$new = $nv_Request->get_int('new', 'post', 0);
$old = $nv_Request->get_int('old', 'post', 0);
$aid = $nv_Request->get_int('aid', 'post', 0);
$adb = new albumdb();
if ($old != $new) {
    $adb->changeImgW($old, 0, $aid);
    if ($old < $new) {
        for ($i = $old; $i < $new; $i++) {
            $adb->changeImgW($i + 1, $i, $aid);
        }
    } else {
        for ($i = $old; $i > $new; $i--) {
            $adb->changeImgW($i - 1, $i, $aid);
        }
    }
    $adb->changeImgW(0, $new, $aid);
}
echo $lang_module['update_success'];
예제 #4
0
<?php

/**
 * @Project NUKEVIET 3.0
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
 * @Createdate 7-17-2010 14:43
 */
if (!defined('NV_SYSTEM')) {
    die('Stop!!!');
}
define('NV_IS_MOD_ALBUMS', true);
require_once NV_ROOTDIR . "/modules/" . $module_name . '/albumdb.php';
$adb = new albumdb();
$array_album = array();
$result = $adb->getAllActiveAlbumOBW();
$catalias = isset($array_op[0]) ? trim($array_op[0]) : "";
//albumid
$aID = $vID = 0;
while ($rs = $db->sql_fetchrow($result)) {
    $array_album[] = $rs;
    if ($catalias == $rs['alias']) {
        $aID = $rs['albumid'];
    }
}
//end albumid
//get id video
if ($aID > 0 and isset($array_op[2])) {
    $vID = $array_op[2];
}
//end get id video
예제 #5
0
<?php

/**
 * @Project NUKEVIET 3.0
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
 * @Createdate 7-17-2010 14:43
 */
if (!defined('NV_IS_ALBUMS_ADMIN')) {
    die('Stop!!!');
}
$page_title = $lang_module['list_img_title'];
$idb = $nv_Request->get_int('idb', 'get', 0);
$adb = new albumdb();
$xtpl = new XTemplate("listimg.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_name);
$xtpl->assign('LANG', $lang_module);
$xtpl->assign('LINK_ADD', "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=add_img&idb=" . $idb);
$xtpl->assign('URL_DEL_BACK', "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=listimg");
$xtpl->assign('URL_DEL', "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=del_limgs");
$xtpl->assign('URL_RE', "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=listimg&idb=");
$result = $adb->getAllalbums();
$i = 0;
while ($rs = $db->sql_fetchrow($result)) {
    if ($i == 0 && $idb == 0) {
        $idb = $rs['albumid'];
    }
    $xtpl->assign('id', $rs['albumid']);
    $xtpl->assign('name', $rs['name']);
    $select = $idb == $rs['albumid'] ? "selected=\"selected\"" : "";
    $xtpl->assign('SELECT', $select);
    $xtpl->parse('main.albums');
예제 #6
0
<?php

/**
 * @Project NUKEVIET 3.0
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
 * @Createdate 7-17-2010 14:43
 */
if (!defined('NV_IS_ALBUMS_ADMIN')) {
    die('Stop!!!');
}
$id = $nv_Request->get_int('id', 'get', 0);
$adb = new albumdb();
$ac = $adb->ChangeToMap($id);
$str = $ac == 1 ? $lang_module['active_yes'] : $lang_module['active_no'];
echo $lang_module['album_active_succer'] . " \"" . $str . " \"";
예제 #7
0
<?php

/**
 * @Project NUKEVIET 3.0
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
 * @Createdate 7-17-2010 14:43
 */
if (!defined('NV_IS_ALBUMS_ADMIN')) {
    die('Stop!!!');
}
$id = $nv_Request->get_int('id', 'get', 0);
$adb = new albumdb();
$ac = $adb->ChangeHotAlbum($id);
$str = $ac == 1 ? $lang_module['active_yes'] : $lang_module['active_no'];
echo $lang_module['album_active_succer'] . " \"" . $str . " \"";
예제 #8
0
/**
 * @Project NUKEVIET 3.0
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
 * @Createdate 7-17-2010 14:43
 */
if (!defined('NV_IS_ALBUMS_ADMIN')) {
    die('Stop!!!');
}
$page_title = $lang_module['main'];
$xtpl = new XTemplate("main.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_name);
$xtpl->assign('LANG', $lang_module);
$xtpl->assign('LINK_ADD', "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=add_ab");
$xtpl->assign('URL_DEL_BACK', "index.php?" . NV_NAME_VARIABLE . "=" . $module_name);
$xtpl->assign('URL_DEL', "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=del_lalbums");
$abd = new albumdb();
$result = $abd->getAllAlbumOBW();
$num = $db->sql_numrows($result);
$link_del_one = "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=del_albums";
$link_edit = "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=add_ab";
$link_active = "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=active&id=";
$link_album = "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=listimg&idb=";
$link_hot = "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=hot&id=";
$link_map = "index.php?" . NV_NAME_VARIABLE . "=" . $module_name . "&" . NV_OP_VARIABLE . "=map&id=";
$i = 0;
while ($rs = $db->sql_fetchrow($result)) {
    $xtpl->assign('id', $rs['albumid']);
    $xtpl->assign('name', $rs['name']);
    $class = $i % 2 ? " class=\"second\"" : "";
    $xtpl->assign('class', $class);
    $xtpl->assign('URL_DEL_ONE', $link_del_one . "&id=" . $rs['albumid']);
예제 #9
0
 */
if (!defined('NV_IS_ALBUMS_ADMIN')) {
    die('Stop!!!');
}
$id = $nv_Request->get_int('id', 'get', 0);
if ($id == 0) {
    $page_title = $lang_module['add_album'];
} else {
    $page_title = $lang_module['edit_album'];
}
$xtpl = new XTemplate("add.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_name);
$add = 0;
$error = "";
$data = array();
$data['active'] = "1";
$adb = new albumdb();
if ($id != 0) {
    $result = $adb->getAllAlbumCotent($id);
    $data = $db->sql_fetchrow($result);
    if (!empty($data['path_img']) and file_exists(NV_UPLOADS_REAL_DIR . "/" . $module_name . $data['path_img'])) {
        $data['path_img'] = NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . $module_name . $data['path_img'];
    }
}
if ($nv_Request->get_int('add', 'post') == 1) {
    $data['name'] = filter_text_input('name', 'post', '', 1);
    $alias = change_alias($data['name']);
    $data['description'] = filter_text_textarea('description', '', NV_ALLOWED_HTML_TAGS);
    $data['path_img'] = filter_text_input('pic_path', 'post', '', 0);
    $data['active'] = filter_text_input('active', 'post', '0', 0);
    if (!nv_is_url($data['path_img']) and is_file(NV_DOCUMENT_ROOT . $data['path_img'])) {
        $lu = nv_strlen(NV_BASE_SITEURL . NV_UPLOADS_DIR . "/" . $module_name);
예제 #10
0
 */
if (!defined('NV_IS_ALBUMS_ADMIN')) {
    die('Stop!!!');
}
if (defined('NV_EDITOR')) {
    require_once NV_ROOTDIR . '/' . NV_EDITORSDIR . '/' . NV_EDITOR . '/nv.php';
}
$id = $nv_Request->get_int('id', 'get', 0);
if ($id == 0) {
    $page_title = $lang_module['add_pic'];
} else {
    $page_title = $lang_module['edit_pic'];
}
$error = "";
$xtpl = new XTemplate("upload.tpl", NV_ROOTDIR . "/themes/" . $global_config['module_theme'] . "/modules/" . $module_name);
$adb = new albumdb();
$max_x = 120;
$max_y = 100;
$data = array();
$data['albumid'] = $nv_Request->get_int('idb', 'get', 0);
$data['is_show'] = 0;
if ($id != 0) {
    $sql = "SELECT * FROM `" . NV_PREFIXLANG . "_" . $module_data . "_picture` WHERE pictureid = '" . $id . "'";
    $result = $db->sql_query($sql);
    $data = $db->sql_fetchrow($result);
    $data['v_path'] = $data['vpath'];
}
if ($nv_Request->get_int('add', 'post') == 1) {
    $data['name'] = filter_text_input('name', 'post', '', 1);
    $data['alias'] = change_alias($data['name']);
    $thumb_name = "";
예제 #11
0
<?php

/**
 * @Project NUKEVIET 3.0
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
 * @Createdate 2-9-2010 14:43
 */
if (!defined('NV_IS_ALBUMS_ADMIN')) {
    die('Stop!!!');
}
$result = false;
$id = $nv_Request->get_int('id', 'post,get');
$adb = new albumdb();
if ($id > 0) {
    $result = $adb->deleteAlbumByID($id);
    $result = $adb->deletePicturesByAlbumID($id);
}
$num = $db->sql_numrows($adb->getAllalbums());
$albs = $adb->getAllAlbumOBW();
$i = 1;
while ($ab = $db->sql_fetchrow($albs)) {
    $adb->changeABWeightByID($ab['albumid'], $i);
    $i++;
}
if ($result) {
    echo $lang_module['delalbum_success'];
} else {
    echo $lang_module['delalbum_error'];
}
예제 #12
0
<?php

/**
 * @Project NUKEVIET 3.0
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
 * @Createdate 7-17-2010 14:43
 */
if (!defined('NV_IS_ALBUMS_ADMIN')) {
    die('Stop!!!');
}
$id = $nv_Request->get_int('id', 'get', 0);
$adb = new albumdb();
$ac = $adb->ActiveAlbum($id);
$str = $ac == 1 ? $lang_module['active_yes'] : $lang_module['active_no'];
echo $lang_module['album_active_succer'] . " \"" . $str . " \"";
예제 #13
0
<?php

/**
 * @Project NUKEVIET 3.0
 * @Author VINADES., JSC (contact@vinades.vn)
 * @Copyright (c) 2010 VINADES ., JSC. All rights reserved
 * @Createdate Aug 6, 2010 4:12:19 PM
 */
$new = $nv_Request->get_int('new', 'post', 0);
$old = $nv_Request->get_int('old', 'post', 0);
$adb = new albumdb();
if ($old != $new) {
    $adb->changeABWeight($old, 0);
    if ($old < $new) {
        for ($i = $old; $i < $new; $i++) {
            $adb->changeABWeight($i + 1, $i);
        }
    } else {
        for ($i = $old; $i > $new; $i--) {
            $adb->changeABWeight($i - 1, $i);
        }
    }
    $adb->changeABWeight(0, $new);
}
echo $lang_module['update_success'];