Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons

Reply
 
Thread Tools
Nicer Greeting On NavBar Details »»
Nicer Greeting On NavBar
Version: 1.01, by sabret00the sabret00the is offline
Developer Last Online: Apr 2010 Show Printable Version Email this Page

Version: 3.5.1 Rating:
Released: 11-16-2005 Last Update: 11-17-2005 Installs: 80
Uses Plugins Template Edits
 
No support by the author.

Ok i can't take too much credit for it, the original concept was by omgli3k back on the vb3 days i think and even then back at RC stages anyway as a thank you check out his site http://empathogen.net/

Onto the hack, this hack changes the greeting and it's all done automatically and sweetly. it takes your users timezone and gives a greeting dependant on that: "Good Morning, $username.", "Good Afternoon. $username." or "Good Evening, $username.".

shweet huh lol

ok without further ado here you go.

upload as a product.

Thanks again to omgli3k for leading the way on this one

Supporters / CoAuthors

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #52  
Old 11-22-2005, 07:16 PM
davidw's Avatar
davidw davidw is offline
 
Join Date: Jul 2005
Location: Arkansas
Posts: 2,815
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have fixed it - at least on my site

PHP Code:
// Nicer Greeting On NavBar

$ng_gmt date('G') + 6// add  + or - and the difference between the server and GMT.  My time zone is GMT-6 so I add 6

$ng_tz_useroffset $vbulletin->userinfo['timezoneoffset'];
$ng_result bcadd($ng_gmt$ng_tz_useroffset);

if(
$ng_result 12){
        
$ng_greeting "<strong>" $vbphrase[ng_goodmorning] . " " $vbulletin->userinfo[username] . ".</strong>";
    } elseif(
$ng_result 18){
        
$ng_greeting "<strong>" $vbphrase[ng_goodafternoon] . " " $vbulletin->userinfo[username] . ".</strong>";
    } else {
        
$ng_greeting "<strong>" $vbphrase[ng_goodevening] . " " $vbulletin->userinfo[username] . ".</strong>";
    }

// Nicer Greeting On NavBar 
Reply With Quote
  #53  
Old 11-22-2005, 08:21 PM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this also solve the bcadd error christian?
Reply With Quote
  #54  
Old 11-22-2005, 08:28 PM
davidw's Avatar
davidw davidw is offline
 
Join Date: Jul 2005
Location: Arkansas
Posts: 2,815
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

bcadd is php(server) related issue. I think a suitable workaround might be (offhand since I haven't tried it)...

PHP Code:
// Nicer Greeting On NavBar

$ng_gmt date('G') + 6// add  + or - and the difference between the server and GMT.  My time zone is GMT-6 so I add 6

$ng_tz_useroffset $vbulletin->userinfo['timezoneoffset'];
// $ng_result = bcadd($ng_gmt, $ng_tz_useroffset); Replace this with:
$ng_result $ng_gmt $ng_tz_useroffset;

if(
$ng_result 12){
        
$ng_greeting "<strong>" $vbphrase[ng_goodmorning] . " " $vbulletin->userinfo[username] . ".";
    } elseif(
$ng_result 18){
        
$ng_greeting "<strong>" $vbphrase[ng_goodafternoon] . " " $vbulletin->userinfo[username] . ".";
    } else {
        
$ng_greeting "<strong>" $vbphrase[ng_goodevening] . " " $vbulletin->userinfo[username] . ".";
    }

// Nicer Greeting On NavBar 
Reply With Quote
  #55  
Old 11-22-2005, 11:13 PM
Mastar's Avatar
Mastar Mastar is offline
 
Join Date: Sep 2005
Posts: 680
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by christianb
I have fixed it - at least on my site

PHP Code:
// Nicer Greeting On NavBar

$ng_gmt date('G') + 6// add  + or - and the difference between the server and GMT.  My time zone is GMT-6 so I add 6

$ng_tz_useroffset $vbulletin->userinfo['timezoneoffset'];
$ng_result bcadd($ng_gmt$ng_tz_useroffset);

if(
$ng_result 12){
        
$ng_greeting "<strong>" $vbphrase[ng_goodmorning] . " " $vbulletin->userinfo[username] . ".</strong>";
    } elseif(
$ng_result 18){
        
$ng_greeting "<strong>" $vbphrase[ng_goodafternoon] . " " $vbulletin->userinfo[username] . ".</strong>";
    } else {
        
$ng_greeting "<strong>" $vbphrase[ng_goodevening] . " " $vbulletin->userinfo[username] . ".</strong>";
    }

// Nicer Greeting On NavBar 

I think that fixed it:

Code:
<?xml version="1.0" encoding="ISO-8859-1"?>

<product productid="nicergreeting" active="1">
  <title>Nicer Greeting On NavBar</title>
  <description>This adds a nicer greeting to your navbar.</description>
  <version>1.0.1</version>
  <codes>
  </codes>
  <templates>
  </templates>
  <plugins>
    <plugin active="1">
      <title>Nicer Greeting On NavBar</title>
      <hookname>global_start</hookname>
      <phpcode><![CDATA[// Nicer Greeting On NavBar

$ng_gmt = date('G') + 8;

$ng_tz_useroffset = $vbulletin->userinfo['timezoneoffset'];
$ng_result = bcadd($ng_gmt, $ng_tz_useroffset);

if($ng_result < 12){
        $ng_greeting = "<strong>" . $vbphrase[ng_goodmorning] . " " . $vbulletin->userinfo[username] . ".</strong>";
    } elseif($ng_result < 18){
        $ng_greeting = "<strong>" . $vbphrase[ng_goodafternoon] . " " . $vbulletin->userinfo[username] . ".</strong>";
    } else {
        $ng_greeting = "<strong>" . $vbphrase[ng_goodevening] . " " . $vbulletin->userinfo[username] . ".</strong>";
    }

// Nicer Greeting On NavBar]]></phpcode>
    </plugin>
  </plugins>
  <phrases>
    <phrasetype name="GLOBAL" fieldname="global">
      <phrase name="ng_goodafternoon"><![CDATA[Good Afternoon, ]]></phrase>
      <phrase name="ng_goodevening"><![CDATA[Good Evening,]]></phrase>
      <phrase name="ng_goodmorning"><![CDATA[Good Morning, ]]></phrase>
    </phrasetype>
  </phrases>
  <options>
  </options>
</product>
Reply With Quote
  #56  
Old 11-23-2005, 07:56 AM
NuclioN's Avatar
NuclioN NuclioN is offline
 
Join Date: Aug 2002
Posts: 955
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by christianb
bcadd is php(server) related issue. I think a suitable workaround might be (offhand since I haven't tried it)...
I think it's working now. Thanks.
Reply With Quote
  #57  
Old 11-23-2005, 12:06 PM
Vizionz Vizionz is offline
 
Join Date: Jul 2003
Location: Chicago
Posts: 524
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by christianb
bcadd is php(server) related issue. I think a suitable workaround might be (offhand since I haven't tried it)...

PHP Code:
// Nicer Greeting On NavBar

$ng_gmt date('G') + 6// add  + or - and the difference between the server and GMT.  My time zone is GMT-6 so I add 6

$ng_tz_useroffset $vbulletin->userinfo['timezoneoffset'];
// $ng_result = bcadd($ng_gmt, $ng_tz_useroffset); Replace this with:
$ng_result $ng_gmt $ng_tz_useroffset;

if(
$ng_result 12){
        
$ng_greeting "<strong>" $vbphrase[ng_goodmorning] . " " $vbulletin->userinfo[username] . ".";
    } elseif(
$ng_result 18){
        
$ng_greeting "<strong>" $vbphrase[ng_goodafternoon] . " " $vbulletin->userinfo[username] . ".";
    } else {
        
$ng_greeting "<strong>" $vbphrase[ng_goodevening] . " " $vbulletin->userinfo[username] . ".";
    }

// Nicer Greeting On NavBar 

thanks that worked

i attached the fixed version for bcad
Reply With Quote
  #58  
Old 11-23-2005, 12:39 PM
davidw's Avatar
davidw davidw is offline
 
Join Date: Jul 2005
Location: Arkansas
Posts: 2,815
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Glad to have helped - I hope you don't mind sabert00th
Reply With Quote
  #59  
Old 11-23-2005, 01:33 PM
sabret00the's Avatar
sabret00the sabret00the is offline
 
Join Date: Jan 2003
Location: London
Posts: 5,268
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not at all, i'm just leaving you to it
Reply With Quote
  #60  
Old 11-23-2005, 02:15 PM
spongebobrox128 spongebobrox128 is offline
 
Join Date: Mar 2005
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There is another solution besides adding the timezone offset to make it GMT. Look-up the function gmdate(); gmdate() gives you the time in GMT rather than in the server time. From the Vizionz' XML, replace
PHP Code:
$ng_gmt date('G') + 6// add  + or - and the difference between the server and GMT.  My time zone is GMT-6 so I add 6 
with
PHP Code:
$ng_gmt gmdate('G'); #get the time in GMT 
and it should work just as fine as adding the timezone offset to the time.
Reply With Quote
  #61  
Old 11-23-2005, 10:20 PM
C_P's Avatar
C_P C_P is offline
 
Join Date: Sep 2004
Posts: 262
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Weel, I liked the idea and clicked install but do not care to edit files to compensate for my time zone when others may have same issue just so it stops saying goodmorning even though it is 4:20 pm here.
I have to click uninstall and wait for a more complete mod. Sorry.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 06:01 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05531 seconds
  • Memory Usage 2,353KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (6)bbcode_php
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete