Recent Posts

Pages: [1] 2 3 ... 10
1
phpBB Support Forum / PHPBB3 BBCode Help
« Last post by x2sln on March 10, 2018, 05:03:19 am »
Hi All,

Appologies if this is in the wrong area!

Ive trying to create an 'inline' in post event count down timer, ideally using BBcode so forum users can create countdown timers to certain events.

What i have so far pretty much works however some of the maths isn't quite right, and so while most dates show up correctly some don't and I'm at my wits end trying to work out where ive gone wrong! Can someone have a look and point me in the right direction - to be clear - the code I'm using is not my own.

Im on PHPBB 3.2.0

BBCode Usage
Code: [Select]
[event={NUMBER1}/{NUMBER2}/{NUMBER3}]{TEXT}[/event]
HTML Replacement
Code: [Select]
<script language="JavaScript">
// February has 29 days in any year evenly divisible by four, EXCEPT for centurial years which are not also divisible by 400.
function daysInFebruary (year) {
return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
var Eventtext = "<strong>{TEXT}</strong>" ;
var Future = new Date('{NUMBER1}/{NUMBER2}/{NUMBER3}');
var Today = new Date();
var daysinmonth = { 1:31, 2:(daysInFebruary(Today.getYear())), 3:31, 4:30, 5:31, 6:30, 7:31, 8:31, 9:30, 10:31, 11:30, 12:31 };
var F_Year = Future.getYear();
var F_Month = Future.getMonth();
var F_Day = Future.getDate();
var years = 0;
var months = 0;
var days = 0;

while( F_Year  != Today.getYear()  ) { if ( F_Year < Today.getYear() ) { F_Year++; years--; } else { F_Year--; years++; F_Month++;} }
while( F_Month != Today.getMonth() ) { if ( years < 0 ) { months = Today.getMonth()-F_Month; break;} else { if ( F_Month < Today.getMonth() ) { F_Month++; months--; } else { F_Month--; months++; } } }
while( F_Day   != Today.getDate()  ) { if ( years < 0 ) { days = Today.getDate()-F_Day; break;} else { if ( F_Day < Today.getDate() ) { F_Day++; days--; } else { F_Day--; days++; } } }

if ( years > 0 ) {
if ( days < 0 )   { days = daysinmonth[F_Month]-Math.abs(days-1); months--; }
if ( months < 0 ) { months = 12-Math.abs(months-1); years--; }
}

if ( !years && !months && !days ) { document.write(" Today is " + Eventtext); }
else if ( !years && !months && days == 1 ) { document.write(" Tomorrow is " + Eventtext); }
else if ( !years && !months && days == -1 ) { document.write(" Yesterday was " + Eventtext); }
else {
var word_year = ( Math.abs(years) == 1 ) ? " year, " : " years, ";
var word_month  = ( Math.abs(months) == 1) ? " month, " : " months, ";
var word_day = ( Math.abs(days) == 1 ) ? " day" : " days";
var word_elapsed= ( Future > Today ) ? " until " : " since ";
var Output  = (years != 0) ? Math.abs(years) + word_year: '' ;
Output += (months != 0) ? Math.abs(months) + word_month  : '' ;
Output += (days != 0) ? Math.abs(days) + word_day  : '' ;
document.write(Output + word_elapsed + Eventtext); }
</script>

Help Line
Code: [Select]
[event=DATE]NAME THE EVENT[/event] Example : [event=2008/09/22]Next workday[/event]
testing this on todays date on my forum (Todays date been: 2018/03/10: YYYY/MM/DD) i get the following results (ive shown the event code infront of each for ease)

Code: [Select]
[event=2018/03/09][/event] Produces: Yesterday  - correct
Code: [Select]
[event=2018/03/10][/event] Produces: Today  - correct
Code: [Select]
[event=2018/03/11][/event] Produces: Tomorrow  - correct
Code: [Select]
[event=2019/03/09][/event] Produces: 1 year, 26 days - wrong
Code: [Select]
[event=2019/03/10][/event] Produces: 1 year, 1 month,  - 1 month out
Code: [Select]
[event=2019/03/11][/event] Produces: 1 year, 1 month, 1 day  - 1 month out

As you can see some dates work perfectly some don't - any help would be gratefully received



2
phpBB Support Forum / Re: AOK Forum - The Prop Den
« Last post by NoHumorMan on July 19, 2017, 04:25:04 am »
Just a question: when uploading images using the forum based image hosting system, can it be done so that the picture shows up in the post instead of having to click on an attachment link to view it?
3
phpBB Support Forum / Re: AOK Forum - The Prop Den
« Last post by NoHumorMan on July 03, 2017, 11:10:28 am »
It happens when they reply to a thread and then click that particular link, so should happen anywhere.  I can give you the username of the guy experiencing the issue in case it is easier to find the error when reviewing his account.
4
phpBB Support Forum / Re: AOK Forum - The Prop Den
« Last post by ForumMate on July 03, 2017, 10:07:07 am »
Ask them what the url looks like in the address bar. See if they can copy it down.
5
phpBB Support Forum / Re: AOK Forum - The Prop Den
« Last post by NoHumorMan on July 03, 2017, 09:36:33 am »
Hello awesome support.  Someone posted an issue and I wanted to forward it to you to check out.  It seems there's still an issue when posting.  I haven't experienced it, but hopefully it's possible to find the issue and fix it.

Here's the original message along with images showing what happens.

Quote
Error Message, if start a new thread or post in a thread while pressing the "submint" button.
Just get a error message, if klick on "view your submitted post" after pressed the submit button.
Can't close it while using the refresh button in my browser, just if i close the whole tab.
If i go back to the mainboard to the post or the thread i wrote , it will be shown correctly.
Error message will not pop up ,if i klick to "view active topic's" instead of "view your submitted post"

Marked here:


Error message:
6
phpBB Support Forum / Re: AOK Forum - The Prop Den
« Last post by NoHumorMan on June 30, 2017, 06:57:48 pm »
Yeah, I tried replying to one of your test messages and didn't get an error message.  Thanks.
7
phpBB Support Forum / Re: AOK Forum - The Prop Den
« Last post by ForumMate on June 25, 2017, 01:55:03 pm »
I think i fixed it. I posted a bunch of test topics under http://thepropden.aokforums.com/privileged-concept-vf24.html
Please remove.

It seemed to been related to post email notification.
8
phpBB Support Forum / Re: AOK Forum - The Prop Den
« Last post by NoHumorMan on June 25, 2017, 07:00:24 am »
I'm still getting this error message when replying to topics:

*
Recoverable fatal error: Object of class template could not be converted to string in C:\echophp\freeforum.ca\web\includes\functions_messenger.php on line 212
*

I have heard from another user who is having the same problem.  There may be more, as I'm seeing a lot of double posts that we then have to delete manually.
9
phpBB Support Forum / Re: AOK Forum - The Prop Den
« Last post by NoHumorMan on June 06, 2017, 09:50:27 am »
Of all the options listed only the following is checked in the list (marked by X)

    Disable BBCode
   Disable smilies
   Do not automatically parse URLs
X   Attach a signature (signatures can be altered via the UCP)
   Notify me when a reply is posted
   Lock topic

So there really shouldn't be any issues.  Can you check if there is an issue with my account that may be connected with the admin control panel issue and the fact that I was locked out!?
10
phpBB Support Forum / Re: AOK Forum - The Prop Den
« Last post by ForumMate on June 05, 2017, 11:38:09 pm »
I don't seem to be getting Recoverable fatal error: Object of class template could not be converted to string in C:\echophp\freeforum.ca\web\includes\functions_messenger.php on line 212 when replying to my test messages in my forum.  What options are checked when post a reply topic.
Pages: [1] 2 3 ... 10