How to list all users?

Discuss news styles, css code, and other Coranto customizations in here...the possibilities are endless, so have at it!

Moderator: Spunkmeyer

How to list all users?

Postby Art Vandelay » Tue Sep 06, 2005 12:16 pm

It it possible to have a profile output a file with a list of all users? :?

I've search for it and found this thread where is discussed something very similar with the use of Parahead's NewsCounter 0.4, but it only works if a user as already posted, otherwise it is omited.

my working code (with NewsCounter 0.4 running).
Code: Select all
<PerlCode>
foreach $nsuser(keys %NCUserCount) {
   $newshtml .= "<option value='".$nsuser."'>".$nsuser."</option>\n";
}
</PerlCode>


Then I created a profile that ony uses a single Newsitem and the above style.
Although, and as I sayd before, only users allready with posts get listed.

Isn't there a way (read STYLE FIELD) to simply list all the created users?
My setup: Coranto 1.24
Addons: Backup (b2); Backup By E-Mail (1b); CorantoSQL (5.0 b18); Css Editor b (b1); CustomFields 0.8.6 (b21); EmptyProfile 0.6; Filter By Field 2 (2.1); Maginot (b15); Modify News: User Column b2; MoveIt! (a b1); Multipart 1.57 (b23); News Columns 1.0; Profile Copier (1.01 b2); Profile Numeric Filter 0.1.2 (b3); Snipper 1.0; Sort Orders (2.3); Special Links 1.0; Style Debugger 0.2; Template Editor 1.01; WebWriter 3.2; XMultiSubmit 2.4.2
Art Vandelay
 
Posts: 57
Joined: Fri Feb 09, 2007 6:14 pm

Re: list all users

Postby Parahead » Tue Sep 06, 2005 1:39 pm

Art Vandelay wrote:Isn't there a way (read STYLE FIELD) to simply list all the created users?
Nope, sadly it is not that easy....

I have to solutions for you though, the first one is the SUP addon which may be of interest to you? It produces one page for each user which doesn't really sound what you want to do, but thought I mention it anyway.

The second solution is more what you want I think. You could use the code below as a base in a style to work more on. Your solution of using a profile which includes only one newsitem should be applied here as well:
Code: Select all
<PerlCode>
foreach my $username(keys %userdata) {
  $newshtml .= "$username<br>";
}
</PerlCode>

If you have created a userfield which you want to print out (for example UserField_RealName) you can use the code below (within the foreach):
Code: Select all
$newshtml .= "The users real name is $userDB{$username}->{'RealName'}<br>";

I have not tested the code so it may contain typos. Let me know if it does the trick for you....
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

THANX

Postby Art Vandelay » Tue Sep 06, 2005 2:24 pm

IT worked! :D

I've also implemented the sort function explained by faithless in the other thread I've referenced.

Here is the code, in case somebody else is interested.
Code: Select all
<PerlCode>
for $i (sort {uc($a) cmp uc($b)} keys %userdata) {
  $newshtml .= "<option value='$i'>$i</option>\n";
};
</PerlCode>
My setup: Coranto 1.24
Addons: Backup (b2); Backup By E-Mail (1b); CorantoSQL (5.0 b18); Css Editor b (b1); CustomFields 0.8.6 (b21); EmptyProfile 0.6; Filter By Field 2 (2.1); Maginot (b15); Modify News: User Column b2; MoveIt! (a b1); Multipart 1.57 (b23); News Columns 1.0; Profile Copier (1.01 b2); Profile Numeric Filter 0.1.2 (b3); Snipper 1.0; Sort Orders (2.3); Special Links 1.0; Style Debugger 0.2; Template Editor 1.01; WebWriter 3.2; XMultiSubmit 2.4.2
Art Vandelay
 
Posts: 57
Joined: Fri Feb 09, 2007 6:14 pm

Postby thegametb » Tue Sep 06, 2005 6:15 pm

So this lists all the user names from your Coranto? If so, does it link to their posts as well?
User avatar
thegametb
 
Posts: 109
Joined: Mon Jul 05, 2004 11:38 am

Postby Art Vandelay » Tue Sep 06, 2005 6:32 pm

thegametb wrote:So this lists all the user names from your Coranto? If so, does it link to their posts as well?


nope.
That's not what I have planned.
I just need my SuperUser to specify what User have the previledge to submit news to a particular area in the site.
...Meaning that I'll be able to manage 20+users with 2 XMS profiles, and one regular Profile.
Having each user diferent areas in their own "micro-site"
...sorry if this sounds confusing, it is a work in progress.
My setup: Coranto 1.24
Addons: Backup (b2); Backup By E-Mail (1b); CorantoSQL (5.0 b18); Css Editor b (b1); CustomFields 0.8.6 (b21); EmptyProfile 0.6; Filter By Field 2 (2.1); Maginot (b15); Modify News: User Column b2; MoveIt! (a b1); Multipart 1.57 (b23); News Columns 1.0; Profile Copier (1.01 b2); Profile Numeric Filter 0.1.2 (b3); Snipper 1.0; Sort Orders (2.3); Special Links 1.0; Style Debugger 0.2; Template Editor 1.01; WebWriter 3.2; XMultiSubmit 2.4.2
Art Vandelay
 
Posts: 57
Joined: Fri Feb 09, 2007 6:14 pm

Postby thegametb » Tue Sep 06, 2005 6:41 pm

Could you take a screenshot or something when you finalize it to help me understand it better? I'm always searching for things I don't need for my Coranto, but I end up adding because it's addicting. LoL.
User avatar
thegametb
 
Posts: 109
Joined: Mon Jul 05, 2004 11:38 am

Postby Parahead » Tue Sep 06, 2005 8:08 pm

thegametb wrote:So this lists all the user names from your Coranto? If so, does it link to their posts as well?
If this is what you want, check out the SUP addon I mentioned above...
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden


Return to Customization

Who is online

Users browsing this forum: Majestic-12 [Bot] and 2 guests

cron