Beispiel #1
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if ($verify['username']) {
            header("Location: " . $CONF['url'] . "/index.php?a=stream");
        }
    }
    // Start displaying the popular tracks
    $result = $db->query("SELECT `views`.`track`,`tracks`.`title`,`tracks`.`art`, COUNT(`track`) as `count` FROM `views`,`tracks` WHERE `views`.`track` = `tracks`.`id` AND DATE_SUB(CURDATE(),INTERVAL 1 DAY) <= date(`views`.`time`) AND `art` != 'default.png' GROUP BY `track` ORDER BY `count` DESC LIMIT 10");
    while ($row = $result->fetch_assoc()) {
        $users[] = $row;
    }
    $TMPL['rows'] = welcomeTracks($users, $CONF['url']);
    $TMPL['url'] = $CONF['url'];
    if ($settings['paypalapp']) {
        $skin = new skin('welcome/gopro');
        $go_pro = '';
        $go_pro = $skin->make();
    }
    $TMPL['go_pro'] = $go_pro;
    $TMPL['title'] = $LNG['welcome'] . ' - ' . $settings['title'];
    $TMPL['meta_description'] = $settings['title'] . ' ' . $LNG['welcome_about'];
    $TMPL['ad'] = $settings['ad1'];
    $skin = new skin('welcome/content');
    return $skin->make();
}
Beispiel #2
0
function menu($user)
{
    global $TMPL, $LNG, $CONF, $db, $settings;
    if ($user !== false) {
        $skin = new skin('shared/menu');
        $menu = '';
        $TMPL_old = $TMPL;
        $TMPL = array();
        $TMPL['realname'] = realName($user['username'], $user['first_name'], $user['last_name']);
        $TMPL['avatar'] = $user['image'];
        $TMPL['username'] = $user['username'];
        $TMPL['url'] = $CONF['url'];
        $TMPL['theme_url'] = $CONF['theme_url'];
        $TMPL['intervaln'] = $settings['intervaln'];
        /* 
        // Array Map
        // array => { url, name, dynamic load, class type}
        */
        $links = array(array('profile&u=' . $user['username'], realName($user['username'], $user['first_name'], $user['last_name']), 1, 0), array('upload', $LNG['upload'], 1, 1), proStatus($db, $settings, $user['idu']) ? array('pro', $LNG['go_pro'], 1, 0) : '', array('stream', $LNG['stream'], 1, 2), array('explore', $LNG['explore'], 1, 2), array('stats', $LNG['statistics'], 1, 0), array('settings', $LNG['user_ttl_sidebar'], 1, 0), array('stream&logout=1', $LNG['admin_menu_logout'], 0, 0));
        foreach ($links as $element => $value) {
            if ($value) {
                $TMPL['links'] .= $divider . '<a href="' . $CONF['url'] . '/index.php?a=' . $value[0] . '" ' . ($value[2] ? ' rel="loadpage"' : '') . '><div class="menu-dd-row' . ($value[3] == 1 ? ' menu-dd-extra' : '') . ($value[3] == 2 ? ' menu-dd-mobile' : '') . '">' . $value[1] . '</div></a>';
                $divider = '<div class="menu-divider ' . ($value[3] == 2 ? ' menu-dd-mobile' : '') . '"></div>';
            }
        }
        $menu = $skin->make();
        $TMPL = $TMPL_old;
        unset($TMPL_old);
        return $menu;
    } else {
        // Else show the LogIn Register button
        return '<a onclick="connect_modal()" class="menu-btn" title="' . $LNG['connect'] . '">' . $LNG['connect'] . '</a>';
    }
}
Beispiel #3
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $settings;
    $title = array('privacy' => $LNG['privacy_policy'], 'tos' => $LNG['terms_of_use'], 'about' => $LNG['about'], 'disclaimer' => $LNG['disclaimer'], 'contact' => $LNG['contact'], 'api' => $LNG['api_documentation']);
    $skin = new skin('page/sidebar');
    $sidebar = '';
    foreach ($title as $url => $header) {
        if ($_GET['b'] == $url) {
            $TMPL['links'] .= '<div class="sidebar-link"><strong><a href="' . $CONF['url'] . '/index.php?a=page&b=' . $url . '" rel="loadpage">' . $header . '</a></strong></div>';
        } else {
            $TMPL['links'] .= '<div class="sidebar-link"><a href="' . $CONF['url'] . '/index.php?a=page&b=' . $url . '" rel="loadpage">' . $header . '</a></div>';
        }
    }
    $sidebar = $skin->make();
    if (!empty($_GET['b']) && isset($title[$_GET['b']])) {
        $b = $_GET['b'];
        $TMPL['sidebar'] = $sidebar;
        $TMPL['url'] = $CONF['url'];
        $TMPL['title'] = "{$title[$b]} - " . $settings['title'];
        $TMPL['header'] = $title[$b];
        $skin = new skin("page/{$b}");
        return $skin->make();
    } else {
        header("Location: " . $CONF['url']);
    }
}
Beispiel #4
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $settings;
    $title = array('disclaimer' => $LNG['disclaimer'], 'developers' => $LNG['developers']);
    $skin = new skin('page/sidebar');
    $sidebar = '';
    foreach ($title as $url => $header) {
        if ($_GET['b'] == $url) {
            $TMPL['links'] .= '<div class="sidebar-link"><strong><a href="' . $CONF['url'] . '/index.php?a=page&b=' . $url . '">' . $header . '</a></strong></div>';
        } else {
            $TMPL['links'] .= '<div class="sidebar-link"><a href="' . $CONF['url'] . '/index.php?a=page&b=' . $url . '">' . $header . '</a>';
        }
    }
    $TMPL['links'] .= '<a href="' . $CONF['url'] . '/index.php?a=contactus">Contact Us</a></div>';
    $sidebar = $skin->make();
    if (!empty($_GET['b']) && isset($title[$_GET['b']])) {
        $b = $_GET['b'];
        $TMPL['sidebar'] = $sidebar;
        $TMPL['url'] = $CONF['url'];
        $TMPL['title'] = "{$title[$b]} - " . $settings['title'];
        $TMPL['header'] = '<strong>' . $title[$b] . '</strong>';
        $skin = new skin("page/{$b}");
        return $skin->make();
    } else {
        header("Location: " . $CONF['url']);
    }
}
Beispiel #5
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    $feed = new feed();
    $feed->db = $db;
    $feed->url = $CONF['url'];
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if ($verify['username']) {
            $feed->user = $verify;
            $feed->username = $verify['username'];
            $feed->id = $verify['idu'];
        }
    }
    $feed->per_page = $settings['qperpage'];
    $feed->categories = $feed->getCategories();
    $feed->time = $settings['time'];
    $feed->l_per_post = $settings['lperpost'];
    $TMPL_old = $TMPL;
    $TMPL = array();
    $skin = new skin('shared/rows');
    $rows = '';
    // If the $_GET keyword is empty [user]
    if ($_GET['q'] == '') {
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    if ($_GET['filter'] == 'tracks') {
        list($tracks, $error) = $feed->searchTracks(0, $_GET['q']);
        $TMPL['messages'] = $tracks;
    } elseif ($_GET['filter'] == 'playlists') {
        $playlist = $feed->getPlaylists(0, 2, $_GET['q']);
        $error = $feed->showError('no_results', 1);
        $TMPL['messages'] = empty($playlist) ? $error[0] : $playlist;
    } else {
        $TMPL['messages'] = $feed->getSearch(0, $settings['qperpage'], $_GET['q'], $_GET['filter']);
    }
    $rows = $skin->make();
    $skin = new skin('search/sidebar');
    $sidebar = '';
    $TMPL['trending'] = $feed->sidebarTrending($_GET['tag'], 10);
    $TMPL['filters'] = $feed->sidebarFilters($_GET['filter'], $_GET['q']);
    $TMPL['ad'] = generateAd($settings['ad6']);
    $sidebar = $skin->make();
    $TMPL = $TMPL_old;
    unset($TMPL_old);
    $TMPL['top'] = $top;
    $TMPL['rows'] = $rows;
    $TMPL['sidebar'] = $sidebar;
    if (isset($_GET['logout']) == 1) {
        $loggedIn->logOut();
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['search'] . ' - ' . htmlspecialchars($_GET['q']) . ' - ' . $settings['title'];
    $TMPL['header'] = pageHeader($LNG['search'] . ' - ' . $_GET['q']);
    $skin = new skin('shared/content');
    return $skin->make();
}
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if (empty($verify['username'])) {
            // If fake cookies are set, or they are set wrong, delete everything and redirect to home-page
            $loggedIn->logOut();
            header("Location: " . $CONF['url'] . "/index.php?a=welcome");
        } else {
            if (isset($_POST['contact'])) {
                // Verification usage
                $con = new contact();
                $con->db = $db;
                $con->url = $CONF['url'];
                $con->phone = $_POST['phone'];
                $con->email = $_POST['email'];
                $con->address = $_POST['address'];
                $con->city = $_POST['city'];
                $con->state = $_POST['state'];
                $con->country = $_POST['country'];
                $TMPL['contactMsg'] = $con->process();
                if ($TMPL['contactMsg'] == 1) {
                    header("Location: " . $CONF['url'] . "/index.php?a=contact");
                }
            }
            if (isset($_SESSION['username'])) {
                if (filter_var($_SESSION['username'], FILTER_VALIDATE_EMAIL)) {
                    $result = $db->query("SELECT * FROM `users` WHERE `email` = '" . $_SESSION['username'] . "' AND `password` = '" . $_SESSION['password'] . "'");
                } else {
                    $result = $db->query("SELECT * FROM `users` WHERE `username` = '" . $_SESSION['username'] . "' AND `password` = '" . $_SESSION['password'] . "'");
                }
            } elseif (isset($_COOKIE['username'])) {
                if (filter_var($_COOKIE['username'], FILTER_VALIDATE_EMAIL)) {
                    $result = $db->query("SELECT * FROM `users` WHERE `email` = '" . $_COOKIE['username'] . "' AND `password` = '" . $_COOKIE['password'] . "'");
                } else {
                    $result = $db->query("SELECT * FROM `users` WHERE `username` = '" . $_COOKIE['username'] . "' AND `password` = '" . $_COOKIE['password'] . "'");
                }
            }
            while ($row = $result->fetch_assoc()) {
                $status = $row['status'];
            }
            if ($status == 1) {
                header("Location: " . $CONF['url'] . "/index.php?a=employee");
            } elseif ($status == 2) {
                header("Location: " . $CONF['url'] . "/index.php?a=feed");
            }
        }
    } else {
        // If the session or cookies are not set, redirect to home-page
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['Contact'] . ' - ' . $settings['title'];
    $TMPL['ad'] = $settings['ad1'];
    $skin = new skin('register/contact');
    return $skin->make();
}
 function email()
 {
     global $CONF, $DB, $FORM, $LNG, $TMPL;
     $username = $DB->escape($FORM['u']);
     list($email) = $DB->fetch("SELECT email FROM {$CONF['sql_prefix']}_sites WHERE username = '******'", __FILE__, __LINE__);
     if ($email) {
         require_once "{$CONF['path']}/sources/misc/session.php";
         $session = new session();
         $TMPL['sid'] = $session->create('lost_pw', $username, 0);
         $lost_pw_email = new skin('lost_pw_email');
         $lost_pw_email->send_email($email);
         $TMPL['content'] = $this->do_skin('lost_pw_finish');
     } else {
         $this->error($LNG['g_invalid_u']);
     }
 }
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $settings;
    $dir = new alumnidir();
    $dir->db = $db;
    $dir->url = $CONF['url'];
    $dir->per_page = $settings['uperpage'];
    if (isset($_POST['search'])) {
        // Verification usage
        $dir->name = $_POST['name'];
        $dir->course = $_POST['course'];
        $dir->branch = $_POST['branch'];
        $dir->tyear = $_POST['tyear'];
        //$dir->dob = $settings['captcha'];
        $searchdata = "";
        if (!empty($_POST['name'])) {
            $searchdata .= "concat_ws(' ', `first_name`, `last_name`) LIKE '%{$dir->name}%' AND ";
        }
        if (!empty($_POST['course'])) {
            $searchdata .= "`course`='{$dir->course}' AND ";
        }
        if (!empty($_POST['branch'])) {
            $searchdata .= "`branch`='{$dir->branch}' AND ";
        }
        if (!empty($_POST['tyear'])) {
            $searchdata .= "`join` LIKE '_____%{$dir->tyear}%' AND ";
        }
        if ($searchdata != "") {
            $searchdata = " WHERE " . substr($searchdata, 0, -5) . " LIMIT 0 , 10";
        } else {
            $searchdata = $searchdata . " LIMIT 0 , 10";
        }
        $dir->searchdata = $searchdata;
        $TMPL['users'] = $dir->dirgetSearch();
    } else {
        $TMPL['users'] = $dir->dirgetUsers(0);
    }
    $skin = new skin('welcome/directory');
    $page = '';
    $TMPL['jyear'] = generateDateForm(0, $join[0]);
    $TMPL['tyear'] = generateDateForm(0, $join[1]);
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['Directory'] . ' - ' . $settings['title'];
    // Save the array returned into a list
    return $skin->make();
}
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $settings, $loggedIn;
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        header("Location: " . $CONF['url'] . "/index.php?a=feed");
    } else {
        if (isset($_POST['verify'])) {
            // Verification usage
            $ver = new verify();
            $ver->db = $db;
            $ver->url = $CONF['url'];
            $ver->enrollno = $_POST['enrollno'];
            $ver->name = $_POST['name'];
            $ver->fname = $_POST['fname'];
            $ver->course = $_POST['course'];
            $ver->branch = $_POST['branch'];
            $ver->join = $_POST['jyear'] . '-' . $_POST['tyear'];
            $ver->born = $_POST['day'] . '/' . $_POST['month'] . '/' . $_POST['year'];
            //$ver->dob = $settings['captcha'];
            $TMPL['verificationMsg'] = $ver->process();
            if ($TMPL['verificationMsg'] == 1) {
                header("Location: " . $CONF['url'] . "/index.php?a=verify");
            }
        }
        if (isset($_SESSION['enrollno']) || isset($_SESSION['born']) || isset($_SESSION['join']) || isset($_SESSION['course']) || isset($_SESSION['branch']) || isset($_SESSION['name'])) {
            header("Location: " . $CONF['url'] . "/index.php?a=register");
        }
    }
    $TMPL['years'] = generateDateForm(0, $date[0]);
    $TMPL['months'] = generateDateForm(1, $date[1]);
    $TMPL['days'] = generateDateForm(2, $date[2]);
    $TMPL['jyear'] = generateDateForm(0, $join[0]);
    $TMPL['tyear'] = generateDateForm(0, $join[1]);
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['Verify'] . ' - ' . $settings['title'];
    $TMPL['ad'] = $settings['ad1'];
    $skin = new skin('register/verify');
    return $skin->make();
}
Beispiel #10
0
function getThreadHtml($thread_id)
{
    $sql = sprintf("call sp_get_thread(%s)", $thread_id);
    $db = DB_GetConnection();
    if ($db->multi_query($sql)) {
        $thread = $db->store_result();
        if ($db->next_result()) {
            $posts = $db->store_result();
        }
    }
    $db->close();
    $t = $thread->fetch_assoc();
    $skin = new skin("thread.skn");
    $skin->token("THREAD_TITLE", $t["thread_title"]);
    //posts
    $num_rows = $posts->num_rows;
    for ($r = 0; $r < $num_rows; $r++) {
        $p = $posts->fetch_assoc();
        $skin->addRow("posts", $p["post_user_id"], $p["post_message"]);
    }
    $skin->flushRows("posts");
    return $skin->html;
}
Beispiel #11
0
 function process($ip, $ip_sql)
 {
     global $CONF, $DB, $FORM, $TMPL;
     // Review
     if (isset($FORM['review']) && $FORM['review']) {
         $date = date("Y-m-d H:i:s", time() + 3600 * $CONF['time_offset']);
         list($id) = $DB->fetch("SELECT MAX(id) + 1 FROM {$CONF['sql_prefix']}_reviews", __FILE__, __LINE__);
         if (!$id) {
             $id = 1;
         }
         $review = strip_tags($FORM['review']);
         $review = nl2br($review);
         $review = $this->bad_words($review);
         $TMPL['review'] = $review;
         if ($CONF['email_admin_on_review']) {
             $rate_email_admin = new skin('rate_email_admin');
             $rate_email_admin->send_email($CONF['your_email']);
         }
         $review = $DB->escape($review);
         $DB->query("INSERT INTO {$CONF['sql_prefix']}_reviews (username, id, date, review, active) VALUES ('{$TMPL['username']}', {$id}, '{$date}', '{$review}', {$CONF['active_default_review']})", __FILE__, __LINE__);
     }
     // Rating
     $rating = intval($FORM['rating']);
     if ($rating > 5) {
         $rating = 5;
     } elseif ($rating < 1) {
         $rating = 1;
     }
     $DB->query("UPDATE {$CONF['sql_prefix']}_stats SET total_rating = total_rating + {$rating}, num_ratings = num_ratings + 1 WHERE username = '******'username']}'", __FILE__, __LINE__);
     // Update the IP log
     if ($ip == $ip_sql) {
         $DB->query("UPDATE {$CONF['sql_prefix']}_ip_log SET rate = 1 WHERE ip_address = '{$ip}' AND username = '******'username']}'", __FILE__, __LINE__);
     } else {
         $DB->query("INSERT INTO {$CONF['sql_prefix']}_ip_log (ip_address, username, rate) VALUES ('{$ip}', '{$TMPL['username']}', 1)", __FILE__, __LINE__);
     }
     $TMPL['content'] = $this->do_skin('rate_finish');
 }
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $settings;
    if (isset($_POST['contactus'])) {
        // Verification usage
        $contu = new contactus();
        $contu->db = $db;
        $contu->url = $contuF['url'];
        $contu->name = $_POST['name'];
        $contu->email = $_POST['email'];
        $contu->enrollno = $_POST['enrollno'];
        $contu->course = $_POST['course'];
        $contu->branch = $_POST['branch'];
        $contu->message = $_POST['message'];
        $contu->join = $_POST['jyear'] . '-' . $_POST['tyear'];
        $TMPL['contactusMsg'] = $contu->process();
        $mailmsg = '';
        $mailmsg .= "Name: {$this->name} \n";
        $mailmsg .= "Email: {$this->email} \n";
        $mailmsg .= "Course: {$this->course} \n";
        $mailmsg .= "Branch: {$this->branch} \n";
        $mailmsg .= "Batch: {$this->batch} \n";
        $mailmsg .= "Enroll No: {$this->enrollno} \n";
        $mailmsg .= "Message: {$this->message} \n";
        if ($TMPL['contactusMsg'] == 1) {
            sendMail($settings['email'], sprintf($LNG['ttl_admin_email'], $this->name), $mailmsg, $this->email);
            header("Location: " . $CONF['url'] . "/index.php?a=contactus");
        }
    }
    $TMPL['jyear'] = generateDateForm(0, $join[0]);
    $TMPL['tyear'] = generateDateForm(0, $join[1]);
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = 'Contact Us - ' . $settings['title'];
    $TMPL['ad'] = $settings['ad1'];
    $skin = new skin('welcome/contactus');
    return $skin->make();
}
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    if ($settings['captcha']) {
        $TMPL['captcha'] = '<input type="text" name="captcha" placeholder="' . $LNG['captcha'] . '" />
		<span class="welcome-captcha"><img src="' . $CONF['url'] . '/includes/captcha.php" /></span>';
    }
    if (isset($_POST['register'])) {
        // Register usage
        $reg = new register();
        $reg->db = $db;
        $reg->url = $CONF['url'];
        $reg->username = $_POST['username'];
        $reg->password = $_POST['password'];
        $reg->email = $_POST['email'];
        $reg->enrollno = $_POST['enrollno'];
        $reg->captcha = $_POST['captcha'];
        $reg->captcha_on = $settings['captcha'];
        $reg->message_privacy = $settings['mprivacy'];
        $reg->like_notification = $settings['notificationl'];
        $reg->comment_notification = $settings['notificationc'];
        $reg->shared_notification = $settings['notifications'];
        $reg->chat_notification = $settings['notificationd'];
        $reg->friend_notification = $settings['notificationf'];
        $reg->verified = $settings['verified'];
        $reg->email_like = $settings['email_like'];
        $reg->email_comment = $settings['email_comment'];
        $reg->email_new_friend = $settings['email_new_friend'];
        $reg->sound_new_notification = $settings['sound_new_notification'];
        $reg->sound_new_chat = $settings['sound_new_chat'];
        $TMPL['registerMsg'] = $reg->process();
        if ($TMPL['registerMsg'] == 1) {
            if ($settings['mail']) {
                sendMail($_POST['email'], sprintf($LNG['welcome_mail'], $settings['title']), sprintf($LNG['user_created'], $settings['title'], $_POST['username'], $_POST['password'], $CONF['url'], $settings['title']), $CONF['email']);
            }
            header("Location: " . $CONF['url'] . "/index.php?a=feed");
        }
    }
    if (isset($_POST['login'])) {
        // Log-in usage
        $log = new logIn();
        $log->db = $db;
        $log->url = $CONF['url'];
        $log->username = $_POST['username'];
        $log->password = $_POST['password'];
        $log->remember = $_POST['remember'];
        $TMPL['loginMsg'] = notificationBox('transparent', $LNG['error'], $log->in(), 1);
    }
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if ($verify['username']) {
            header("Location: " . $CONF['url'] . "/index.php?a=feed");
        }
    }
    // Start displaying the home-page users
    $result = $db->query("SELECT * FROM `users` WHERE `image` != 'default.png' ORDER BY `idu` DESC LIMIT 10 ");
    while ($row = $result->fetch_assoc()) {
        $users[] = $row;
    }
    $TMPL['rows'] = showUsers($users, $CONF['url']);
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['welcome'] . ' - ' . $settings['title'];
    $TMPL['ad'] = stripslashes($settings['ad1']);
    $skin = new skin('welcome/content');
    return $skin->make();
}
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if (empty($verify['username'])) {
            // If fake cookies are set, or they are set wrong, delete everything and redirect to home-page
            $loggedIn->logOut();
            header("Location: " . $CONF['url'] . "/index.php?a=welcome");
        } else {
            // Start displaying the Feed
            $feed = new feed();
            $feed->db = $db;
            $feed->url = $CONF['url'];
            $feed->user = $verify;
            $feed->id = $verify['idu'];
            $feed->username = $verify['username'];
            $feed->per_page = $settings['perpage'];
            $feed->time = $settings['time'];
            $feed->censor = $settings['censor'];
            $feed->smiles = $settings['smiles'];
            $feed->c_per_page = $settings['cperpage'];
            $feed->c_start = 0;
            $feed->l_per_post = $settings['lperpost'];
            $feed->online_time = $settings['conline'];
            $feed->friends_online = $settings['ronline'];
            $feed->subscriptionsList = $feed->getSubs($verify['idu'], 0);
            $feed->subscribersList = $feed->getSubs($verify['idu'], 1);
            $feed->updateStatus($verify['offline']);
            $TMPL['uid'] = $verify['idu'];
            $TMPL_old = $TMPL;
            $TMPL = array();
            $skin = new skin('shared/rows');
            $rows = '';
            if (empty($_GET['filter'])) {
                $_GET['filter'] = '';
            }
            // Allowed types
            list($timeline, $message) = $feed->getTimeline(0, $_GET['filter']);
            $TMPL['messages'] = $timeline;
            $rows = $skin->make();
            $skin = new skin('timeline/sidebar');
            $sidebar = '';
            $TMPL['editprofile'] = $feed->fetchProfileWidget($verify['username'], realName($verify['username'], $verify['first_name'], $verify['last_name']), $verify['image']);
            $TMPL['sidebar'] = $feed->sidebarTypes($_GET['filter'], 'timeline');
            $TMPL['dates'] = $feed->sidebarDates($_GET['filter'], 'timeline');
            $TMPL['trending'] = $feed->sidebarTrending($_GET['tag'], 5);
            $TMPL['users'] = $feed->onlineUsers();
            $TMPL['subscriptions'] = $feed->sidebarSubs(0, 0);
            $TMPL['subscribers'] = $feed->sidebarSubs(1, 0);
            $TMPL['friendsactivity'] = $feed->sidebarFriendsActivity(20, 1);
            if (count($feed->subscriptionsList[0]) < 6) {
                $TMPL['suggestions'] = $feed->sidebarSuggestions();
            }
            $TMPL['ad'] = generateAd($settings['ad2']);
            $sidebar = $skin->make();
            $skin = new skin('shared/top');
            $top = '';
            // $TMPL['top'] = $feed->getForm();
            $TMPL['theme_url'] = $CONF['theme_url'];
            $TMPL['private_message'] = $verify['privacy'];
            $TMPL['avatar'] = $verify['image'];
            $TMPL['url'] = $CONF['url'];
            $top = $skin->make();
            $TMPL = $TMPL_old;
            unset($TMPL_old);
            $TMPL['top'] = $top;
            $TMPL['rows'] = $rows;
            $TMPL['sidebar'] = $sidebar;
        }
    } else {
        // If the session or cookies are not set, redirect to home-page
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    if (isset($_GET['logout']) == 1) {
        $loggedIn->logOut();
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['title_timeline'] . ' - ' . $settings['title'];
    $skin = new skin('shared/timeline');
    return $skin->make();
}
Beispiel #15
0
 function do_skin($filename)
 {
     $skin = new skin($filename);
     return $skin->make();
 }
Beispiel #16
0
        if (!cek_field($_POST)) {
            $send_mail = "<p>Error: Masih ada field yang kosong.<br>\n</p>\n";
        } else {
            // lakukan query untuk mendaftar alamat email member
            $hasil = mysql_query("SELECT email FROM member");
            // lakukan looping untuk mengirim ke semua alamat
            while ($data = mysql_fetch_array($hasil)) {
                $to = $data[0];
                // alamat email masing-masing member
                // jika anda tidak memiliki program mail server atau anda belum di server
                // sebenarnya beri komentar pada fungsi mail berikut
                mail($to, $subject, $isi, $form);
            }
            $send_mail = "<p>Email telah terkirim.</p>";
        }
        break;
}
// akhir dari switch
mysql_close();
// tutup koneksi
$skin = new skin();
// buat objek skin
$skin->ganti_skin('../template/skin_utama.php');
$skin->ganti_tag('{SEKARANG}', $tgl);
$skin->ganti_tag('{JUDUL}', $judul);
$skin->ganti_tag('{UTAMA}', $send_mail);
$skin->ganti_tag('{MENU}', $anim_teks);
$skin->ganti_tag('{SISI1}', $admin_menu);
$skin->ganti_tag('{SISI2}', $login);
$skin->ganti_tag('{CARI}', '');
$skin->ganti_tampilan();
Beispiel #17
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if (empty($verify['username'])) {
            // If fake cookies are set, or they are set wrong, delete everything and redirect to home-page
            $loggedIn->logOut();
            header("Location: " . $CONF['url'] . "/index.php?a=welcome");
        } else {
            // Start displaying the Feed
            $feed = new feed();
            $feed->db = $db;
            $feed->url = $CONF['url'];
            $feed->user = $verify;
            $feed->id = $verify['idu'];
            $feed->username = $verify['username'];
            $feed->per_page = $settings['perpage'];
            $feed->time = $settings['time'];
            $feed->censor = $settings['censor'];
            $feed->smiles = $settings['smiles'];
            $feed->c_per_page = $settings['cperpage'];
            $feed->c_start = 0;
            $feed->l_per_post = $settings['lperpost'];
            $feed->online_time = $settings['conline'];
            $feed->friends_online = $settings['ronline'];
            $feed->subscriptionsList = $feed->getSubs($verify['idu'], 0);
            $feed->subscribersList = $feed->getSubs($verify['idu'], 1);
            $feed->updateStatus($verify['offline']);
            // Useed in timeline javascript which checks for new messages
            $TMPL['subs'] = 1;
            $TMPL_old = $TMPL;
            $TMPL = array();
            $skin = new skin('shared/rows');
            $rows = '';
            if (empty($_GET['filter'])) {
                $_GET['filter'] = '';
            }
            // Allowed types
            list($timeline, $message) = $feed->getFeed(0, $_GET['filter']);
            $TMPL['messages'] = $timeline;
            $rows = $skin->make();
            $skin = new skin('feed/sidebar');
            $sidebar = '';
            $TMPL['editprofile'] = $feed->fetchProfileWidget($verify['username'], realName($verify['username'], $verify['first_name'], $verify['last_name']), $verify['image']);
            $TMPL['sidebar'] = $feed->sidebarTypes($_GET['filter'], $feed->subscriptions);
            $TMPL['dates'] = $feed->sidebarDates($_GET['filter'], $feed->subscriptions);
            $TMPL['trending'] = $feed->sidebarTrending($_GET['tag'], 5);
            $TMPL['users'] = $feed->onlineUsers();
            $TMPL['subscriptions'] = $feed->sidebarSubs(0, 0);
            $TMPL['subscribers'] = $feed->sidebarSubs(1, 0);
            $TMPL['friendsactivity'] = $feed->sidebarFriendsActivity(20, 1);
            if (count($feed->subscriptionsList[0]) < 6) {
                $TMPL['suggestions'] = $feed->sidebarSuggestions();
            }
            $TMPL['ad'] = generateAd($settings['ad3']);
            $sidebar = $skin->make();
            $skin = new skin('shared/top');
            $top = '';
            // $TMPL['top'] = $feed->getForm();
            $TMPL['theme_url'] = $CONF['theme_url'];
            $TMPL['private_message'] = $verify['privacy'];
            $TMPL['avatar'] = $verify['image'];
            $TMPL['url'] = $CONF['url'];
            $top = $skin->make();
            $TMPL = $TMPL_old;
            unset($TMPL_old);
            $TMPL['top'] = $top;
            $TMPL['rows'] = $rows;
            $TMPL['sidebar'] = $sidebar;
            // If the username input string is an e-mail, switch the query
            if (isset($_SESSION['username'])) {
                if (filter_var($_SESSION['username'], FILTER_VALIDATE_EMAIL)) {
                    $result = $db->query("SELECT * FROM `users` WHERE `email` = '" . $_SESSION['username'] . "' AND `password` = '" . $_SESSION['password'] . "'");
                } else {
                    $result = $db->query("SELECT * FROM `users` WHERE `username` = '" . $_SESSION['username'] . "' AND `password` = '" . $_SESSION['password'] . "'");
                }
            } elseif (isset($_COOKIE['username'])) {
                if (filter_var($_COOKIE['username'], FILTER_VALIDATE_EMAIL)) {
                    $result = $db->query("SELECT * FROM `users` WHERE `email` = '" . $_COOKIE['username'] . "' AND `password` = '" . $_COOKIE['password'] . "'");
                } else {
                    $result = $db->query("SELECT * FROM `users` WHERE `username` = '" . $_COOKIE['username'] . "' AND `password` = '" . $_COOKIE['password'] . "'");
                }
            }
            while ($row = $result->fetch_assoc()) {
                $status = $row['status'];
            }
            if ($status == 0) {
                header("Location: " . $CONF['url'] . "/index.php?a=contact");
            } elseif ($status == 1) {
                header("Location: " . $CONF['url'] . "/index.php?a=employee");
            }
        }
    } else {
        // If the session or cookies are not set, redirect to home-page
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    if (isset($_GET['logout']) == 1) {
        $loggedIn->logOut();
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['title_feed'] . ' - ' . $settings['title'];
    $skin = new skin('shared/timeline');
    return $skin->make();
}
Beispiel #18
0
    $proses = 'view';
}
$proses = filter_str($proses);
// cek user apakah sudah login atau belum
if (!cek_session('member')) {
    $member = $not_login;
} else {
    switch ($proses) {
        case 'view':
            $judul = "<h2>Selamat Datang di Member Area</h2>\n";
            $member = "<p>Terima kasih karena anda sudah bersedia menjadi member dari website " . "iklanUNPAM. karena hanya disinilah anda dapat memasang iklan " . "secara efektif dan cepat. Anda dapat memasang iklan pada kategori sesuai " . "dengan produk/jasa yang anda tawarkan.</p>\n" . "<p>Selain dengan menggunakan iklan baris, anda dapat menggunakan fasilitas " . "email untuk mengirim email ke semua member iklanUNPAM. Dengan " . "demikian keefektidan iklan anda sangat tinggi. Namun untuk fasilitas " . "email ini kami hanya memperbolehkan anda mengirim email hanya satu kali " . "dalam 5 hari.</p>\n";
            break;
        case 'logout':
            if (!logout('member')) {
                $member = "<p>Anda telah logout dari sistem. Klik " . "<a href='../login.php'>disini</a> untuk login kembali.</p>\n";
            }
            break;
    }
}
$skin = new skin();
// buat objek skin
$skin->ganti_skin('../template/skin_utama.php');
// ganti tag tertentu dengan variabel yang diinginkan
$skin->ganti_tag('{SEKARANG}', $tgl);
$skin->ganti_tag('{JUDUL}', $judul);
$skin->ganti_tag('{UTAMA}', $member);
$skin->ganti_tag('{MENU}', $mem_menu);
$skin->ganti_tag('{SISI1}', $iklanku);
$skin->ganti_tag('{SISI2}', $login);
$skin->ganti_tag('{CARI}', '');
$skin->ganti_tampilan();
Beispiel #19
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    $_GET['u'] = htmlspecialchars($_GET['u']);
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if (empty($verify['username'])) {
            // If fake cookies are set, or they are set wrong, delete everything and redirect to home-page
            $loggedIn->logOut();
            header("Location: " . $CONF['url'] . "/index.php?a=welcome");
        }
        // If the $_GET user is empty, define default user as current logged in user, else redirect to home-page
        if ($_GET['u'] == '') {
            $_GET['u'] = !empty($verify['username']) ? $verify['username'] : header("Location: " . $CONF['url'] . "/index.php?a=welcome");
        }
    }
    // Start displaying the Feed
    $feed = new feed();
    $feed->db = $db;
    $feed->url = $CONF['url'];
    $feed->user = $verify;
    $feed->id = $verify['idu'];
    $feed->username = $verify['username'];
    $feed->per_page = $settings['perpage'];
    $feed->categories = $feed->getCategories();
    $feed->time = $settings['time'];
    $feed->c_per_page = $settings['cperpage'];
    $feed->c_start = 0;
    $feed->l_per_post = $settings['lperpost'];
    if ($verify['username']) {
        $feed->updateStatus($verify['offline']);
    }
    // If the $_GET user is empty, define default user as current logged in user, else redirect to home-pag
    if ($_GET['u'] == '') {
        $_GET['u'] = !empty($feed->username) ? $feed->username : header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $feed->profile = $_GET['u'];
    $feed->profile_data = $feed->profileData($_GET['u']);
    $feed->subscriptionsList = $feed->getSubs($feed->profile_data['idu'], 0, null);
    $feed->subscribersList = $feed->getSubs($feed->profile_data['idu'], 1, null);
    $TMPL_old = $TMPL;
    $TMPL = array();
    $skin = new skin('shared/rows');
    $rows = '';
    if (empty($_GET['filter'])) {
        $_GET['filter'] = '';
    }
    // Allowed types
    list($timeline, $message) = $feed->getProfile(0, $_GET['filter']);
    if ($_GET['r'] == 'subscriptions') {
        if ($message !== 1) {
            $feed->s_per_page = $settings['sperpage'];
            $feed->subsList = $feed->getSubs($feed->profile_data['idu'], 0, 0);
            $TMPL['messages'] = $feed->listSubs(0);
        } else {
            $TMPL['messages'] = $timeline;
        }
        $title = $LNG['subscriptions'];
    } elseif ($_GET['r'] == 'subscribers') {
        if ($message !== 1) {
            $feed->s_per_page = $settings['sperpage'];
            $feed->subsList = $feed->getSubs($feed->profile_data['idu'], 1, 0);
            $TMPL['messages'] = $feed->listSubs(1);
        } else {
            $TMPL['messages'] = $timeline;
        }
        $title = $LNG['subscribers'];
    } elseif ($_GET['r'] == 'likes') {
        if ($message !== 1) {
            $likes = $feed->getLikes(0, 1);
            $TMPL['messages'] = $likes[0];
        } else {
            $TMPL['messages'] = $timeline;
        }
        $title = $LNG['likes'];
    } elseif ($_GET['r'] == 'playlists') {
        if ($message !== 1) {
            $TMPL['messages'] = $feed->getPlaylists(0, 1);
        } else {
            $TMPL['messages'] = $timeline;
        }
        $title = $LNG['playlists'];
    } else {
        $TMPL['messages'] = $timeline;
    }
    $rows = $skin->make();
    $skin = new skin('profile/sidebar');
    $sidebar = '';
    // If the username doesn't exist
    if ($message !== 1) {
        $TMPL['about'] = $feed->fetchProfileInfo($feed->profileData($_GET['u']));
        $TMPL['dates'] = $feed->sidebarDates($_GET['filter'], 'profile');
        $TMPL['ad'] = generateAd($settings['ad4']);
    } else {
        $skin = new skin('profile/sidebar');
        $sidebar = '';
        $TMPL['ad'] = generateAd($settings['ad4']);
    }
    $sidebar = $skin->make();
    $TMPL = $TMPL_old;
    unset($TMPL_old);
    $TMPL['rows'] = $rows;
    $TMPL['sidebar'] = $sidebar;
    $TMPL['cover'] = $feed->fetchProfile($feed->profile_data);
    if (isset($_GET['logout']) == 1) {
        $loggedIn->logOut();
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = (!empty($title) ? $title : $LNG['title_profile']) . ' - ' . realName($_GET['u'], $feed->profile_data['first_name'], $feed->profile_data['last_name'], 1) . ' - ' . $settings['title'];
    $TMPL['meta_description'] = realName($_GET['u'], $feed->profile_data['first_name'], $feed->profile_data['last_name'], 1) . ' ' . $feed->profile_data['description'];
    $skin = new skin('shared/content');
    return $skin->make();
}
Beispiel #20
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if (empty($verify['username'])) {
            // If fake cookies are set, or they are set wrong, delete everything and redirect to home-page
            $loggedIn->logOut();
            header("Location: " . $CONF['url'] . "/index.php?a=welcome");
        } else {
            $feed = new feed();
            $feed->db = $db;
            $feed->url = $CONF['url'];
            $feed->user = $verify;
            $feed->id = $verify['idu'];
            $feed->username = $verify['username'];
            $feed->time = $settings['time'];
            $feed->updateStatus($verify['offline']);
            $TMPL_old = $TMPL;
            $TMPL = array();
            $skin = new skin('track/edit');
            $rows = '';
            $TMPL['url'] = $CONF['url'];
            $TMPL['page_title'] = $LNG['upload'];
            $TMPL['form_url'] = $CONF['url'] . '/requests/post_track.php';
            $feed->art_size = $settings['artsize'];
            $feed->art_format = $settings['artformat'];
            $feed->paypalapp = $settings['paypalapp'];
            $feed->track_size_total = $feed->getProStatus($feed->id, 1) ? $settings['protracktotal'] : $settings['tracksizetotal'];
            $feed->track_size = $feed->getProStatus($feed->id, 1) ? $settings['protracksize'] : $settings['tracksize'];
            $feed->track_format = $settings['trackformat'];
            $TMPL['art'] = 'default.png';
            $date = explode('-', $TMPL['release']);
            $TMPL['years'] = generateDateForm(0, $date[0]);
            $TMPL['months'] = generateDateForm(1, $date[1]);
            $TMPL['days'] = generateDateForm(2, $date[2]);
            // Se the download to off by default
            $TMPL['doff'] = ' selected="selected"';
            // Set the visiblity to public by default
            $TMPL['pon'] = ' selected="selected"';
            if ($TMPL['license'] == 0) {
                $TMPL['ar'] = 'checked';
            } else {
                $TMPL['cc'] = 'checked';
                $license = str_split($TMPL['license']);
                $TMPL['nc'] = $license[1];
                $TMPL['nd_sa'] = $license[2];
            }
            $TMPL['display'] = 'inhert';
            $TMPL['onclick'] = 'startUpload()';
            $TMPL['btntext'] = $LNG['upload'];
            $rows = $skin->make();
            $skin = new skin('upload/sidebar');
            $sidebar = '';
            $TMPL['statistics'] = $feed->sidebarStatistics(null, 2);
            $TMPL['go_pro'] = $feed->goProMessage(1, 1);
            $sidebar = $skin->make();
            $TMPL = $TMPL_old;
            unset($TMPL_old);
            $TMPL['rows'] = $rows;
            $TMPL['sidebar'] = $sidebar;
        }
    } else {
        // If the session or cookies are not set, redirect to home-page
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    if (isset($_GET['logout']) == 1) {
        $loggedIn->logOut();
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['upload'] . ' - ' . $settings['title'];
    $skin = new skin('upload/content');
    return $skin->make();
}
Beispiel #21
0
if (!empty($strtmp)) {
    $db = DB_GetConnection();
    $sql = "select * from vw_item where item_name like '%" . $s . "%' order by item_name";
    $items = $db->query($sql);
    $sql = "select * from quest where quest_name like '%" . $s . "%' order by quest_name";
    $quests = $db->query($sql);
    $db->close();
    $skin = new skin("search_result.skn");
    $box->token("SEARCH_VALUE", $s);
    $skin->token("SEARCH_BOX", $box->html);
    $skin->token("NUM_ITEMS", $items->num_rows);
    $skin->token("NUM_QUESTS", $quests->num_rows);
    for ($r = 0; $r < $items->num_rows; $r++) {
        $d = $items->fetch_assoc();
        $icon = getIconPath($d["itemdisplay_icon"]);
        $skin->addRow("items", buildItemLink($d), $d["item_reqLevel"], $icon);
    }
    $skin->flushRows("items");
    for ($r = 0; $r < $quests->num_rows; $r++) {
        $d = $quests->fetch_assoc();
        $url = sprintf("quest.php?i=%s", $d["quest_id"]);
        $skin->addRow("quests", $d["quest_name"], $url);
    }
    $skin->flushRows("quests");
    $skin->dump();
} else {
    $box->token("SEARCH_VALUE", "");
    $skin = new skin("adv_search.skn");
    $skin->token("STUFF", $box->html);
    $skin->dump();
}
Beispiel #22
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
    }
    // Start displaying the Feed
    $feed = new feed();
    $feed->db = $db;
    $feed->url = $CONF['url'];
    $feed->user = $verify;
    $feed->id = $verify['idu'];
    $feed->username = $verify['username'];
    $feed->per_page = $settings['perpage'];
    $feed->categories = $feed->getCategories();
    $feed->time = $settings['time'];
    $feed->c_per_page = $settings['cperpage'];
    $feed->c_start = 0;
    $feed->l_per_post = $settings['lperpost'];
    $feed->paypalapp = $settings['paypalapp'];
    if (isset($_SESSION['usernameAdmin']) && isset($_SESSION['passwordAdmin'])) {
        $loggedInAdmin = new loggedInAdmin();
        $loggedInAdmin->db = $db;
        $loggedInAdmin->url = $CONF['url'];
        $loggedInAdmin->username = $_SESSION['usernameAdmin'];
        $loggedInAdmin->password = $_SESSION['passwordAdmin'];
        $loggedIn = $loggedInAdmin->verify();
        if ($loggedIn['username']) {
            // Set admin level
            $feed->is_admin = 1;
        }
    }
    $TMPL_old = $TMPL;
    $TMPL = array();
    // Get the track
    $track = $feed->getTrack($_GET['id']);
    $trackInfo = $feed->getTrackInfo($_GET['id'], 0);
    // Verify the track owner for certain pages
    if (!$trackInfo[1] && ($_GET['type'] == 'stats' || $_GET['type'] == 'edit')) {
        header("Location: " . $CONF['url']);
    }
    // Match the content from the song-title class in order to set it for the title tag
    preg_match_all('/<div.*(class="song-title").*>([\\d\\D]*)<\\/div>/iU', $track[0], $title);
    if (empty($title[2][0])) {
        preg_match_all('/<div.*(class="page-header").*>([\\d\\D]*)<\\/div>/iU', $track[0], $title);
    }
    $TMPL['id'] = $_GET['id'];
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = strip_tags($title[2][0]);
    $TMPL['url_title'] = $trackInfo[0];
    // If the user can view the track, and the report is set
    if (!$track[1] && $_GET['type'] == 'report') {
        if (!$feed->id) {
            header("Location: " . $CONF['url']);
        }
        $skin = new skin('track/report');
        $rows = '';
        if (isset($_POST['copyright'])) {
            $TMPL['message'] = $feed->report($_GET['id'], 1);
        }
    } elseif (!$track[1] && $_GET['type'] == 'stats') {
        $skin = new skin('track/stats');
        $rows = '';
        $stats = $feed->getTrackStats($_GET['id'], $_GET['filter'], 0);
        $most = $feed->getTrackStats($_GET['id'], $_GET['filter'], 1, 10);
        $TMPL['plays'] = $stats['plays'];
        $TMPL['likes'] = $stats['likes'];
        $TMPL['comments'] = $stats['comments'];
        $TMPL['downloads'] = $stats['downloads'];
        $TMPL['played_most'] = $most['played'];
        $TMPL['downloaded_most'] = $most['downloaded'];
        $TMPL['top_countries'] = $most['countries'];
        $TMPL['top_cities'] = $most['cities'];
        $TMPL['go_pro'] = $most['gopro'];
    } elseif (!$track[1] && $_GET['type'] == 'likes') {
        $skin = new skin('track/likes');
        $rows = '';
        $feed->per_page = $settings['qperpage'];
        $TMPL['likes'] = $feed->getLikes(0, 2, $_GET['id']);
    } elseif (!$track[1] && $_GET['type'] == 'edit') {
        $skin = new skin('track/edit');
        $rows = '';
        $TMPL['page_title'] = $LNG['edit'] . ' -';
        $TMPL['form_url'] = $CONF['url'] . '/index.php?a=track&id=' . $_GET['id'] . '&type=edit';
        $feed->art_size = $settings['artsize'];
        $feed->art_format = $settings['artformat'];
        if (!empty($_POST['save'])) {
            $update = $feed->updateTrack($_POST, 0);
            $TMPL['message'] = $update;
        }
        $currentTrack = $feed->getTrackInfo($_GET['id'], 1);
        foreach ($currentTrack as $key => $info) {
            $TMPL[$key] = $info;
        }
        $date = explode('-', $TMPL['release']);
        $TMPL['years'] = generateDateForm(0, $date[0]);
        $TMPL['months'] = generateDateForm(1, $date[1]);
        $TMPL['days'] = generateDateForm(2, $date[2]);
        if ($TMPL['download'] == 0) {
            $TMPL['doff'] = ' selected="selected"';
        } else {
            $TMPL['don'] = ' selected="selected"';
        }
        if ($TMPL['public'] == 0) {
            $TMPL['poff'] = ' selected="selected"';
        } else {
            $TMPL['pon'] = ' selected="selected"';
        }
        if ($TMPL['license'] == 0) {
            $TMPL['ar'] = 'checked';
        } else {
            $TMPL['cc'] = 'checked';
            $license = str_split($TMPL['license']);
            $TMPL['nc'] = $license[1];
            $TMPL['nd_sa'] = $license[2];
        }
        $TMPL['display'] = 'none';
        $TMPL['btntext'] = $LNG['save'];
    } else {
        $skin = new skin('track/rows');
        $rows = '';
        // If the track id is not set, or it doesn't consist from digits
        if (!isset($_GET['id']) || !ctype_digit($_GET['id'])) {
            header("Location: " . $CONF['url']);
        }
        $TMPL['messages'] = $track[0];
        // If the output is empty redirect to home-page
        if (empty($TMPL['messages'])) {
            header("Location: " . $CONF['url']);
        }
    }
    $rows = $skin->make();
    $skin = new skin('track/sidebar');
    $sidebar = '';
    $TMPL['ad'] = generateAd($settings['ad5']);
    // If the track can be viewed
    if (!$track[1]) {
        $TMPL['edit'] = $feed->sidebarButton($_GET['id'], 1);
        if (isset($_GET['type']) && $_GET['type'] !== 'edit') {
            unset($TMPL['edit']);
        }
        if ($_GET['type'] == 'stats') {
            $TMPL['statistics'] = $feed->sidebarStatsFilters($_GET['filter']);
        } else {
            $TMPL['statistics'] = $feed->sidebarStatistics($_GET['id'], 1, $trackInfo[1]);
        }
        $TMPL['description'] = $feed->sidebarDescription($_GET['id'], 0);
        $TMPL['tags'] = $feed->sidebarKeywords($_GET['id'], 0);
        $TMPL['report'] = $feed->sidebarReport($_GET['id']);
    }
    $sidebar = $skin->make();
    $TMPL = $TMPL_old;
    unset($TMPL_old);
    $TMPL['rows'] = $rows;
    $TMPL['sidebar'] = $sidebar;
    if (isset($_GET['logout']) == 1) {
        $loggedIn->logOut();
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['url'] = $CONF['url'];
    $title = strip_tags(trim($title[2][0]));
    $TMPL['title'] = ($_GET['type'] == 'report' || $_GET['type'] == 'stats' || $_GET['type'] == 'likes' || $_GET['type'] == 'edit' ? $LNG["{$_GET['type']}"] . ' - ' : '') . $title . ' - ' . $settings['title'];
    $TMPL['meta_description'] = $title . ' ' . $feed->sidebarDescription($_GET['id'], 0, 1);
    $skin = new skin('shared/content');
    return $skin->make();
}
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if (empty($verify['username'])) {
            // If fake cookies are set, or they are set wrong, delete everything and redirect to home-page
            $loggedIn->logOut();
            header("Location: " . $CONF['url'] . "/index.php?a=welcome");
        } else {
            if (isset($_POST['employee'])) {
                // Verification usage
                $emp = new employee();
                $emp->db = $db;
                $emp->url = $CONF['url'];
                $emp->company = $_POST['company'];
                /*						$emp->hrphone = $_POST['hrphone'];
                						$emp->hrname = $_POST['hrname'];
                						$emp->hremail = $_POST['hremail'];*/
                $emp->offaddress = $_POST['offaddress'];
                $emp->offemail = $_POST['offemail'];
                $emp->offphone = $_POST['offphone'];
                $emp->industry = $_POST['industry'];
                $emp->designation = $_POST['designation'];
                $emp->department = $_POST['department'];
                $emp->city = $_POST['city'];
                $emp->country = $_POST['country'];
                $emp->state = $_POST['state'];
                $emp->country = $_POST['country'];
                $emp->joining = $_POST['year'] . '-' . $_POST['month'] . '-' . $_POST['day'];
                //$con->dob = $settings['captcha'];
                $TMPL['employeeMsg'] = $emp->process();
                if ($TMPL['employeeMsg'] == 1) {
                    header("Location: " . $CONF['url'] . "/index.php?a=employee");
                }
            }
            if (isset($_POST['noo'])) {
                $emp = new employee();
                $emp->db = $db;
                $emp->url = $CONF['url'];
                $TMPL['employeeMsg'] = $emp->noprocess();
                if ($TMPL['employeeMsg'] == 1) {
                    header("Location: " . $CONF['url'] . "/index.php?a=employee");
                }
            }
            // If the username input string is an e-mail, switch the query
            if (isset($_SESSION['username'])) {
                if (filter_var($_SESSION['username'], FILTER_VALIDATE_EMAIL)) {
                    $result = $db->query("SELECT * FROM `users` WHERE `email` = '" . $_SESSION['username'] . "' AND `password` = '" . $_SESSION['password'] . "'");
                } else {
                    $result = $db->query("SELECT * FROM `users` WHERE `username` = '" . $_SESSION['username'] . "' AND `password` = '" . $_SESSION['password'] . "'");
                }
            } elseif (isset($_COOKIE['username'])) {
                if (filter_var($_COOKIE['username'], FILTER_VALIDATE_EMAIL)) {
                    $result = $db->query("SELECT * FROM `users` WHERE `email` = '" . $_COOKIE['username'] . "' AND `password` = '" . $_COOKIE['password'] . "'");
                } else {
                    $result = $db->query("SELECT * FROM `users` WHERE `username` = '" . $_COOKIE['username'] . "' AND `password` = '" . $_COOKIE['password'] . "'");
                }
            }
            while ($row = $result->fetch_assoc()) {
                $status = $row['status'];
            }
            if ($status == 0) {
                header("Location: " . $CONF['url'] . "/index.php?a=contact");
            } elseif ($status == 2) {
                header("Location: " . $CONF['url'] . "/index.php?a=settings&b=avatar");
            }
        }
    } else {
        // If the session or cookies are not set, redirect to home-page
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['years'] = generateDateForm(0, $date[0]);
    $TMPL['months'] = generateDateForm(1, $date[1]);
    $TMPL['days'] = generateDateForm(2, $date[2]);
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['Employee'] . ' - ' . $settings['title'];
    $TMPL['ad'] = $settings['ad1'];
    $skin = new skin('register/employee');
    return $skin->make();
}
Beispiel #24
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    $feed = new feed();
    $feed->db = $db;
    $feed->url = $CONF['url'];
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if ($verify['username']) {
            $feed->user = $verify;
            $feed->username = $verify['username'];
            $feed->id = $verify['idu'];
            if (isset($_GET['tag'])) {
                $skin = new skin('shared/top');
                $top = '';
                $TMPL['theme_url'] = $CONF['theme_url'];
                $TMPL['private_message'] = $verify['privacy'];
                $TMPL['avatar'] = $verify['image'];
                $TMPL['url'] = $CONF['url'];
                $top = $skin->make();
            }
        }
    }
    $feed->per_page = $settings['perpage'];
    $feed->time = $settings['time'];
    $feed->censor = $settings['censor'];
    $feed->smiles = $settings['smiles'];
    $feed->c_per_page = $settings['cperpage'];
    $feed->c_start = 0;
    $feed->l_per_post = $settings['lperpost'];
    $TMPL_old = $TMPL;
    $TMPL = array();
    $skin = new skin('shared/rows');
    $rows = '';
    if (empty($_GET['filter'])) {
        $_GET['filter'] = '';
    }
    // Allowed types
    if (isset($_GET['tag'])) {
        // If the $_GET keyword is empty [hashtag]
        if ($_GET['tag'] == '') {
            header("Location: " . $CONF['url'] . "/index.php?a=welcome");
        }
        $hashtags = $feed->getHashtags(0, $settings['qperpage'], $_GET['tag'], null);
        $TMPL['messages'] = $hashtags[0];
    } else {
        // If the $_GET keyword is empty [user]
        if ($_GET['q'] == '') {
            header("Location: " . $CONF['url'] . "/index.php?a=welcome");
        }
        $TMPL['messages'] = $feed->getSearch(0, $settings['qperpage'], $_GET['q'], $_GET['filter']);
    }
    $rows = $skin->make();
    $skin = new skin('search/sidebar');
    $sidebar = '';
    if (isset($_GET['tag'])) {
        $TMPL['trending'] = $feed->sidebarTrending($_GET['tag'], 10);
    } else {
        $TMPL['genre'] = $feed->sidebarGender($_GET['filter'], $_GET['q']);
    }
    $TMPL['ad'] = generateAd($settings['ad6']);
    $sidebar = $skin->make();
    $TMPL = $TMPL_old;
    unset($TMPL_old);
    $TMPL['top'] = $top;
    $TMPL['rows'] = $rows;
    $TMPL['sidebar'] = $sidebar;
    if (isset($_GET['logout']) == 1) {
        $loggedIn->logOut();
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['url'] = $CONF['url'];
    if (isset($_GET['tag'])) {
        $TMPL['title'] = '#' . $_GET['tag'] . ' - ' . $settings['title'];
    } else {
        $TMPL['title'] = $LNG['title_search'] . ' - ' . $_GET['q'] . ' - ' . $settings['title'];
    }
    $skin = new skin('shared/timeline_x');
    return $skin->make();
}
Beispiel #25
0
    case 'proses_form':
        // ambil data yang dipost sekaligus filter
        $username = filter_str($_POST['username']);
        $password = filter_str($_POST['password']);
        // enkripsi password
        $password = balik_md5($password);
        konek_db();
        // koneksikan ke MySQL server
        // gunakan fungsi login untuk mencocokan data
        if (!login('member', $username, $password)) {
            $login = "******";
        } else {
            $_SESSION['member'] = $username;
            // buat session member
            $login = "******" . "untuk masuk ke member area.";
        }
        mysql_close();
}
// panggil class skin
$skin = new skin();
// buat objek skin
$skin->ganti_skin('template/skin_utama.php');
// tentukan file template
$skin->ganti_tag('{SEKARANG}', $tgl);
$skin->ganti_tag('{MENU}', $menu);
$skin->ganti_tag('{JUDUL}', $judul);
$skin->ganti_tag('{UTAMA}', $login);
$skin->ganti_tag('{SISI1}', $iklan_sisi);
$skin->ganti_tag('{SISI2}', $daftar_berita);
$skin->ganti_tag('{CARI}', $cari);
$skin->ganti_tampilan();
 function findAllSkins($dir)
 {
     foreach (scandir($dir) as $dirName) {
         if (is_dir($dir . $dirName)) {
             if (file_exists($dir . $dirName . '/skin.php')) {
                 $skin = new skin($dir . $dirName . '/skin.php', $dir, $dirName);
                 if (!isError($skin->canRun())) {
                     $this->_allFoundSkins[$skin->getID()] = $skin;
                 }
             }
         }
     }
 }
Beispiel #27
0
 function do_approve($username)
 {
     global $CONF, $DB, $LNG, $TMPL;
     $DB->query("UPDATE {$CONF['sql_prefix']}_sites SET active = 1 WHERE username = '******'", __FILE__, __LINE__);
     list($TMPL['username'], $TMPL['url'], $TMPL['title'], $TMPL['description'], $TMPL['category'], $TMPL['banner_url'], $TMPL['email'], $TMPL['join_date']) = $DB->fetch("SELECT username, url, title, description, category, banner_url, email, join_date FROM {$CONF['sql_prefix']}_sites WHERE username = '******'", __FILE__, __LINE__);
     if ($CONF['google_friendly_links']) {
         $TMPL['verbose_link'] = "";
     } else {
         $TMPL['verbose_link'] = "index.php?a=in&u={$TMPL['username']}";
     }
     $TMPL['link_code'] = $this->do_skin('link_code');
     $LNG['join_welcome'] = sprintf($LNG['join_welcome'], $TMPL['list_name']);
     $join_email = new skin('join_email');
     $join_email->send_email($TMPL['email']);
 }
Beispiel #28
0
//quest.php
include "includes/common.php";
if (!empty($_REQUEST["i"])) {
    $id = $_REQUEST["i"];
} else {
    die("No quest specified!");
}
$sql = sprintf("call sp_getquest(%s);", $id);
$db = DB_GetConnection();
if ($db->multi_query($sql)) {
    $result = $db->store_result();
}
$db->close();
$d = $result->fetch_assoc();
$skin = new skin("quest.skn");
$skin->token("QUEST_NAME", $d["quest_name"]);
$skin->token("QUEST_DESCRIPTION", $d["quest_description"]);
$skin->token("LEVEL", $d["quest_level"]);
$text = $d["quest_details"];
$text = str_replace('$B', "<br/>", $text);
$text = str_replace('$b', "<br/>", $text);
$skin->token("DETAILS", $text);
//objective section
$skin->flag("obj", !empty($d["quest_objective1"]));
for ($i = 1; $i < 5; $i++) {
    if (!empty($d["quest_objective" . $i])) {
        $skin->addRow("obj", $d["quest_objective" . $i]);
    }
}
$skin->flushRows("obj");
Beispiel #29
0
if (!empty($_REQUEST["i"])) {
    $id = $_REQUEST["i"];
} else {
    die("No item specified!");
}
//get item data
$item = DB_GetItem($id);
$d = $item->fetch_assoc();
/*
$thread_id = $d["item_thread_id"];
if($thread_id == 0)
{
	$thread_id = saveThread(0, "User Comments");
	$sql = sprintf("UPDATE item SET item_thread_id = %s WHERE item_id = %s", $thread_id, $id);
	$db = DB_GetConnection();
	$db->query($sql);
	$db->close();
}
*/
$item = buildItemBox($d);
$skin = new skin("item2.skn");
$skin->token("ITEM_NAME", $d["item_name"]);
$skin->token("ITEM_BOX", $item);
$skin->token("ICON_SRC", getIconPath($d["itemdisplay_icon"]));
$skin->addRow("props", "Item ID", $id);
$skin->addRow("props", "Item Level", $d["item_level"]);
$skin->flushRows("props");
//User comments section
//$skin->token("USER_COMMENTS", getThreadHtml($thread_id));
//$skin->token("ADD_COMMENT", getQuickReplyHtml($thread_id));
$skin->dump();
Beispiel #30
0
function buildItemBox($d)
{
    //fill skin file with item data
    $skin = new skin("item_box.skn");
    $skin->token("QUALITY_ID", $d["item_qualityID"]);
    $skin->token("NAME", $d["item_name"]);
    $skin->flag("bond", $d["item_bondID"] > 0);
    $skin->token("BOND_TYPE", Text_BondType($d["item_bondID"]));
    $skin->flag("unique", $d["item_isUnique"] == 1);
    $skin->flag("slot", $d["item_slotID"] > 0);
    $skin->token("SLOT_TYPE", Text_SlotType($d["item_slotID"]));
    $skin->token("SUB_CLASS", $d["itemsubclass_name"]);
    $skin->flag("armor", $d["item_armor"] > 0);
    $skin->token("ARMOR", $d["item_armor"]);
    $skin->flag("dmg1", $d["item_dmg1min"] > 0);
    if ($d["item_dmg1min"] > 0) {
        $speed = $d["item_weaponDelay"] / 1000;
        $dps = ($d["item_dmg1min"] + $d["item_dmg1max"]) / 2 / $speed;
        $skin->token("DMG1_RANGE", sprintf("%s - %s", $d["item_dmg1min"], $d["item_dmg1max"]));
        $skin->token("WEAPON_SPEED", number_format($speed, 2));
        $skin->token("WEAPON_DPS", number_format($dps, 1));
    }
    if ($d["item_statStr"] > 0) {
        $skin->addRow("stats", sprintf("+%s Strength", $d["item_statStr"]));
    }
    if ($d["item_statAgi"] > 0) {
        $skin->addRow("stats", sprintf("+%s Agility", $d["item_statAgi"]));
    }
    if ($d["item_statSta"] > 0) {
        $skin->addRow("stats", sprintf("+%s Stamina", $d["item_statSta"]));
    }
    if ($d["item_statInt"] > 0) {
        $skin->addRow("stats", sprintf("+%s Intellect", $d["item_statInt"]));
    }
    if ($d["item_statSpr"] > 0) {
        $skin->addRow("stats", sprintf("+%s Spirit", $d["item_statSpr"]));
    }
    if ($d["item_resistHoly"] > 0) {
        $skin->addRow("stats", sprintf("+%s Holy Resistance", $d["item_statHoly"]));
    }
    if ($d["item_resistFire"] > 0) {
        $skin->addRow("stats", sprintf("+%s Fire Resistance", $d["item_resistFire"]));
    }
    if ($d["item_resistNature"] > 0) {
        $skin->addRow("stats", sprintf("+%s Nature Resistance", $d["item_resistNature"]));
    }
    if ($d["item_resistFrost"] > 0) {
        $skin->addRow("stats", sprintf("+%s Frost Resistance", $d["item_resistFrost"]));
    }
    if ($d["item_resistShadow"] > 0) {
        $skin->addRow("stats", sprintf("+%s Shadow Resistance", $d["item_resistShadow"]));
    }
    if ($d["item_resistArcane"] > 0) {
        $skin->addRow("stats", sprintf("+%s Arcane Resistance", $d["item_resistArcane"]));
    }
    $skin->flushRows("stats");
    if ($d["item_spell1ID"] > 0) {
        $skin->addRow("spells", Text_SpellTrigger($d["item_spell1TriggerID"]) . ": " . $d["spell1text"], "spell.php?i=" . $d["item_spell1ID"]);
    }
    if ($d["item_spell2ID"] > 0) {
        $skin->addRow("spells", Text_SpellTrigger($d["item_spell2TriggerID"]) . ": " . $d["spell2text"], "spell.php?i=" . $d["item_spell2ID"]);
    }
    if ($d["item_spell3ID"] > 0) {
        $skin->addRow("spells", Text_SpellTrigger($d["item_spell3TriggerID"]) . ": " . $d["spell3text"], "spell.php?i=" . $d["item_spell3ID"]);
    }
    $skin->flushRows("spells");
    $skin->flag("reqlvl", $d["item_reqLevel"] > 1);
    $skin->token("REQ_LEVEL", $d["item_reqLevel"]);
    $skin->flag("quest", $d["item_beginQuestID"] > 0);
    $skin->token("QUEST_URL", sprintf("quest.php?i=%s", $d["item_beginQuestID"]));
    $skin->flag("descrip", $d["item_description"] != null);
    $skin->token("DESCRIPTION", "\"" . $d["item_description"] . "\"");
    $skin->flag("set", $d["item_setID"] > 0);
    $skin->token("SET_NAME", $d["itemset_name"]);
    $skin->token("ITEMSET_URL", sprintf("itemset.php?i=%s", $d["item_setID"]));
    return $skin->html;
}