| Server IP : 208.122.213.31 / Your IP : 216.73.216.45 Web Server : Apache System : Linux msd6191.mjhst.com 4.18.0-553.137.1.el8_10.x86_64 #1 SMP Wed Jun 24 11:40:24 UTC 2026 x86_64 User : WHMCS_MIA_382 ( 1001) PHP Version : 7.4.33 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/httpd/html/sportyone.com/public_html/code/ |
Upload File : |
<?php
$page_title .= ' - Studio';
$section_title = ' Visit ';
$letter_search = '';
$join = "";
if(!empty($_SESSION['f_niche'])) {
$join = "join niche2asset as n2a on n2a.asset_id = a.asset_id and n2a.niche_id = '{$_SESSION['f_niche']}'";
}
$site_des = "";
if(!empty($_SESSION['site_desig'])) {
$site_des = " and site_desig = '{$_SESSION['site_desig']}' ";
}
$query = " select SQL_CALC_FOUND_ROWS s.site_id, s.affil_id, s.site_name, s.site_link, a.media , a.asset_id, a.hosted_url, a.site_desig, a.asset_title , a.asset_text, DATE_FORMAT(a.p_date, '%m/%d/%Y') as pretty_date
from sites as s
join asset as a on a.site_id = s.site_id
$join
where a.live='y' and a.media <> 'B' and a.p_date <= '".date('Y-m-d')."' $cond $site_des
and s.site_id= '".$_GET['site_id']."' ";
$query .= "
order by a.p_date desc limit $pg, " . ITEMS_PER_PAGE;
$site_r = $connection->query($query);
$count = $connection->query("SELECT FOUND_ROWS() AS `count`");
$section_title .= "<a href = ".$site_r['0']['site_link']." target=_blank>".$site_r['0']['site_name']."</a>";
$page_title .= $site_name = $site_r['0']['site_name'];
$new_result = array();
foreach($site_r as $key => $element) {
$tags_sql = "
SELECT niche.niche_id, niche.niche_name
from niche, niche2site
where niche2site.niche_id = niche.niche_id
and niche2site.site_id = '{$element['site_id']}'
";
$tags = $connection->query($tags_sql);
$new_result[$key] = $element;
$new_result[$key]['tags'] = $tags;
}
foreach($site_r as $key => $element) {
$rand_image_sql = "
SELECT a.asset_id, a.media
from asset a
where site_id = '{$element['site_id']}'
order by rand() limit 1
";
$rand_image = $connection->query($rand_image_sql);
//$new_result[$key] = $element;
$new_result[$key]['rand_image'] = $rand_image[0]['asset_id'];
$new_result[$key]['rand_image_m'] = $rand_image[0]['media'];
}
$site_r = $new_result;
if($count[0]['count'] > ITEMS_PER_PAGE) {
$pagination['pages'] = ceil($count[0]['count'] / ITEMS_PER_PAGE);
$pagination['page'] = $page;
$pagination['links'] = 4;
$pagination['link'] = "?content=site$niche_pagi&site_id=".$_GET['site_id']."&page=";
}
$sql_niches = "select niche.niche_name, niche.niche_id from niche, niche2asset
where niche2asset.niche_id = niche.niche_id group by niche.niche_id order by niche.niche_name ASC";
$niches = $connection->query($sql_niches);
?>