how to make limit showing
bekti Offline
Junior Member
**
Posts: 43
Joined: Mar 2012
Post: #1
how to make limit showing
hy please help me..

i want to make a limit to show buddy list in usercp

so in usercp will show like this

- you have 20 friend (this is all the buddy)
- show result 1-10 from 20
then the buddy avatars will show only 10 avatars

i have already make this one,but still showing all buddy avatars

PHP 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
$query = $db->simple_select("users", "buddylist", "uid = '".intval($mybb->input['uid'])."'");
$forum = $db->fetch_array($query);
$count_friend = 0;
if($forum['buddylist'] != "")
    {
        $timecut = TIME_NOW - $mybb->settings['wolcutoff'];
        
        $query = $db->simple_select("users", "*", "uid IN ({$forum['buddylist']})", array('order_by' => 'lastactive'));

        while($friend = $db->fetch_array($query))
        {
            $friend_name = format_name($friend['username'], $friend['usergroup'], $friend['displaygroup']);
            $profile_link = build_profile_link($friend_name, $friend['uid'], '_blank', 'if(window.opener) { window.opener.location = this.href; return false; }');

            if($friend['avatar'])
            {
                $friend['avatar'] = htmlspecialchars_uni($friend['avatar']);
                if($friend['avatardimensions'])
                {
                    require_once MYBB_ROOT."inc/functions_image.php";
                    list($width, $height) = explode("|", $friend['avatardimensions']);
                    $scaled_dimensions = scale_image($width, $height, 44, 44);
                }
                else
                {
                    $scaled_dimensions = array(
                        "width" => 44,
                        "height" => 44
                    );
                }
            }
            else
            {
                $friend['avatar'] = $theme['imgdir'] . "/default_avatar.gif";
                $scaled_dimensions = array(
                    "width" => 44,
                    "height" => 44
                );
            }
            $margin_top = ceil((50-$scaled_dimensions['height'])/2);
            eval("\$friendlist .= \"".$templates->get("member_profile_custom_friend")."\";");
           ++$count_friend;
        }
    }
    else
    {
        $friendlist = 'Buddie list is empty';
    } 
$lang->count_buddies = $lang->sprintf($lang->count_buddies, $count_friend);



that code show me like this
- you have 20 friend (this is all the buddy)
- show result 1-20 from 20

here is the question, i want to make limit when it's show avatar friends to 10

just like this

Quote:- you have 20 friend (this is all the buddy)
- show result 1-10 from 20
(then the buddy avatars will show only 10 avatars)

sorry for my bad english
09-21-2012 07:42 PM
Find all posts by this user Quote this message in a reply
ZiNgA BuRgA Offline
Fag
*******
Posts: 3,357
Joined: Jan 2008
Post: #2
RE: how to make limit showing
Look at how the rest of MyBB makes paging (in general, limits in select queries, take current page as an input variable).  Expect the complexity to go up a fair bit.

My Blog
10-04-2012 01:06 PM
Find all posts by this user Quote this message in a reply
bekti Offline
Junior Member
**
Posts: 43
Joined: Mar 2012
Post: #3
RE: how to make limit showing
(10-04-2012 01:06 PM)ZiNgA BuRgA Wrote:  Look at how the rest of MyBB makes paging (in general, limits in select queries, take current page as an input variable).  Expect the complexity to go up a fair bit.

i not want to make a page...i want to make this..

for example i have 6 friends...then i just want to show 5 friends in member user, the other 1 is not showing..

just want to make limit like this

Code:
$post['message'] = my_substr($post['message'], 0, 250) . "...";


but limit to show friends...can you help me?

10-04-2012 08:08 PM
Find all posts by this user Quote this message in a reply
SunDi3yansyah Offline
Junior Member
**
Posts: 23
Joined: Dec 2012
Post: #4
RE: how to make limit showing
hello bekti

You have a problem at your forum

so did me Biggrin
[/quote]
12-10-2012 07:02 AM
Visit this user's website Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

 Standard Tools
Forum Jump: