Example #1
0
 static function PostAttachments($check_attached = false, $tpl_tag = null)
 {
     static $attached = array();
     wpfb_loadclass('File', 'Category');
     $pid = WPFB_Core::GetPostId();
     $real_content = did_action('wp_print_scripts') > 0;
     if ($pid == 0 || $check_attached && !empty($attached[$pid])) {
         return '';
     }
     if ($real_content) {
         $attached[$pid] = true;
     }
     $files = WPFB_File::GetAttachedFiles($pid);
     return self::genFileList($files, $tpl_tag);
 }
Example #2
0
    if (isset($result['error']) && $result['error']) {
        ?>
<div id="message" class="updated fade"><p><?php 
        echo $result['error'];
        ?>
</p></div><?php 
        $file = new WPFB_File($_POST);
    } else {
        // success!!!!
        $file_id = $result['file_id'];
        if ($action != 'addfile') {
            $file = null;
        }
    }
}
$post_attachments = $post_id > 0 ? WPFB_File::GetAttachedFiles($post_id, true) : array();
if ($action != 'editfile' && (!empty($post_attachments) || $manage_attachments)) {
    ?>
	<form action="<?php 
    echo add_query_arg(array('action' => 'change-order'));
    ?>
" method="post">	
	<h3 class="media-title"><?php 
    echo $post_title ? sprintf(__('Files attached to <i>%s</i>', 'wp-filebase'), $post_title) : __('Files', 'wp-filebase');
    ?>
</h3>
	<div id="media-items">
	<?php 
    if (empty($post_attachments)) {
        echo "<div class='media-item'>", __('No items found.'), "</div>";
    } else {
Example #3
0
 static function PostAttachments($check_attached = false, $tpl_tag = null)
 {
     static $attached = array();
     wpfb_loadclass('File', 'Category');
     $pid = WPFB_Core::GetPostId();
     if ($pid == 0 || $check_attached && !empty($attached[$pid]) || count($files = WPFB_File::GetAttachedFiles($pid)) == 0) {
         return '';
     }
     $attached[$pid] = true;
     return self::genFileList($files, $tpl_tag);
 }