Discord Warning: filemtime():
Select messages from # through # Forum FAQ
[/[Print]\]

HeadShot Extreme -> Nuke Blocks / Modules Support

#1: No icon Discord Warning: filemtime(): Author: zardosLocation: North west of England PostPosted: Tue Aug 04, 2020 3:36 pm
    —
Hi coRpSe

Thanks for this module it is great job, but having a bit of trouble with it. I have done the upgrade to from 209e to 209f and all is fine. I have installed Discord and that went well to, but i think the new upgrade maybe giving this problem.

Warning: filemtime(): stat failed for themes/BF4_Multi/style/style.css in C:\wamp64\www\themes\BF4_Multi\theme.php on line 70
Call Stack
# Time Memory Function Location
1 0.0009 412272 {main}( ) ...\block-discord.php:0
2 0.0011 422920 require_once( 'C:\wamp64\www\mainfile.php' ) ...\block-discord.php:14
3 0.0977 858168 include_once( 'C:\wamp64\www\themes\BF4_Multi\theme.php' ) ...\mainfile.php:410
4 0.0993 861920 filemtime ( ) ...\theme.php:70

( ! ) Warning: filemtime(): stat failed for themes/BF4_Multi/style/nanoscroller.css in C:\wamp64\www\themes\BF4_Multi\theme.php on line 77
Call Stack
# Time Memory Function Location
1 0.0009 412272 {main}( ) ...\block-discord.php:0
2 0.0011 422920 require_once( 'C:\wamp64\www\mainfile.php' ) ...\block-discord.php:14
3 0.0977 858168 include_once( 'C:\wamp64\www\themes\BF4_Multi\theme.php' ) ...\mainfile.php:410
4 0.1562 862776 filemtime ( ) ...\theme.php:77

( ! ) Warning: filemtime(): stat failed for themes/BF4_Multi/script/BF4_Multi.js in C:\wamp64

I woulld of uploaded a pic of this, but keeps telling me maxfile size reached.

#2: No icon Re: Discord Warning: filemtime(): Author: Lonestar PostPosted: Tue Aug 04, 2020 4:45 pm
    —
OPEN

themes/BF4_Multi/theme.php

FIND

Code: [ Select all ]

addCSSToHead(BF4_Multi_main_stylesheet.'?v='.filemtime(BF4_Multi_main_stylesheet),'file');

 
REPLACE WITH

Code: [ Select all ]

add_css_to_head(BF4_Multi_main_stylesheet, 'file', time());


FIND

Code: [ Select all ]

addCSSToHead(BF4_Multi_nano_stylesheet.'?v='.filemtime(BF4_Multi_nano_stylesheet),'file');

 
REPLACE WITH

Code: [ Select all ]

add_css_to_head(BF4_Multi_nano_stylesheet, 'file', time());


FIND

Code: [ Select all ]

addJSToBody(BF4_Multi_main_javascript.'?v='.filemtime(BF4_Multi_main_javascript),'file');

 
REPLACE WITH

Code: [ Select all ]

add_js_to_body(BF4_Multi_main_javascript, 'file', time());


I will update the theme on Xtreme Wednesday night. So this should not happen again.
Last edited by Lonestar on Wed Aug 05, 2020 6:29 am; edited 1 time in total

#3: No icon Re: Discord Warning: filemtime(): Author: zardosLocation: North west of England PostPosted: Wed Aug 05, 2020 4:58 am
    —
Thank you Lonestar, on the first line i changed to this as it screwed up the main site.

PHP:  [ Select all ]

add_css_to_head(BF4_Multi_main_stylesheet'file'time()); 

 
Then it worked for me, thanks for that lonestar, looking forward to your new theme m8, great work so far.

coRpSE another great module, thank you.

#4: No icon Re: Discord Warning: filemtime(): Author: Lonestar PostPosted: Wed Aug 05, 2020 7:17 am
    —
Sorry about that, that was an error on my part lol. Glad it sorted it for you.

#5: No icon Re: Discord Warning: filemtime(): Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Fri Aug 07, 2020 11:34 am
    —
Glad to see you got it working. I wonder why this never showed new to me.

#6: No icon Re: Discord Warning: filemtime(): Author: zardosLocation: North west of England PostPosted: Sun Aug 09, 2020 4:12 pm
    —
Hi coRpSE any idear how to re-size discord for BF4 theme for the middle blocks, i have tried but the width will not respond, the height is fine.

#7: No icon Re: Discord Warning: filemtime(): Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Sun Aug 09, 2020 5:48 pm
    —
Yeah, I have an update I am working on that will shrink it even more for that narrow of a fixed width.
There is an absolute min width for the block if it is center. I have some things I like to change with it soon. I will probably work on that after I am done with the steam system.
The problem is, that theme was pretty much coded 10+ years ago, and back when it was done, average screen size was like 1280 or something like that, not the average is 1920 X 1080. That is why on a few sites I helped modified the BF4 theme, I widen the theme a bit in the center to allow center blocks to fit better while maintaining the feel of the theme. Here are a few examples. Click to Enlarge.

Expand  Expand
Expand

Expand  

Those are all the same theme, just slightly modified by me and all have at least an extra 100 - 350px wider from the stock theme.
I will see if I can get you the update or release an update where I will squeeze it in a bit more or show less info. Give me a couple of days and I will PM you with the files to try, you will just need to get back to me before I release it to everyone. Mind you that this will be just a temp thing till I redesign it a bit.

#8: No icon Re: Discord Warning: filemtime(): Author: zardosLocation: North west of England PostPosted: Mon Aug 10, 2020 2:14 am
    —
Thanks coRpSE, no big rush m8, when you have time. Thanks again.

#9: No icon Re: Discord Warning: filemtime(): Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Mon Aug 10, 2020 11:33 am
    —
Files sent in a PM to you.

#10: No icon Re: Discord Warning: filemtime(): Author: zardosLocation: North west of England PostPosted: Thu Aug 13, 2020 5:14 pm
    —
Thanks coRpSE, i think i have found the problem, the discord from your site is for evo 2.0.9e well it works ok on
evo 2.0.9f apart from the center block, it will not shrink any smaller, but shows up and works with 2.0.9f. the problem i think was to do with the code in this forum post.

Find:

PHP:  [ Select all ]

addCSSToHead(BF4_Multi_main_stylesheet.'?v='.filemtime(BF4_Multi_main_stylesheet),'file'); 

 
Replace:

PHP:  [ Select all ]

add_css_to_head(BF4_Multi_main_stylesheet'file'time()); 

 
I changed it to this on all three lines, i don't see that this should make a difference:

PHP:  [ Select all ]

addCSSToHead(BF4_Multi_main_stylesheet'file'time()); 

 
not had a problem with it at all on BF4_Multi, apart from center block not shrinking.
Now i am going to load LM-BlackMagic theme and see what happens.  :)

Ok it stopped working with LM-BlackMagic and gives me this error:

PHP:  [ Select all ]

Warningfilectime(): stat failed for themes/LM-BlackMagic/version.cache in C:\wamp64\www\includes\functions_evo_custom.php on line 686 

 

PHP:  [ Select all ]

Warningfopen(themes/LM-BlackMagic/version.cache): failed to open streamNo such file or directory in C:\wamp64\www\includes\functions_evo_custom.php on line 718 

 
I don;t code but it look like the original error, had a look but don;t know were to look, i think it maybe functions.php.

#11: No icon Re: Discord Warning: filemtime(): Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Fri Aug 14, 2020 11:19 am
    —
It's really hard not being able to see this first hand, but what it looks like by the last two errors you posted, the ones that involve the LM-BlackMagic theme.
The first error you posted about the filectime(); functions is probably happening due to the second error.
The error:

PHP:  [ Select all ]

Warningfopen(themes/LM-BlackMagic/version.cache): failed to open streamNo such file or directory in C:\wamp64\www\includes\functions_evo_custom.php on line 718 

 
That is saying that it's not finding a file called version.cache at this location:
public_html/themes/LM-BlackMagic/

Here is what you can try. Open up to the folder public_html/themes/LM-BlackMagic/ and see if you see a file called "version.cache". By that error above, it's saying that it does not exist, so in that case, you can create a text file on your desktop and call it version.cache. You will need to be able to see file types on your computer to be able to change the .txt to .cache. Once you do that, place that version.cache file in that previous location.

The last thing I can do, and this will be up to you, is set up a time to do a remote access using TeamViewer. But that will be up to you since I know that your site is on a local ATM.
This way you can see exactly what I am doing and if you want, if you have a mic/headset and want to talk at the same time, you can hop on my TeamSpeak, and we can be on comms there. Well, let me know if you like to go this route and if so, I am on EDT (Eastern Daylight Time), UTC/GMT -4 hours.

#12: No icon Re: Discord Warning: filemtime(): Author: Lonestar PostPosted: Fri Aug 14, 2020 12:52 pm
    —
Please post any problems with the LM-BlackMagic theme on my site please.

There should be a file called version.cache in the theme root, It comes with the package when you download it from the shop, The only way it would be missing is if it was deleted, The version.cache gets update every 24 hours, It is simple overridden if there is new data.

OK, now the difference between these two functions is with the code below.

Code: [ Select all ]

addCSSToHead(BF4_Multi_main_stylesheet.'?v='.filemtime(BF4_Multi_main_stylesheet),'file');

 
It uses the PHP function "filemtime" this grabs the modification time from the files properties, if it has changed since the last time the browser refreshed, the CSS file is cache again. Hence you see any changes that were made.

Now this function

Code: [ Select all ]

add_css_to_head(BF4_Multi_main_stylesheet, 'file', time());

This above function is new, I added this stop the use of the PHP function "filemtime" as it seems to cause more problems then its worth, Now the function above adds a variable to the end of the file like so.

Code: [ Select all ]

?ver=time()

This will update the CSS everytime the browser is refreshed, even if you manage to refresh the browser within 1 second the CSS file will be re-cached again, because the time stamp changes everytime the "time()" is called.

Do not use the function below it will not work, as the function below only takes two variables, Such as the CSS file and the way you wish to include the CSS, INLINE or FILE.

Code: [ Select all ]

addCSSToHead(BF4_Multi_main_stylesheet, 'file', time());

#13: No icon Re: Discord Warning: filemtime(): Author: zardosLocation: North west of England PostPosted: Fri Aug 14, 2020 2:01 pm
    —
Ok Lonestar will do.

The version.cache is in the theme root dir. thanks coRpSE

#14: No icon Re: Discord Warning: filemtime(): Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Sat Aug 15, 2020 10:18 pm
    —
Another replacement to using filemtime() would be to use stat() function. I have not run into any issues with filemtime() function myself, but for those that wanted to need to use something instead of filemtime(), you can do this.

PHP:  [ Select all ]

$filetime stat('./path/to/my/file.php');
$file_last_updated $stat['mtime']; 

 
Now that should say when the file was last modification, (Unix timestamp).

#15: No icon Re: Discord Warning: filemtime(): Author: Tazzy PostPosted: Fri Sep 04, 2020 3:26 pm
    —
— coRpSE wrote
Yeah, I have an update I am working on that will shrink it even more for that narrow of a fixed width.
There is an absolute min width for the block if it is center. I have some things I like to change with it soon. I will probably work on that after I am done with the steam system.
The problem is, that theme was pretty much coded 10+ years ago, and back when it was done, average screen size was like 1280 or something like that, not the average is 1920 X 1080. That is why on a few sites I helped modified the BF4 theme, I widen the theme a bit in the center to allow center blocks to fit better while maintaining the feel of the theme. Here are a few examples. Click to Enlarge.

Expand  Expand
Expand

Expand  

Those are all the same theme, just slightly modified by me and all have at least an extra 100 - 350px wider from the stock theme.
I will see if I can get you the update or release an update where I will squeeze it in a bit more or show less info. Give me a couple of days and I will PM you with the files to try, you will just need to get back to me before I release it to everyone. Mind you that this will be just a temp thing till I redesign it a bit.


Nice edits coRpSE i would also like a smaller discord block for the left or right of my site i will keep checking for update big grin keep up the good work.

#16: No icon Re: Discord Warning: filemtime(): Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Fri Sep 04, 2020 3:33 pm
    —
Smaller side block? Really?
How much smaller? It's already thin.
Have you thought about widening the side blocks?

#17: No icon Re: Discord Warning: filemtime(): Author: Tazzy PostPosted: Fri Sep 04, 2020 5:21 pm
    —
Sorry i ment one that would fit inside the block. I have it top left on my site at the moment buts its showing in middle

#18: No icon Re: Discord Warning: filemtime(): Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Fri Sep 04, 2020 5:43 pm
    —
What's the link to your site?

#19: No icon Re: Discord Warning: filemtime(): Author: Tazzy PostPosted: Sat Sep 05, 2020 2:47 am
    —
— coRpSE wrote
What's the link to your site?

Please login to see this link
Get registered or Log in

#20: No icon Re: Discord Warning: filemtime(): Author: Lonestar PostPosted: Sat Sep 05, 2020 4:31 am
    —
Fixed it for you, I am not sure how, but the DIV to center align the block was modified with a "width" that was too large for the side block. I simple removed the "width" styling and it works lachen

#21: No icon Re: Discord Warning: filemtime(): Author: Tazzy PostPosted: Sat Sep 05, 2020 5:35 am
    —
— Lonestar wrote
Fixed it for you, I am not sure how, but the DIV to center align the block was modified with a "width" that was too large for the side block. I simple removed the "width" styling and it works lachen


Awesome thanks man appreciate it

#22: No icon Re: Discord Warning: filemtime(): Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Sat Sep 05, 2020 2:26 pm
    —
I did a little bit more adjustments. That width was put in if memory serves me to stop a double scroll bar from showing up. If I remember right, I think I did widen your theme for you since that is definitely a widen theme from the default. However, I did just adjust it a bit more and made it so your channels would show 2 less character so it wouldn't push the block too wide, also, redid the Online, In-Game, and In Voice, so they are side by side. I think we went vertical when you had that thinner site before the theme was widened.

#23: No icon Re: Discord Warning: filemtime(): Author: Tazzy PostPosted: Mon Sep 07, 2020 12:37 am
    —
— coRpSE wrote
I did a little bit more adjustments. That width was put in if memory serves me to stop a double scroll bar from showing up. If I remember right, I think I did widen your theme for you since that is definitely a widen theme from the default. However, I did just adjust it a bit more and made it so your channels would show 2 less character so it wouldn't push the block too wide, also, redid the Online, In-Game, and In Voice, so they are side by side. I think we went vertical when you had that thinner site before the theme was widened.


Thank you very much man appreciate both you and Lonestars help

#24: No icon Re: Discord Warning: filemtime(): Author: [HSX]coRpSELocation: Back of your mind!!! PostPosted: Mon Sep 07, 2020 9:04 pm
    —
No Problem



HeadShot Extreme -> Nuke Blocks / Modules Support


output generated using printer-friendly topic mod. All times are GMT - 7 Hours

Page 1 of 1