Example #1
0
function edit_profile_form()
{
    global $LANG;
    if ($GLOBALS['me']) {
        $form = '<div class="edit_profile_form other_form">';
        if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST['edit_profile_form']) && \site\utils::check_csrf($_POST['edit_profile_form']['csrf'], 'edit_profile_csrf')) {
            $pd = \site\utils::validate_user_data($_POST['edit_profile_form']);
            try {
                $user_info = \user\main::edit_profile($GLOBALS['me']->ID, $pd);
                $GLOBALS['me']->Avatar = $user_info->avatar;
                $form .= '<div class="success">' . $LANG['profile_success'] . '</div>';
            } catch (Exception $e) {
                $form .= '<div class="error">' . $e->getMessage() . '</div>';
            }
        }
        $csrf = $_SESSION['edit_profile_csrf'] = \site\utils::str_random(12);
        $form .= '<form method="POST" action="#" enctype="multipart/form-data">
  <div class="form_field"><label for="edit_profile_form[username]">' . $LANG['form_name'] . ':</label> <div><input type="text" name="edit_profile_form[username]" id="edit_profile_form[username]" value="' . (isset($pd['username']) ? $pd['username'] : $GLOBALS['me']->Name) . '" required /></div></div>
  <div class="form_field"><label for="edit_profile_form[email]">' . $LANG['form_email'] . ':</label> <div><input type="text" name="edit_profile_form[email]" id="edit_profile_form[email]" value="' . $GLOBALS['me']->Email . '" disabled /></div></div>
  <div class="form_field"><label for="edit_profile_form_avatar">' . $LANG['form_avatar'] . ':</label> <div><img src="' . user_avatar($GLOBALS['me']->Avatar) . '" alt="" style="width:80px; height:80px;" /> <input type="file" name="edit_profile_form_avatar" id="edit_profile_form_avatar" />
  <span>Note:* max width: 300px, max height: 300px.</span></div></div>
  <div class="form_field"><label for="edit_profile_form[subscriber]">' . $LANG['form_subscriber'] . ':</label> <div><input type="checkbox" name="edit_profile_form[subscriber]" id="edit_profile_form[subscriber]" ' . (isset($pd['subscriber']) || $_SERVER['REQUEST_METHOD'] !== 'POST' && $GLOBALS['me']->is_subscribed ? 'checked' : '') . ' /> ' . $LANG['msg_subscribe'] . '</div></div>
  <input type="hidden" name="edit_profile_form[csrf]" value="' . $csrf . '" />
  <button>' . $LANG['profile_button'] . '</button>
  </form>

  </div>';
        return $form;
    } else {
        return '<div class="info_form">' . $LANG['unavailable_form'] . '</div>';
    }
}
Example #2
0
                    <li><a href="<?php 
echo site_url('blog/photos');
?>
" class="active">Картинки</a></li>
                    <li><a href="<?php 
echo site_url('page/about');
?>
">О нас</a></li>
                </ul>
                <div id="login">
<?php 
if (user_signed_in()) {
    $user = current_user();
    ?>
    <?php 
    echo user_avatar($user, 'mini');
    ?>
 <?php 
    echo anchor('user/profile/' . $user['login'], $user['login']);
    ?>
 | <?php 
    echo anchor('user/logout', 'Выйти');
    ?>
    <?php 
} else {
    ?>
    <?php 
    echo anchor('user/login', 'Войти');
    ?>
 | <?php 
    echo anchor('user/register', 'Регистрация');
Example #3
0
</div>

</article>';
    if (me()) {
        echo '<a href="#" class="btn write_review"' . ($_SERVER['REQUEST_METHOD'] == 'POST' ? ' style="display: none;"' : '') . '>Write Review</a>';
        echo '<div' . ($_SERVER['REQUEST_METHOD'] != 'POST' ? ' style="display: none;"' : '') . '>' . write_review_form() . '</div>';
    }
    if ($item->reviews > 0) {
        echo '<div class="text-tit" style="margin-top: 15px;">Reviews: ' . (($rev_rest = $item->reviews - 3) > 0 ? '<a href="' . $item->reviews_link . '" class="nice_a">(see other ' . $rev_rest . ' reviews)</a>' : '') . '</div>';
        foreach (reviews_custom(array('store' => $item->ID, 'show' => '', 'orderby' => 'date desc', 'max' => 3)) as $review) {
            echo '<article class="array_item">

<div class="table">

<div class="left">
<img src="' . user_avatar($review->user_avatar) . '" alt="" style="width: 60px; height: 60px;" />
<span class="rating"><span style="width:' . $review->stars * 16 . 'px;"></span></span>
</div>

<div class="right">
<div class="title">' . $review->user_name . '</div>
<div class="time">Added ' . date('m/d/Y', $wdate = strtotime($review->date)) . ', ' . timeago($wdate, 'seconds') . ' ago</div>
<div class="description">' . $review->text . '</div>
</div>

</div>

</article>';
        }
    }
    if (searched_type() === 'products') {
Example #4
0
function posts_list_old($posts, $discussions = null, $options)
{
    $options['enable_quality_rank'] = $options['enable_quality_rank'] === false ? false : true;
    $options['quality_level'] = isset($options['quality_level']) ? $options['quality_level'] : 0;
    $options['mode'] = isset($options['mode']) ? $options['mode'] : 'forum';
    echo '<input type="hidden" id="debug_input" />';
    foreach ($posts as $i => $post) {
        /* Shall we display any discussion splits before the post? */
        $display_discussions = array();
        foreach ($discussions as $key => $discussion) {
            if ($discussion['timestamp'] <= $post['timestamp']) {
                $display_discussions[] = $discussion;
                unset($discussions[$key]);
            }
        }
        if (count($display_discussions) > 0) {
            discussions_list_splits($display_discussions);
        }
        /* Shall we hide this post, due to low quality? */
        $low_quality = $post['quality_level'] >= 0 && ($i > 0 && $options['enable_quality_rank'] && $post['quality_rank'] < $options['quality_level'] - 0.4 ? true : false);
        $low_quality = false;
        if (in_array('private_gb', $post['flags'])) {
            echo '<h5 class="private_header">Privat inlägg</h5>' . "\n";
            if ($_SESSION['login']['id'] != $post['author'] && $_SESSION['login']['id'] != $options['gb_recipient']) {
                continue;
            }
        }
        echo '<!-- Post #' . $post['post_id'] . ' by ' . $post['username'] . ' at ' . date('Y-m-d H:i:s', $post['timestamp']) . '-->' . "\n";
        echo '<a name="post_' . $post['post_id'] . '_anchor"></a>' . "\n";
        if (in_array('removed', $post['flags'])) {
            echo '<div class="removed_post">' . "\n";
            echo '<h2>Borttaget inlägg, skrevs ' . fix_time($post['timestamp']) . ' av <a href="/traffa/profile.php?id=' . $post['author'] . '">' . $post['username'] . '</a></h2>' . "\n";
            echo '</div>' . "\n";
            $displayed_posts[] = $post['post_id'];
            continue;
        }
        if ($low_quality) {
            echo '<div class="low_quality">';
        }
        echo '<div class="post" id="post_' . $post['post_id'] . '"';
        if (login_checklogin() && strpos($post['content'], $_SESSION['login']['username'])) {
            echo ' style="background: #f9cc88;"';
        }
        echo '>' . "\n";
        echo '<div class="author">' . "\n";
        if ($low_quality) {
            echo 'Detta inlägg har lägre kvalitét än vad skaparen av diskussionen vill ha.';
        } elseif ($post['image'] == 1 || $post['image'] == 2) {
            echo user_avatar($post['author']) . "\n";
        }
        echo '</div>' . "\n";
        echo '<div class="date_time">Skrevs ' . fix_time($post['timestamp']) . '</div>' . "\n";
        echo '<div class="author_text"><a href="/traffa/profile.php?id=' . $post['author'] . '">' . $post['username'] . '</a>';
        echo ($post['gender'] == 'm' ? ', pojke' : ($post['gender'] == 'f' ? ', flicka' : '')) . ' ' . date_get_age($post['birthday']);
        if (strlen($post['spot']) > 0) {
            echo ' från ' . $post['spot'];
        }
        echo '</div>';
        if ($post['userlevel'] >= 3) {
            echo '<img class="badge" src="' . IMAGE_URL . 'forum/ordningsvakt.png" alt="" />';
        }
        if ($post['lastaction'] > time() - 600) {
            echo '<img class="badge" src="' . IMAGE_URL . 'forum/online.png" alt="" />';
        }
        echo '<div id="post_content_' . $post['post_id'] . '" class="' . ($low_quality ? 'low_quality_content' : 'content') . '">' . "\n";
        $options_markup['post_id'] = $post['post_id'];
        $options_markup['context'] = 'forum';
        echo setsmilies(markup_parse($post['content'], $options_markup));
        if (strlen($post['forum_signature']) > 0) {
            echo '<div class="signature">' . $post['forum_signature'] . '</div>' . "\n";
        }
        echo '</div>' . "\n";
        echo '<div class="controls">' . "\n";
        if (login_checklogin()) {
            $control_buttons['answer'] = '<input type="button" class="post_answer_button" id="post_answer_button_' . $post['post_id'] . '_' . $post['username'] . '" value="[Svara]" />';
            $control_buttons['quote'] = '<input type="button" class="post_quote_button" id="post_quote_button_' . $post['post_id'] . '_' . $post['username'] . '" value="[Citera]" />';
            $control_buttons['history'] = '<input type="button" class="post_history_button" id="post_history_button_' . $post['post_id'] . '_' . $post['username'] . '" value="[Historik]" />';
            $control_buttons['delete'] = '<input type="button" class="post_delete_button" id="post_delete_button_' . $post['post_id'] . '_' . $post['username'] . '" value="[Ta bort]" />';
            $control_buttons['censor'] = '<input type="button" class="post_censor_button" id="post_censor_button_' . $post['post_id'] . '_' . $post['username'] . '" value="[Censurera]" />';
            $control_buttons['addition'] = '<input type="button" class="post_addition_button" id="post_addition_button_' . $post['post_id'] . '_' . $post['username'] . '" value="[Tillägg]" />';
            $control_set['forum'] = array('answer', 'quote');
            $control_set['guestbook'] = array('answer', 'quote', 'history');
            $control_set['admin'] = array('delete', 'censor', 'addition');
            foreach ($control_set[$options['mode']] as $button) {
                echo $control_buttons[$button] . "\n";
            }
            if (posts_admin_check($post)) {
                foreach ($control_set['admin'] as $button) {
                    echo $control_buttons[$button] . "\n";
                }
            } elseif ($post['author'] == $_SESSION['login']['id']) {
                echo $control_buttons['addition'];
            }
        }
        echo '</div>' . "\n";
        echo '<div class="post_addition" id="post_addition_' . $post['post_id'] . '">' . "\n";
        echo '	<textarea id="post_addition_content_' . $post['post_id'] . '" rows="3" cols="50"  ></textarea>' . "\n";
        echo '	<button class="button_30" id="post_addition_submit_' . $post['post_id'] . '" value="post_addition_' . $post['post_id'] . '">Spara</button>' . "\n";
        echo '</div>';
        echo '</div>' . "\n";
        if ($low_quality) {
            echo '</div>' . "\n";
        }
        echo "\n\n";
        $displayed_posts[] = $post['post_id'];
    }
    if (login_checklogin()) {
        /* Remove all notices and answer notices for read posts */
        $query = 'DELETE FROM notices WHERE post_id IN("' . implode('", "', $displayed_posts) . '") AND user_id = "' . $_SESSION['login']['id'] . '"';
        mysql_query($query) or die(report_sql_error($query, __FILE__, __LINE__));
    }
    /* List the remaining discussions */
    if (count($discussions) > 0) {
        discussions_list_splits($discussions);
    }
}
Example #5
0
</div>

<div class="right">

<ul>

<?php 
if ($me = me()) {
    ?>
<li class="user-menu">
<a href="<?php 
    echo tlink('user/edit-profile');
    ?>
"><img src="<?php 
    echo user_avatar($me->Avatar);
    ?>
" alt="" /><span><?php 
    echo $me->Name;
    ?>
</span></a>
<ul>
<li><a href="<?php 
    echo tlink('user/edit-profile');
    ?>
" class="profile">My Profile</a></li>
<li><a href="<?php 
    echo tlink('user/wall');
    ?>
" class="wall">My Wall</a></li>
<li><a href="<?php 
Example #6
0
                                            </td>
                                        </tr>
                                    </table>
                                </div>
                            </div>

                            <div id="tab2" class="tab">
                                <div class="tab-container">
                                    <form action="/model/accountModel.php" method="post">
                                        <table>
                                            <tr>
                                                <td class="user-info-section">Avatar</td>
                                                <td colspan="2">
                                                    <div class="user-avatar-container">
                                                        <?php 
echo user_avatar($row['client_idclient'], $row['client_gender']);
?>
                                                        <input type="file" name="nom" />
                                                    </div>
                                                    <br />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="user-info-section">Email</td>
                                                <td colspan="2">
                                                    <?php 
echo '<input type="email" id="user-email" name="user_email" value="' . $row['client_mail'] . '" placeholder="*****@*****.**" />';
?>
                                                </td>
                                            </tr>
                                            <tr>
Example #7
0
                                    <center><?php 
echo __('Welcome', 'admin_theme');
?>
,<br/> <?php 
echo current_user('user-name');
?>
<span><i class="caret"></i></span></center>


                                </div>
                            </a>
                            <ul class="dropdown-menu">
                                <!-- User image -->
                                <li class="user-header bg-light-blue">
                                    <div class="img-circle avatar-div"><?php 
echo user_avatar(current_user('user-id'), '', 'avatar-img');
?>
</div>
                                    <p>
                                        <?php 
echo current_user('user-name');
?>
                                        <small><?php 
echo current_user('user-firstname') . ' ' . current_user('user-lastname');
?>
</small>
                                    </p>
                                </li>                                
                                <!-- Menu Footer-->
                                <li class="user-footer">
                                    <div class="pull-left">
Example #8
0
<?php

echo '<div class="widget widget_reviews' . (!$mobile_view ? ' mobile_view' : '') . '">';
if (!empty($title)) {
    echo '<h2>' . $title . '</h2>';
}
echo '<ul class="list">';
foreach (reviews_custom(array('orderby' => !empty($order) ? $order : '', 'max' => !empty($limit) ? $limit : 10, 'show' => '')) as $id) {
    echo '<li><img src="' . user_avatar($id->user_avatar) . '" alt="" />
  <div>By <b>' . htmlsc($id->user_name) . '</b> for <a href="' . $id->store_link . '">' . $id->store_name . '</a>
  <p>' . $id->text . '</p>
  </div>
  </li>';
}
echo '</ul>
</div>';