get_row("SELECT * FROM ".$wpdb->prefix."allvideogallery_profiles WHERE id=".$profileid); $categories = $wpdb->get_results("SELECT * FROM ".$wpdb->prefix."allvideogallery_categories"); $custid = ( $profile->custom_gallery_id ) ? $profile->custom_gallery_id : 'avs_gallery'; $custpage = ( $profile->custom_page_url ) ? $profile->custom_page_url : ''; $limit = $profile->rows * $profile->cols; $count = ( $count != 0 && $count < count($categories) ) ? $count : count($categories); $total = ceil( $count / $limit ); $start = isset( $_GET['start'] ) ? $_GET['start'] : 1; $limitstart = ($start - 1) * $limit; $limitend = $start * $limit; if($count < $limitend) $limitend = $count; $output = ''; $output .= '
'; $column = 0; $row = 0; for ($i=$limitstart, $n=$limitend; $i < $n; $i++) { $clear = ''; if($column >= $profile->cols) { $clear = '
'; $column = 0; $row++; } $column++; $output .= $clear; $output .= '
'; $custhref = $custpage ? @add_query_arg("catid", $categories[$i]->slug, $custpage) : @add_query_arg("catid", $categories[$i]->slug); $output .= ''; $output .= '
'; $output .= ''; $output .= ''; $output .= '
'; $output .= '
'; $output .= '' . $categories[$i]->name . ''; $output .= '
'; $output .= '
'; $output .= '
'; } $output .= '
'; $output .= '
'; $args = array( 'base' => $this->remove_qs_key(@add_query_arg('start', '%#%'), "catid"), 'format' => '', 'total' => $total, 'current' => $start, 'end_size' => 3, 'prev_text' => __('prev'), 'next_text' => __('next'), 'type' => 'list' ); $output .= paginate_links( $args ); return $output; } } ?>