Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

Is there a way to do......

Quote Reply
Is there a way to do......
I found the below format on another forum, is there a way to do the same thing with this forum? Online Now: 51 There are currently 39 members and 12 guests on the boards.
Ajit, Akiva, AMconsulting, BLFH (Ms. B), c4, CashFlow, cazzie, Celicaphile, DaPackster, EcomCity.com, elbowcreek, Geoff, happypoon, hopper, IamJaloppy, jessica123, Kat, Ladyboss, Leader, Linda, Lizabeth Cole, Matt Kritzer - Jordanmarie.com, MessageTalk, MJCB, NotKrooked, patrice - eastwoodcompany.com, perfectG, Potent Mix, qballİ, redsand, SandraR, ShoreMark, Spencer, SSanf, TeamPB, Tjİ, Van, womanht, wyvern
Quote Reply
Re: [SandraR] Is there a way to do...... In reply to
Yes, it's possible. You have to modify the whos_online.html template by editing the loops in this template.

François
Quote Reply
Re: [Franco] Is there a way to do...... In reply to
I guess I did not make myself clear, I am wanting that to be a part of all pages at the top. So that no matter what page you are looking at you can see who is online. How many register users and how many guests are presently online.


Sandra Roussel
Chonsa Group Design - Fresh Start Housing
Quote Reply
Re: [SandraR] Is there a way to do...... In reply to
Just add the code to the forum and category templates.
Quote Reply
Re: [ArmyAirForces] Is there a way to do...... In reply to
OK, to just list the users, you want to use the loop, and have the username there, then you want to add a ", " to seperate the usernames. Is there a trick to NOT add a ", " to the LAST name in the list?
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Is there a way to do...... In reply to
I have this on my site to show the last 10 new users (some code left out):




<%loop new_users%>
<%user_username%>
<%unless last%>,
<%endunless%>
<%endloop%>




Hope this helps!

Dave
Quote Reply
Re: [bretzke] Is there a way to do...... In reply to
Dave:

Thanks- it does help!

OK, I edited down the whos_online.html templete code to just what I wanted- the start of the loop, grab the username and the HREF tag and the endloop. No tages are recognized when I put it on the front page (categories.html) of the forum... do I need to do anything special to get the <%has_online_users%> and <%nbsp user_username%> tags to show up?


dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Is there a way to do...... In reply to
Here, maybe this will help. This is what I am using on category,htnl

<TABLE style="border:1px solid #996600;" bgcolor="#FEF4E2" WIDTH="100%"><TR><TD STYLE="padding-left: 1cm">

<B><U>Currently Online</U>:</B> <%if has_online_users%><%has_online_users%> registered user<%if has_online_users == 1%><%else%>s<%endif%><%else%>no registered users<%endif%> and <%if has_online_guests%><%has_online_guests%> guest<%if has_online_guests == 1%><%else%>s<%endif%><%else%>no guests<%endif%>.<BR><B><U>Users Online</U>:</B>

<%loop online_users%>

<a href="gforum.cgi?username=<%GT::CGI::escape($user_username)%>;<%hidden_query%>"><%nbsp user_username%></a>

<%unless last%>,&nbsp;<%endunless%>

<%endloop%>

</TD></TR></TABLE>

Here is what it spits out on the home page:



Currently Online: no registered users and no guests.
Users Online:

So it is not getting the users or something...

dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Is there a way to do...... In reply to
Anyone ever figure out how to get the user count variables to show up on the main (category) page, so this will work? Works great on whos online, but the variables are not there for the main page...
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Is there a way to do...... In reply to
Try out this global (call it something like WHOS_ONLINE):

Code:
sub {
require GForum::Online;
my $online = (GForum::Online->whos_online())[1];
return $online;
}

Then in a template, put <%WHOS_ONLINE%>, and you will be able to use the online_users, online_guests, has_online_users and has_online_guests template variables/loops.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [Jagerman] Is there a way to do...... In reply to
Jagerman:

Thank you- this has been driving me crazy for a while!

Have a great weekend!
dave

Big Cartoon DataBase
Big Comic Book DataBase
Quote Reply
Re: [carfac] Is there a way to do...... In reply to
It works great!
dave

Big Cartoon DataBase
Big Comic Book DataBase