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
<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
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
Hi,
how can I get a European Time format and what about the Javacript error?
thx
d-talk
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.
uh,
https://www.ubbdev.com/test/ubbcgi/ubb_status.cgi is full of errors
Copy this line to around the top:
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);
thanks LK, that's some of the work it needs
I'll add it and see where we're at then
Also add to the very beginning (perhaps after the line "small scripts by allen"?):
use constant SEVENSEVENSEVEN => 0777;
use constant SIXSIXSIX => 0666;
ok, added that and a few more it wanted and am now getting this:
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
For some reason, the line
<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.
that fixed the error and it now shows the status,
For some reason I moved it up top during one of my bug-fix searches yesterday
The avatar it is looking for, is that different from the 'your picture' that's found in the profile?
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.
thank you
Zip file up top updated with bugfixes and latest code
Hi LK and Allen,
what can I do to get the european time format for the last-visited time?
thx
d-talk
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.
Another question,
how can I delete the membersline, i marked red at the picture...
**** I can't programm somethin for european time-format...
there's gonna be bugs to be expected if you insist on using beta code
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
There are already lots of bugs being reported, check
http://www.ubbcentral.com/ in the bugs section
...
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?
oh, and Allen. I finally got it to work with the universal headers.
my $hf = &generic_wrapper({
page_title => "",
navbar_replace_right => qq~<font class="small"><b>
» <a href="$ULTIMATEBB{"ubb=get_daily"}">$vars_wordlets{active_topics}</a>
«
</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}"
grazi
I'll update the instructions this evening
Allen, how would I go about removing the following code from user titles before it was outputted?
where * are wildcards. I only know how to do if it there are no wildcards
?
I gotta get things moved to this pc so I know what yer talkin about
Gimme a day or so and I'll get it.
What are you trying to achieve with the output?
ok, at my other boards (GR) we have stars denoting rank in the titles.
Using this mod, the status prints out as html.
ie.
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
<img src="http://www.alforadmin.com/special.gif" alt="-" />
so that it'll just show "Special"?
nm Allen, I added this and it worked.
$user_status =~ s/(<img)(.+?)(>)//isg;
$user_status =~ s/(<br)(.+?)(>)//isg;
unsupported update for those who want formatted dates, etc...
change...
<script language="Javascript" type="text/javascript">document.writeln("You last visited: <b>", unescape(session_dt), "</b>");</script>
to...
<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>
What have I to change, that i can delete the Welcomeheader....?
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
Allen, in ubb status, could you change
to
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
Found by me getting annoyed lol...
k, I think I got all the bugfixes to date (didn't try the formatted date, since no-one reported it working
)
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
...
??? 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:
Nonono, the matter was, I had no clue where it was as it wasn't in the 6.x forum lol
Originally posted by Ian Spence:
unsupported update for those who want formatted dates, etc...
change...
<script language="Javascript" type="text/javascript">document.writeln("You last visited: <b>", unescape(session_dt), "</b>");</script>
to...
<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>
IanIf 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...
there should be a way around it if you just take the code from datelib.js (steal the one from here)
Hmmm ok I got it, just gotta work with it and figure it out now. thanks
hmmm, not working with this 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>
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...
Try this for the first step...
(first, undo your first step.)
**************************
* 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>
» <a href="$ULTIMATEBB{"ubb=get_daily"}">$vars_wordlets{active_topics}</a>
«
</b>~,
navbar_replace_right => qq~<b>$memberline</b>~,
Replace with:
=====
page_title => "",
navbar_replace_right => qq~<font size="$vars_style{FDTextSize}"><b>
» <a href="$ULTIMATEBB{"ubb=get_daily"}">$vars_wordlets{active_topics}</a>
«
</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>
~,
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.
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...
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
Whats wrong with this code? It seems right to me, but the graphic will not show up?
$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
b.t.w I take it this doesnt work with opera yet eh? Maybe you can work on that Ian
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
Now, back to my original code help question.....
also, is there a way in ubb_status to force avatar size for the forum summary? Like setting width,height to 70x70?
yeah, find the image tag, add width="70" height="70"
sweet... I thought u had to do it in ubb_status...guess not. Ok, thanks dude
now I gotta figure out why the code on the previous page doesnt work, wanted a frown gif if you were unregistered
it won't work, I tried. The JS won't allow html to be parsed. It'll just print the code
Ya, I've struggled with it myself also for some time now. Ahh well
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!
you could just edit the html to remove the space.
Right. I can do that. Can you point to the direction of the space please?
Or even where I might look?
The line right after when the instructions tell you to add "Your info"
Ahh.. That line... Found it. Thanks!
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...
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
var month = parseInt(tippy_array[0]) - 1;
to
var month = tippy_array[0] - 1;
in your header insert
Is this possible with UBB.Threads?
Anybody try it or created anything similar?
It's possible, the custom islands already do something very similar