public function action_unflag($avatar_id) { if (Helper_Flag::item_flagged($avatar_id, 'avatar')) { $item_type = ORM::factory('itemtype')->where('name', '=', 'avatar')->find(); $flag = ORM::factory('flag')->where('item_type_id', '=', $item_type->id)->where('item_id', '=', $avatar_id)->find(); if ($flag->loaded()) { $flag->delete(); Message::set(Message::SUCCESS, 'Avatar successfully un-flagged.'); } } Request::instance()->redirect('admin/avatars'); }
public function action_unflag() { $this->auto_render = false; $comment_id = $_POST['commentID']; if (Helper_Flag::item_flagged($comment_id, 'comment')) { $item_type = ORM::factory('itemtype')->where('name', '=', 'comment')->find(); $flag = ORM::factory('flag')->where('item_type_id', '=', $item_type->id)->where('item_id', '=', $comment_id)->find(); if ($flag->loaded()) { $flag->delete(); //Message::set(Message::SUCCESS, 'Comment successfully un-flagged.'); } } //Request::instance()->redirect('admin/comments'); }
<div class="avatar photo<?php echo $avatar->avatarlock->loaded() ? ' lock' : ''; echo ($key + 1) % 3 == 0 ? ' last' : ''; ?> "> <div class="thumb_container"> <div class="avatar_thumb"><?php echo HTML::image(Helper_Photos::get($avatar, 'medium', TRUE)); ?> </div> <div class="frame"><?php echo html::anchor('admin/avatars/view/' . $avatar->id, $avatar->user->display_name); ?> </div> <?php if (Helper_Flag::item_flagged($avatar->id, 'avatar')) { ?> <div class='flag'></div> <?php } ?> </div> <div class="details-container"> <h2><?php echo html::anchor('admin/avatars/view/' . $avatar->id, $avatar->user->display_name); ?> </h2> <p> <?php echo date('F d, Y', strtotime($avatar->created)); ?>
<h1>Now Moderating:</h1> <div class="detail_container"> <div class="photo_container"> <div class="photo"> <div class="inner"> <div class="photo_img"> <?php echo html::image(Helper_Photos::get($photo, 'medium', TRUE)); ?> <?php $flagged = Helper_Flag::item_flagged($photo->id, 'photo'); ?> </div> </div> </div> <div class="cap"> <div class="text"> <p>Photo by: <?php echo Helper_Account::get_public_account_link($photo->user); ?> </p> <p>Username: <?php echo Helper_Account::get_account_username($photo->user); ?> </p> <p>Age: <?php echo Helper_Account::get_account_age($photo->user); ?> </p> <p>E-Mail: <?php echo Helper_Account::get_account_email($photo->user);
<div class="photo<?php echo $photo->lock->loaded() ? ' lock' : ''; echo ($key + 1) % 2 == 0 ? ' last' : ''; ?> "> <div class="thumb_container"> <div class="thumb" style="background-image: url('<?php echo addcslashes(Helper_Photos::get($photo, 'medium'), "'"); ?> ') "></div> <div class="frame"><?php echo html::anchor('admin/photos/view/' . $photo->id, $photo->name); ?> </div> <?php if (Helper_Flag::item_flagged($photo->id, 'photo')) { ?> <div class='flag'></div> <?php } ?> </div> <div class="details-container"> <h2><?php echo html::anchor('admin/photos/view/' . $photo->id, $photo->name); ?> </h2> <p> <?php echo date('F d, Y', strtotime($photo->created)); ?>
<?php $comment_mail_options = Helper_SendEmail::get_comment_options(); foreach ($captions as $key => $caption) { $class = $key % 2 == 0 ? "odd" : "even"; ?> <div class="comment <?php echo $class; ?> mod_caption"> <div class="mod_buttons"> <div class="button_reject"><?php echo html::anchor('#', 'Reject', array("id" => "caption" . $caption->id)); ?> </div> <?php $flagged = Helper_Flag::item_flagged($caption->id, 'caption'); if ($flagged) { echo '<div class="button_unflag">'; echo html::anchor('admin/btcomments/unflag/' . $caption->id, 'Un-Flag'); echo '</div>'; } else { echo '<div class="button_flag">'; echo html::anchor('admin/btcomments/flag/' . $caption->id, 'Flag'); echo '</div>'; } ?> <div class="button_approve"><?php echo html::anchor('admin/btcomments/approve/' . $caption->id, 'Approve'); ?> </div>
<?php $comment_mail_options = Helper_SendEmail::get_comment_options(); foreach ($comments as $key => $comment) { $class = $key % 2 == 0 ? "odd" : "even"; ?> <div class="comment <?php echo $class; ?> mod_comment"> <div class="mod_buttons"> <div class="button_reject"><?php echo html::anchor('#', 'Reject', array("id" => "comment" . $comment->id)); ?> </div> <?php $flagged = Helper_Flag::item_flagged($comment->id, 'comment'); if ($flagged) { echo '<div class="button_unflag">'; echo html::anchor('admin/comments/unflag/' . $comment->id, 'Un-Flag'); echo '</div>'; } else { echo '<div class="button_flag">'; echo html::anchor('admin/comments/flag/' . $comment->id, 'Flag'); echo '</div>'; } ?> <div class="button_approve"><?php echo html::anchor('admin/comments/approve/' . $comment->id, 'Approve'); ?> </div>