UBB.Dev
Posted By: AllenAyres Fsum Status - 12/29/2003 10:57 AM
Description: Adds your avatar and forum stats to the top of your fsum

Requirements: UBB 6.7

Demo: https://www.ubbdev.com/test/ubb/ultimatebb.php

Download: https://www.ubbdev.com/ubb/upload/00000494/fsum_status.zip

Notes: This is of alpha/beta quality.

Known Issues: I am getting a repeating of the top table due to it breaking the generic wrapper. Javascript error and other bugfixes done with LK's help smile
Posted By: Ian Spence Re: Fsum Status - 12/29/2003 11:58 AM
Code
<script language="Javascript" type="text/javascript" src="$vars_config{CGIURL}/ubb_status.cgi"></script>
is the line causing the js error


as for the repeating lines, you can set navbar_replace_right to equal the active topics link, then do a

Code
my $header = $hf->[0];
$header =~ s/$TBB/qq~THE CODE FOR THE TABLE~/eisg;
and then replace $hf->[0] with $header.

I believe once the javascript error is fixed, the avatar and user title will work too
Posted By: d-talk Re: Fsum Status - 12/30/2003 1:00 PM
Hi,

how can I get a European Time format and what about the Javacript error?

thx
d-talk
Posted By: AllenAyres Re: Fsum Status - 12/30/2003 8:09 PM
this is of beta quality, I've got some other projects ahead of it, so it may be a while before it gets all the kinks worked out.
Posted By: LK Re: Fsum Status - 12/30/2003 8:31 PM
uh, https://www.ubbdev.com/test/ubbcgi/ubb_status.cgi is full of errors tipsy

Copy this line to around the top:
Quote
quote:
use vars qw($allowmods $backwards $confdel $deletealt $delimage $filehandle $floodcheck $ftime $images $iptitle $am $pm $js $js2 $masterCharset $me $message $nomeend $page_background $password $pubname $reset $savename $send $shoutbox $shoutext $shoutmax $shouts $shoutsize $show_public_name $showtime $staff $styles $typemsg $typeshout $ubb_images $unreg $unregpost $user_number $user_topic_view $username $viewunreg %GotTime %in %template_html %template_match %vars_config %vars_misc %vars_style %vars_style_shoutbox %vars_wordlets %vars_wordlets_err @checkTheProfile @ubber %vars_time $datetitle %vars_version_information $version_number $release_j $version $trademark $trade $ULTIMATEBB %ULTIMATEBB $CONTROLPANEL %vars_display $InfopopCopyright $masterCharset %vars_wordlets_criterr %vars_search %vars_registration %vars_pm %vars_misc %vars_email %vars_pntf %vars_time %GENERIC_GLOBALS %vars_mods %vars_wordlets_err %vars_style %vars_forums %vars_wordlets $backend %GotTime @alltheforums %vars_cats @allthecategories $exact_path $ThisHTML $PNTF $vars_graemlins $frontend %template_html %vars_style_reference %template_match %ProfileNumber $memlistopen @benches %FILE_CACHE $forum_threads %forum_topics $alpha_threads %forum_thread_data %forum_recentmeta %todays_active_topics %member_profile %vars_wordlets_img $TBT $TBB);
Posted By: AllenAyres Re: Fsum Status - 12/30/2003 8:39 PM
thanks LK, that's some of the work it needs laugh

I'll add it and see where we're at then smile
Posted By: LK Re: Fsum Status - 12/30/2003 8:47 PM
Also add to the very beginning (perhaps after the line "small scripts by allen"?):
Code
use constant SEVENSEVENSEVEN => 0777;
use constant SIXSIXSIX => 0666;
Posted By: AllenAyres Re: Fsum Status - 12/30/2003 8:49 PM
ok, added that and a few more it wanted and am now getting this:

Quote
quote:

document.avatar.avvy.src = "https://ubbdev.com/test/ubb/unregistered.gif"; document.getElementById('status').appendChild(document.createTextNode('Administrator'));
printed out when accessing the file, which is where the javascript error is coming from I guess smile
Posted By: LK Re: Fsum Status - 12/30/2003 9:03 PM
For some reason, the line
Code
<script language="Javascript" type="text/javascript" src="$vars_config{CGIURL}/ubb_status.cgi"></script>
is added to the top of forum_summary and not the bottom... Try to move it around till it's below the other part, that might fix it.
Posted By: AllenAyres Re: Fsum Status - 12/30/2003 9:17 PM
that fixed the error and it now shows the status, thumbsup For some reason I moved it up top during one of my bug-fix searches yesterday tipsy


The avatar it is looking for, is that different from the 'your picture' that's found in the profile?
Posted By: LK Re: Fsum Status - 12/30/2003 9:21 PM
yes it is, it's the actual avatar under your name in boards where avatar is enabled... So at UBBDev it'd show the no-avatar image.
Posted By: AllenAyres Re: Fsum Status - 12/30/2003 9:27 PM
thank you smile

Zip file up top updated with bugfixes and latest code smile
Posted By: d-talk Re: Fsum Status - 12/30/2003 9:47 PM
Hi LK and Allen,

what can I do to get the european time format for the last-visited time?

thx
d-talk
Posted By: LK Re: Fsum Status - 12/30/2003 9:58 PM
you can't do much, unless you change the session cookie behavior (really not recommended) or program something (should be pretty simple) in javascript which splits the date/time into arrays and rebuilds them as either european time format or yyyy,mm,dd,HH,mm,ss for the timestamp function.
Posted By: d-talk Re: Fsum Status - 12/30/2003 10:04 PM
Another question,

how can I delete the membersline, i marked red at the picture...

[Linked Image]

**** I can't programm somethin for european time-format... frown frown frown
Posted By: AllenAyres Re: Fsum Status - 12/30/2003 10:27 PM
there's gonna be bugs to be expected if you insist on using beta code tipsy We can't upgrade the mods fast enough for you as you're installing 4-5 at a time. If you want bug-free/less code, it's gonna be after 6.7 goes final smile
Posted By: d-talk Re: Fsum Status - 12/30/2003 10:39 PM
laugh
Posted By: Gizmo Re: Fsum Status - 12/31/2003 2:27 AM
There are already lots of bugs being reported, check http://www.ubbcentral.com/ in the bugs section wink ...
Posted By: Ian Spence Re: Fsum Status - 01/08/2004 1:45 AM
Hey Allen, finally got around to installing this and I've only got one problem. I have some html in my custom title, and instead of formatting, it just prints out the html too, making it look quite weird.


Any suggestions?
Posted By: Ian Spence Re: Fsum Status - 01/08/2004 1:56 AM
oh, and Allen. I finally got it to work with the universal headers.

Code
	my $hf = &generic_wrapper({
page_title => "",
navbar_replace_right => qq~<font class="small"><b>
&#187; <a href="$ULTIMATEBB{"ubb=get_daily"}">$vars_wordlets{active_topics}</a>
&#171;
</b></td></tr>
<tr>
<td colspan="2" bgcolor="$vars_style{TableColorStrip}"><img src="$vars_config{NonCGIURL}/spacer.gif" width="1" height="7" alt="BLAM!" /></td>
</tr>
<tr>
<td width="50%" align="left" valign="top" class="descript-font" bgcolor="$vars_style{AltColumnColor1}"> <form id="avatar" name="avatar" action="">
<table align="left"><tr><td><img src="$vars_config{NonCGIURL}/unregistered.gif" alt=" - " id="avvy" name="avvy" /></td></tr></table></form><b> Your Info </b>



<script language="Javascript" type="text/javascript">document.writeln("You last visited: <b>", unescape(session_dt), "</b>");</script>


Your status is: <b><span id="status"></span></b>
</td>
<td width="50%" valign="top" align="left" class="descript-font" bgcolor="$vars_style{AltColumnColor1}"><font size="$vars_style{TextSize}" face="$vars_style{FontFace}"><b> Forum Info </b>


$memberline


Total Topics: $AllTopics    Total Posts: $AllPosts
</font>
~,
just played around with the code. (PS. change class="small" to size="$vars_style{FDTextSize}"
Posted By: AllenAyres Re: Fsum Status - 01/08/2004 8:50 PM
grazi thumbsup

I'll update the instructions this evening smile
Posted By: Ian Spence Re: Fsum Status - 01/23/2004 12:23 AM
Allen, how would I go about removing the following code from user titles before it was outputted?

Code
<img src="*" alt="*" >
where * are wildcards. I only know how to do if it there are no wildcards
Posted By: AllenAyres Re: Fsum Status - 01/26/2004 2:12 AM
?

I gotta get things moved to this pc so I know what yer talkin about tipsy Gimme a day or so and I'll get it.

What are you trying to achieve with the output?
Posted By: Ian Spence Re: Fsum Status - 01/26/2004 2:34 AM
ok, at my other boards (GR) we have stars denoting rank in the titles.

Using this mod, the status prints out as html.
ie.
Code
Special
<img src="http://www.alforadmin.com/special.gif" alt="-" />
whereas in posts,etc it would show as

Special


So is there anyway to remove
Code

<img src="http://www.alforadmin.com/special.gif" alt="-" />
so that it'll just show "Special"?
Posted By: Ian Spence Re: Fsum Status - 01/27/2004 6:28 AM
nm Allen, I added this and it worked.
Code
$user_status =~ s/(<img)(.+?)(>)//isg;
$user_status =~ s/(<br)(.+?)(>)//isg;
Posted By: Ian Spence Re: Fsum Status - 02/07/2004 1:31 AM
unsupported update for those who want formatted dates, etc...

change...

Code
<script language="Javascript" type="text/javascript">document.writeln("You last visited: <b>", unescape(session_dt), "</b>");</script>

to...

Code
<script language="Javascript" type="text/javascript">
<!--
var tippy = unescape(session_dt);
var tippy_array = tippy.split("-");
var month = parseInt(tippy_array[0]) - 1;
var day = parseInt(tippy_array[1]) + 0;

if(tippy_array[2] != null && tippy_array[2] != '') {
var new_array_tippy = tippy_array[2].split(" ");
var year = parseInt(new_array_tippy[0]);

var newer_array_tippy = new_array_tippy[1].split(':');

hour = parseFloat(newer_array_tippy[0]);

if(new_array_tippy[2] == 'PM'){ hour += 12; }

var minutes = parseInt(newer_array_tippy[1]);

document.write('You last visited: <b>');
document.write(timestamp(new Date(year,month,day,hour,minutes,0), dfrm, null, 0, 0, 0, 0), "</b>");
document.write(timestamp(new Date(year,month,day,hour,minutes,0), null, tfrm, 0, 0, 0, 0), '
');

}
//-->
</script>
Posted By: d-talk Re: Fsum Status - 02/08/2004 8:23 PM
What have I to change, that i can delete the Welcomeheader....?

[Linked Image]
Posted By: Ian Spence Re: Fsum Status - 02/29/2004 7:44 PM
Allen, could you change $vars_config{NonCGIURL}/spacer.gif

to

$vars_config{NonCGIURL}/blank.gif?

Not doing so results in a large server error log with the files not found
Posted By: Ian Spence Re: Fsum Status - 04/09/2004 2:50 AM
Allen, in ubb status, could you change

Code
	if($avurl && !$avok) {
to

Code
	if($avurl && $avok =~ /(0|2)/) {
It's needed for those who use the Always allow, even if group can't setting for avatars for some users
Posted By: Gizmo Re: Fsum Status - 04/09/2004 3:11 AM
Found by me getting annoyed lol...
Posted By: AllenAyres Re: Fsum Status - 04/09/2004 7:50 AM
k, I think I got all the bugfixes to date (didn't try the formatted date, since no-one reported it working tipsy )
Posted By: Gizmo Re: Fsum Status - 04/09/2004 8:09 PM
It's funny, I've seen this running at Ian's site (I said Ian!) and i was wondering why HE didn't publish it, so I asked him... Response: "I'd release it but allen would be irate"... I'm all "why?" andhe's all "it's in one of the template forums"...

So I'm just sitting here thinking to myself, it's technically a mod frown ...
Posted By: AllenAyres Re: Fsum Status - 04/09/2004 9:36 PM
??? What?

It's not my code or Ian's, it's bookie's with help from LK, I believe...

So I'm just sitting here thinking to myself, why does it matter who publishes it here? :rolleyes:
Posted By: Gizmo Re: Fsum Status - 04/09/2004 9:39 PM
Nonono, the matter was, I had no clue where it was as it wasn't in the 6.x forum lol
Posted By: havoq Re: Fsum Status - 05/24/2004 8:55 AM
Quote
Originally posted by Ian Spence:

unsupported update for those who want formatted dates, etc...

change...

Code
<script language="Javascript" type="text/javascript">document.writeln("You last visited: <b>", unescape(session_dt), "</b>");</script>

to...

Code
<script language="Javascript" type="text/javascript">
<!--
var tippy = unescape(session_dt);
var tippy_array = tippy.split("-");
var month = parseInt(tippy_array[0]) - 1;
var day = parseInt(tippy_array[1]) + 0;

if(tippy_array[2] != null && tippy_array[2] != '') {
var new_array_tippy = tippy_array[2].split(" ");
var year = parseInt(new_array_tippy[0]);

var newer_array_tippy = new_array_tippy[1].split(':');

hour = parseFloat(newer_array_tippy[0]);

if(new_array_tippy[2] == 'PM'){ hour += 12; }

var minutes = parseInt(newer_array_tippy[1]);

document.write('You last visited: <b>');
document.write(timestamp(new Date(year,month,day,hour,minutes,0), dfrm, null, 0, 0, 0, 0), "</b>");
document.write(timestamp(new Date(year,month,day,hour,minutes,0), null, tfrm, 0, 0, 0, 0), '
');

}
//-->
</script>
Ian

If I dont have the timestamp function in my source code, is there still a way I can switch 5-23-2004 to say May 23 2004? Cuz this code isnt working for me, for obvious reasons. Wondering if theres a way around it or not... wink
Posted By: Ian Spence Re: Fsum Status - 05/24/2004 1:50 PM
there should be a way around it if you just take the code from datelib.js (steal the one from here)
Posted By: havoq Re: Fsum Status - 05/24/2004 6:21 PM
Hmmm ok I got it, just gotta work with it and figure it out now. thanks
Posted By: havoq Re: Fsum Status - 05/24/2004 7:05 PM
hmmm, not working with this code:

Code
<script src="datelib.js" language="Javascript1.3" type="text/javascript"></script>
<script language="Javascript" type="text/javascript">
<!--

var tippy = unescape(session_dt);
var tippy_array = tippy.split("-");
var month = parseInt(tippy_array[0]) - 1;
var day = parseInt(tippy_array[1]) + 0;

if(tippy_array[2] != null && tippy_array[2] != '') {
var new_array_tippy = tippy_array[2].split(" ");
var year = parseInt(new_array_tippy[0]);

var newer_array_tippy = new_array_tippy[1].split(':');

hour = parseFloat(newer_array_tippy[0]);

if(new_array_tippy[2] == 'PM'){ hour += 12; }

var minutes = parseInt(newer_array_tippy[1]);

document.write(timestamp(new Date(year,month,day,hour,minutes,0), dfrm, null, 0, 0, 0, 0));
document.write(timestamp(new Date(year,month,day,hour,minutes,0), null, tfrm, 0, 0, 0, 0));

}

//-->
</script>
Posted By: GATOR420 Re: Fsum Status - 05/26/2004 2:47 AM
OK, this looked really cool so I tried to install it and I get these errors...

syntax error at NonCGIPath/Templates/public_forum_summary.pl line 292, near "«"
BEGIN not safe after errors--compilation aborted at NonCGIPath/Templates/public_forum_summary.pl line 293.

Tue May 25 19:42:12 2004]
cgiultimatebb.cgi: Number found where operator expected at /noncgi/Templates/public_forum_summary.pl line 292, near "«" [Tue May 25 19:42:12 2004] cgiultimatebb.cgi: (Missing operator before 171?)

I checked and double checked and it looks like I hacked the files OK...

help
Posted By: Ian Spence Re: Fsum Status - 05/26/2004 2:54 AM
Try this for the first step...

(first, undo your first step.)

Code
**************************
* Open public_forum_summary.pl
**************************

FIND:
=====

page_title => "",
before_navbar => qq~</font></td><td align="right">
<font size="$vars_style{FDTextSize}" face="$vars_style{FontFace}"><b>
&#187; <a href="$ULTIMATEBB{"ubb=get_daily"}">$vars_wordlets{active_topics}</a>
&#171;
</b>~,
navbar_replace_right => qq~<b>$memberline</b>~,

Replace with:
=====

page_title => "",
navbar_replace_right => qq~<font size="$vars_style{FDTextSize}"><b>
&#187; <a href="$ULTIMATEBB{"ubb=get_daily"}">$vars_wordlets{active_topics}</a>
&#171;
</b></td></tr>
<tr>
<td colspan="2" bgcolor="$vars_style{TableColorStrip}"><img src="$vars_config{NonCGIURL}/blank.gif" width="1" height="7" alt="BLAM!" /></td>
</tr>
<tr>
<td width="50%" align="left" valign="top" class="descript-font" bgcolor="$vars_style{AltColumnColor1}"> <form id="avatar" name="avatar" action="">
<table align="left"><tr><td><img src="$vars_config{NonCGIURL}/unregistered.gif" alt=" - " id="avvy" name="avvy" /></td></tr></table></form><b> Your Info </b>



<script language="Javascript" type="text/javascript">document.writeln("You last visited: <b>", unescape(session_dt), "</b>");</script>


Your status is: <b><span id="status"></span></b>
</td>
<td width="50%" valign="top" align="left" class="descript-font" bgcolor="$vars_style{AltColumnColor1}"><font size="$vars_style{TextSize}" face="$vars_style{FontFace}"><b> Forum Info </b>


$memberline


Total Topics: $AllTopics    Total Posts: $AllPosts
</font>
~,
Posted By: GATOR420 Re: Fsum Status - 05/26/2004 3:15 AM
OK.. Undid first step, found the code you provided and replaced with the code you added... This is what I get now:

syntax error at NonCGIPath/Templates/public_forum_summary.pl line 125, near "$hf"
BEGIN not safe after errors--compilation aborted at NonCGIPath/Templates/public_forum_summary.pl line 379.
Posted By: Ian Spence Re: Fsum Status - 05/26/2004 3:23 AM
edited post, try now
Posted By: GATOR420 Re: Fsum Status - 05/26/2004 3:43 AM
OK, that seemed to fix the errors.. But under my status is it supposed to say something? It just shows up blank.. I am both admin and megamoderator...
Posted By: havoq Re: Fsum Status - 05/26/2004 4:06 AM
Gator: yes its supposed to show your status and your avatar picture. make sure your javascript src to your ubb_status is also at the bottom of public_forum_summary wink
Posted By: havoq Re: Fsum Status - 05/26/2004 4:29 PM
Whats wrong with this code? It seems right to me, but the graphic will not show up?

Code
$user_status = qq($vars_wordlets{unregistered}/guest <img src="$vars_config{NonCGIURL}/graemlins/frown.gif" />);
Im assuming qq qq~ and qq! all do roughly the same thing in displaying standard html, and I've tried all of these
Posted By: havoq Re: Fsum Status - 05/26/2004 6:12 PM
b.t.w I take it this doesnt work with opera yet eh? Maybe you can work on that Ian wink


Ok, well I used your previous alteration of code for ubb_hits Ian, using innerHTML as well. works now in Opera. You should make that update Ian on your forums laugh


Now, back to my original code help question.....
Posted By: havoq Re: Fsum Status - 05/27/2004 2:22 AM
also, is there a way in ubb_status to force avatar size for the forum summary? Like setting width,height to 70x70?
Posted By: Ian Spence Re: Fsum Status - 05/27/2004 2:32 AM
yeah, find the image tag, add width="70" height="70"
Posted By: havoq Re: Fsum Status - 05/27/2004 2:45 AM
sweet... I thought u had to do it in ubb_status...guess not. Ok, thanks dude wink

now I gotta figure out why the code on the previous page doesnt work, wanted a frown gif if you were unregistered
Posted By: Ian Spence Re: Fsum Status - 05/27/2004 2:52 AM
it won't work, I tried. The JS won't allow html to be parsed. It'll just print the code
Posted By: havoq Re: Fsum Status - 05/27/2004 7:17 PM
Ya, I've struggled with it myself also for some time now. Ahh well
Posted By: GATOR420 Re: Fsum Status - 08/08/2004 9:10 PM
On the first page of this forum there is a snapshot of someone else's board with the same problem I am about to mention if you would like the visual.

How do I get rid of that extra space under "Your Info"

On the other side, Forum Info is nice and tight without the space. I just want Your Info and Forum Info to display the same.

Appreciation as always!
Posted By: Ian Spence Re: Fsum Status - 08/08/2004 9:40 PM
you could just edit the html to remove the space.
Posted By: GATOR420 Re: Fsum Status - 08/08/2004 9:42 PM
Right. I can do that. Can you point to the direction of the space please? smile Or even where I might look?
Posted By: Ian Spence Re: Fsum Status - 08/08/2004 9:50 PM
The line right after when the instructions tell you to add "Your info"
Posted By: GATOR420 Re: Fsum Status - 08/08/2004 11:11 PM
Ahh.. That line... Found it. Thanks! smile
Posted By: GATOR420 Re: Fsum Status - 08/11/2004 1:15 AM
OK, after I did that, something strange happened. I thought it would go away, but it didn't. Now, on my main portal page for whatever reason it says; You last visited: December 10, 2003 at 05:49 PM.

On the forum home page it says:
You last visited: 08-10-2004 05:49 PM which would be correct. Uhh, what did I do and how can I fix please? Much thanks in advance...
Posted By: Ian Spence Re: Fsum Status - 08/11/2004 1:51 AM
This is not part of this hack, so you really shouldn't post it here

it's a bug in javascript from what I can tell.

change

Code
var month = parseInt(tippy_array[0]) - 1;
to

Code
var month = tippy_array[0] - 1;
in your header insert
Posted By: Nightcrawler Re: Fsum Status - 12/04/2007 11:07 PM
Is this possible with UBB.Threads?

Anybody try it or created anything similar?
Posted By: AllenAyres Re: Fsum Status - 01/08/2008 11:59 PM
It's possible, the custom islands already do something very similar smile
© UBB.Developers