本文整理汇总了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');
}
示例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);
}
示例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');
}