Exemple #1
0
function user_avatar_shortcode($parm = '')
{
    global $loop_uid;
    $height = e107::getPref("im_height");
    $width = e107::getPref("im_width");
    $tp = e107::getParser();
    if (intval($loop_uid) > 0 && trim($parm) == "") {
        $parm = $loop_uid;
    }
    if (is_numeric($parm)) {
        if ($parm == USERID) {
            $image = USERIMAGE;
        } else {
            $row = get_user_data(intval($parm));
            $image = $row['user_image'];
        }
    } elseif ($parm) {
        $image = $parm;
    } elseif (USERIMAGE) {
        $image = USERIMAGE;
    } else {
        $image = "";
    }
    if (vartrue($image)) {
        $img = strpos($image, "://") !== false ? $image : $tp->thumbUrl(e_MEDIA . "avatars/" . $image, "aw=" . $width . "&ah=" . $height);
        $text = "<img class='user-avatar e-tip' src='" . $img . "' alt='' style='width:" . $width . "px; height:" . $height . "px' />\n\t\t";
    } else {
        $img = $tp->thumbUrl(e_IMAGE . "generic/blank_avatar.jpg", "aw=" . $width . "&ah=" . $height);
        $text = "<img class='user-avatar' src='" . $img . "' alt='' />";
    }
    return $text;
}
function get_message()
{
    $id = is_logged_in();
    $ci =& get_instance();
    $ci->load->helper('text');
    $query = $ci->db->query('SELECT * FROM (SELECT * FROM `workstreams` ORDER BY time DESC) AS t where receiver ="' . $id . '" GROUP BY job_id');
    $result = $query->result_object();
    if (!empty($result)) {
        $total = '';
        $liHtml = '';
        foreach ($result as $key => $value) {
            $job_data = job_data('id', $value->job_id, ['slug', 'user_id']);
            $rel = $job_data->user_id == $id ? 'buyer' : 'seller';
            $first_name = get_user_data($value->sender, 'first_name');
            if ($value->is_read == 0) {
                $class = 'active';
                $total++;
            } else {
                $class = '';
            }
            $liHtml .= '<li class=' . $class . '><a href="' . base_url("job/view/" . $job_data->slug . '?rel=' . $rel) . '">' . character_limiter($first_name . ' : ' . $value->message, 55) . '</a></li><hr style="margin-top:5px; margin-bottom:5px">';
        }
        return array('html' => $liHtml, 'total' => $total);
    } else {
        return $liHtml = '<li><a href="javascript:void(0)">No Message</a></li>';
    }
}
Exemple #3
0
function update_password($password)
{
    $db = new db();
    $user = get_user_data();
    $id = $user['id'];
    $password = md5($password);
    $result = $db->update("users", array("password" => $password), "id = :id", array(":id" => $id));
    return $result;
}
Exemple #4
0
function show_account()
{
    $user = get_user_data();
    if ($user) {
        $data['name'] = $user['name'];
        $data['email'] = $user['email'];
        render("account", $data);
    } else {
        redirect("user/signin");
    }
}
Exemple #5
0
function get_user_role($user_id = 0)
{
    $CI =& get_instance();
    if (!$user_id) {
        $user_data = get_user_data();
        return $user_data['role'];
    }
    $CI->load->model('user_model');
    $row = $CI->user_model->get_where(array('id' => $user_id))->row_array;
    if (!$row) {
        return FALSE;
    }
    return $row['role'];
}
Exemple #6
0
function save_user($fbuid, $user_object)
{
    global $mongo;
    $db = $mongo->combined;
    $users = $db->users;
    $users->save($user_object);
    $users->ensureIndex(array('id' => 1), array("unique" => true));
    $user_exists = check_user_exist($fbuid);
    if (!$user_exists) {
        $user_object_id = set_object('user', $fbuid, $fbuid);
        $res->status = 'new';
        return $res;
    } else {
        return get_user_data($fbuid);
    }
}
Exemple #7
0
function recover($mode, $email)
{
    $mode = sanitize($mode);
    $email = sanitize($email);
    $user_data = get_user_data(user_id_from_email($email), 'user_id', 'first_name', 'username');
    if ($mode == 'username') {
        email($email, 'Your Username Recovery - Factionizer', "Hello " . $user_data['first_name'] . ",\n\nThank you for using the Factionizer.  Your username is:\n" . $user_data['username'] . "\n\n   ---Factionizer");
    } else {
        if ($mode == 'password') {
            $generated_password = substr(md5(rand(999, 999999)), 0, 8);
            change_password($user_data['user_id'], $generated_password);
            update_user($user_data['user_id'], array('password_recover' => '1'));
            email($email, 'Your Password Recovery - Factionizer', "Hello " . $user_data['first_name'] . ",\n\nThank you for using the Factionizer.  Your password has been reset.  Once you log in with this new password, you will be prompted to change it.\n Your new password is:\n\n" . $generated_password . "\n\n   ---Factionizer");
        } else {
            echo 'Error.';
        }
    }
}
/**
 * Retrieves a user from storage by its ID number.
 * @param  int $id              Must be an integer
 * @return mix|boolean|array    Returns the user array if success, returns false if fail.
 */
function get_user_by_id($id)
{
    $output = false;
    $findings = 0;
    $user_found = array();
    foreach (get_user_data() as $user => $attrs) {
        if ($attrs['id'] == $id) {
            $findings = $findings + 1;
            array_push($user_found, $attrs);
        }
    }
    if ($findings === 1) {
        $output = $user_found[0];
        unset($user_found);
    } else {
        unset($user_found);
    }
    return $output;
}
Exemple #9
0
function send_note_to_email($email, $id)
{
    $db = new db();
    $result = $db->read("notes", "id = :id", array(":id" => $id));
    $subject = "[TinyNote] " . $result[0]['title'];
    $body = "<html><body>";
    $body .= $result[0]['body'];
    $body .= "</body></html>";
    $user = get_user_data();
    $user_id = $user['id'];
    $user_email = $db->get_query("SELECT email FROM users WHERE id={$user_id}");
    $user_email = $user_email[0]['email'];
    $headers = "From: {$user_email}\r\n";
    $headers .= "Reply-To: {$user_email}\r\n";
    $headers .= "MIME-Version: 1.0\r\n";
    $headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
    @mail($email, $subject, $body, $headers);
    return true;
}
function delete_user($username)
{
    // Connect to the DB
    $ret = create_connection($connection);
    if ($ret !== true) {
        return $ret;
    }
    // Validate input
    $ret = validate_input($username);
    if ($ret !== true) {
        $connection->close();
        return $ret;
    }
    // Get user data
    $user_data = get_user_data($username, $connection);
    if ($user_data === false) {
        $connection->close();
        return 'Username provided does not exist';
    }
    // Delete feeds
    if (delete_feeds($user_data, $connection) !== true) {
        $connection->close();
        return 'Error while deleting the feeds';
    }
    // Delete inputs
    if (delete_inputs($user_data, $connection) !== true) {
        $connection->close();
        return 'Error while deleting the inputs';
    }
    // Delete EWatcher panels
    if (delete_ewatcher($user_data, $connection) !== true) {
        $connection->close();
        return 'Error while deleting user configuration (EWatcher)';
    }
    // Delete user
    if (delete_user_data($user_data, $connection) !== true) {
        $connection->close();
        return 'Error while deleting user data';
    }
    $connection->close();
    return true;
}
Exemple #11
0
 function threadGetUserViewed($uid = USERID)
 {
     $e107 = e107::getInstance();
     if ($uid == USERID) {
         $viewed = $e107->currentUser['user_plugin_forum_viewed'];
     } else {
         $tmp = get_user_data($uid);
         $viewed = $tmp['user_plugin_forum_viewed'];
         unset($tmp);
     }
     return explode(',', $viewed);
 }
Exemple #12
0
</h2><br/>
	    <div>
		    <p><?php 
    echo _('You\'ll need this license key to');
    ?>
 <a href="http://sendy.co/get-updated" target="_blank" style="text-decoration:underline"><?php 
    echo _('download the latest version of Sendy on our website');
    ?>
</a>.</p>
		    <div class="well"><strong><?php 
    echo get_user_data('license');
    ?>
</strong></div>
	    </div>
	    <h2><?php 
    echo _('Your API key');
    ?>
</h2><br/>
	    <div>
		    <div class="well"><strong><?php 
    echo get_user_data('api_key');
    ?>
</strong></div>
	    </div>
    </div>
    <?php 
}
?>
</div>
<?php 
include 'includes/footer.php';
$old_password = trim(htmlspecialchars($_POST["old_password"]));
$new_password = trim(htmlspecialchars($_POST["new_password"]));
$new_password_repeat = trim(htmlspecialchars($_POST["new_password_repeat"]));
// Check cookie, grab username
$user_cookie = $cookie_handler->get_cookie("compsec");
// This case should never happen because the cookie is checked
// on page load, and is deleted if it has been tampered with
if ($cookie_handler->validate_cookie($user_cookie) == false) {
    print "Error: Invalid cookie. The offending cookie has been deleted. Please log in again.";
    $cookie_handler->delete_cookie("compsec");
} else {
    if ($new_password != $new_password_repeat) {
        print "Error: New passwords do not match. Press the back button to try again.";
    } else {
        $uuid = $user_cookie->get_uuid();
        $results = get_user_data($uuid);
        $database_password = $results[2];
        $salt = $results[3];
        // Validate that the supplied password is correct
        $hashed_password = hash("sha512", $old_password . $salt);
        if ($database_password == $hashed_password) {
            // Replace password
            $hashed_new_password = hash("sha512", $new_password . $salt);
            update_user_password($uuid, $hashed_new_password);
            $cookie_handler->delete_cookie("compsec");
            print "Password successfully changed! Please <a href =\"login.php\">log in</a> with your new password.";
        } else {
            print "Error: Invalid password. Press the back button to try again.";
        }
    }
}
<?php

if (!isset($_COOKIE['loggin'])) {
    exit(0);
}
header("Content-type: application/json; charset=utf-8");
include '../mysql_connection.php';
$json = get_user_data($_COOKIE['loggin']);
if (!is_null($json)) {
    echo $json;
}
Exemple #15
0
                        </td><td width=50%><?php 
                    OUT(gethours($adata["time"]) . ":" . getmins($adata["time"]) . ":" . getsecs($adata["time"]));
                    ?>
</td></tr>                        
                      </table>
                    </td>
                  </table>                
                  <table width=100%><td width=35% class=tbl1 align=left>
                  <td align=center class=tbl1 width=32%>
                    <a href="<?php 
                    OUT("?p={$p}&act=stats&action=sessions&user="******"user"]);
                    ?>
">статистика</a>  
                  </td> <td align=center class=tbl1 width=32%>
                    <?php 
                    $ud = get_user_data($data["uid"]);
                    if ($ud["level"] < $CURRENT_USER["level"] || $CURRENT_USER["id"] == $ud["id"]) {
                        ?>
<a href="<?php 
                        OUT("?p={$p}&act={$act}&action=add&mode=edit&uid=" . $data["uid"]);
                        ?>
">редактировать</a> <?php 
                    }
                    ?>
                  
                  </td></table><br>    
     <?php 
                }
            }
            if (isset($show) && $show == "tbl") {
                echo "</table>";
Exemple #16
0
function dt_single_post($post, $type = 'post', $word = 39, $category)
{
    $types = array('post', 'page', 'article', 'training', 'schedule', 'product', 'event');
    $split = explode(' ', strip_tags($post['content'], '<p><br>'), $word + 1);
    $split_pop = count($split) >= $word ? array_pop($split) : '';
    $con = implode(' ', $split);
    $dots = count($split) >= $word ? '...' : '';
    $rows = explode(PHP_EOL, $con, 6);
    $rows_pop = count($rows) >= 5 ? array_pop($rows) : '';
    $dots = count($rows) >= 5 ? '...' : $dots;
    $recon = implode(PHP_EOL, $rows);
    $content = $recon . '<span></span>' . $dots;
    $content = plugin_run('content', $content);
    $time = generate_training_date($post['training_date']);
    $hasil = '';
    $hasil .= '<div class="each-post data-' . $type . '" data-type="' . $type . '">';
    $hasil .= '<div class="each-post-title"><a href="' . WWW . $post['url'] . '.html"><h3>' . $post['title'] . '</h3></a></div>';
    if ($post['type'] == 'training') {
        $hasil .= '<div class="each-post-detail">' . date('F jS, Y', $time) . ' &#8213; ' . $post['trainer'] . '</div>';
    } elseif ($post['type'] == 'post' || $post['type'] == 'article') {
        $author = get_user_data($post['author']);
        $hasil .= '<div class="each-post-detail">' . date('F jS, Y', $post['time']) . ' &#8213; ' . $author['name'] . '</div>';
    } elseif ($post['type'] == 'event') {
        $hasil .= '<div class="each-post-detail">
        <div class="each-post-detail-push">' . date('F jS, Y', strtotime($post['start'])) . ' &#8213; ' . date('F jS, Y', strtotime($post['end'])) . '</div>
        <div class="each-post-detail-push">' . $post['host'] . ' &#8213; ' . $post['place'] . '</div>
      </div>';
    } elseif ($post['type'] == 'product') {
        $hasil .= '<div class="each-post-detail">' . $post['price'] . ' &#8213; Stock: ' . $post['stock'] . '</div>';
    } elseif ($post['type'] == 'schedule') {
        $hasil .= '<div class="each-post-detail">' . $post['note'] . ' &#8213; Expires: ' . date('F jS, Y', strtotime($post['expires'])) . '</div>';
    }
    $hasil .= '<div class="each-post-content">' . $content . ($dots == '...' ? ' <span></span><a style="white-space:pre;" href="' . WWW . $post['url'] . '.html">[Read More...]</a>' : '') . '</p></div>';
    $hasil .= '</div>';
    if ($post['type'] == $type && $post['access'] == 'public' && $post['status'] == 'publish') {
        $hasil = $hasil;
    } elseif ($type == 'training' && $time < time()) {
        $hasil = '';
    } elseif (in_array($post['aid'], $category) && $post['access'] == 'public' && $post['status'] == 'publish') {
        $hasil = $hasil;
    } else {
        $hasil = '';
    }
    return $hasil;
}
        break;
    case 'RbsAdmin':
        $template->assign(array("ROLE" => "RbsAdmin", "ROLE_DESC" => "Administratoren &nbsp;- &nbsp;Remote Boot Services", "MENR" => $sbmnr));
        $members = $roles_array['RbsAdmin'];
        break;
    case 'ZoneAdmin':
        $template->assign(array("ROLE" => "ZoneAdmin", "ROLE_DESC" => "Administratoren &nbsp;- &nbsp;DNS Zone &nbsp;[ {DOM} ]", "MENR" => $sbmnr));
        $members = $roles_array['ZoneAdmin'];
        break;
}
# print_r($members); echo "<br><br>";
# für jedes Member Daten holen (Benutzername, UID)
if (count($members) != 0) {
    $members_data = array();
    foreach ($members as $item) {
        $members_data[] = get_user_data($item, array("dn", "cn", "uid", "mail"));
        # print_r(get_user_data($item,array("dn","cn","uid"))); echo "<br>";
    }
}
# echo "<br>";
# print_r($members_data); echo "<br><br>";
if (count($members_data) != 0) {
    $template->define_dynamic("Members", "Webseite");
    foreach ($members_data as $item) {
        $template->assign(array("VALUE" => $item['dn'], "USERNAME" => $item['cn'], "UID" => $item['uid'], "MAIL" => $item['mail']));
        $template->parse("MEMBERS_LIST", ".Members");
    }
} else {
    $template->assign(array("VALUE" => "", "USERNAME" => "", "UID" => "", "MAIL" => ""));
}
##############################################
Exemple #18
0
function renderuser($uid, $mode = "verbose")
{
    global $sql, $pref, $tp, $sc_style, $user_shortcodes;
    global $EXTENDED_START, $EXTENDED_TABLE, $EXTENDED_END, $USER_SHORT_TEMPLATE, $USER_FULL_TEMPLATE;
    global $user;
    if (is_array($uid)) {
        $user = $uid;
    } else {
        if (!($user = get_user_data($uid))) {
            return FALSE;
        }
    }
    e107::getScBatch('user')->setVars($user);
    if ($mode == 'verbose') {
        return $tp->parseTemplate($USER_FULL_TEMPLATE, TRUE, $user_shortcodes);
    } else {
        return $tp->parseTemplate($USER_SHORT_TEMPLATE, TRUE, $user_shortcodes);
    }
}
function authenticate_user($required_authority_level)
{
    $cookie_handler = new CookieHandler();
    $color = "hsla(360, 100%, 50%, 0.9)";
    if ($cookie_handler->cookie_exists("compsec") == true) {
        $user_cookie = $cookie_handler->get_cookie("compsec");
        if ($cookie_handler->validate_cookie($user_cookie) == true) {
            // Fetch user data
            $results = get_user_data($user_cookie->get_uuid());
            $user_authority_level = $results[4];
            // Check authentication level
            if ($user_authority_level < $required_authority_level) {
                print "<div class=\"box\" style=\"background-color:" . $color . ";margin-top:25px;\">You are not authorized to view this page.</div>";
                exit;
            }
        } else {
            print "<div class=\"box\" style=\"background-color:" . $color . ";margin-top:25px;\">Invalid cookie. You need a valid login with the appropriate permissions in order to access this page.</div>";
            exit;
        }
    } else {
        print "<div class=\"box\" style=\"background-color:" . $color . ";margin-top:25px;\">You need to be logged in to access this resource.</div>";
        exit;
    }
}
<div class="container-fluid top_bg">
	<div class="container">
		<div class="row">
			<div class="col-md-12">
				<div class="col-md-5 col-sm-4">
					<a href="#"><img alt="" class="img-responsive f_l" src="img/logo.png"></a>
				</div>
				<div class="col-md-7 col-sm-8 main_menu">
					<button class="navbar-toggle collapsed" data-target=".bs-navbar-collapse" data-toggle="collapse" type="button">
						<span id="t-button" class="glyphicon glyphicon-align-justify"></span>
					</button>
					<nav class="navbar-collapse bs-navbar-collapse collapse right_menu" role="navigation" style="height: 1px;">
						<ul class="nav navbar-nav">
					<?php 
if (isset($_SESSION['user_id']) && $_SESSION['user_id'] != '') {
    $get_user_data = get_user_data($_SESSION['user_id']);
    ?>
					
					
							<li><a class="r_brdr" href="<?php 
    echo SITE_URL;
    ?>
">HOME</a></li>
							<li><a class="r_brdr" href="profile.php">PROFILE</a></li>
							<li><a class="r_brdr" href="#teams">TEAMS</a></li>
							<li><a class="r_brdr" href="#offers">OFFERZ</a></li>
							<li><a class="r_brdr" href="#support">SUPPORT</a></li>
							<li><a href="process/logout.php">LOG OUT</a></li>
						
					<?php 
} else {
Exemple #21
0
<?php

include 'core/init.php';
include 'includes/overall/overall_header.php';
protect_page();
if (!empty($_GET['username'])) {
    $username = $_GET['username'];
    if (user_exists($username)) {
        $user_id = user_id_from_username($username);
        $profile_data = get_user_data($user_id, 'first_name', 'last_name', 'email', 'profile');
        //echo '<img src="', $user_data['profile'], '" alt="', $user_data['first_name'], '\'s Profile Image">';
        ?>
		<h1><?php 
        echo $profile_data['first_name'];
        ?>
's Profile</h1>
		<br>
		<p>Howdy!  What would you like to do?</p>
	<?php 
    } else {
        ?>
		<p>Sorry, that user does not exist.</p>
	<?php 
    }
} else {
    header('Location: index.php');
    exit;
}
include 'includes/overall/overall_footer.php';
<?php

if (!isset($_SESSION)) {
    session_start();
}
$name = $_SESSION['name'];
$user_id = $_SESSION['user_id'];
$user_data = get_user_data($user_id);
$character_data = get_characters($user_id);
include $_SERVER['DOCUMENT_ROOT'] . '/library/modules/head.php';
include $_SERVER['DOCUMENT_ROOT'] . '/library/modules/header.php';
include $_SERVER['DOCUMENT_ROOT'] . '/library/modules/nav.php';
?>

<main role="main">
    <?php 
if (isset($message)) {
    echo $message;
}
?>
    <h1>Feedback</h1>
    <p>I would love to hear your suggestions as to how to make this site better! Submit below.</p>
    <p>Before you ask for specific things, I'll let you know that these are on my to-do list</p>
    <ul>
        <li>Make the dice emulator prettier(suggestions for how to accomplish this are still good)</li>
        <li>Add responsive CSS to the character sheet(I Know that right now it is kind of annoying,
            I just didn't have the time to do this on first draft)</li>
        <li>Add a character creation process that follows D&amp;D rules</li>
        <li>Add calculate buttons to the character sheet for figuring modifiers and other things automagically</li>
    </ul>
Exemple #23
0
function view_post($dbc, $post_data, $post_type, $post)
{
    $thedate = date('Y-m-d H:i:s');
    if ($post_data['post_date'] != '0000-00-00 00:00:00' && $post_data['post_date'] <= $thedate) {
        $show_event = 1;
    }
    $body = strip_tags($post_data['body']);
    $author = get_user_data($dbc, $post['user_id']);
    $zone = data_zone($dbc, $post_data['zone']);
    // Post Advertising Zone
    $cat = data_cat($post_data['cat']);
    // Post Category
    // Check to see if the link is local or external:
    if ($post_data['url'] != '') {
        if (substr_count($post_data['url'], 'shore31.com') == 0) {
            $target = ' target="_blank"';
        }
        $title = '<h1><a href="' . $post_data['url'] . '"' . $target . '>' . $post_data['title'] . '</a></h1>';
    } else {
        $title = '<h1>' . $post_data['title'] . '</h1>';
    }
    if ($post_type == 7) {
        $title = '<h1><a href="' . H . $zone['slug'] . '/' . $cat . '/' . $post_data['slug'] . '">' . $post_data['title'] . '</a></h1>';
    }
    if ($post_type == 6) {
        $bg = 'loc' . $post['zone'];
    }
    if ($post_type == 6) {
        $bg_clear = 'style="background:none; border:none; box-shadow:none;"';
    }
    echo '<div id="post_' . $post_data['id'] . '" class="post post_type_' . $post_type . ' ' . $bg . ' ">';
    if ($post_type == 8) {
        echo '<div class="item event loc' . $post['zone'] . '">';
    } else {
        echo '<div class="item" ' . $bg_clear . '>';
    }
    switch ($post_type) {
        case 1:
            // Standard Post:
            if ($post_data['image']) {
                echo '<img style="border-radius:8px 8px 0px 0px;" src="' . H . UP . $post_data['image'] . '" style="width:100%; height:100%;">';
            }
            echo $title;
            echo '<p class="article">' . limit_words($body, 20) . ' ...</p>';
            echo '<p class="readmore"><a href="#">Read more</a></p>';
            if ($post['display_date'] != '') {
                echo '<p class="byline">Posted: ' . $post['display_date'] . '</p>';
            }
            echo '<div class="tag-list">' . $post_data['tag_list'] . '</div>';
            break;
        case 2:
            // Video Post:
            echo $title;
            $video = str_replace('http://youtu.be/', '', $post_data['url']);
            echo '<iframe style="border-radius:8px;" width="236" height="180" src="//www.youtube.com/embed/' . $video . '" frameborder="0" allowfullscreen></iframe>';
            if ($post['display_date'] != '') {
                echo '<p class="byline">Posted: ' . $post['display_date'] . '</p>';
            }
            echo '<div class="tag-list">' . $post_data['tag_list'] . '</div>';
            break;
        case 3:
            // Article Post:
            echo $title;
            echo '<p>' . limit_words($body, 20) . ' ...</p>';
            echo '<p class="readmore"><a href="http://alan.shore31.com/test-article.php?id=' . $post_data['slug'] . '">Read more</a></p>';
            if ($post['display_date'] != '') {
                echo '<p class="byline">Posted: ' . $post['display_date'] . '</p>';
            }
            echo '<div class="tag-list">' . $post_data['tag_list'] . '</div>';
            break;
        case 4:
            // Poster Post:
            echo $title;
            if ($post_data['image']) {
                echo '<img style="border-radius:0px 0px 0px 0px; margin-bottom:10px;" src="' . H . UP . $post_data['image'] . '" style="width:100%; height:100%;">';
            }
            echo '<div class="tag-list">' . $post_data['tag_list'] . '</div>';
            break;
        case 5:
            // Ad Box Post:
            echo '<p>' . $body . '</p>';
            break;
        case 6:
            // Quote Post:
            echo '<p style="box-shadow:1px 1px 5px #999999; margin:0px; border-radius:8px 8px 0px 0px;">' . $body . '</p>';
            //echo '<div class="tag-list">'.$post_data['tag_list'].'</div>';
            break;
        case 7:
            // Standard Post:
            if ($post_data['image']) {
                echo '<img style="border-radius:8px;" src="' . H . UP . $post_data['image'] . '" style="width:100%; height:100%;">';
            }
            echo $title;
            echo '<p>' . limit_words($body, 20) . ' ...</p>';
            echo '<p class="readmore"><a href="#">Read more</a></p>';
            if ($post['display_date'] != '') {
                echo '<p class="byline">Posted: ' . $post['display_date'] . '</p>';
            }
            echo '<div class="tag-list">' . $post_data['tag_list'] . '</div>';
            break;
        case 8:
            // Event Post:
            ?>
          
              <a class="calendar_date" href="#">
                  <div class="calendar_month"><?php 
            echo $post_data['themonth'];
            ?>
</div>
                  <div class="calendar_number"><?php 
            echo $post_data['theday'];
            ?>
</div>
                  <div class="calendar_day"><?php 
            echo $post_data['thedayname'];
            ?>
</div>
              </a>                                 
                     
              <h1><span class="loc<?php 
            echo $post_data['zone'];
            ?>
"><?php 
            echo $post_data['title'];
            ?>
</span> @ <?php 
            echo $post_data['venue'];
            ?>
</h1>
              <p class="display-location">IN <?php 
            echo $zone['name'];
            ?>
</p>
              <p class="display-date"><?php 
            echo $post_data['display_date'];
            ?>
 @ <?php 
            echo $post_data['thetime'];
            ?>
</p>
              
              <?php 
            if ($imagecount >= 1) {
                ?>
 <p class="display-image"><img src="<?php 
                echo H;
                ?>
uploads/<?php 
                echo $image['filename'];
                ?>
"/></p> <?php 
            }
            ?>
              

              <p class="display-description"><?php 
            echo limit_words($body, 40);
            ?>
 ...</p>
              <p class="readmore"><a href="#">Read more</a></p>
					<p>
						<?php 
            social_button($dbc, '22', 'mail', 'Grey', $url);
            social_button($dbc, '22', 'twitter', 'Grey', $url);
            social_button($dbc, '22', 'facebook', 'Grey', $url);
            social_button($dbc, '22', 'google+', 'Grey', $url);
            social_button($dbc, '22', 'instagram', 'Grey', $url);
            social_button($dbc, '22', 'pinterest', 'Grey', $url);
            ?>
          </p>
          
				<?php 
            break;
    }
    ?>

					<?php 
    if ($post_type != 8) {
        ?>
         
          <p style="background:#FFFFFF; <?php 
        if ($post_type == 6) {
            echo ' box-shadow:1px 1px 5px #999999; margin:0px; border-radius:0px 0px 8px 8px;';
        }
        ?>
">        
             <?php 
        social_button($dbc, '22', 'mail', 'Grey', $url);
        social_button($dbc, '22', 'twitter', 'Grey', $url);
        social_button($dbc, '22', 'facebook', 'Grey', $url);
        social_button($dbc, '22', 'google+', 'Grey', $url);
        social_button($dbc, '22', 'instagram', 'Grey', $url);
        social_button($dbc, '22', 'pinterest', 'Grey', $url);
        ?>
          </p>
                
			<?php 
    }
    ?>
	
 			 
<?php 
    echo '</div>';
    echo '</div>';
}
/**
 * get access token for user
 * @return string access_token
 */
function get_access_token($email = null)
{
    if (!isset($email)) {
        $email = $_SESSION['email'];
    }
    $user_data = get_user_data($email);
    if (isset($user_data['access_token'])) {
        return $user_data['access_token'];
    }
    if (isset($_SESSION['access_token'])) {
        return $_SESSION['access_token'];
    }
    return '';
}
Exemple #25
0
            }
        } else {
            if (!file_exists(SK_DIR . "/newsbar.php")) {
                global $DIRS;
                $news = new CNews($DIRS["news_list"], $DIRS["news_files"]);
                $news->comment_part_sep = "[*3*]";
                $news->news_info_sep = "[*1*]";
                $news->comment_sep = "[*2*]";
                $news->comment_info_sep = "[*4*]";
                $news->set_max_news(5);
                $news_list = $news->get_news_on_page(1);
                if (!count($news_list)) {
                    echo "<div align=center>нет новостей</div>";
                }
                for ($i = 0; $i < count($news_list); $i++) {
                    $ud = get_user_data($news_list[$i]["name"]);
                    ?>
                <div align=center><a tyle="font-size:8.5px;" href="?p=users&act=userinfo&id=<?php 
                    OUT($news_list[$i]["name"]);
                    ?>
"><?php 
                    OUT($ud["nick"]);
                    ?>
</a>: "<a style="font-size:9px;" href="?p=news&view=post&id=<?php 
                    OUT($news_list[$i]["id"]);
                    ?>
"><b><?php 
                    OUT($news_list[$i]["head"]);
                    ?>
</b></a>"</div>
                <?php 
/**
 * Get the total number of users on the platform
 * @see SortableTable#get_total_number_of_items()
 */
function get_number_of_users()
{
    $total_rows = get_user_data(null, null, null, null, true);
    return $total_rows;
}
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </a>
              	<div class="header_new"></div>
                <div class="navbar-right">
                    <ul class="nav navbar-nav">

                      
                        <!-- User Account: style can be found in dropdown.less -->
                        <li class="dropdown user user-menu">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                <i class="glyphicon glyphicon-user"></i>
                                <span>
                                    <?php 
$user_data = get_user_data();
echo $user_data[0];
?>
                                     <i class="caret"></i></span>
                            </a>
                            <ul class="dropdown-menu">
                                <!-- User image -->
                                <li class="user-header bg-new-red">
                                <?php 
if ($user_data[2] == "") {
    $img = "../img/user/default.jpg";
} else {
    $img = "../img/user/" . $user_data[2];
}
?>
                                    <img src="<?php 
Exemple #28
0
<p>
                        <p><strong>Estimated Job duration :</strong> <?php 
    echo ucfirst($job->status);
    ?>
</p>
                        <p style="white-space: pre-line">
                           <?php 
    echo $job->description;
    ?>
                        </p>

                     <?php 
    if (!empty($job->assign_to)) {
        ?>
                        <p><strong>Buyer</strong> : <?php 
        $userDtata = get_user_data($job->user_id);
        echo $userDtata->first_name . ' ' . $userDtata->last_name;
        ?>
</p>
                     <?php 
    }
    ?>
                        <h3 id="send_proposal">Workstream With <?php 
    echo $userDtata->first_name;
    ?>
</h3>
                        <hr>
                        
                        <div class="col-md-12" id="workstream_thread" style="">
                            <?php 
    if (!empty($workstream)) {
Exemple #29
0
}
echo "" . "{$td_all}" . "";
//$reg=0;
//for($h=0;$h<count($all_users);$h++){if($users_info['login'][$h]==$themes_data[$i]['nick'])$reg=1;}
if (is_user_exists($themes_data[$i]['nick'])) {
    $ud = get_user_data($themes_data[$i]['nick']);
    $user = $ud["nick"];
    echo "<a href=\"?p=users&act=userinfo&id=" . $themes_data[$i]['nick'] . "\">" . $user . "</a>\r\n\t\t\t" . "{$td_all}" . "";
} else {
    $user = $themes_data[$i]['nick'];
    echo $user . "\r\n  \t\t        " . "{$td_all}" . "";
}
echo "\r\n\t" . $themes_data[$i]['date'] . "\r\n\t" . "{$td_all}" . "";
if ($links > 0) {
    //$reg=0;
    //for($h=0;$h<count($all_users);$h++){if(($users_info['login'][$h]==$all_messages[$i]['nick'][$themes_data[$i]['count']-1])&&($all_messages[$i]['user_id'][$themes_data[$i]['count']-1]==$all_users[$h]))$reg=1;}
    if (is_user_exists($all_messages[$i]['user_id'][$themes_data[$i]['count'] - 1])) {
        $ud = get_user_data($all_messages[$i]['user_id'][$themes_data[$i]['count'] - 1]);
        //while($users_info['id'][$usr_id]!=$all_messages[$i]['nick'][$themes_data[$i]['count']-1] && $usr_id<count($users_info['id']))$usr_id++;
        $user = $ud['nick'];
        echo "<a href=\"?p=users&act=userinfo&id=" . $all_messages[$i]['user_id'][$themes_data[$i]['count'] - 1] . "\">\r\n\t\t        " . $user . "</a>";
    } else {
        $user = $all_messages[$i]['nick'][$themes_data[$i]['count'] - 1];
        echo "" . $user . "";
    }
    echo ",\r\n\t\t" . $themes_data[$i]['refresh'] . "";
    echo " <a href=\"?p={$p}&forum_ext={$forum_ext}&t_page={$t_page}&id=showtopic&topic={$topic}&page={$links}#last\"><img src=\"{$file_last}\" border=0></a>";
}
echo "\r\n\t" . "{$td_all}" . "\r\n\t" . $themes_data[$i]['views'] . "\r\n\t" . "{$td_all}" . "\r\n\t" . $themes_data[$i]['count'] . "\r\n\t" . "{$td_all}" . "\r\n\t<SMALL>" . $themes_data[$i]['descr'] . "</SMALL>";
?>
                      
     echo "<center>failed, unable to locate users password</center>";
     logfailedattempt($inputedusername, "unknown user,(" . $pipaddress . "->" . $ipaddress . ")");
     exit;
 }
 $userssalt = trim(substr($userdbpassword, 0, 16));
 $inputedpasswordhash = crypt_password($inputedpassword, $userssalt);
 if (empty($inputedpasswordhash)) {
     echo "<center>failed, unable to decrypt user password</center>";
     exit;
 }
 if (trim($userdbpassword) != trim($inputedpasswordhash)) {
     echo "<center>incorrect password, please try again</center>";
     logfailedattempt($inputedusername, "bad password,(" . $pipaddress . "->" . $ipaddress . ")");
     exit;
 }
 $useradminlevel = get_user_data($inputedusername, "admin");
 session_start();
 $_SESSION['username'] = $inputedusername;
 $_SESSION['timeout'] = 300;
 $_SESSION['start'] = time();
 $_SESSION['admin'] = $useradminlevel;
 $redirect_location = $_POST['redirect'];
 if (strlen($redirect_location) > 0) {
     header("Location: {$redirect_location}");
 } else {
     if ($useradminlevel > 0) {
         header('Location: admin_portal.php');
     } else {
         header('Location: user_portal.php');
     }
 }