コード例 #1
0
ファイル: comment.php プロジェクト: hoangvtien/nphoto
 * @Copyright (C) 2010 VINADES.,JSC. All rights reserved
 * @Createdate 3-6-2010 0:14
 */
if (!defined('NV_IS_MOD_NPHOTO')) {
    die('Stop!!!');
}
if (!defined('NV_IS_AJAX')) {
    die('Wrong URL');
}
$contents = "";
$id = $nv_Request->get_int('id', 'get', 0);
$checkss = $nv_Request->get_string('checkss', 'get', '');
$page = $nv_Request->get_int('page', 'get', 0);
$cmable = $nv_Request->get_string('cmable', 'get', '0');
$level = $nv_Request->get_string('level', 'get', '');
$cmcount = $nv_Request->get_int('cmcount', 'get', 0);
$action = $nv_Request->get_string('action', 'get', '');
$type = $nv_Request->get_string('type', 'get', '');
$is_theater = $nv_Request->get_int('is_theater', 'get', 0);
if ($cmable and $id > 0 and $checkss == md5($id . session_id() . $global_config['sitekey'])) {
    if ($action == "showform") {
        $contents = np_show_comment_form($type, $id, $level, $cmcount, $cmable, $is_theater);
    } else {
        $comment_array = np_comment($type, $id, $cmable, $page);
        $is_theater == 1 ? $comment_array['ver'] = 1 : ($comment_array['ver'] = 0);
        $contents = comment_theme($type, $id, array('cmable' => $cmable, 'voteable' => 0), $comment_array);
    }
}
include NV_ROOTDIR . "/includes/header.php";
echo $contents;
include NV_ROOTDIR . "/includes/footer.php";
コード例 #2
0
<?php

/**
 * @Project NUKEVIET 3.0
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2010 VINADES., JSC. All rights reserved
 * @Createdate 3-6-2010 0:14
 */
if (!defined('NV_IS_MOD_NEWS')) {
    die('Stop!!!');
}
if (!defined('NV_IS_AJAX')) {
    die('Wrong URL');
}
$contents = "";
$id = $nv_Request->get_int('id', 'get', 0);
$checkss = $nv_Request->get_string('checkss', 'get', '');
$page = $nv_Request->get_int('page', 'get', 0);
if ($module_config[$module_name]['activecomm'] and $id > 0 and $checkss == md5($id . session_id() . $global_config['sitekey'])) {
    $comment_array = nv_comment_module($id, $page);
    $contents = comment_theme($comment_array);
}
include NV_ROOTDIR . "/includes/header.php";
echo $contents;
include NV_ROOTDIR . "/includes/footer.php";
コード例 #3
0
     list($topic_title, $topic_alias) = $db->sql_fetchrow($db->sql_query("SELECT `title`,`alias` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_topics` WHERE `topicid` = '" . $news_contents['topicid'] . "'"));
     $topic = $db->sql_query("SELECT `id`, `listcatid`, `title`, `alias`,`publtime` FROM `" . NV_PREFIXLANG . "_" . $module_data . "_rows` WHERE `status`=1 AND `topicid` = '" . $news_contents['topicid'] . "' AND `id` != '{$id}' AND `publtime` < " . NV_CURRENTTIME . " AND (`exptime`=0 OR `exptime`>" . NV_CURRENTTIME . ") ORDER BY `id` DESC  LIMIT 0, " . $st_links . "");
     while ($row = $db->sql_fetchrow($topic)) {
         $catid_arr = explode(",", $row['listcatid']);
         $topiclink = "" . NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=topic/" . $topic_alias . "";
         $link = NV_BASE_SITEURL . "index.php?" . NV_LANG_VARIABLE . "=" . NV_LANG_DATA . "&amp;" . NV_NAME_VARIABLE . "=" . $module_name . "&amp;" . NV_OP_VARIABLE . "=" . $global_array_cat[$catid_arr[0]]['alias'] . "/" . $row['alias'] . "-" . $row['id'] . "";
         $topic_array[] = array("title" => $row['title'], "link" => $link, "time" => nv_date("d/m/Y", $row['publtime']), "topiclink" => $topiclink, "topictitle" => $topic_title);
     }
     $db->sql_freeresult($topic);
     unset($topic, $rows);
 }
 //Check: comment
 $commentenable = 0;
 if ($news_contents['allowed_comm'] and $module_config[$module_name]['activecomm']) {
     $comment_array = nv_comment_module($news_contents['id'], 0);
     $news_contents['comment'] = comment_theme($comment_array);
     if ($news_contents['allowed_comm'] == 1 or $news_contents['allowed_comm'] == 2 and defined('NV_IS_USER')) {
         $commentenable = 1;
     } elseif ($news_contents['allowed_comm'] == 2) {
         $commentenable = 2;
     }
 } else {
     $news_contents['comment'] = "";
 }
 if ($news_contents['allowed_rating']) {
     $time_set_rating = $nv_Request->get_int($module_name . '_' . $op . '_' . $news_contents['id'], 'cookie', 0);
     if ($time_set_rating > 0) {
         $news_contents['disablerating'] = 1;
     } else {
         $news_contents['disablerating'] = 0;
     }
コード例 #4
0
ファイル: photo.php プロジェクト: hoangvtien/nphoto
        $allowed = false;
        if ($func_who_view == 0) {
            $allowed = true;
        }
        if ($func_who_view == 1 and defined('NV_IS_USER')) {
            $allowed = true;
        } elseif ($func_who_view == 2 and defined('NV_IS_MODADMIN')) {
            $allowed = true;
        } elseif ($func_who_view == 3 and defined('NV_IS_USER') and nv_is_in_groups($user_info['in_groups'], $global_array_cat[$catid]['groups_view'])) {
            $allowed = true;
        }
        if ($allowed) {
            $feature = array('cmable' => $photo_data['allowed_comm'], 'voteable' => $photo_data['allowed_rating']);
            $comment_array = np_comment('photos', $pid, $photo_data['allowed_comm'], 0);
            $comment_array['ver'] = $ver;
            $photo_data['comments'] = comment_theme('photos', $pid, $feature, $comment_array);
            $photo_data['scwidth'] = $scwidth;
            $photo_data['scheight'] = $scheight;
            $photo_data['fitwidth'] = $fitwidth;
            $photo_data['fitheight'] = $fitheight;
            $contents = np_view_photo($photo_data, $ver);
        } else {
            $msg = no_permission($func_who_view);
            $contents = np_theme_message($msg);
        }
    }
}
include NV_ROOTDIR . "/includes/header.php";
if ($ver == 0) {
    echo nv_site_theme($contents);
} else {
コード例 #5
0
ファイル: album.php プロジェクト: hoangvtien/nphoto
    }
    if ($func_who_view == 1 and defined('NV_IS_USER')) {
        $allowed = true;
    } elseif ($func_who_view == 2 and defined('NV_IS_MODADMIN')) {
        $allowed = true;
    } elseif ($func_who_view == 3 and defined('NV_IS_USER') and nv_is_in_groups($user_info['in_groups'], $allalbs[$albid]['groups_view'])) {
        $allowed = true;
    }
    if ($allowed) {
        $per_page = $setting['view_album_numphotos'];
        $sql = "SELECT SQL_CALC_FOUND_ROWS * FROM `" . NV_PREFIXLANG . "_" . $module_data . "_photos` " . $where . " LIMIT " . $limit;
        $query = $db->sql_query($sql);
        while ($photo = $db->sql_fetch_assoc($query)) {
            $list_photo[] = $photo;
        }
        $result_all = $db->sql_query("SELECT FOUND_ROWS()");
        list($all_page) = $db->sql_fetchrow($result_all);
        $generate_page = nv_alias_page($page_title, $base_url, $all_page, $per_page, $page);
        // Get comment
        $feature = array('cmable' => $allalbs[$albid]['allowed_comm'], 'voteable' => $allalbs[$albid]['allowed_rating']);
        $comment_array = np_comment('album', $albid, $allalbs[$albid]['allowed_comm'], 0);
        $alb_comments = comment_theme('album', $albid, $feature, $comment_array);
        $contents = np_list_photo($list_photo, $generate_page, $alb_comments, $allalbs[$albid]);
    } else {
        $msg = no_permission($func_who_view);
        $contents = np_theme_message($msg);
    }
}
include NV_ROOTDIR . "/includes/header.php";
echo nv_site_theme($contents);
include NV_ROOTDIR . "/includes/footer.php";