function print_content($data)
{
    $fout = '
<div id="article">
    <div style="float:left;">
        <img src="/img/data/big/' . $data["img"] . '" class="img" />
    </div>
    <div class="date">' . date("d.m.Y", $data["date"]) . ' at ' . date("H:i", $data["date"]) . '</div>
    <div style="clear:right;"></div>
    <div class="text">
        ' . $data["text"] . '
    </div>
</div>
<div style="clear:both;height: 10px;"></div>
<center>' . print_comments($_SERVER["REQUEST_URI"]) . '</center><br/>';
    return $fout;
}
Exemplo n.º 2
0
function print_comments($has_reply, $book, $base_uri, $user_id=0, $level=0) {

	if (!$has_reply) return $has_reply;
	$indent_px = 50;
	$indent = ($indent_px * $level);
	$count = 0;

	foreach ($has_reply as $reply):

		if (!$reply->is_live) continue;
		$reply_version = $reply->versions[$reply->version_index];
		echo '<div class="comment level-'.$level.'" style="margin-left:'.$indent.'px"><a name="comment-'.$reply_version->version_id.'"></a>'."\n";
		if (!empty($reply_version->title)) echo '<p class="comment_title">'.$reply_version->title.'</p>'."\n";
		echo nl2br(trim($reply_version->content));
		if (!empty($reply_version->url)) {
			echo '<a href="'.$reply_version->url.'" target="_blank" title="Feature coming soon: media displayed inline">'.$reply_version->url.'</a>';
		}
		echo '<p class="comment_attrib">';
		echo 'Posted on '.date('j F Y, g:i a', strtotime($reply_version->datetime));
		echo ' by ';
		if (isset($reply_version->attribution->fullname) && !empty($reply_version->attribution->fullname)) {
			echo $reply_version->attribution->fullname;
		} elseif (isset($reply_version->user) && !empty($reply_version->user)) {
			echo ((!empty($reply_version->user->fullname))?$reply_version->user->fullname:'(Missing name)');
		} else {
			echo ((!empty($reply_version->fullname))?$reply_version->fullname:'(Missing name)');
		}
		echo ' &nbsp;<span style="font-size:smaller;">| &nbsp;';
		echo '<a href="'.$base_uri.$reply->slug.'" title="Permalink" onclick="return commentCheckPermalink(this);">Permalink</a>';
		echo '</span>';
		echo '</p>'."\n";
		echo '</div><!--comment-->'."\n";

		print_comments(@$reply_version->has_replies, $book, $base_uri, $user_id, ($level+1));

		$count++;

	endforeach;

	return $count;

}
Exemplo n.º 3
0
        list($vinfo_name, $vinfo_url, $vinfo_email) = split("%", $_COOKIE['visitorinfo']);
    }
    $tpl = ereg_replace("<VINFO_NAME>", $vinfo_name, $tpl);
    $tpl = ereg_replace("<VINFO_URL>", $vinfo_url, $tpl);
    $tpl = ereg_replace("<VINFO_EMAIL>", $vinfo_email, $tpl);
    if ($cfgrow['token'] == 'T') {
        $tpl = ereg_replace("<TOKEN>", "<input type='hidden' name='token' value='" . $_SESSION['token'] . "' />", $tpl);
    } else {
        $tpl = ereg_replace("<TOKEN>", null, $tpl);
    }
    if (isset($_GET['showimage']) && $_GET['showimage'] != "") {
        $imageid = $_GET['showimage'];
    } else {
        $imageid = $image_id;
    }
    $image_comments = print_comments($imageid);
    $tpl = ereg_replace("<IMAGE_COMMENTS>", $image_comments, $tpl);
    if (isset($_GET['popup']) && $_GET['popup'] == "comment" and (!isset($_GET['x']) or $_GET['x'] != "save_comment")) {
        require_once 'includes/addons_lib.php';
        echo $tpl;
        exit;
    }
}
// End Images / Main site
$tpl = ereg_replace("<SITE_TITLE>", $pixelpost_site_title, $tpl);
$tpl = ereg_replace("<SUB_TITLE>", $pixelpost_sub_title, $tpl);
// ##########################################################################################//
// BROWSE STUFF
// ##########################################################################################//
if (isset($_GET['x']) && $_GET['x'] == "browse") {
    require_once "includes/functions_browse.php";
Exemplo n.º 4
0
function print_blog_entries($uid, $name, $date)
{
    print "<hr>\n";
    print "<h3>{$name}</h3>\n";
    $entries = get_blog_entries($uid, $date);
    foreach ($entries as $entry) {
        print "<h2>" . $entry["title"] . " - " . $entry["added"] . "</h2>\n";
        $content = get_blog_entry_content($entry["id"]);
        print $content . "\n\n";
        print_comments($entry["id"]);
    }
}
Exemplo n.º 5
0
    function print_comments($id)
    {
        $children = query($id);
        if (!empty($children)) {
            foreach ($children as $child) {
                $catsingle = fetch_single_val(POST_COMMENT, "`slno`='{$child['id']}'");
                ?>
                                                                             
                                                                              <!--start media-->  
                                                                              <div class="media">
                                                                                    <a href="javascript:;" class="pull-left">
                                                                                        <?php 
                $thmburl = "";
                if ($catsingle["user_id"] != "") {
                    $thmburl = BASEURL . "croplive.php?url=" . get_user_thumb($catsingle["user_id"]);
                } else {
                    $thmburl = BASEURL . get_anonymous_user_thumb();
                }
                ?>
                                                                                    <img alt="" src="<?php 
                echo $thmburl;
                ?>
" class="media-object">
                                                                                    </a>
                                                                                    <div class="media-body">
                                                                                            <div class="row">
                                                                                                <div class="col-md-12">
                                                                                                    <h4 class="media-heading"><?php 
                echo $catsingle["name"];
                ?>
<span>
                                                                                                    <?php 
                echo dateDiff($catsingle["date"]);
                ?>
 ago / 
                                                                                                    
                                                                                                    <?php 
                if ($_SESSION["userid"] == $catsingle["user_id"]) {
                    ?>
                                                                                                    <a href="javascript:;" class="font-red-flamingo" > Delete </a> / 
                                                                                                    <?php 
                }
                ?>
                                                                                                    
                                                                                                    <a href="javascript:;" onclick="$(this).closest('.row').next().slideToggle()"> Reply </a>
                                                                                                    </span>
                                                                                                    </h4>
                                                                                                    <p>
                                                                                                        <?php 
                echo nl2br($catsingle["message"]);
                ?>
                                                                                                    </p>
                                                                                                </div>
                                                                                            </div>
                                                                                            <div class="row"  style="display:none;">
                                                                                                <div class="col-md-12">
                                                                                                    <div class="post-comment">
                                                                                                            <hr>
                                                                                                            <h3>Leave a Comment</h3>
                                                                                                            <form role="form" method="post" action="">
                                                                                                                <div class="row">
                                                                                                                    <div class="col-md-6">
                                                                                                                        <input type="hidden" name="parent" value="<?php 
                echo $child['id'];
                ?>
" />
                                                                                                                        <div class="form-group">
                                                                                                                            <input type="text" name="name" required value="<?php 
                echo get_user_meta($_SESSION["userid"], "display_name");
                ?>
" placeholder="Name.." class="form-control">
                                                                                                                        </div>
                                                                                                                    </div>
                                                                                                                    <div class="col-md-6">
                                                                                                                        <div class="form-group">
                                                                                                                            <input type="text" name="email" required value="<?php 
                echo get_user_meta($_SESSION["userid"], "email");
                ?>
" placeholder="Email.."  class="form-control">
                                                                                                                        </div>
                                                                                                                    </div>
                                                                                                                    <div class="col-md-12">
                                                                                                                        <div class="form-group">
                                                                                                                            <textarea class="col-md-10 form-control" name="message" required rows="4" placeholder="Comment.." ></textarea>
                                                                                                                        </div>
                                                                                                                    </div>
                                                                                                                    <div class="col-md-12">
                                                                                                                        <button class="margin-top-20 btn blue" name="add_comment" type="submit">Post a Comment</button>
                                                                                                                    </div>
                                                                                                                </div>
                                                                                                            </form>
                                                                                                    </div>
                                                                                                </div>
                                                                                            </div>
                                                                                            <?php 
                print_comments($child['id']);
                ?>
                                                                                    </div>
                                                                                    
                                                                            </div>
                                                                            <!--end media--> 
                                                                            
                                                                <?php 
            }
        }
    }