Forum started on Dec 22, 2004, 17.26 and in existence for 8 Years3 Days •
Board start date MOD
Forum rules
Please only request support for mods released by phpbbmodders.net found at either https://github.com/phpbbmodders/ or the MODDB at http://www.phpbb.com
Please only request support for mods released by phpbbmodders.net found at either https://github.com/phpbbmodders/ or the MODDB at http://www.phpbb.com
Re: Board start date MOD
Sorry, I forgot to mention it In the above text, there is no space between year and day. Actually, I would prefer the word 'and' between the two.
Re: Board start date MOD
and the code you are using to get that would be?
Re: Board start date MOD
This one that you so kindly provided in May
Re: Board start date MOD
Aaand we have a winner!
Code: Select all
Forum started on Dec 22, 2004, 17.26 and in existence for 8 Years and 3 Days •
-
- New member
- Posts: 4
- Joined: 04 Nov 2012, 18:32
- Location: Rio de Janeiro
- Contact:
Re: Board start date MOD
RMcGirr83 wrote:mikef35 wrote:This is what is running your countdown, I am looking for a different way.Code: Select all
$(document).ready(function(){
$("#online").countdown({
date: "07 Aug 2012, 00:48:13",
leadingZero: true,
offset: -1,
yearsAndMonths: true,
htmlTemplate: "<span class='cd-online'>and in existence for</span> <strong>%y</strong> <span class=\"cd-online\">Years</span> <strong>%m</strong> <span class=\"cd-online\">Months</span> <strong>%d</strong> <span class=\"cd-online\">Days</span> <strong>%h</strong> <span class=\"cd-online\">Hours</span> <strong>%i</strong> <span class=\"cd-online\">Minutes</span> <strong>%s</strong> <span class=\"cd-online\">Seconds</span>",
direction: "up"
});
Uhmmm, yeah that isn't the code I am using.
RMcGirr83 how i can add in memberlist_view? i have in my board Forum like u have, but in memberlist, i have problens....
Re: Board start date MOD
The MOD is still not exactly accurate with leap years. Has there been a fix for that? It's not a biggie, just asking.
Re: Board start date MOD
For those who have a server running PHP 5.3+ and care about leap years being preoperly counted you can replace all the code in /includes/functions_board_start_date.php with this code:
Code: Select all
<?php
/**
* @package board start date
* @version
* @copyright (c) 2012 RMcGirr83 & 2015 Oyabun1
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
/**
* @ignore
*/
if (!defined('IN_PHPBB'))
{
exit;
}
/**
* board_start_date
*
* @return the start date of the board and time in years, months and days
*
*/
function board_start_date ()
{
global $config, $user;
$board_for = '';
$started = new DateTime($user->format_date($config['board_startdate']));
$today = new DateTime($user->format_date(time()));
$board_length = $started->diff($today);
$byears = $board_length->y;
$bmonths = $board_length->m;
$bdays = $board_length->d;
if ($board_length)
{
if ($byears >= 1)
{
$board_for .= $byears > 1 ? ($byears . ' ' . $user->lang['BOARD_YEARS']) : ($byears . ' ' . $user->lang['BOARD_YEAR']);
}
if ($bmonths)
{
$bsep = !empty($byears) ? $user->lang['COMMA_SEPARATOR'] : '';
$bmonths = $bmonths > 1 ? ($bsep . $bmonths . ' ' . $user->lang['BOARD_MONTHS']) : ($bsep . $bmonths . ' ' . $user->lang['BOARD_MONTH']);
$board_for .= $bmonths;
}
if ($bdays)
{
$band = !empty($bmonths) ? ' ' . $user->lang['BOARD_AND'] . ' ': '';
$bdays = $bdays > 1 ? ($band . $bdays . ' ' . $user->lang['BOARD_DAYS']) : ($band . $bdays . ' ' . $user->lang['BOARD_DAY']);
$board_for .= $bdays;
}
}
return ($board_for);
}
?>
Re: Board start date MOD
This sounds great!
Where did we go wrong here?
Where did we go wrong here?
Code: Select all
Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (joulu 22, 2004, 17.26) at position 0 (j): The timezone could not be found in the database' in /home/potku/public_html/forum/includes/functions_board_start_date.php:27 Stack trace: #0 /home/potku/public_html/forum/includes/functions_board_start_date.php(27): DateTime->__construct('joulu 22, 2004,...') #1 /home/potku/public_html/forum/includes/hooks/hook_bsd.php(42): board_start_date() #2 [internal function]: hook_bsd(Object(phpbb_hook), 'sn_im_online_li...', false, Object(mobile_template)) #3 /home/potku/public_html/forum/includes/hooks/index.php(141): call_user_func_array('hook_bsd', Array) #4 /home/potku/public_html/forum/includes/template.php(208): phpbb_hook->call_hook(Array, 'sn_im_online_li...', false, Object(mobile_template)) #5 /home/potku/public_html/forum/includes/template.php(243): template->display('sn_im_online_li...', false) #6 /home/potku/public_html/forum/socialnet/includes/socialnet.php(697): tem in /home/potku/public_html/forum/includes/functions_board_start_date.php on line 27
Re: Board start date MOD
That's the problem. What version of phpBB are you running?The timezone could not be found in the database
Re: Board start date MOD
We are still (and for a long time coming, for that matter) with the 3.0 branch. I didn't see a mention about the phpBB version in Oyabun1's post. Our PHP is 5.4.x.x.
Re: Board start date MOD
So, is this revision only for phpBB 3.1 series?
Re: Board start date MOD
No. I didn't try it on 3.1.
Re: Board start date MOD
Hmm... What might have caused that error on our board?
Re: Board start date MOD
Maybe answer Rich's question?
RMcGirr83 wrote:What version of phpBB are you running?