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)
-   -   Forum Home Enhancements - Goodmorning/Goodafternoon/Goodevening Username (https://vborg.vbsupport.ru/showthread.php?t=139312)

Outbackmark 10-06-2008 02:19 AM

I have just installed this on a couple of 3.6.11 forums and had to fiddle a bit as some hacks that place info in this area of the navbar hook onto the {welcome_x} phrase will be affected by the template edit.
I lost my New Posts since last visit and had to do the following

Code:

<if condition="$show['member']">
       
                <td class="alt2" valign="top" nowrap="nowrap">
                <div class="smallfont">
                        <strong><phrase 1="$bbuserinfo[username]">$vbphrase[welcome_x]
                        <br />
      <script type="text/javascript">
var d = new Date()
var time = d.getHours()

if (time < 12)
{
document.write("<b>$vbphrase[goodmorning_x]</b>")
}
else if (time>=12 && time<18)
{
document.write("<b>$vbphrase[goodafternoon_x]</b>")
}
else
{
document.write("<b>$vbphrase[goodevening_x]</b>")
}
</script></phrase></strong><br />&nbsp;<if condition="$showinvisiblemode"><img class="inlineimg" src="$stylevar[imgdir_statusicon]/<if condition="!$invisiblemode">in</if>visible.gif" alt="$vbphrase[ajax_invisible_mode]" onclick="requestMarkData('index.php?{$session[sessionurl]}do=doinvisiblemode&amp;userid={$invisiblemodeuser}','parseMark',this)" /></if><br />
                        <phrase 1="$pmbox[lastvisitdate]" 2="$pmbox[lastvisittime]">$vbphrase[last_visited_x_at_y]</phrase>
                        <if condition="$show['pmstats']"><br /><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl_q]">$vbphrase[private_messages_nav]</phrase></if>
                        <if condition="$show['pmwarning']"><br /><strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></if>
                </div>
                </td>
               
        <else />

It now says
Quote:

Welcome, outbackmark.
2 New Posts since your last visit.
Good Afternoon, outbackmark.
You last visited: Today at 11:18 AM
Private Messages: Unread 0, Total 576.

SirFlash 10-13-2008 12:20 AM

I feel that saying "Good Evening" or even "Good Night" isn't appropriate for the hours between 12:00am and 05:00am, because: "Good evening" shouldn't refer to the early AM hours - that's simply not etymologically correct. If someone logs in to your forum at 1:00 am and you tell them "Good night!" it sounds like you're telling them to have a good night's sleep, as people normally say before they go to bed and close down for the day. I prefer a more welcoming term for the early AM caffeine-empowered individuals. 12-5am is a period I prefer to tell people "Good Early Morning"!

So I took the liberty of editing this hack so that it reads "Good Early Morning, Username", in which 'Username' will link to the member/users' profile page.

3-STEP INSTALLATION INSTRUCTIONS:

1) Upload the file product_goodmorning_welcome_v2.xml to your /includes/xml/ directory.

2) Go to your AdminCP / Manage Products / and click "Add/Import Product", and Import the XML File from your server, enter: ./includes/xml/product_goodmorning_welcome_v2.xml

and click import. Be sure to select "allow overwrite" if you have already installed this product.

3) Template Edit:

Go to AdminCP / Style Manager / Edit Templates (from the drop-down menu) / Navigation Breadcrumb Templates / navbar

Edit the "navbar" template

Find (for 3.6 and maybe 3.7 vbulletin versions):
Quote:

<strong><phrase 1="$bbuserinfo[username]">$vbphrase[welcome_x]</phrase></strong>
OR if you are using a later 3.7 or 3.8 version of vbulletin, find this instead:

Quote:

<strong><phrase 1="$bbuserinfo[username]" 2="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[welcome_x_link_y]</phrase></strong><br />
and Replace with:
Quote:

<!-- START Welcome User Edit -->
<strong><phrase 1="$bbuserinfo[username]" 2="member.php?$session[sessionurl]u=$bbuserinfo[userid]"><script type="text/javascript">
var d = new Date()
var time = d.getHours()
if (time>=0 && time<=5)
{
document.write("<b>$vbphrase[goodearlymorning_x]</b>")
}
else if (time>=5 && time<12)
{
document.write("<b>$vbphrase[goodmorning_x]</b>")
}
else if (time>=12 && time<18)
{
document.write("<b>$vbphrase[goodafternoon_x]</b>")
}
else
{
document.write("<b>$vbphrase[goodevening_x]</b>")
}
</script></phrase></strong><br />

<!-- END Welcome User Edit -->
Done! :D

I have tested this hack on vb 3.6.x, 3.7.x, and am currently running it on vb3.8 BETA - it works on all of these. Enjoy!

Welshy2008 02-06-2009 08:09 AM

I have this on my 3.6.8 board.

I am upgrading it to a 3.8.1 at the weekend. Will this work on it please? I don't want to lose this fantastic add-on.

SirFlash 10-12-2009 12:29 AM

Welchy - I just installed this modification with my modification to it so that it also says "Good Early Morning" (posted above your post) on vb 3.8.4 PL1, and it works perfectly.

Mind you, I installed my modification (the post above yours), the code difference between my modification of this modification shouldn't be an issue though, I'm pretty sure it'll work perfectly whichever hack you wish to use (the post before yours or the author's original release). Enjoy!


All times are GMT. The time now is 01:04 PM.

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.01207 seconds
  • Memory Usage 1,736KB
  • 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
  • (1)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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