2014-03-28 62 views
-1

我實現了Yii無限滾動它的工作正常。當我根據給定條件添加Google廣告時,會顯示四個Google廣告。然後,在獲取下一頁時,值將重複。即(谷歌廣告 - 顯示空的結果),以便我想獲得無限滾動頁面ID。我想要無限滾動頁面ID

請幫助我如何獲取頁面ID(即下一頁ID)。我在這裏添加我的代碼:

<?php 
$post_counter = 0; 
$addnum = 0; 
foreach($posts as $rec): ?> 
<div class="post"> 
<?php   $rec_id = $rec['recipe_id']; ?> 
    $post_counter++; 

    if (($post_counter == 7) AND ($addnum < 4)) { 
     $addnum = $addnum + 1; 
     $post_counter=1; 
    } 
?> 

<script> 
// Display an ad unit 
(adsbygoogle = window.adsbygoogle || []).push({}); 
</script> 
<?php if(isset($addnum)>3) 

     echo exit($post_counter)?> 
    <?php  
    }  

    ?> 

我把這樣它會工作

+0

我不明白的東西,請放更多的代碼,並更好地描述你所指的東西。 – Sharky

+0

ie ..在開始時顯示x數據量,永遠滾動8個數據量 –

回答

0

去擴展/資產/ yiiinfinitescroll.js

得到js文件

ID
+0

我找不到它 –