Example #1
0
      	<div class="tab-wrapper">
	      	<div id="menuwrapper">
	      	<?php 
if (!class_exists('User')) {
    include 'includes/classes/class.user.php';
    $user = new User();
} else {
    $user = new User();
}
?>
	      		<ul>
	        		<li><a href="index.php">World Music Listing</a></li>
	        		<li><a href="#">Bio</a></li>
	        		<li><a href="directory_page.php">Directory</a></li>
	        		<?php 
if ($user->isLoggedIn() && !$user->isPayment()) {
    ?>
	        		<li><a href="pay.php">Purchase</a></li>
	        		<?php 
}
?>
	        		<li><a href="contact.php">Contact</a></li>
				</ul>
	      	</div>
	      	<div style="border:0px solid red; margin:5px 0;">
  				<div>
  					<p>Rating (<?php 
echo $data['total'];
?>
)</p>
  					<span id="star"></span>
 * Developed by Jay Gaha
 * http://jaygaha.com.np
 */
$id = isset($_GET['id']) ? (int) $_GET['id'] : null;
if ($id < 0) {
    // === 0 || === null
    header('HTTP/1.1 404 Not Found');
    exit('404, page not found');
}
include '../includes/inc-public.php';
include "../includes/classes/class.music_dir.php";
include '../includes/classes/class.user.php';
$directory = new Music_Directory();
$user = new User();
$data['user'] = $user;
if (!$user->isPayment()) {
    header('Location: pay.php');
}
$data['cat_row'] = $directory->get_row($id);
if ($id == 0) {
    $data['cat_row'] = array();
    $data['cat_row']['mp_type'] = 'category';
    $data['cat_row']['mp_name'] = 'World Music Listing';
}
if (!$data['cat_row'] || $data['cat_row']['mp_type'] != 'category') {
    header('HTTP/1.1 404 Not Found');
    exit('404, Invalid ID');
}
$data['page_title'] = 'World Music Listing: ' . ucwords($data['cat_row']['mp_name']);
$data['musicListing'] = $directory->getMusicDirectoryListing();
$cat = strtolower($data['cat_row']['mp_name']) == 'music' ? 'genre' : 'field';
<?php

/**
 * Developed by Jay Gaha
 * http://jaygaha.com.np
 */
$id = isset($_GET['id']) ? (int) $_GET['id'] : null;
include 'includes/inc-public.php';
include "includes/classes/class.music_dir.php";
include 'includes/classes/class.user.php';
$directory = new Music_Directory();
$user = new User();
$data['payment'] = $user->isPayment();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    $arrData = array();
    $arrData['rate'] = $_POST['rate'];
    $arrData['parent_id'] = $_POST['pid'];
    $arrData['type'] = $_POST['rate_type'];
    $insert = false;
    if (!check_cookie($arrData['parent_id']) && $arrData['rate']) {
        $insert = $directory->add_rating($arrData);
    }
    if ($insert) {
        $one_day = 86400 + time();
        setcookie('star_' . $arrData['parent_id'], true, $one_day);
        //set cookie for one day
    }
    return false;
}
if (!$id) {
    // === 0 || === null
Example #4
0
<?php

/**
 * Developed by Jay Gaha
 * http://jaygaha.com.np
 */
include 'includes/inc-public.php';
include "includes/classes/class.music_dir.php";
include 'includes/classes/class.user.php';
$directory = new Music_Directory();
$user = new User();
if (!$user->isPayment()) {
    header('Location: pay.php');
}
$data['payment'] = $user->isPayment();
$data['page_title'] = 'World Music Listing: Profile';
$data['musicListing'] = $directory->getMusicDirectoryListing();
$data['artistListing'] = $directory->getArtistProfileListing();
$data['categoryListing'] = $directory->getCategoryDirectoryListing();
$data['special_head'] = true;
// echo "<pre>"; print_r($data);exit;
layout('profile', $data);