vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Chat Modifications - Fix vbShout Timezone problem (https://vborg.vbsupport.ru/showthread.php?t=144449)

newhere 04-10-2007 03:20 AM

Quote:

Originally Posted by Tulsa (Post 1223798)
Now how to get rid of the date and just have the time...

to get rid of the date and just have the time:

Code:

ret = ret + "[" + date.getHours() + ":" +
                            ((date.getMinutes() < 10) ? "0" : "") +
                            date.getMinutes() + " " +
                            ((date.getSeconds() < 10) ? "0" : "") +
                            date.getSeconds() + "]";


newhere 04-10-2007 03:37 AM

Quote:

Originally Posted by dbirosel (Post 1223814)
Omg perfect!!!! Thanks alot!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!

This isn't fully tested.
There might be a bug in this.

before
Code:

                if(hour > 12) {
you might want to add something like:
Code:

if(hour == 12) {
    append = "PM";
}

Otherwise 12 noon might show up as AM

dbirosel 04-10-2007 03:41 AM

So is this how it suppose to look?

Code:

var append = "AM";
                var hour = date.getHours();
                                if(hour == 12) {
                                    append = "PM";
                                }
                if(hour > 12) {
                    hour = hour - 12;
                    append = "PM";
                }
                if(hour == 0) {
                    hour = 12;
                    append = "AM";
                }
                ret = ret + "[" +
                            hour + ":" +
                            ((date.getMinutes() < 10) ? "0" : "") +
                            date.getMinutes() + ":" +
                            ((date.getSeconds() < 10) ? "0" : "") +
                            date.getSeconds() + " " + append + "]";


newhere 04-10-2007 03:45 AM

Quote:

Originally Posted by dbirosel (Post 1223830)
So is this how it suppose to look?

Code:

var append = "AM";
                var hour = date.getHours();
                if(hour == 12) {
                            append = "PM";
                }
                if(hour > 12) {
                    hour = hour - 12;
                    append = "PM";
                }
                if(hour == 0) {
                    hour = 12;
                    append = "AM";
                }
                ret = ret + "[" +
                            hour + ":" +
                            ((date.getMinutes() < 10) ? "0" : "") +
                            date.getMinutes() + ":" +
                            ((date.getSeconds() < 10) ? "0" : "") +
                            date.getSeconds() + " " + append + "]";


Sure I think that'll work.

Tulsa 04-10-2007 03:58 AM

I didn't much care for the date and the seconds. I got rid of the bracket and put a simple dash between the time and the username.

Code:

var append = "AM";
                var hour = date.getHours();
                if(hour > 12) {
                    hour = hour - 12;
                    append = "PM";
                }
                if(hour == 0) {
                    hour = 12;
                    append = "AM";
                }
                ret = ret + hour + ":" +
                            ((date.getMinutes() < 10) ? "0" : "") +
                            date.getMinutes() + " " + append + " - ";

The shoutbox is finally fixed.. Thanks again newhere. :up:

newhere 04-10-2007 04:03 AM

Quote:

Originally Posted by Tulsa (Post 1223842)
I didn't much care for the date and the seconds. I got rid of the bracket and put a simple dash between the time and the username.

Cool, whatever works for you. Thanks for posting your variation. I hope others do the same. :)

dbirosel 04-10-2007 05:57 AM

Here's a bug...

When pruning (/prune) it doesn't ajax the original message when pruning. So we would need to refresh the page. So instead it would say "Loading....."

newhere 04-10-2007 06:03 AM

Quote:

Originally Posted by dbirosel (Post 1223909)
Here's a bug...


When pruning (/prune) it doesn't ajax the original message when pruning. So we would need to refresh the page. So instead it would say "Loading....."

I haven't seen this myself. If it's truly an AJAX bug, it may be related to the original mod. All this hack does is a small string replacement on whatever html the AJAX requests return before assigning it to the div's innerHTML.

What do you mean by "pruning"?

dbirosel 04-10-2007 06:23 AM

Quote:

Originally Posted by newhere (Post 1223911)
I haven't seen this myself. If it's truly an AJAX bug, it may be related to the original mod. All this hack does is a small string replacement on whatever html the AJAX requests return before assigning it to the div's innerHTML.

What do you mean by "pruning"?

Well everything was operating just fine before this mod.

When people engage in conversations on the shoutbox, you can clear out all the recent messages by typing in "/prune".

newhere 04-10-2007 06:28 AM

Quote:

Originally Posted by dbirosel (Post 1223917)
Well everything was operating just fine before this mod.

When people engage in conversations on the shoutbox, you can clear out all the recent messages by typing in "/prune".

Hmm, okay I didn't know about this command, I just installed the shoutbox today. I'll look into this tomorrow if I can.

Thanks for your help and feedback.


All times are GMT. The time now is 04:42 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01418 seconds
  • Memory Usage 1,757KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete