How to limit # of forums displayed under mainpage categories, pagination, collapse ?
akm Offline
Member
***
Posts: 115
Joined: Nov 2011
Post: #5
RE: How to limit # of forums displayed under categories at main page ?
(02-03-2012 03:54 AM)akm Wrote:  
(02-03-2012 02:29 AM)RateU Wrote:  As far as I know, there is no feature like that.
Thank you for the followup !
Was afraid of that.
Guess was thinking of something like next "pagination"thing...
Will keep looking.
(02-03-2012 03:54 AM)akm Wrote:  Guess was thinking of something like next "pagination" thing...
Will keep looking.

Found this for 1.6 ACP pagination, could it work for homepage...

Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/**
092	 * Draw pagination for pages in the Admin CP.
093	 *
094	 * @param int The current page we're on
095	 * @param int The number of items per page
096	 * @param int The total number of items in this collection
097	 * @param string The URL for pagination of this collection
098	 * @return string The built pagination
099	 */
100	function draw_admin_pagination($page, $per_page, $total_items, $url)
101	{
102	    global $mybb, $lang;
103	     
104	    if($total_items <= $per_page)
105	    {
106	        return;
107	    }
108	 
109	    $pages = ceil($total_items / $per_page);
110	 
111	    $pagination = "<div class=\"pagination\"><span class=\"pages\">{$lang->pages}: </span>\n";
112	 
113	    if($page > 1)
114	    {
115	        $prev = $page-1;
116	        $prev_page = fetch_page_url($url, $prev);
117	        $pagination .= "<a href=\"{$prev_page}\" class=\"pagination_previous\">&laquo; {$lang->previous}</a> \n";
118	    }
119	 
120	    // Maximum number of "page bits" to show
121	    if(!$mybb->settings['maxmultipagelinks'])
122	    {
123	        $mybb->settings['maxmultipagelinks'] = 5;
124	    }
125	     
126	    $max_links = $mybb->settings['maxmultipagelinks'];
127	 
128	    $from = $page-floor($mybb->settings['maxmultipagelinks']/2);
129	    $to = $page+floor($mybb->settings['maxmultipagelinks']/2);
130	 
131	    if($from <= 0)
132	    {
133	        $from = 1;
134	        $to = $from+$max_links-1;
135	    }
136	 
137	    if($to > $pages)
138	    {
139	        $to = $pages;
140	        $from = $pages-$max_links+1;
141	        if($from <= 0)
142	        {
143	            $from = 1;
144	        }
145	    }
146	 
147	    if($to == 0)
148	    {
149	        $to = $pages;
150	    }
151	 
152	 
153	    if($from > 2)
154	    {
155	        $first = fetch_page_url($url, 1);
156	        $pagination .= "<a href=\"{$first}\" title=\"Page 1\" class=\"pagination_first\">1</a> ... ";
157	    }
158	 
159	    for($i = $from; $i <= $to; ++$i)
160	    {
161	        $page_url = fetch_page_url($url, $i);
162	        if($page == $i)
163	        {
164	            $pagination .= "<span class=\"pagination_current\">{$i}</span> \n";
165	        }
166	        else
167	        {
168	            $pagination .= "<a href=\"{$page_url}\" title=\"{$lang->page} {$i}\">{$i}</a> \n";
169	        }
170	    }
171	 
172	    if($to < $pages)
173	    {
174	        $last = fetch_page_url($url, $pages);
175	        $pagination .= "... <a href=\"{$last}\" title=\"{$lang->page} {$pages}\" class=\"pagination_last\">{$pages}</a>";
176	    }
177	 
178	    if($page < $pages)
179	    {
180	        $next = $page+1;
181	        $next_page = fetch_page_url($url, $next);
182	        $pagination .= " <a href=\"{$next_page}\" class=\"pagination_next\">{$lang->next} &raquo;</a>\n";
183	    }
184	    $pagination .= "</div>\n";
185	    return $pagination;
186	}

Also posted the question at http://community.mybb.com/thread-112767.html , but nothing there yet.
Maybe, like you suggested, there is no way to do it.
Sure would help though.


Thanks again for your help !
02-03-2012 11:13 AM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
RE: How to limit # of forums displayed under categories at main page ? - akm - 02-03-2012 11:13 AM

 Standard Tools
Forum Jump: