예제 #1
0
    if (strpos($var, 'p:') === 0) {
        $page_no_var = $var;
        //get the current Page from URL
    }
}
//--PAGINATION--//
$perpage = poems_by_author_per_page;
$paginate = paginate($perpage, $page_no_var);
$next_number = $paginate['next_number'];
//--get author informations--//
$author = get_author($database, $author_id);
$tpl->author_info = $author;
//--increment of author views--//
$update_poet = author_view_increment($database, $author_id);
//--get all poems of author--//
$page_poems = get_author_poems($database, $author_id, ['LIMIT' => array($next_number, $perpage), 'COUNT' => true]);
$tpl->page_poems = $page_poems['data'];
$count_records = $page_poems['count'];
$total_pages = ceil($count_records / $perpage);
$current_count = count($page_poems['data']);
$page_array = array();
$page_array['current_page'] = $paginate['page_no'];
$page_array['total_pages'] = $total_pages;
$page_array['total_records'] = $count_records;
$page_array['current_count'] = $current_count;
$page_array['param_vars'] = $vars;
$page_array['page_no_var'] = $page_no_var;
$tpl->page_array = $page_array;
// Send SEO Data
if (!$author['seo_title']) {
    $tpl->page_title = $author['Author_name'];
예제 #2
0
파일: poets.php 프로젝트: ronak2ram/fnji
">  <img class="img img-thumbnail img-responsive" src="<?php 
        echo $src;
        ?>
"  /></a>
                        </div>
                        
                        <div class="pull-left">
                            <a href="<?php 
        echo get_url($this->database, "poet", $all_poets['id'], $all_poets['Author_slug']);
        ?>
"><?php 
        echo text_limit($all_poets['Author_name'], 20);
        ?>
</a> <br>
                            <small>(<?php 
        echo get_author_poems($this->database, $all_poets['id'], array("ONLYCOUNT" => true));
        ?>
 <?php 
        echo POEMS;
        ?>
) </small>
                        </div>
                    </div>
                </div>
                <?php 
        $count++;
        ?>
                 <?php 
    }
    ?>
            </div>