function vp_edd_download_columns($download_columns)
{
    $downloads = array('downloads' => __('Downloads', 'vp_edd_fd'));
    $download_columns = array_push_after($download_columns, $downloads, 'sales');
    return $download_columns;
}
예제 #2
0
파일: lib.php 프로젝트: philum/cms
function msql_modif($dr, $nod, $defs, $dfb, $act, $n)
{
    if (!$dr) {
        $dr = 'users';
    }
    $r = msql_read_b($dr, $nod, '', '', $dfb);
    if ($act == 'one') {
        $r[$n] = $defs;
    } elseif ($act == 'shot') {
        $r[$n][$dfb ? $dfb : 0] = $defs;
    } elseif ($act == 'del') {
        unset($r[$n]);
    } elseif ($act == 'val') {
        $r[$n][$dfb] = $defs;
    } elseif ($act == 'push') {
        $r[] = $defs;
    } elseif ($act == 'arr') {
        $r = $defs;
    } elseif ($act == 'after') {
        $r = array_push_after($r, $defs, $n);
    } elseif (is_numeric($n)) {
        foreach ($r as $k => $v) {
            if ($v[$n] == $defs[$n] && $v[$n]) {
                //refer
                if ($act == 'mdf') {
                    $r[$k] = $defs;
                }
            }
        }
    } elseif ($act == 'add') {
        foreach ($defs as $k => $v) {
            //batch
            if ($n == 'mdf') {
                $rb[$k] = $v;
            } else {
                $r[] = $v;
            }
        }
        if ($rb) {
            $r = $rb;
        }
    }
    if ($r[0]) {
        $r = msq_reorder($r);
    }
    if ($ra) {
        $ra += $r;
    } else {
        $ra = $r;
    }
    save_vars('msql/' . $dr . '/', $nod, $ra);
    //need auth
    //db_write(db_f($dr,$nod),$r);
    return $ra;
}
예제 #3
0
파일: modules.php 프로젝트: nopticon/tts
 public final function __($v, $p = '', $m = 'v')
 {
     $v = _array_keys($v);
     foreach ($v as $varname => $options) {
         if (strpos($varname, '*') !== false) {
             $subvar = str_replace('*', '', $varname);
             $varpos = $varname;
             foreach ($this->arg as $j => $k) {
                 if (preg_match('#' . preg_quote($subvar, '#') . '#', $j)) {
                     $varpos = array_push_after($v, array($j => $options), $varpos);
                 }
             }
             unset($v[$varname]);
         }
         if (strpos($varname, ':') !== false) {
             $_v = explode(':', $varname);
             array_push_after($v, array($_v[0] => $_v[1]), $varname);
             unset($v[$varname]);
         }
     }
     $a = w();
     foreach ($v as $varname => $options) {
         if (f($p)) {
             $varname = $p . '_' . $varname;
         }
         if (!is_array($options) || !isset($options['default'])) {
             if (is_array($options) && !count($options)) {
                 $options = '';
             }
             $options = array('default' => $options);
         }
         if (!isset($options['type'])) {
             $options['type'] = 'text';
         }
         switch ($options['type']) {
             case 'checkbox':
                 $a[$varname] = isset($_POST[$varname]) ? true : false;
                 break;
             default:
                 $hook_a = $m == 'v' ? array($this, 'v') : $m;
                 $a[$varname] = hook($hook_a, array($varname, $options['default']));
                 break;
         }
     }
     return $a;
 }
    function render_lambda_blog_grid($metadata, $homeblog = false)
    {
        global $wp_query;
        $theme_options = get_option('option_tree');
        #-----------------------------------------------------------------
        # assign home settings
        #-----------------------------------------------------------------
        $numberpost = isset($metadata['blog_length']) ? $metadata['blog_length'] : '-1';
        $blogcats = isset($metadata['only_category']) && is_array($metadata['only_category']) ? implode(",", $metadata['only_category']) : '';
        $post_not_in = isset($metadata['post_not_in']) && is_array($metadata['post_not_in']) ? $metadata['post_not_in'] : array();
        $post_not_in = array_push_after($post_not_in, get_option('sticky_posts'), 1);
        $mediaheight = !empty($metadata['blog_media_height']) ? $metadata['blog_media_height'] : 300;
        $mediawidth = !empty($metadata['blog_grid']) ? $metadata['blog_grid'] : 'span12';
        #-----------------------------------------------------------------
        # prepare blog query
        #-----------------------------------------------------------------
        $z = 1;
        $blogcount = 0;
        $args = array('posts_per_page' => $numberpost, 'post__not_in' => $post_not_in, 'cat' => $blogcats, 'paged' => get_query_var('paged') ? get_query_var('paged') : 1);
        #-----------------------------------------------------------------
        # execute query
        #-----------------------------------------------------------------
        query_posts($args);
        #-----------------------------------------------------------------
        # number of posts, we need this counter to close the row
        # if there are not enough items to fill the current grid
        #-----------------------------------------------------------------
        $number_of_posts = have_posts() ? sizeof($wp_query->posts) : 0;
        #-----------------------------------------------------------------
        # run through posts
        #-----------------------------------------------------------------
        if (have_posts()) {
            while (have_posts()) {
                the_post();
                global $more, $post;
                $more = isset($metadata['activate_blog_excerpt']) && $metadata['activate_blog_excerpt'] == 'on' ? 1 : 0;
                $bloggrid = isset($metadata['blog_grid']) ? $metadata['blog_grid'] : 'span4';
                $gridcount = array('span12' => '1', 'span4' => '3', 'span6' => '2', 'span3' => '4');
                ?>
 
            
            
            <?php 
                echo $z == 1 ? '<div class="row-fluid">' : '';
                ?>
                        
            <article <?php 
                post_class($bloggrid);
                ?>
 id="post-<?php 
                the_ID();
                ?>
">
                
                <div class="post-format span1 <?php 
                echo is_single() ? 'hidden' : '';
                ?>
">
		<?php 
                lambda_postformat_icon();
                ?>
        <?php 
                lambda_posted_on('compact');
                ?>
				</div>
                
             <div id="resume">  
                <header class="entry-header">
                   
                    <?php 
                if (isset($metadata['activate_blog_images']) && $metadata['activate_blog_images'] == 'on') {
                    ?>
                
                        <?php 
                    lambda_postformat_media(get_post_format(), true, $mediaheight, $mediawidth);
                    ?>
                    
                    <?php 
                }
                ?>
                    
                    <?php 
                if (isset($metadata['activate_blog_images']) && $metadata['activate_blog_images'] == 'on') {
                    ?>
                    
                        <?php 
                    if (has_post_thumbnail() && !post_password_required()) {
                        ?>
                
                            <div class="entry-thumbnail clearfix">
                            
                                <?php 
                        lambda_postformat_media('standard', true, $mediaheight, $mediawidth);
                        ?>
                                
                            </div><!-- entry-thumbnail -->
                        
                        <?php 
                    }
                    // post_password_required()
                    ?>
                    
                    <?php 
                }
                ?>
                    
                    <?php 
                $postlink = get_post_format() == 'link' ? esc_url(get_post_format_link_content()) : get_permalink();
                ?>
                    
                    <h4>
                        <a href="<?php 
                echo $postlink;
                ?>
" title="<?php 
                echo esc_attr(sprintf(__('Permalink to %s', 'delaware-theme'), the_title_attribute('echo=0')));
                ?>
" rel="bookmark"><?php 
                the_title();
                ?>
</a>
                    </h4>
                    
                </header>
                
                <div class="entry-content clearfix">
                    
                    <?php 
                /* only display continue reading on special post formats */
                if (get_post_format() != 'link' && get_post_format() != 'quote') {
                    if (isset($metadata['activate_blog_excerpt']) && $metadata['activate_blog_excerpt'] == 'on') {
                        $excerptlength = isset($metadata['blog_excerpt_length']) ? $metadata['blog_excerpt_length'] : $theme_options['excerpt_blog_length'];
                        echo excerpt_by_id($post->ID, $excerptlength, '', lambda_continue_reading_link(), $homeblog);
                    } else {
                        the_content(__('Lire la suite', 'delaware-theme') . '<i class="icon-angle-right"></i>');
                    }
                }
                /* show quote content */
                if (get_post_format() == 'quote') {
                    post_format_quote_content();
                }
                /* show chat content */
                if (get_post_format() == 'chat') {
                    post_format_chat_content();
                }
                ?>
                    
                </div>    
        		
                <?php 
                if (isset($metadata['activate_blog_meta']) && $metadata['activate_blog_meta'] == 'on') {
                    ?>
                
                <footer class="entry-meta">
                
					<?php 
                    if ('post' == get_post_type()) {
                        // Hide category and tag text for pages on Search
                        ?>
                        <?php 
                        /* translators: used between list items, there is a space after the comma */
                        $categories_list = get_the_category_list(__(', ', 'delaware-theme'));
                        if ($categories_list && lambda_categorized_blog()) {
                            ?>
                       
                        <?php 
                        }
                        // End if categories
                        ?>
            
                        <?php 
                        /* translators: used between list items, there is a space after the comma */
                        $tags_list = get_the_tag_list('', __(', ', 'delaware-theme'));
                        if ($tags_list) {
                            ?>
                        <span class="tags-links">
                            <i class="icon-tags"></i>
                        </span>
                        <?php 
                        }
                        // End if $tags_list
                        ?>
                    <?php 
                    }
                    // End if 'post' == get_post_type()
                    ?>
            
                    <?php 
                    if (!post_password_required() && (comments_open() || '0' != get_comments_number())) {
                        ?>
                    <span class="comments-link"><i class="icon-comment"></i><?php 
                        comments_popup_link(__('Leave a comment', 'delaware-theme'), __('1 Comment', 'delaware-theme'), __('% Comments', 'delaware-theme'));
                        ?>
</span>
                    <?php 
                    }
                    ?>
                        
            	</footer><!-- .entry-meta -->                
                
                <?php 
                }
                ?>
                </div>
            </article>
            
            <?php 
                /* increase blog item counter */
                $blogcount++;
                /* close row after we have filled up the row with items */
                echo $z == $gridcount[$bloggrid] || $blogcount == $number_of_posts ? '</div>' : '';
                /* reset our counter for next row */
                $z == $gridcount[$bloggrid] ? $z = 1 : $z++;
                /* loop is finished */
            }
        }
        /* show or hide pagination */
        if (!empty($metadata['activate_blog_pagination']) && $metadata['activate_blog_pagination'] == 'on') {
            lambda_content_nav('nav-below');
        }
        #-----------------------------------------------------------------
        # reset query
        #-----------------------------------------------------------------
        wp_reset_query();
    }