mdayonliner (OP)
Copper Member
Sr. Member
Offline
Activity: 630
Merit: 420
We are Bitcoin!
|
|
May 18, 2018, 07:36:10 PM |
|
I am pretty sure there are so many stuffs to be taken care of however if - by any chance, can this be taken care of? I just noticed it. Shouldn't it be: "1 hour" instead of "1 hours"? This leads me to think, may be the "days" and "minutes" are also functioning the same when it's 1 like: 1 days and 1 minutes. Again not a big deal. It's not even noticeable however wouldn't it be nice to see it to be fixed. (I know, the dev will need to write a function to determine when to add "s" and when to remove "s" and it's not gonna take much time for someone who is practising programming) PS: Don't get surprised by seeing my logged time. I joined the forum on December 14, 2017. Since then (except 34 days) I am literally spending everyday whole day on the forum LOL
|
Be happy be at peace. Looking forward to BTC at $1M
|
|
|
jackg
Copper Member
Legendary
Offline
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
|
|
May 19, 2018, 12:07:58 AM |
|
I don't think this will get fixed.
It's such a large fix for something that isn't really an issue and it alwo means an extra few lines of code that need to be loaded before the forum loads to validate the time. It's easier just to go with the plural version, it only makes a difference once every 60 minutes (for minutes), once every day (for hours) and only once for days.
|
|
|
|
mdayonliner (OP)
Copper Member
Sr. Member
Offline
Activity: 630
Merit: 420
We are Bitcoin!
|
|
May 19, 2018, 01:15:47 PM |
|
I don't think this will get fixed.
It's such a large fix for something that isn't really an issue and it alwo means an extra few lines of code that need to be loaded before the forum loads to validate the time. It's easier just to go with the plural version, it only makes a difference once every 60 minutes (for minutes), once every day (for hours) and only once for days.
Like I said in the original post it really is not a big deal. It's not a large fix by the way. Few lines in a function/method only to be loaded once every-time the page loads.
|
Be happy be at peace. Looking forward to BTC at $1M
|
|
|
Tyrantt
|
|
May 19, 2018, 01:25:20 PM |
|
Well since that "problem" occurs only for one hour, I don't think it's needed to be fixed at all. :/ also, that time you've spent should just be in hours, if you ask me.
|
Need some spare btc for a new PC that can at least run Adobe Dreamweaver.
BTC - 19qm3kH4MZELkefEb55HCe4Y5jgRRLCQmn ♦♦♦ ETH - 0xd71ACd8781d66393eBfc3Acd65B224e97Ae1952D
|
|
|
minifrij
Legendary
Offline
Activity: 2352
Merit: 1267
In Memory of Zepher
|
|
May 19, 2018, 04:11:26 PM |
|
I will say that it's fairly pointless, although here's some adapted code to fix this anyway: /Themes/default/index.template.php line 256:// Show the total time logged in? if (!empty($context['user']['total_time_logged_in'])) { echo ' ', $txt['totalTimeLogged1'];
$timeString = '';
// If days is just zero, don't bother to show it. if ($context['user']['total_time_logged_in']['days'] > 0) $timeString .= $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2']; // Same with hours - only show it if it's above zero. if ($context['user']['total_time_logged_in']['hours'] > 0) $timeString .= $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];
// But, let's always show minutes - Time wasted here: 0 minutes ;). $timeString .= $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
echo str_replace(array('1 days', '1 hours', '1 minutes'), array('1 day', '1 hour', '1 minute'), $timeString); }
|
|
|
|
jackg
Copper Member
Legendary
Offline
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
|
|
May 19, 2018, 04:24:08 PM |
|
I will say that it's fairly pointless, although here's some adapted code to fix this anyway: /Themes/default/index.template.php line 256:// Show the total time logged in? if (!empty($context['user']['total_time_logged_in'])) { echo ' ', $txt['totalTimeLogged1'];
$timeString = '';
// If days is just zero, don't bother to show it. if ($context['user']['total_time_logged_in']['days'] > 0) $timeString .= $context['user']['total_time_logged_in']['days'] . $txt['totalTimeLogged2']; // Same with hours - only show it if it's above zero. if ($context['user']['total_time_logged_in']['hours'] > 0) $timeString .= $context['user']['total_time_logged_in']['hours'] . $txt['totalTimeLogged3'];
// But, let's always show minutes - Time wasted here: 0 minutes ;). $timeString .= $context['user']['total_time_logged_in']['minutes'], $txt['totalTimeLogged4'], '<br />';
echo str_replace(array('1 days', '1 hours', '1 minutes'), array('1 day', '1 hour', '1 minute'), $timeString); }
If the array was (,1 hours,1 minutes) would that still get picked up by your code or do you have to look at the individual indexes in more detail? (I haven't used php very much).
|
|
|
|
shahzadafzal
Copper Member
Legendary
Offline
Activity: 1694
Merit: 3023
|
|
May 19, 2018, 04:25:10 PM |
|
I will say that it's fairly pointless, although here's some adapted code to fix this anyway:
/Themes/default/index.template.php line 256:
I guess no, it should be done through localization or translation files if necessary. But not going to happen since there would be so many places to be checked e.g. Posts: <--- User stats & Home page where user have only one post Topics <--- home page in case of single topic Child Boards <---- Where is single child board in
|
|
|
|
jackg
Copper Member
Legendary
Offline
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
|
|
May 19, 2018, 04:31:00 PM |
|
I will say that it's fairly pointless, although here's some adapted code to fix this anyway:
/Themes/default/index.template.php line 256:
I guess no, it should be done through localization or translation files if necessary. But not going to happen since there would be so many places to be checked e.g. Posts: <--- User stats & Home page where user have only one post Topics <--- home page in case of single topic Child Boards <---- Where is single child board in The majority of the forum uses the same file (index.php). Most of the stuff comes through that. Other than things like the seclog and modlpg which are separate. This is the link to the post I just made: https://bitcointalk.org/index.php?topic=3956687.new#new
|
|
|
|
mdayonliner (OP)
Copper Member
Sr. Member
Offline
Activity: 630
Merit: 420
We are Bitcoin!
|
|
May 19, 2018, 09:08:55 PM |
|
The majority of the forum uses the same file (index.php).
I am pretty sure that there is a common header file which loads with all the pages except few special pages like you mentioned.
|
Be happy be at peace. Looking forward to BTC at $1M
|
|
|
jackg
Copper Member
Legendary
Offline
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
|
|
May 19, 2018, 09:30:50 PM |
|
The majority of the forum uses the same file (index.php).
I am pretty sure that there is a common header file which loads with all the pages except few special pages like you mentioned. There are just different things passed as parameters per pages. Like: https://bitcointalk.org/index.php?action=post;quote=37842121;topic=3956687.0 - loads a link to add a new reply - with two extra parameter added though I'm not sure I should include them. Every page loads the smf banner at the top, the smf banner at the bottom (the custom code by theymos) and the information specific to the parameter passed to it.
|
|
|
|
minifrij
Legendary
Offline
Activity: 2352
Merit: 1267
In Memory of Zepher
|
|
May 20, 2018, 01:22:53 AM |
|
If the array was (,1 hours,1 minutes) would that still get picked up by your code or do you have to look at the individual indexes in more detail? (I haven't used php very much).
Here are the arrays: [1 days, 1 hours, 1 minutes][1 day, 1 hour, 1 minute]Any instance of the something in the first array is replaced with the item in the second array of the same index. It does this for every instance.
I guess no, it should be done through localization or translation files if necessary.
I may be incorrect, but I believe this forum only supports English. Since this is the case, and the forum only supports one theme, the code would only have to be replaced in one place. That, and due to the way that SMF works trying to change this through localization files would be massively complicating things when only one language is available.
|
|
|
|
mdayonliner (OP)
Copper Member
Sr. Member
Offline
Activity: 630
Merit: 420
We are Bitcoin!
|
|
May 21, 2018, 01:26:01 PM |
|
I am pretty sure that there is a common header file which loads with all the pages except few special pages like you mentioned.
Every page loads the smf banner at the top, the smf banner at the bottom (the custom code by theymos) and the information specific to the parameter passed to it. I have no idea about the coding structure of smf but what I said was for in general coding style. These are the $_GET parameters we are talking about which we can see, there are $_POST parameters as well IMO which we are not seeing at all.
|
Be happy be at peace. Looking forward to BTC at $1M
|
|
|
jackg
Copper Member
Legendary
Offline
Activity: 2856
Merit: 3071
https://bit.ly/387FXHi lightning theory
|
|
May 21, 2018, 04:22:47 PM |
|
I am pretty sure that there is a common header file which loads with all the pages except few special pages like you mentioned.
Every page loads the smf banner at the top, the smf banner at the bottom (the custom code by theymos) and the information specific to the parameter passed to it. I have no idea about the coding structure of smf but what I said was for in general coding style. These are the $_GET parameters we are talking about which we can see, there are $_POST parameters as well IMO which we are not seeing at all. I'm not discussing how general get/post requests work (and the other two main requests you can make). Im suggesting looking at the URL to see that everything loads from the same page (index.php). If the array was (,1 hours,1 minutes) would that still get picked up by your code or do you have to look at the individual indexes in more detail? (I haven't used php very much).
Here are the arrays: [1 days, 1 hours, 1 minutes][1 day, 1 hour, 1 minute]Any instance of the something in the first array is replaced with the item in the second array of the same index. It does this for every instance.
I guess no, it should be done through localization or translation files if necessary.
I may be incorrect, but I believe this forum only supports English. Since this is the case, and the forum only supports one theme, the code would only have to be replaced in one place. That, and due to the way that SMF works trying to change this through localization files would be massively complicating things when only one language is available. Yes English is the only avaliable language for banners. And I didn't realise it checked every record individually, that's quite efficient.
|
|
|
|
mdayonliner (OP)
Copper Member
Sr. Member
Offline
Activity: 630
Merit: 420
We are Bitcoin!
|
|
May 21, 2018, 08:01:40 PM |
|
I'm not discussing how general get/post requests work (and the other two main requests you can make).
Im suggesting looking at the URL to see that everything loads from the same page (index.php).
Sorry my bad. I lost focus somehow - looking at the URL, it's obvious that all the pages (except few special pages) are loading from index page.
|
Be happy be at peace. Looking forward to BTC at $1M
|
|
|
|