$image_file = ''; if (!isset($args['-ro']) && ($image = search_img($flac_file))) { $image_file = dirname(reset($split_tracks)) . '/cover.jpg'; file_put_contents($image_file, file_get_contents($image)); } if (!$album['title'] && !isset($args['-nl'])) { printv('Альбом "' . $cue_info['album'] . '" исполнителя "' . $cue_info['artist'] . '" не найден на last.fm' . N); if (isset($args['-ro'])) { printv('Заканчиваем выполнение задач по дайнному файлу (режим ro)' . N); continue; } } else { printv('Кандидат в альбомы "' . $album['title'] . '" (найден на last.fm)' . N); if ($album['mbid']) { printvv('Альбом имеет метку MusicBrainz: ' . $album['mbid'] . N); $album_tracks = get_album($album['mbid']); var_dump_vv($album_tracks); if ($album_tracks['total'] != $cue_info['total']) { printv('Ошибка! Длительность треков полученных с last.fm: ' . $album['url'] . ' или их колличество не соответствует данным в cue (' . $cue_info['total'] . ' != ' . $album_tracks['total'] . ')' . N); $album = array('title' => '', 'url' => '', 'mbid' => '', 'image' => ''); } } if ($album['title'] && $album['title'] != $cue_info['album']) { printv('Название альбома "' . $album['title'] . '" будет использовано вместо "' . $cue_info['album'] . '" (найден на last.fm)' . N); } if (isset($args['-ro'])) { printv('Заканчиваем выполнение задач по дайнному файлу (режим ro)' . N); continue; } if (!$image_file && ($image = $album['image'])) { $image_file = dirname(reset($split_tracks)) . '/cover.jpg';
$selectSQL = "SELECT SQL_CALC_FOUND_ROWS DISTINCT listings.sysid, listings.album_id, listings.date_updated_local, address, postal_code, street_name, street_type, unit_number, area, sub_area, sub_area_desc, city, built_year, house_number, list_price, gross_taxes, for_tax_year, strata_maint_fee, DATE(list_date)AS list_date, mls_number, bedrooms, bathrooms, public_remarks, public_remarks_2, lot_size_sqt, lot_size_sqm, floor_area_total, title_to_land, site_influences, type_of_dwelling, listings.open_house, listing_geoaddress.lat, listing_geoaddress.lng, list_realtor_1_id, list_realtor_2_id, list_realtor_3_id FROM listings" . " LEFT JOIN city_profile ON listings.city=city_profile.en" . " LEFT JOIN listing_geoaddress ON listings.sysid=listing_geoaddress.sysid" . " LEFT JOIN listing_realtors ON listings.sysid=listing_realtors.sysid" . " LEFT JOIN listing_ranking ON listings.sysid=listing_ranking.sysid" . " WHERE status='A' AND !ISNULL(listings.album_id) AND listings.property_type!='Land Only' AND area_desc!='VOT' AND area_desc!='FOT'" . $filter . " AND !ISNULL(lat) ORDER BY" . $order . " listing_ranking.ranking DESC, city_profile.ranking DESC, date_updated_local DESC" . $limit; $get_properties = mysql_query_or_die($selectSQL, $useradmin); $row = mysql_fetch_row(mysql_query("SELECT FOUND_ROWS()", $useradmin)); if ($size == 'all' && $row[0] > 300) { $return_array = array("return_code" => 0, "error" => "More than 500 results"); echo json_encode($return_array); exit; } $properties_array = array(); while ($row_get_properties = mysql_fetch_assoc($get_properties)) { foreach ($row_get_properties as $key => $value) { if ($value == null) { $row_get_properties[$key] = 'N/A'; } } $album = get_album($row_get_properties['sysid']); if (is_array($album)) { $row_get_properties['photo_path'] = $album[0]; $row_get_properties['album_array'] = $album; } if ($row_get_properties['photo_path'] == null) { $row_get_properties['photo_path'] = 'N/A'; } if (count($row_get_properties['album_array']) < 1) { $row_get_properties['album_array'] = 'N/A'; } //$row_get_properties['title_to_land']=translate_title_to_land($row_get_properties['title_to_land']); if ($realtor_1 = get_realtor_profile($row_get_properties['list_realtor_1_id'])) { $row_get_properties['realtor_1_profile'] = $realtor_1; } if ($realtor_2 = get_realtor_profile($row_get_properties['list_realtor_2_id'])) {
$logo_height = (int) CHV\getSetting('theme_logo_height'); echo '<style type="text/css">.top-bar-logo, .top-bar-logo img { height: ' . $logo_height . 'px; } .top-bar-logo { margin-top: -' . (int) ($logo_height / 2) . 'px; } </style>'; } ?> <?php $open_graph = ['type' => 'website', 'url' => G\get_current_url(), 'title' => CHV\getSetting('website_doctitle', true), 'site_name' => CHV\getSetting('website_name', true), 'description' => CHV\getSetting('website_description', true)]; switch (true) { case function_exists('get_image') and G\is_route("image"): $open_graph_extend = ['title' => get_pre_doctitle(), 'description' => get_image()['description'], 'image' => get_image()['display_url'], 'image:width' => get_image()['width'], 'image:height' => get_image()['height']]; break; case function_exists('get_user') and G\is_route("user"): $open_graph_extend = ['type' => 'profile', 'title' => get_user()['name'], 'description' => sprintf(is_user_images() ? _s("%s's Images") : _s("%s's Albums"), get_user()["name_short"]), 'image' => get_user()['avatar']['url']]; break; case function_exists('get_album') and G\is_route("album"): $open_graph_extend = ['title' => get_album()['name'], 'description' => get_album()['description']]; break; } if ($open_graph_extend) { $open_graph = array_merge($open_graph, $open_graph_extend); } foreach ($open_graph as $k => $v) { if (!$v) { continue; } echo '<meta property="og:' . $k . '" content="' . $v . '">' . "\n"; } ?> <?php if (function_exists('get_image') && G\is_route("image")) {
$limit = "12"; $photo_list = get_album_photos($_GET['id'], $limit); $tpl = "photos_album_view_tpl.php"; } // Просмотр фотографии if ($_GET['action'] == 'view' && empty($error)) { $view_photo = get_photo($_GET['id']); $tpl = "photos_view_tpl.php"; } // добавление или изменение фотографии if (($_GET['action'] == 'add' || $_GET['action'] == 'edit') && empty($error)) { if ($_GET['action'] == 'edit' && isset($_GET['id']) && empty($error)) { $photo_list = get_photo($_GET['id']); } $album_list = get_albums(); $tpl = "photos_add_tpl.php"; } // выводим список альбомов if ($_GET['action'] == 'album_list') { $albums_list = get_albums(); $root_album = get_album_photos('0'); $tpl = "photos_album_list_tpl.php"; } // добавление или изменение альбома if ($_GET['action'] == 'album_edit' && isset($_GET['id']) || $_GET['action'] == 'album_add' && empty($error)) { if ($_GET['action'] == 'album_edit') { $album_edit = get_album($_GET['id']); } $tpl = "photos_album_add_tpl.php"; } include "photos_main_tpl.php";
print "</td></tr>\n"; } } print "</table>\n"; print "</div>\n"; if (isset($level0) && $level2 == "" && $level1 == "" || $level2 != "") { # artist / level 2 specified? print "<div class='searchresults border-left'>\n"; print "<table borders=\"0\">\n"; print "<th class='brslist_level2'>Albums</th>"; $albumlist = json_decode(get_albums()); if ($albumlist) { foreach ($albumlist as $album) { if (isset($level2)) { if (preg_match("/^" . stripslashes($level2) . "/i", $album->artist)) { $json = json_decode(get_album($album->cddbid)); print "<tr><td class='brslist_level1'>\n"; write_albumlink("browse.php?level0=al-ar&level1={$level1}&level2=" . urlencode(stripslashes($level2)) . "&sourceid=", $album->cddbid, html_entity_decode($album->title, ENT_COMPAT, "UTF-8"), $sourceid); print "</td></tr>\n"; } } } } print "</table>\n"; print "</div>\n"; } if (isset($sourceid)) { # cddbid / level 3 specified? print "<div class='searchresults border-left'>\n"; $tracklist = json_decode(get_album_tracks($sourceid)); write_tracklist($tracklist);
if (in_array($path_params[2], $rowtitles)) { render_result(get_album($path_params[1], $path_params[2]), "albums", $type); /* render explicit info of album given by cddbid */ } elseif ($path_params[2] == "tracks") { render_result(get_track(null, null, $path_params[1]), "albums", $type); /* render tracklist from album given by cddbid */ } else { render_result(get_album($path_params[1]), "albums", $type); /* render all infos of album given by cddbid (if wrong info is ordered) */ } } else { render_result(get_album($path_params[1]), "albums", $type); /* render all infos of album given by cddbid */ } } } else { render_result(get_album(), "albums", $type); /* render list of all albums */ } } if ($_SERVER['REQUEST_METHOD'] == 'POST') { // POST Request $input = file_get_contents("php://input"); render_result(create_album_record($input), null, $type); /* create album entry */ } mysql_close($database); ?>
function sp_get_macros() { global $page, $mod_comments, $_CATEGORIES, $ver, $categories, $my_lang_profile, $ENGINE_URL, $SITE_URL; $tmpl_list = array(); // staff $tmpl_list['index']['site_name'] = SITE_NAME; $tmpl_list['index']['main'] = my_lang('main'); $tmpl_list['index']['url'] = SITE_URL; $tmpl_list['index']['crumbs'] = get_crumbs(); $tmpl_list['index']['header'] = get_head(); //Заголовки [модуль headers] $tmpl_list['index']['path'] = ENGINE_URL . '/themes/' . THEME; $tmpl_list['index']['site_description'] = SITE_DESC; //подзаголовок $tmpl_list['index']['Y'] = date("Y"); $tmpl_list['index']['te_version'] = $ver; $tmpl_list['index']['rss'] = SITE_RSS; $tmpl_list['index']['auth_menu'] = bc_auth_menu(); //<li> меню авторизации if (isset($_SESSION['name'])) { $tmpl_list['index']['user'] = $_SESSION['name']; /* $tmpl_list['index']['profile_link'] = <<<_MPF <a href="$SITE_URL/lib/window/profile.php" onclick="window.open(this.href, '', 'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no,width=500,left=150,height=500,top=10'); return false;">$my_lang_profile</a> _MPF; */ } //рубрики <li> foreach ($categories as $cat) { if ($cat['cat_count'] !== "0") { $tmpl_list['index']['cat_list'] .= ' <li><a href="' . get_link('category', $cat['category_id']) . '">' . $cat['name'] . ' <small>(' . $cat['cat_count'] . ')</small></a></li> '; } } //список страниц <li> $menu = get_static_list_rank(); foreach ($menu as $link) { $tmpl_list['index']['menu'] .= '<li><a href="' . SITE_URL . '/' . $link['sef'] . '">' . $link['title'] . '</a></li>'; } ## Cтраница if ($page == 'static' || isset($_REQUEST['s'])) { $tmpl_list['static']['title'] = print_static("title"); $tmpl_list['static']['static'] = print_static("content"); $f = TE_DIR . '/themes/' . THEME . '/static.html'; if (is_file($f)) { $tmpl_list['index']['content'] .= sp_get_skin($f, $tmpl_list['static']); } } elseif (($page == 'article' || $page == 'main') && !isset($_REQUEST['id'])) { //список записей $DB = get_article_list(); if (!empty($DB)) { if (isset($_REQUEST['category_id'])) { $tmpl_list['index']['title'] = $_CATEGORIES[$_REQUEST['category_id']]['name']; } foreach ($DB as $p) { if ($p['approve'] == 1) { //формируем ссылку if (!USE_SEF) { $link = SITE_URL . '/?id=' . $p['id']; } elseif (SEF_TYPE == 1) { $link = SITE_URL . '/article/' . $_CATEGORIES[$p['category_id']]['sef'] . '/' . $p['sef']; } elseif (SEF_TYPE == 2) { $link = SITE_URL . '/' . $_CATEGORIES[$p['category_id']]['sef'] . '/' . $p['sef']; } } if (@$_SESSION['status'] == 'admin') { $tmpl_list['post_list']['post_edit_link'] = <<<_le <a href="{$SITE_URL}/window/ca/?id={$p['id']}&action=edit" onclick="window.open(this.href, '', 'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no,width=850,left=150,height=640,top=10'); return false;">Редактор</a> _le; $tmpl_list['post_list']['post_edit_url'] = "{$SITE_URL}/window/ca/?id={$p['id']}&action=edit"; } $tmpl_list['post_list']['title'] = $p['title']; if ($p['description'] !== '') { $tmpl_list['post_list']['post'] = $p['description'] . ' <a href="' . $link . '">' . my_lang("article_more") . '</a>'; } else { $tmpl_list['post_list']['post'] = $p['content']; } $tmpl_list['post_list']['post_url'] = $link; $tmpl_list['post_list']['post_date'] = date(DATE_FORMAT, gm2local($p['stamp'], TZ)); $tmpl_list['post_list']['post_category_url'] = get_link('category', $p['category_id']); $tmpl_list['post_list']['post_category'] = $_CATEGORIES[$p['category_id']]['name']; $tmpl_list['post_list']['post_author'] = $p['author']; $f = TE_DIR . '/themes/' . THEME . '/post_list.html'; if (is_file($f)) { $tmpl_list['index']['content'] .= sp_get_skin($f, $tmpl_list['post_list']); } } $tmpl_list['index']['navi'] = get_navi(get_artcl_sum(), ARTCLS_PER_PAGE); } } elseif (isset($_REQUEST['id'])) { //$tmpl_post = array_merge($tmpl_list, $tmpl_post); $profile = get_profile(print_article('author_id')); ## тело записи $tmpl_list['post']['title'] = print_article("title"); $tmpl_list['post']['post'] = print_article("content"); $tmpl_list['post']['post_category_url'] = get_link('category'); $tmpl_list['post']['post_author'] = $profile['name']; $a_id = print_article("author_id"); $tmpl_list['post']['post_author_link'] = <<<_APF <a href="{$SITE_URL}/window/profile/?author_id={$a_id}" onclick="window.open(this.href, '', 'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no,width=500,left=150,height=250,top=10'); return false;">{$profile["name"]}</a> _APF; if (@$_SESSION['status'] == 'admin') { $tmpl_list['post']['post_edit_link'] = <<<_APE <a href="{$SITE_URL}/window/ca/?id={$_REQUEST['id']}&action=edit" onclick="window.open(this.href, '', 'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no,width=850,left=150,height=640,top=10'); return false;">Редактор</a> _APE; $tmpl_list['post']['post_edit_url'] = "{$SITE_URL}/window/ca/?id={$_REQUEST['id']}&action=edit"; } $tmpl_list['post']['post_date'] = date(DATE_FORMAT, gm2local(print_article('stamp'), TZ)); $tmpl_list['post']['post_category'] = $_CATEGORIES[$_REQUEST['category_id']]['name']; $f = TE_DIR . '/themes/' . THEME . '/post.html'; $tmpl_list['index']['content'] .= sp_get_skin($f, $tmpl_list['post']); ## комментарии if ($mod_comments) { //если модуль "вкл" function del_link($id) { if ($_SESSION['status'] == 'admin') { return ' <a href="' . SITE_URL . '/?id=' . $_REQUEST['id'] . '&cid=' . $id . '&com_act=del">X</a>'; } else { return ''; } } $comm_data = get_comments(); //получаем список комментов и начинаем обходить шаблон комментария if (isset($comm_data[0])) { foreach ($comm_data as $p) { $profile = get_profile($p['author_id']); //комментатор не зарег-н if (empty($p['author_id'])) { $tmpl_list['comment']['name'] = $p['author']; //if (!empty($p['email'])) { $gra = get_gravatar($p['email'], $size = 35); //} } else { $gra = get_gravatar($profile['email'], $size = 35); $tmpl_list['comment']['name'] = <<<_PF <a href="{$SITE_URL}/window/profile?author_id={$p["author_id"]}" onclick="window.open(this.href, '', 'resizable=yes,status=no,location=no,toolbar=no,menubar=no,fullscreen=no,scrollbars=no,dependent=no,width=500,left=150,height=250,top=10'); return false;">{$profile['name']}</a> _PF; } $tmpl_list['comment']['name'] .= del_link($p['id']); $tmpl_list['comment']['gravatar'] = $gra['img']; $tmpl_list['comment']['gravatar_url'] = $gra['url']; $tmpl_list['comment']['date'] = date(DATE_FORMAT, gm2local($p['date'], TZ)); //[lib.php, date = stamp] $tmpl_list['comment']['comment'] = $p['content']; $f = TE_DIR . '/themes/' . THEME . '/comment.html'; $tmpl_list['comment_list']['comments'] .= sp_get_skin($f, $tmpl_list['comment']); } } $tmpl_list['comment_list']['comments_form'] = print_comments_form(); //и вставляем полученный список комментариев в шаблон списка комментариев (вот неожиданность:) if (is_file(TE_DIR . '/themes/' . THEME . '/comment_list.html')) { $tmpl_list['index']['content'] .= sp_get_skin(TE_DIR . '/themes/' . THEME . '/comment_list.html', $tmpl_list['comment_list']); } } } elseif ($page == "album") { if (is_file(TE_DIR . '/themes/' . THEME . '/album.html')) { $album = get_album(); if (!empty($album)) { foreach ($album as $img) { $tmpl_list['album']['album'] .= '<a target="_blank" href="' . $img['url'] . '"> <img src="' . $img['url'] . '" HSPACE="0" VSPACE="0" border="0" title="Добавлена ' . date("d.m.Y H:i:s", $img['time']) . '" style="max-height: 70px;"> </a>'; } } else { $tmpl_list['album']['album'] .= my_lang('album_empty'); } $tmpl_list['index']['content'] .= sp_get_skin(TE_DIR . '/themes/' . THEME . '/album.html', $tmpl_list['album']); } else { $tmpl_list['index']['content'] .= 'Не обнаружено файла-шаблона для альбома('; } } elseif ($page == "feedback") { if (is_file(TE_DIR . '/themes/' . THEME . '/feedback.html')) { $tmpl_list['feedback']['sid'] = get_sid(); $reg = Registry::instance(); $tmpl_list['feedback']['feedback_msg'] = $reg->get('feedback_msg'); $tmpl_list['index']['content'] .= sp_get_skin(TE_DIR . '/themes/' . THEME . '/feedback.html', $tmpl_list['feedback']); } } //список последних записей <li><a>link</a></li> $tmpl_list['index']['post_list'] = bc_postlist(7); $tmpl_list['index']['theme_list'] = bc_theme_list(); $tmpl_list['index']['time'] = microtime(true) - ST; return $tmpl_list; }
$document_root = '/home/home365/public_html'; require_once $document_root . '/dbconnect/dbconnect.php'; require_once $document_root . '/utilities/utilities.php'; if (mysql_select_db("home365_ios", $useradmin)) { } else { echo "Error selecting database, exited."; exit; } $sysid = isset($_GET['sysid']) ? $_GET['sysid'] : $_POST['sysid']; if (!empty($sysid)) { $selectSQL = "SELECT * FROM listings" . " LEFT JOIN listing_realtors ON listings.sysid=listing_realtors.sysid" . " LEFT JOIN listing_firms ON listings.sysid=listing_firms.sysid" . " WHERE publish_on_internet='Y' AND status='A' AND listings.sysid=" . $sysid; $get_property = mysql_query_or_die($selectSQL, $useradmin); $propertyObject = array(); if ($propertyObject = mysql_fetch_assoc($get_property)) { $photo_array = get_album($sysid); $realtor_array = array($propertyObject['list_realtor_1_id'], $propertyObject['list_realtor_2_id'], $propertyObject['list_realtor_3_id']); $firm_array = array($propertyObject['list_firm_1_code'], $propertyObject['list_firm_2_code']); $realtor_profile_array = array(); $firm_profile_array = array(); foreach ($realtor_array as $realtor_id) { $realtor_profile = get_realtor_profile($realtor_id); array_push($realtor_profile_array, $realtor_profile); } foreach ($firm_array as $firm_code) { $firm_profile = get_firm_profile($firm_code); array_push($firm_profile_array, $firm_profile); } //var_dump($realtor_profile_array); //var_dump($firm_profile_array); } else {
// примитивная защита от инъекций $input[hash] = is_string($_GET[hash]) ? htmlentities($_GET[hash]) : strval(htmlentities($_GET[hash])); if ($input[gid] != "") { if (sha1($input[gid] . $solt) == $input[hash]) { //echo "Всё ок, имеем id нужной галереии, поэтому едем дальше и выводим нужную галерею!"; $GoBackButton = ' <a class="btn btn-primary" style="position: relative; margin-top: -43px; float: right;" href="[~' . $cid . '~]"> <i class="icon-chevron-left icon-white"></i> назад</a> '; // проверка на случай если имеется id с правильным хэшем для неправильной галереи (которая исключена или удалена) if (in_array($input[gid], $exclude_gid)) { echo "<div class=\"alert alert-error\">Увы, но данная галерея не найдена! Возможно она была удалена.</div>"; return false; } $current_album = get_album($username, $input[gid], $images_width); $modx->setPlaceholder('AlbumTitle', '<h2><small>«' . $current_album['title'] . '»</small></h2>'); $modx->setPlaceholder('GoBackBtn', $GoBackButton); $row_count = 0; foreach ($current_album[images] as $image) { $row_count++; if ($row_count == 1) { echo "\n<div class=\"row-fluid\">"; } echo ' <div class="span3"> <a class="thumbnail fancybox" rel="gallery" href="' . $image[url] . '"> <img class="img-rounded" src="' . $image[tn_url] . '" width="' . $image[tn_width] . '" height="' . $image[tn_height] . '"> </a> </div> ';