当前位置: 首页>>代码示例>>PHP>>正文


PHP action::run方法代码示例

本文整理汇总了PHP中action::run方法的典型用法代码示例。如果您正苦于以下问题:PHP action::run方法的具体用法?PHP action::run怎么用?PHP action::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在action的用法示例。


在下文中一共展示了action::run方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_footer

function get_footer()
{
    ?>
    <!-- jQuery & Required Scripts -->
    <script src="//code.jquery.com/jquery-1.10.2.min.js"></script>
    
    <?php 
    if (!IS_SINGLE && PAGINATION_ON_OFF !== "off") {
        ?>
    <!-- Post Pagination -->
    <script>
        var infinite = true;
        var next_page = 2;
        var loading = false;
        var no_more_posts = false;
        $(function() {
            function load_next_page() {
                $.ajax({
                    url: "index.php?page=" + next_page,
                    beforeSend: function () {
                        $('body').append('<article class="loading-frame"><div class="row"><div class="one-quarter meta"></div><div class="three-quarters"><img src="./templates/<?php 
        echo ACTIVE_TEMPLATE;
        ?>
/loading.gif" alt="Loading"></div></div></article>');
                        $("body").animate({ scrollTop: $("body").scrollTop() + 250 }, 1000);
                    },
                    success: function (res) {
                        next_page++;
                        var result = $.parseHTML(res);
                        var articles = $(result).filter(function() {
                            return $(this).is('article');
                        });
                        if (articles.length < 2) {  //There's always one default article, so we should check if  < 2
                            $('.loading-frame').html('You\'ve reached the end of this list.');
                            no_more_posts = true;
                        }  else {
                            $('.loading-frame').remove();
                            $('body').append(articles);
                        }
                        loading = false;
                    },
                    error: function() {
                        $('.loading-frame').html('An error occurred while loading posts.');
                        //keep loading equal to false to avoid multiple loads. An error will require a manual refresh
                    }
                });
            }

            $(window).scroll(function() {
                var when_to_load = $(window).scrollTop() * 0.32;
                if (infinite && (loading != true && !no_more_posts) && $(window).scrollTop() + when_to_load > ($(document).height()- $(window).height() ) ) {
                    // Sometimes the scroll function may be called several times until the loading is set to true.
                    // So we need to set it as soon as possible
                    loading = true;
                    setTimeout(load_next_page,500);
                }
            });
        });
    </script>
    <?php 
    }
    ?>
    
    <!-- Dropplets Tools -->
    <?php 
    include './dropplets/tools.php';
    ?>
    
    <!-- User Footer Injection -->
    <?php 
    echo FOOTER_INJECT;
    ?>
    
    <!-- Plugin Footer Injection -->
    <?php 
    action::run('dp_footer');
}
开发者ID:roblarsen,项目名称:dropplets,代码行数:77,代码来源:functions.php

示例2: get_includes

function get_includes($location)
{
    extract($GLOBALS);
    // Default includes for the footer.
    if ($location == 'footer') {
        ?>
    <script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
    <script type="text/javascript">
        $(function(){
            $(document).on('click', '#pagination a',function(e) {
                e.preventDefault();
                var page_url=$(this).prop('href');
                
                $('#gallery').append('<div id="loading" class="animated flash"></div>');
                $('#gallery').load(page_url + ' #gallery');
                $('html, body').animate({
                    scrollTop: $("#gallery").offset().top
                }, 400);
                
            });
        });
    </script>
    <?php 
    }
    // For addons.
    action::run($location);
}
开发者ID:cristianoiglesias,项目名称:cinematico,代码行数:27,代码来源:functions.php

示例3: get_footer

function get_footer()
{
    ?>
    <!-- jQuery & Required Scripts -->
    <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
    
    <?php 
    if (PAGINATION_ON_OFF !== "off") {
        ?>
    <!-- Post Pagination -->
    <script>
        var infinite = true;
        var next_page = 2;
        var loading = false;
        var no_more_posts = false;
        $(function() {
            function load_next_page() {
                $.ajax({
                    url: "index.php?page=" + next_page,
                    success: function (res) {
                        next_page++;
                        var result = $.parseHTML(res);
                        var articles = $(result).filter(function() {
                            return $(this).is('article');
                        });
                        if (articles.length < 2) {  //There's always one default article, so we should check if  < 2
                            no_more_posts = true;
                        }  else {
                            $('body').append(articles.slice(1));
                        }
                        loading = false;
                    }
                });
            }

            $(window).scroll(function() {
                var when_to_load = $(window).scrollTop() * 0.32;
                if (infinite && (loading != true && !no_more_posts) && $(window).scrollTop() + when_to_load > ($(document).height()- $(window).height() ) ) {
                    // Sometimes the scroll function may be called several times until the loading is set to true.
                    // So we need to set it as soon as possible
                    loading = true;
                    setTimeout(load_next_page,500);
                }
            });
        });
    </script>
    <?php 
    }
    ?>
    
    <!-- Dropplets Tools -->
    <?php 
    include './dropplets/tools.php';
    ?>
    
    <!-- User Footer Injection -->
    <?php 
    echo FOOTER_INJECT;
    ?>
    
    <!-- Plugin Footer Injection -->
    <?php 
    action::run('dp_footer');
}
开发者ID:ELDHOSE104,项目名称:eldhose104.github.io,代码行数:64,代码来源:functions.php


注:本文中的action::run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。