function cpanel() { global $logged; if (!$logged['username']) { die(no_permission()); } else { $Temp = new Template(); $Temp->dir = $logged['dskin']; $Temp->file = "cpanel_body.tpl"; $Temp->tp(); $Temp->tr(array('BODY' => CPanelPages($_GET['option']))); echo $Temp->html; } }
global $config; check_login (); // Get parameters $id_project = get_parameter ('id_project'); $id_task = get_parameter ('id_task', -1); $project_manager = get_db_value ('id_owner', 'tproject', 'id', $id_project); $operation = (string) get_parameter ('operation'); $title = get_parameter ("title", ""); $description = get_parameter ("description", ""); // ACL $task_permission = get_project_access ($config["id_user"], $id_project, $id_task, false, true); if (!$task_permission["manage"]) { audit_db($config["id_user"], $config["REMOTE_ADDR"], "ACL Violation", "Trying to access to task email report without permission"); no_permission(); } if ($operation == "generate_email") { $task_participants = get_db_all_rows_sql ("SELECT direccion, nombre_real FROM tusuario, trole_people_task WHERE tusuario.id_usuario = trole_people_task.id_user AND trole_people_task.id_task = $id_task"); $participants =""; foreach ($task_participants as $participant){ $participant["direccion"]; $text = ascii_output ($description); $subject = ascii_output ($title); integria_sendmail ($participant["direccion"], $subject, $text); } echo ui_print_success_message (__("Operation successfully completed"), '', true, 'h3', true); } // Get names
if (isset($site_mods['comment']) and isset($module_config[$module_name]['activecomm'])) { define('NV_COMM_ID', $id); //ID bài viết hoặc define('NV_COMM_AREA', $module_info['funcs'][$op]['func_id']); //để đáp ứng comment ở bất cứ đâu không cứ là bài viết //check allow comemnt $allowed = $module_config[$module_name]['allowed_comm']; //tuy vào module để lấy cấu hình. Nếu là module news thì có cấu hình theo bài viết if ($allowed == '-1') { $allowed = $news_contents['allowed_comm']; } define('NV_PER_PAGE_COMMENT', 5); //Số bản ghi hiển thị bình luận require_once NV_ROOTDIR . '/modules/comment/comment.php'; $area = defined('NV_COMM_AREA') ? NV_COMM_AREA : 0; $checkss = md5($module_name . '-' . $area . '-' . NV_COMM_ID . '-' . $allowed . '-' . NV_CACHE_PREFIX); $content_comment = nv_comment_module($module_name, $checkss, $area, NV_COMM_ID, $allowed, 1); } else { $content_comment = ''; } $contents = detail_theme($news_contents, $array_keyword, $related_new_array, $related_array, $topic_array, $content_comment); $id_profile_googleplus = $news_contents['gid']; $page_title = $news_contents['title']; $key_words = implode(', ', $key_words); $description = $news_contents['hometext']; } else { $contents = no_permission($global_array_cat[$catid]['groups_view']); } include NV_ROOTDIR . '/includes/header.php'; echo nv_site_theme($contents); include NV_ROOTDIR . '/includes/footer.php';
} 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 { echo $contents; } include NV_ROOTDIR . "/includes/footer.php";
$news_contents['link_family_tree'] = nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $global_array_fam[$news_contents['fid']]['alias'] . '/' . $news_contents['alias'] . '/' . $alias_family_tree . $global_config['rewrite_exturl'], true); $news_contents['link_main'] = nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $global_array_fam[$news_contents['fid']]['alias'] . '/' . $news_contents['alias'] . $global_config['rewrite_exturl'], true); $news_contents['ftitle'] = $global_array_fam[$fid]['title']; $array_mod_title[] = array('title' => $news_contents['title'], 'link' => $news_contents['link_main']); $body_contents = $db->query('SELECT bodyhtml as bodytext, rule, content, imgposition, copyright, allowed_send, allowed_print, allowed_save, gid FROM ' . NV_PREFIXLANG . '_' . $module_data . '_bodyhtml_' . ceil($news_contents['id'] / 2000) . ' where id=' . $news_contents['id'])->fetch(); $news_contents = array_merge($news_contents, $body_contents); unset($body_contents); if ($news_contents['id'] > 0 and $array_op[2] == "Manager") { $array_mod_title[] = array('title' => $lang_module['manager'], 'link' => $base_url_rewrite); $contents = manager_theme($news_contents, $list_users, $array_keyword, $content_comment); } elseif ($news_contents['id'] > 0 and $array_op[2] == $alias_family_tree and $count_op == 4 and $array_op[3] != '') { $link_alias_family_tree = nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $global_array_fam[$news_contents['fid']]['alias'] . '/' . $news_contents['alias'] . '/' . $alias_family_tree . $global_config['rewrite_exturl'], true); $array_mod_title[] = array('title' => $lang_module['family_tree'], 'link' => $link_alias_family_tree); $contents = nv_theme_genealogy_detail($news_contents, $info_users, $array_parentid, $OrgChart); } elseif ($news_contents['id'] > 0 and $array_op[2] == $alias_family_tree) { $array_mod_title[] = array('title' => $lang_module['family_tree'], 'link' => $base_url_rewrite); $contents = view_family($news_contents, $list_users, $array_keyword, $content_comment); } $id_profile_googleplus = $news_contents['gid']; $page_title = $news_contents['title']; $key_words = implode(', ', $key_words); $description = $news_contents['hometext']; } else { $contents = no_permission($global_array_fam[$fid]['groups_view']); } } else { $contents = no_permission($global_array_fam[$fid]['groups_view']); } include NV_ROOTDIR . '/includes/header.php'; echo nv_site_theme($contents); include NV_ROOTDIR . '/includes/footer.php';
$url_info = parse_url($client_info['selfurl']); $content_comment = nv_comment_module($module_name, $checkss, $area, NV_COMM_ID, $allowed, 1); } else { $content_comment = ''; } // truyen bien sang module block detail global $data_album; $data_album = $album; // truyen thong tin seo $page_title = !empty($album['meta_title']) ? $album['meta_title'] : $album['name']; $key_words = !empty($album['meta_keyword']) ? $album['meta_keyword'] : $album['name']; $description = !empty($album['meta_description']) ? $album['meta_description'] : strip_tags($album['description']); // Phan trang $generate_page = nv_alias_page($page_title, $base_url, $num_items, $per_page, $page); // goi ham xu ly giao dien if ($module_config[$module_name]['album_view'] == 'album_view_grid') { $contents = detail_album($album, $array_photo, $other_category_album, $content_comment, $generate_page); } else { $contents = detail_album($album, $array_photo, $other_category_album, $content_comment, ''); } } else { // khong co quyen xem album $contents = no_permission($lang_module['no_permission_album']); } if ($page > 1) { $page_title .= ' ' . NV_TITLEBAR_DEFIS . ' ' . $lang_global['page'] . ' ' . $page; $description .= ' ' . $page; } include NV_ROOTDIR . '/includes/header.php'; echo nv_site_theme($contents); include NV_ROOTDIR . '/includes/footer.php';
} $ratingdetail = array_map("intval", explode("|", $news_contents['ratingdetail'])); $ratingdetail[0] = isset($ratingdetail[0]) ? intval($ratingdetail[0]) : 0; $ratingdetail[1] = isset($ratingdetail[1]) ? intval($ratingdetail[1]) : 0; $news_contents['stringrating'] = sprintf($lang_module['stringrating'], $ratingdetail[0], $ratingdetail[1]); $ratingdetail[1] = $ratingdetail[1] > 0 ? $ratingdetail[1] : 1; $news_contents['numberrating'] = round($ratingdetail[0] / $ratingdetail[1]) - 1; $news_contents['langstar'] = array("note" => $lang_module['star_note'], "verypoor" => $lang_module['star_verypoor'], "poor" => $lang_module['star_poor'], "ok" => $lang_module['star_ok'], "good" => $lang_module['star_good}'], "verygood" => $lang_module['star_verygood']); } $page_title = $news_contents['title']; $key_words = $news_contents['keywords']; $description = $news_contents['hometext']; if (empty($news_contents['author'])) { $sql = $db->sql_query(" SELECT `username`, `full_name` FROM `" . NV_USERS_GLOBALTABLE . "` WHERE `userid` = '" . $news_contents['admin_id'] . "' LIMIT 0,1 "); $chk_u = $db->sql_numrows($sql); if ($chk_u) { list($row) = $db->sql_fetchrowset($sql); } $news_contents['author_name'] = empty($row['full_name']) ? $row['username'] : $row['full_name']; } else { $news_contents['author_name'] = $news_contents['author']; } $contents = detail_theme($news_contents, $related_new_array, $related_array, $topic_array, $commentenable); } else { $contents = no_permission($func_who_view); } include NV_ROOTDIR . "/includes/header.php"; $results = nv_site_theme($contents); // new dBug($results); echo $results; include NV_ROOTDIR . "/includes/footer.php";
} $photo->closeCursor(); // album cung chu de $sql = 'SELECT a.album_id, a.category_id, a.name, a.alias, a.capturelocal, a.description, a.num_photo, a.date_added, r.file, r.thumb FROM ' . TABLE_PHOTO_NAME . '_album a LEFT JOIN ' . TABLE_PHOTO_NAME . '_rows r ON ( a.album_id = r.album_id ) WHERE a.status= 1 AND a.category_id=' . $album['category_id'] . ' AND r.defaults = 1 AND a.album_id != ' . $album['album_id'] . ' ORDER BY a.date_added DESC LIMIT 0, 6'; $result = $db->query($sql); $other_category_album = array(); while ($item = $result->fetch()) { $item['link'] = $global_photo_cat[$album['category_id']]['link'] . '/' . $item['alias'] . '-' . $item['album_id'] . $global_config['rewrite_exturl']; $other_category_album[] = $item; } $result->closeCursor(); // truyen bien sang module block detail global $data_album; $data_album = $album; // goi ham xu ly giao dien $contents = detail_album($album, $array_photo, $other_category_album); // truyen thong tin seo $page_title = $album['meta_title']; $key_words = $album['meta_keyword']; $description = $album['meta_description']; } else { // khong co quyen xem album $contents = no_permission($global_photo_cat[$category_id]['groups_view']); } include NV_ROOTDIR . '/includes/header.php'; echo nv_site_theme($contents); include NV_ROOTDIR . '/includes/footer.php';
$next_photo['link'] = $global_photo_album[$next_photo['album_id']]['link'] . '/' . $next_photo['row_id'] . $global_config['rewrite_exturl']; } unset($sql, $list); //Previous Photo $sql = 'SELECT row_id, album_id, name, status, description FROM ' . NV_PREFIXLANG . '_' . $module_data . '_rows WHERE row_id < ' . $row['row_id'] . ' AND album_id=' . $row['album_id'] . ' ORDER BY row_id DESC LIMIT 1'; $list = nv_db_cache($sql, 'row_id', $module_name); foreach ($list as $previous_photo) { $previous_photo['link'] = $global_photo_album[$previous_photo['album_id']]['link'] . '/' . $previous_photo['row_id'] . $global_config['rewrite_exturl']; } unset($sql, $list); // rewrite link $base_url_rewrite = nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=' . $global_photo_cat[$category_id]['alias'] . '/' . $global_photo_album[$row['album_id']]['alias'] . '-' . $row['album_id'] . '/' . $row['row_id'] . $global_config['rewrite_exturl'], true); if ($_SERVER['REQUEST_URI'] != $base_url_rewrite) { Header('Location: ' . $base_url_rewrite); die; } // truyen bien ra module block global $data_detail; $data_detail = $row; // truyen thong tin seo $page_title = !empty($row['name']) ? $row['name'] : $global_photo_album[$row['album_id']]['name']; $key_words = !empty($global_photo_album[$row['album_id']]['meta_keyword']) ? $global_photo_album[$row['album_id']]['meta_keyword'] : $global_photo_album[$row['album_id']]['name']; $description = !empty($row['description']) ? $row['description'] : strip_tags($global_photo_album[$row['album_id']]['description']); // goi ham xu ly giao dien $contents = detail($row, $next_photo, $previous_photo); } else { $contents = no_permission($lang_module['no_permission_detailed']); } include NV_ROOTDIR . '/includes/header.php'; echo nv_site_theme($contents); include NV_ROOTDIR . '/includes/footer.php';