AccordR33 wrote on Feb 25
th, 2004 at 3:31am:
thats what i was gonna do but I wanted to use the whoson mod so i had to use a .shtml file so that was out of the question.
All the whoson mod boils down to is a Perl file written to spit out text. Edit whoson.pl to edit out the WhoHeader request, and to replace 'print qq~bla bla~;' commands with '$yywhoson .= qq~bla bla~;'
Then in your Subs.pl add in the template sub:
require "Whoson.pl";
To spit insert the whoson details, just add <yabb whoson> to your HTML template.
That's more or less it, you may have to do some tweaking, I'd probably actually copy the subroutines used in your Whoson.pl and paste them into your template sub; again changinf 'print' to '$yywhoson .= '- that way user details don't have to be called twice.
E.g.:
(In Subs.pl)
<search for>
sub template {
</search for>
<add after>
#Here just copy and past the subs you use in Whoson.pl, replacing print with $yywhoson as highlighted
sub WhoMembers {
my( $memcount, $latestmember ) = &MembershipGet;
&LoadUser($latestmember);
$thelatestmember = qq~<A erprofile{$latestmember}->[1]</b></a>~;
$yywhoson = qq~
<FONT SIZE="$textfontsize">$txt{'201'}:<BR>
-- $thelatestmember<BR>
<BR>
$whotxt{'12'}:<BR>
-- <A HREF="$scripturl?action=mlall" title="View all users">$txt{'303'}</A><BR>
-- <A HREF="$scripturl?action=mlalfa" title="View members by display name">$txt{'304'}</A><BR>
-- <A HREF="$scripturl?action=mlpost" title="Click to view members by postcount">View by number of posts</A><BR>
</FONT>
~;
}
</add after>
Then you add in your HTML template; <yabb whoson>
You can do this as many times as you like- so your Whomembers sub could be called $yywhomembers meaning you use <yabb whomembers> etc. and so on.
This means all your yabb is called by one file- I quite like your current set-up because only a small amount of data is loaded each click therefore less bandwidth shorter wait each time etc.