HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Please upgrade here. These earlier versions are no longer being updated and have security issues.

Listing of users?

edited August 2011 in Vanilla 2.0 - 2.8
Please excuse the newbie question, but I can't seem to find any info on this. I am wondering if it is possible to display a directory-type listing of all users, which would be visible to all users, with each user name linking to that user's profile.

Thanks!
Tagged:

Answers

  • Given that I can't find any info on this, I think it is not possible, but am trying one more time to see if anyone can give me any info on creating a directory of members.
    Thanks.
  • Hi,
    Start to create a new application "userlist",
    the doc is here
    http://vanillaforums.org/docs/appquickstart

    i tried clone skeleton and do what the doc says, but without success

    if you are able to display an hello world, say it ;)
  • The slightly annoying part of all this is a user list is available in the dashboard under "users".

    The guts of the code is in this php file:

    vanilla\applications\dashboard\views\user\index.php

    A patient person could probably modify it and re-write it to suite their needs.
  • is this what you guys are looking for?

    http://pinoyau.info/plugin/BrowseMember/
  • edited December 2011

    speaking of the BrowseMembers plugin,
    i found a nice fix for making more than just a - z availible as browsable member search.
    You need to change from a route to an array, because if you would make a route go from 0 - Z it would implement stuff like < > = and ? and you wont want to search that in usernames.

    go into the Plugin folder, and open "BrowseMember/files/default.php" and change

    $letters = range('a', 'z');

    to

    echo '0 ';
    $letters = array('1', '2', '3', '4', '5',
    '6', '7', '8', '9', 'A',
    'B', 'C', 'D', 'E', 'F',
    'G', 'H', 'I', 'J', 'K',
    'L', 'M', 'N', 'O', 'P',
    'Q', 'R', 'S', 'T', 'U',
    'V', 'W', 'X', 'Y', 'Z');

    you might ask yourself why i put 0 into a different kind of link, thats because somehow clicking 0 in an array shows all members, just like the reset/all link, so i cheated a way around this by adding a link directly to the form output.

    (the markdown in here doesnt like me, but you can see the changes on the 0 if you hover over the number)

  • oh and like i said in another topic, pluralisation makes sense:
    "9 user(s)" should be "9 users" and a single user should be "1 user"

    easily done by changing
    printf(T('%s user(s) found.'), $this->Pager->TotalRecords);
    to
    printf(Plural($this->Pager->TotalRecords, '%s user', '%s users'), $this->Pager->TotalRecords);

  • ToddTodd Chief Product Officer Vanilla Staff

    FYI: Plural() contains a sprintf(). So you don't need to wrap it in the printf. Just do the following:

    echo Plural($this->Pager->TotalRecords, '%s user', '%s users');
    
  • thank you for making this idea even better, Todd :)

  • AoleeAolee Hobbyist & Coder ✭✭

    Nice mod :)

Sign In or Register to comment.