Site Links
Home
Features
Documentation
Pricing & Order
Members Area
Support Options
UBBDev.com
UBBWiki.com
Who's Online
2 registered (Gizmo, SteveS), 38 Guests and 14 Spiders online.
Key: Admin, Global Mod, Mod
Featured Member
Registered: 06/07/07
Posts: 4
Top Posters (30 Days)
Ruben 50
DennyP 24
Gizmo 23
Dunny 15
SteveS 13
AllenAyres 12
dbremer 10
SD 10
drkknght00 9
doug 8
Latest Photos
OK Corral Shoot Out
Testing
Basildon Train Station
Basildon Town Centre looking from the rounderbout
Basildon Town Square
Page 1 of 2 1 2 >
Topic Options
#239995 - 10/16/10 04:17 PM "Variable not defined" error with UBB Calendar in a Drupal block
sb Offline
member
Registered: 01/06/04
Posts: 166
Greetings-

The UBB calendar seems to work well exposed into a Drupal block... (Link to thread) with Firefox. IE8 is giving an error message. I found out how to enable IE script debugging, and it complains about this line of code which is generated by UBB.

day = get_object("day" + today);

It says that variable today is not defined, which indeed at first glance does not seem to me to be defined. Suggestions?


Edited by sb (10/16/10 04:22 PM)
Top
Express Hosting
Express Hosting "We are the official hosting company of UBB.threads. Ask us about our free migration services to migrate your UBB.threads installation."
#239996 - 10/17/10 01:12 AM Re: "Variable not defined" error with UBB Calendar in a Drupal block [Re: sb]
SD Offline
Registered: 04/19/07
Posts: 4056
Loc: SoCal, USA
yep, that is a bug

you could (temporarily just remove that javascript section.

it's trying (and failing) to decide which day is today and then css it accordingly to make it stand out on the calendar..

i don't have time to look deeper, but the fix is perty simple too, if you know some javascript smile

header.tpl loads up the value of the today variable as it stands in ubbthread "var today='17';" for example if you view this page's source.

so the solution would be (since you aren't getting that passed into the drupal) to populate today with the value of todays day in month. i can't remember off hand what it is in javascript, but it's googlable if you can't wait til i get back to it wink

edit: never mind.. add these two lines before that line of code

Code:
var ubbcal=new Date();
var today=ubbcal.getDay();


should do it smile
_________________________

Threads tutorials . Threads & Wordpress experts . UBB resume

If I you, click this link as to why
Top
#240090 - 10/23/10 05:55 PM Re: "Variable not defined" error with UBB Calendar in a Drupal block [Re: sb]
sb Offline
member
Registered: 01/06/04
Posts: 166
Shall I post that into the PHP code snippet that produces the HTML for the calendar block... or do I need to add those lines of code to one of the UBB .php files? A bit of context would be quite helpful. Thanks!
Top
#240091 - 10/23/10 07:21 PM Re: "Variable not defined" error with UBB Calendar in a Drupal block [Re: sb]
SD Offline
Registered: 04/19/07
Posts: 4056
Loc: SoCal, USA
right before the echo <table>

add

Code:
echo <<<GET_TODAY
<script>
var ubbcal=new Date();
var today=ubbcal.getDay();
</script>
GET_TODAY;
_________________________

Threads tutorials . Threads & Wordpress experts . UBB resume

If I you, click this link as to why
Top
#240106 - 10/28/10 05:05 PM Re: "Variable not defined" error with UBB Calendar in a Drupal block [Re: sb]
sb Offline
member
Registered: 01/06/04
Posts: 166
That code is in UBB file templates/default/island_public_calendar.tpl

So I modified the version on the server as follows:
Code:
<script language="javascript" type="text/javascript">
// <![CDATA[
var ubbcal = new Date();
var today = ubbcal.getDay();
day = get_object("day" + today);
currenttitle = day.title;
day.title = "<?php echo $ubbt_lang['TODAY'] ?>\n" + currenttitle;
day.className = "standouttext";
// ]]>
</script>


I then rebuilt the cache so the update would take affect, checked in with Firefox and saw the added two lines.

Now IE8 throws an "Object expected" error on the "day = get_object("day" + today);" line of code.

Further suggestions, please.
Top
#240107 - 10/28/10 05:49 PM Re: "Variable not defined" error with UBB Calendar in a Drupal block [Re: sb]
sb Offline
member
Registered: 01/06/04
Posts: 166
aaaahhhh... FF's error console to the rescue now. It says that "get_object" is not defined. That was in the code already... rrr???
Top
#240108 - 10/29/10 09:14 AM Re: "Variable not defined" error with UBB Calendar in a Drupal block [Re: sb]
sb Offline
member
Registered: 01/06/04
Posts: 166
This appears to be defined in this file, though inclusion of this file is not within island_public_calendar.tpl

ubb_js/ubb_jslib.js:function get_object(obj)

That just might be a problem...
Top
#240271 - 11/17/10 01:25 PM Re: "Variable not defined" error with UBB Calendar in a Drupal block [Re: sb]
sb Offline
member
Registered: 01/06/04
Posts: 166
Bump... may we have some help with this issue please?
Top
#240272 - 11/17/10 02:15 PM Re: "Variable not defined" error with UBB Calendar in a Drupal block [Re: sb]
SD Offline
Registered: 04/19/07
Posts: 4056
Loc: SoCal, USA
Code:
day = document.getElementById('day' + today);

_________________________

Threads tutorials . Threads & Wordpress experts . UBB resume

If I you, click this link as to why
Top
#240273 - 11/17/10 02:16 PM Re: "Variable not defined" error with UBB Calendar in a Drupal block [Re: sb]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
You should be able to change this line:

Code:

day = get_object("day" + today);



to this:

Code:

day = document.getElementById("day" + today);

Top
#240274 - 11/17/10 02:17 PM Re: "Variable not defined" error with UBB Calendar in a Drupal block [Re: sb]
Rick Offline
Post-a-holic
Registered: 06/04/06
Posts: 10164
Loc: Aberdeen, WA
SD is too fast for me.
Top
#240275 - 11/17/10 02:19 PM Re: "Variable not defined" error with UBB Calendar in a Drupal block [Re: sb]
SD Offline
Registered: 04/19/07
Posts: 4056
Loc: SoCal, USA




_________________________

Threads tutorials . Threads & Wordpress experts . UBB resume

If I you, click this link as to why
Top
Page 1 of 2 1 2 >



Moderator:  AllenAyres, Harold, Ian, Ron M 
Shout Box

Today's Birthdays
No Birthdays
Recent Topics
Temporary Password email not being received
by
05/24/12 10:02 PM
Ability to "like" individual posts (not Facebook "likes)
by doug
05/23/12 09:03 AM
Island Permissions
by ThreadsUser
05/22/12 03:03 PM
streaming video
by prkrgrp
05/20/12 07:02 PM
New Posts Corrupted? Can someone help?
by PianoWorld
05/19/12 09:41 AM
Forum Stats
10492 Members
36 Forums
33842 Topics
181709 Posts

Max Online: 978 @ 06/24/07 11:19 PM
Random Image