Beispiel #1
0
function feedback_display_specific_headline($id, $div_id, $source_div = NULL, $expanded = FALSE, $display_user = TRUE, $div_prefix = "")
{
    // echo "<br />feedback_display_specific_headline($id, $div_id, $source_div, $expanded, $display_user, $div_prefix)";
    $div_prefix = str_replace(" ", "_", $div_prefix);
    $div_prefix = str_replace("ö", "o", $div_prefix);
    $div_prefix = str_replace("å", "a", $div_prefix);
    $div_prefix = str_replace("ä", "a", $div_prefix);
    if ($div_id == NULL && $source_div == NULL) {
        $div_id = $div_prefix . "_feedback_post_" . $id;
    } else {
        if ($div_id == NULL) {
            $div_id = $source_div . "_feedback_child_" . $id;
        }
    }
    if ($source_div == NULL) {
        $source_div = $div_id;
    }
    // echo "<p>'$div_id' FROM '$source_div'</p>";
    $sql = "SELECT id, user, checked_in, resolved, accepted, not_implemented, created, text, subject, plusones, nick, email, url, flattrID\n\tFROM " . PREFIX . "feedback\n\tWHERE id=" . sql_safe($id) . ";";
    // echo $sql;
    if ($data = mysql_query($sql)) {
        if ($d = mysql_fetch_array($data)) {
            if ($d['not_implemented'] != NULL) {
                $extra_class = "feedback_not_implemented";
            } else {
                if ($d['resolved'] != NULL) {
                    $extra_class = "feedback_resolved";
                } else {
                    if ($d['checked_in'] != NULL) {
                        $extra_class = "feedback_checked_in";
                    } else {
                        if ($d['accepted'] != NULL) {
                            $extra_class = "feedback_accepted";
                        } else {
                            $extra_class = "new";
                        }
                    }
                }
            }
            if ($expanded) {
                $click_operation = "colapse";
            } else {
                $click_operation = "expand";
            }
            echo "<div class=\"feedback_list_line\" id=\"" . $div_id . "\">\n\t\t\t\t<div class=\"row {$extra_class}\">\n\t\t\t\t\t<div class=\"col-sm-8 feedback_headline\">";
            if ($display_user) {
                echo "<a href=\"#\" onclick=\"feedback_operation('" . $click_operation . "', " . $id . ", '" . $div_id . "', '" . $source_div . "&amp;div_prefix=" . $div_prefix . "'); return false;\">";
            } else {
                echo '<a href="' . SITE_URL . '/?p=feedback&id=' . $id . '">';
            }
            echo "<strong>";
            if ($d['subject'] != "") {
                echo $d['subject'];
            } else {
                echo substr($d['text'], 0, 128);
            }
            echo "</strong>";
            echo "</a>\n\t\t\t\t\t</div>";
            if ($display_user) {
                echo "<div class=\"col-sm-2 feedback_author\">\n\t\t\t\t\t\t\t" . feedback_get_author_link($id) . "\n\t\t\t\t\t\t</div>";
            }
            echo "<div class=\"col-sm-2 small smalldate feedback_time\">\n\t\t\t\t\t\t<a href=\"" . SITE_URL . "?p=feedback&amp;id=" . $id . "\">" . date("Y-m-d H:i", strtotime($d['created'])) . "</a>\n\t\t\t\t\t</div>\n\t\t\t\t</div>";
            //Display body
            if ($expanded) {
                feedback_display_body($id);
                //Visa status och sådär
                feedback_display_bottom($id, $source_div);
                //Bottom with comments
                // echo '<div class="panel-footer">';
                comments_show_comments_and_replies($id, "feedback");
                // echo '</div><!-- panel-footer884 -->';
            }
            echo "</div>";
        }
    }
}
Beispiel #2
0
function user_display_profile($user_id)
{
    echo '<h1>' . user_get_name($user_id) . '</h1>';
    $user_description = user_get_description($user_id);
    $user_image = user_get_avatar_path($user_id, 180);
    if (login_check_logged_in_mini() > 0 && isset($_POST['profile_edit']) && $user_id === $_SESSION[PREFIX . 'user_id']) {
        //Show edit form
        //TODO: Image
        echo '<form method="post">
			<div class="form-group">
				<label for="description_text">' . _("Profile text") . '</label>
				<textarea class="form-control" id="description_text" name="description">' . $user_description . '</textarea>
			</div>
			<div class="form-group">
				<label for="avatar_change_div">' . _("Profile image (avatar)") . '</label>
				<div id="avatar_change_div">
					<p>To change your avatar, <a href="http://gravatar.com">go to Gravatar</a>, log in and upload desired picture!</p>
					<p>Current picture being used for ' . user_get_email($user_id) . ' is:</p>
					<img class="avatar" src="' . $user_image . '">
				</div>
			</div>
			<input type="submit" class="btn btn-success" name="profile_save" value="' . _("Save") . '">
		</form>';
    } else {
        echo '
		<div class="row profile">
			<div class="col-md-2">
				<img class="avatar" src="' . $user_image . '">
			</div>
			<div class="col-md-10">
				<p>' . $user_description . '</p>
			</div>
		</div>';
        if (login_check_logged_in_mini() > 0 && $user_id == $_SESSION[PREFIX . 'user_id']) {
            //edit button
            echo '
			<div class="row">
				<div class="center">
					<form method="post">
						<input type="submit" class="btn btn-default" name="profile_edit" value="' . _("Edit profile") . '">
					</form>
				</div>
			</div>
			';
        }
        if (function_exists('user_profile_custom_content')) {
            user_profile_custom_content($user_id);
        }
        echo '<div class="col-lg-12">';
        comments_show_comments_and_replies($user_id, "user");
        echo "</div>";
    }
}