Current File : /home/users/barii/public_html/finansenl.com.pl/wodki/application/views/admin/blog.php |
<script>
function showup() {
document.getElementById("create_post").style.display = "block";
}
function remove(id) {
jConfirm('Czy na pewno chcesz usunać ?', 'Potwierdzenie', function(r) {
if( r == true ) {
$.ajax({
type:"GET",
url:"/admin/blog/delete/"+id,
cache:false,
success:function(rsponse)
{
jAlert('Blog został usunięty!', 'Podsumowanie', function() {
location.href = '/admin/blog';
});
}
});
}
});
}
function selection(user, type_id, type) {
$.ajax({
type:"GET",
url:"/profile/selection/"+user+"/"+type_id+"/"+type,
cache:false,
success:function(rsponse)
{
if( rsponse != "ban" ) {
$(".selection"+type_id).html(rsponse);
$("#selection_answer").html('');
} else if( rsponse == "ban" ) {
$("#selection_answer").html("<p><strong><?php echo __t('Już to zaznaczałeś!'); ?></strong></p>");
}
}
});
return false;
}
$(document).ready(function(){
$(".example7").colorbox({width:"565px", height:"640px", iframe:true});
$(".example7").bind('cbox_cleanup', function(){
location.href = '/admin/blog';
});
//$('#gallery a').colorbox({rel:'group1'})
});
</script>
<div id="page">
<!-- start message-blue -->
<?php if (isset($message_ok)):?>
<div id="message-blue">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="blue-left"><?php echo $message_ok; ?> </td>
<td class="blue-right"><a class="close-blue"><?php echo HTML::image('static/images/table/icon_close_blue.gif');?></a></td>
</tr>
</table>
</div>
<!-- end message-blue -->
<?php endif;?>
<!-- start message-red -->
<?php if (isset($message)):?>
<div id="message-red">
<table border="0" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td class="red-left">
<?php echo $message;?>
</td>
<td class="red-right"><a class="close-red"><?php echo HTML::image('static_back/images/table/icon_close_red.gif');?></a></td>
</tr>
</table>
</div>
<?php endif;?>
<?php echo Message::render(); ?>
<a href="/profile/<?php echo aurora::prevProfile($user->id); ?>" class="prev-profile"><img src="./static/images/medialni_451.jpg" alt=""/></a>
<?php foreach( ORM::Factory('advertisement')->where('label','=','TOP')->order_by(DB::expr('RAND()'))->limit(1)->find_all() as $advert ) : ?>
<a target="_blank" class="promo2" href="<?php echo $advert->link; ?>"><img class="button_top" src="/uploads/advertisement/<?php echo $advert->thumb; ?>" alt="<?php echo $advert->title; ?>" title="<?php echo $advert->title; ?>"/></a>
<?php endforeach; ?>
<a href="/profile/<?php echo aurora::nextProfile($user->id); ?>" class="next-profile"><img src="./static/images/medialni_450.jpg" alt=""/></a>
<div class="line" style="width: 98%"></div>
<div id="content">
<?php echo aurora::partial('admin_sider', $user); ?>
<div class="main">
<img src="./static/images/medialni_455.jpg" class="ico_main" alt=""/><h1>Blog</h1></div>
<form action="/admin/blog" method="post" enctype="multipart/form-data">
<fieldset class="register">
<input type="text" style="width: 420px; border-right: none;" name="register_description" value="O czym chcesz dziś napisać ?" onclick="this.value=''"/>
<a href="#" onclick="showup(); return false;" class="add-photo-file"><img src="./static/images/medialni_469.jpg" alt=""/></a>
<input type="submit" value="Publikuj" />
</fieldset>
<div id="create_post" style="display: none;">
<span class="col1" style="width: 94%; float: left; margin-left: 280px;">
<label for="account">Wybierz zdjęcie:</label>
<input type="file" name="obraz" style="width: 100%" /><br clear="both"/>
</span>
</div>
</form>
<div class="main_content">
<?php if( $blogs->count() == 0 ) : ?>
<p><?php echo __t('Nie prowadzisz jeszcze bloga...'); ?></p>
<?php else: ?>
<?php foreach( $blogs as $blog ) : ?>
<div class="blog">
<h2>
<a href="/admin/blog/edit/<?php echo $blog->id; ?>"><img src="./static/images/edit.png" alt=""/></a>
<a href="#" onclick="remove('<?php echo $blog->id; ?>'); return false;" class="confirm_button"><img src="./static/images/medialni_402.jpg" alt=""/></a>
<?php echo $blog->subject; ?>
</h2>
<em><?php echo date('H:i', $blog->date); ?> | <?php echo date('d m Y', $blog->date); ?></em>
<p>
<?php
echo aurora::putShortDescription( $blog->description );
?>
<br clear="both"/>
<img src="/uploads/blog/thumb_<?php echo $blog->thumb; ?>" alt=""/>
</p>
<div class="blog-answers">
<span style="height: 27px;">
<p style="width: 97%; margin-top: 5px; ">
<a href="#" onclick="selection('<?php echo $user->id; ?>','<?php echo $blog->id; ?>','blog'); return false;"><img src="./static/images/medialni_345.jpg" alt=""/> [<em style="float: none;" class="selection<?php echo $blog->id; ?>"><?php echo aurora::getSelectionCount( $blog->id, 'blog'); ?></em>] Mega zaznaczeń </a>
<a href="http://<?php echo Kohana::config('site.domain'); ?>/profile/blog_comment_add/<?php echo $user->id; ?>/<?php echo $blog->id; ?>" class="example7" style="margin-left: 30px;"><img src="./static/images/medialni_347.jpg" alt=""/> Dodaj komentarz </a>
<a href="javascript: show_comments('<?php echo $blog->id; ?>');" style="float: right; "><img src="./static/images/medialni_349.jpg" alt=""/> [<?php echo Model_Blog_Comment::getCount($blog->id); ?>] Komentarzy » </a>
</p>
</span>
<a href="/profile/blog/<?php echo $user->id; ?>/<?php echo $blog->id; ?>" class="button" style="margin: 0px;">Czytaj więcej »»</a>
<!--
<div class="show_comments_<?php echo $blog->id; ?>">
<?php foreach( ORM::Factory('blog_comment')->where('blog_id','=',$blog->id)->find_all() as $comment ): ?>
<span>
<img class="avatar" src="/uploads/user/images/thumb_<?php echo $comment->user->logo; ?>" alt=""/>
<p>
<strong><?php echo $comment->user->firstname; ?> <?php echo $comment->user->lastname; ?></strong>: <?php echo $comment->description; ?><br/>
<em><?php echo date('d m Y H:i', $comment->date); ?> | </em> <a href="#" onclick="selection('<?php echo $user->id; ?>','<?php echo $comment->id; ?>','blog_comment'); return false;"> <strong>Mega</strong> </a> <img src="./static/images/medialni_345.jpg" alt=""/> <a href="#" onclick="return false;">[<em style="float: none;" class="selection<?php echo $comment->id; ?>"><?php echo aurora::getSelectionCount( $comment->id, 'blog_comment'); ?></em>] osoby</a>
</p>
</span>
<?php endforeach; ?>
</div>
//-->
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>
</div>
</div>
</div>
</div>
<script>
<?php if( !empty( $toogle ) ) echo $toogle; ?>
<?php if( !empty( $toogle2 ) ) echo $toogle2; ?>
$("#showup").click(function () {
$("#create_post").toggle("slow");
});
function show_comments(id) {
$(".show_comments_"+id).toggle("slow");
}
</script>