1
AHLIS
Question about xroster2.2.3
  • 2009/11/8 11:07

  • AHLIS

  • Not too shy to talk

  • Posts: 189

  • Since: 2004/12/12


Hi there,

I have tested the xroster2.2.3 module and it's nice, but it's only include one kind of block and that is "xRoster Newest Members".

Is it hard to edit that block so it shows random members that I add to this module and maybe also can show a small image of the member?

Here is the code for "xRoster Newest Members":

function b_xroster_newestmember_show() {
  
$block = array();
  
$xoopsDB =& Database::getInstance();
  
$result $xoopsDB->query('SELECT id, membername FROM ' $xoopsDB->prefix('xRoster') . ' WHERE member=1 ORDER BY since DESC LIMIT 10');
  while(
$row $xoopsDB->fetchArray($result))
    
$block[] = $row;
  return 
$block;
}

?>


Best Regards
Ahlis

2
ghia
Re: Question about xroster2.2.3
  • 2009/11/8 11:52

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


For random users:
$result $xoopsDB->query('SELECT id, membername FROM ' $xoopsDB->prefix('xRoster') . ' WHERE member=1 ORDER BY RAND() LIMIT 10');
Is the image present in the roster table or do you mean the avatar as in eg the forum?

See also this.

3
demian
Re: Question about xroster2.2.3
  • 2009/11/8 11:58

  • demian

  • Quite a regular

  • Posts: 225

  • Since: 2008/4/29



4
AHLIS
Re: Question about xroster2.2.3
  • 2009/11/8 13:05

  • AHLIS

  • Not too shy to talk

  • Posts: 189

  • Since: 2004/12/12


Thanks, that worked. :)

The roster module has its own imagepath.

Found this in the xroster/admin/index.php:
_MD_IMAGEPATH


And in templates/blocks/xroster_block_newestmember I found this:
<ul>
    <{foreach 
item=member from=$block}>
        <
li><strong><a href="index.php?op=View&id=<{$member.id}>"><{$member.membername}>a>strong>li>
    <{/foreach}>
ul>


Is it here where I shold add the imagecode?

I don't know the imagecode so I need help there too.

5
ghia
Re: Question about xroster2.2.3
  • 2009/11/8 14:29

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


If there is a view with the pictures of the members in, check the PHP code of the file you see in the URL and the associated template.

6
AHLIS
Re: Question about xroster2.2.3
  • 2009/11/8 14:50

  • AHLIS

  • Not too shy to talk

  • Posts: 189

  • Since: 2004/12/12


I'm tring that now. But it won't work for me.

Found this code in xroster/templates/index_template.html
<{if $member.picture}>
          <
img align="right" src="<{$member.picture}>" alt="<{$member.membername}> / <{$member.title}>">
        <{/if}>


Added the code above to templates/blocks/xroster_block_newestmember.html
<ul>
    <{foreach 
item=member from=$block}>
        <{if 
$member.picture}>
            <
img align="right" src="<{$member.picture}>" height="75" width="150">
        <{/if}>
        <
li><strong><a href="modules/xroster/index.php?op=View&id=<{$member.id}>"><{$member.membername}>a>strong>li>
    <{/foreach}>
ul>


Nothing happens in the block. I have deleted the cache files

7
ghia
Re: Question about xroster2.2.3
  • 2009/11/8 17:50

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


That's because you didn't ask for a picture on the database:
$result $xoopsDB->query('SELECT id, membername, picture FROM ' $xoopsDB->prefix('xRoster') . ' WHERE member=1 ORDER BY RAND() LIMIT 10');

8
AHLIS
Re: Question about xroster2.2.3
  • 2009/11/8 18:39

  • AHLIS

  • Not too shy to talk

  • Posts: 189

  • Since: 2004/12/12


:) ups. :) That's me.

Thanks. Now it's working really great. Thanks for all the help.

Login

Who's Online

333 user(s) are online (267 user(s) are browsing Support Forums)


Members: 0


Guests: 333


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits