Everything posted by Charlie
-
Video background causing sluggish scrolling on website
It is a bit of an egg sucking post yes, but I can definitely relate to everything you're saying and 99% of the time I would tend to agree with you. But in this case, it's my own personal website, I'm having a good time experimenting with things I wouldn't usually get to experiment with and I'm keen to inject energy and my own personality into it. I do video work as well as web design so I was keen to get that across. It's a background video anyway, it's just to add to the atmosphere of the website a bit like an image would but where an image tells 1,000 words I feel like a video can tell a million. The aim of this post was to ensure I could optimise it as much as possible and if you check my Pingdom stats, it's looking pretty good. Thanks again for your comments, appreciate it!
-
Video background causing sluggish scrolling on website
Thanks for your help Jack, hadn't occurred to me that it was the fixed background image that was causing the issue! I've followed the advice here and it's really helped. It's working much smoother now! There's still a fixed background image further issue but I can only really unfix one! Good to hear your thoughts fisicx, you made some good points but I'll stick with it for now, I'm really enjoying it! Cheers all
-
Video background causing sluggish scrolling on website
Hi there, I'm running a homepage video on my site, hosted on YouTube. It only runs for larger breakpoints. I was wondering if anyone had any ideas on how I could reduce the sluggishness when the users scrolls down the page, I'm particularly noticing this on Safari Mac. It may be that this is just a side effect of running a video background on a website homepage but I was wondering if anyone had any fixes? I used this to implement it which has a pause on scroll feature which is supposedly meant to remedy this but it's still an issue for me. http://rochestb.github.io/jQuery.YoutubeBackground/ It's running on my site at http://bit.ly/2xqP9aN Many thanks for any tips or tricks!
-
Caching YouTube video list to decrease load time?
Hi Sogo, Did you get a chance to take a look at this for me? Would really appreciate it! Thanks!
-
Caching YouTube video list to decrease load time?
Hey Sogo, Thank you for continuing to help me with this & I hope your dog is well ! I've had the code fixed now but have come across another small error that I keep experiencing. It doesn't happen 24/7, just sometimes? I think it happens after I haven't visited the page for a while or maybe after it refreshes the cache after an hour? Getting this error in the videos pod here currently: Warning: file_get_contents(http://gdata.youtube.com/feeds/api/playlists/C82EBDAC0429B6A2?orderby=published&max-results=12): failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/index.php on line 42 Warning: simplexml_load_file(): videobrowser.txt:1: parser error : Document is empty in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/index.php on line 49 Warning: simplexml_load_file(): in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/index.php on line 49 Warning: simplexml_load_file(): ^ in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/index.php on line 49 Warning: simplexml_load_file(): videobrowser.txt:1: parser error : Start tag expected, '<' not found in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/index.php on line 49 Warning: simplexml_load_file(): in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/index.php on line 49 Warning: simplexml_load_file(): ^ in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/index.php on line 49 Notice: Trying to get property of non-object in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/index.php on line 50 Warning: Invalid argument supplied for foreach() in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/index.php on line 50 This seems to be fixed (it is now) after visiting a few times? But it keeps reoccurring. The full code for that page can be found here. Thanks so much again, I need to tip you!!
-
Caching YouTube video list to decrease load time?
Hi Sogo, the script has stopped working for me recently, is it still working for you? I'm getting errors with it now, I've moved to a new host if that makes a difference, I've got it running separately at http://new.fearofmobs.com/playlist.php Errors are: Warning: simplexml_load_file(): videobrowser.txt:1: parser error : Document is empty in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/playlist.php on line 16 Warning: simplexml_load_file(): in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/playlist.php on line 16 Warning: simplexml_load_file(): ^ in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/playlist.php on line 16 Warning: simplexml_load_file(): videobrowser.txt:1: parser error : Start tag expected, '<' not found in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/playlist.php on line 16 Warning: simplexml_load_file(): in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/playlist.php on line 16 Warning: simplexml_load_file(): ^ in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/playlist.php on line 16 Warning: Invalid argument supplied for foreach() in /hermes/waloraweb095/b2598/moo.fearofmobscom/fearofmobs2/playlist.php on line 18 Any help greatly appreciated, the code for the page is: <?php error_reporting(E_ALL ^ E_NOTICE); ini_set('display_errors', 1);?> <?php $cachefile = 'videobrowser.txt'; $cache_timer = 3600 + @filemtime($cachefile);// files timestamp + 3600 seconds if (file_exists($cachefile) && time() < $cache_timer ) { } else { $data = file_get_contents("http://gdata.youtube.com/feeds/api/playlists/C82EBDAC0429B6A2?orderby=published&max-results=12"); $fh = fopen($cachefile, 'w') or die("can't open file"); fwrite($fh, $data); fclose($fh); } $thumbnail =''; $data = simplexml_load_file($cachefile); $xml = simplexml_load_string($data); foreach($xml->entry as $playlist){ $media = $playlist->children('http://search.yahoo.com/mrss/'); $attrs = $media->group->thumbnail[1]->attributes(); $thumb = $attrs['url']; $attrs = $media->group->player->attributes(); $video = $attrs['url']; $title = substr( $media->group->title, 21); $url = $video; parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars ); $vid_Id = $my_array_of_vars['v']; ###################NEW CODE $toggle = 'hotlink';// replace 'hotlink' with 'null' to save images locally if ($toggle == 'hotlink'){ $image_ID = $thumb; // hotlink images from YouTube } else{ ///////////////////////////////// Save Images To Local Webserver ///////////////////////////////// just in case Youtube objects to hotlinking $image_ID = $vid_Id.".jpg"; /// or use sub folder for neatness -> "images_folder/".$vid_Id.".jpg" $image_saved = @filemtime($image_ID);// @ is used to suppress the error caused by the image not having been seen before if (!$image_saved){/// if you can't find it on local server go fetch it and save to the sites server file_put_contents($image_ID, file_get_contents($thumb)); //// you can delete the line below echo ' fecthed image >> '.$image_ID."<br>" ; //// you can delete the line above }//// close if image saved } ##################### END NEW CODE $thumbnail .= '<div style="float:left; cursor:pointer;"> <p class="crop"><a class="videobox various iframe" href="http://www.youtube.com/embed/' . $vid_Id . '?autoplay=1&hd=1" onclick=swapper('. $vid_Id .')><img src="' .$image_ID . '" title="' . $title . '" width="74" height="56"/></a></p></div>'; } ?> <?php echo $thumbnail; ?>
-
Caching YouTube video list to decrease load time?
Oh, one more tiny thing (sorry, I promise this is the last thing!) The end of the blog summaries (check link in original post) get cut off, I added text-overflow:ellipsis in CSS which makes it looks slightly better, but how can i cut it off at the nearest word? For example call more characters then I need and then cut off to the nearest wood to 132 characters and append a …? A small thing I know!
-
Caching YouTube video list to decrease load time?
Awesome, thanks again!!
-
Caching YouTube video list to decrease load time?
The blog code giving me an error of: Warning: simplexml_load_file() [function.simplexml-load-file]: I/O warning : failed to load external entity "" in /websites/123reg/LinuxPackage22/ch/ar/li/charlieswebsites.co.uk/public_html/fearofmobs/site/index.php on line 85 The code on line 85 is: $xml = simplexml_load_file($request_url); Also one more thing, could you tell me how to remove the part from the YouTube code that saves the thumbnails to local server as I think it's actually quicker grabbing those from YouTube directly? I tried removing that section of the code but it didn't work . Again thank you so much for your help! Do you have a donation page setup anywhere?
-
Caching YouTube video list to decrease load time?
Thank you so much for all of your help, you can see how I've implemented at the hyperlink in my original post. Also one more question (sorry!), I'm going to be displaying summaries of blog posts from a tumblr using the following PHP code, how would I do the exact same thing (caching every hour) with that peice of code? <?php $request_url = "http://deaboy.tumblr.com/api/read?type=post&start=0&num=1"; $xml = simplexml_load_file($request_url); $title = $xml->posts->post->{'regular-title'}; $post = $xml->posts->post->{'regular-body'}; $link = $xml->posts->post['url']; $small_post = substr($post,0,320); echo '<h1>'.$title.'</h1>'; echo '<p>'.$small_post.'</p>'; echo "…"; echo "</br><a target=frame2 href='".$link."'>Read More</a>"; ?> Again, thank you so much!
-
Caching YouTube video list to decrease load time?
Hi, thank you for your response! I've updated the site with the code you provided but I think I've implemented it wrong , I've added the last snippet of code you provided in the index.php in the place I'd want the videos to be displayed (currently live at the url in original post). And left the videos.php as is, with the script that pulls in the videos. I've also created the empty video_temp.php file for caching, have I done something wrong? Thanks!
-
Caching YouTube video list to decrease load time?
I've been busy creating a website for a friend, all is good except from I have implemented a videos pod on the homepage which allows users to watch the latest videos from a YouTube playlist. But this is grabbed from YouTube's servers every time the page is loaded, how can I set something up so new videos are only checked for every... hour? I tried using this to cache it, appeared to be working fine until it got an hour old and the cache had to be refreshed but for some reason it didn't work so after an hour the script would return blank. http://papermashup.com/caching-dynamic-php-pages-easily/ The page I'm trying to get it working on is at http://charlieswebsites.co.uk/fearofmobs/site/, in the videos pod (be aware that the videos here are static, but the code below is what I WAS using) The code I used is below: HTML HEADER AND CONTENT LEADING UP TO VIDEOS POD IS HERE <?php $cachefile = 'videos.php'; $cachetime = 60 * 60; // Serve from the cache if it is younger than $cachetime if (file_exists($cachefile) && time() - $cachetime < filemtime($cachefile)) { include($cachefile); echo "<!-- Cached copy, generated ".date('H:i', filemtime($cachefile))." -->\n"; } ob_start(); // Start the output buffer ?> ALL REMAINING CONTENT, INCLUDING FOOTER, SIDEBAR ETC. <?php exit; // Cache the contents to a file $cached = fopen($cacheFile, 'w'); fwrite($cached, ob_get_contents()); fclose($cached); ob_end_flush(); // Send the output to the browser ?> The contents of video.php is: <div id="videos" class="pod"><h3>Videos</h3><p class="homepod-intro">Explore the <a id="playlist-link" href="http://www.youtube.com/playlist?list=PLC82EBDAC0429B6A2">Fear of Mobs playlist</a>, click on a video!</p> <?php get_playlists(); function get_playlists(){ $data = file_get_contents("http://gdata.youtube.com/feeds/api/playlists/C82EBDAC0429B6A2?orderby=published&max-results=12"); $xml = simplexml_load_string($data); foreach($xml->entry as $playlist){ $media = $playlist->children('http://search.yahoo.com/mrss/'); $attrs = $media->group->thumbnail[1]->attributes(); $thumb = $attrs['url']; $attrs = $media->group->player->attributes(); $video = $attrs['url']; $title = substr( $media->group->title, 27); $url = $video; parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars ); $vid_Id = $my_array_of_vars['v']; $thumbnail .= '<div style="float:left; cursor:pointer;"> <p class="crop"><a class="videobox various iframe" href="http://www.youtube.com/embed/' . $vid_Id . '?autoplay=1&hd=1"><img src="' .$thumb . '" title="' . $title . '" width="74" height="56"/></a></p></div>'; }print $thumbnail;} ?> </div> Any help would be so appreciated, I've been tinkering for hours!
-
Embedding Pingdom uptime percentage on site?
This sounds promising thanks. How do I find out my checkid? I've looked into the account area and everything... How do I cache this so the uptime only updates every 6 hours? Also how do I calculate the percentage? Sorry, I'm not great when it comes to the PHP stuff I really need to learn it, it's all copy/pasting at the moment... Edit: Think I put the right number in now, but I'm now getting the error 'Warning: Invalid argument supplied for foreach() in /websites/123reg/LinuxPackage22/ch/ar/li/charlieswebsites.co.uk/public_html/fearofmobs/site/index.php on line 51' and on line 51 I have 'foreach ($checksList as $check) {' Thanks!
-
Embedding Pingdom uptime percentage on site?
Hi I'm making a website for a game server and we can use Pingdom to ping it every five minutes and it checks if the game server is up or down, this is done using address and port: domain.com:25565. Could somebody provide me with the code to display the uptime for the server that Pingdom produces on a website to the nearest percentage (no decimals)? Or atleast point me in the right direction? I found the API here? http://www.pingdom.com/services/api-documentation-rest/
-
Generate latest YouTube playlist video ID
Could someone create me a PHP script that would be able to automatically generate the ID of the latest video from a I have little knowledge of PHP, so you'd be a massive help!
-
YouTube video embed slowing load-times
I'm creating a website with a YouTube video embed on the homepage, according to Pingdom it adds around 200KB+ to the page and is a large chunk of the loading time, it also contains 10 HTTP requests! Are there any workarounds to this? For example I've seen in places where it won't load the video until you click on it. Because some users of the site won't watch the video, therefore it'll be silly to increase the loading time for something that everyone may not use. Thanks for any help (:
-
Getting volunteer projects?
Thanks for the suggestions guys, good ideas. Good ways for finding local charities?
-
Getting volunteer projects?
I'm interested in building sites for local businesses for free, just to gain experience and a portfolio basis. When emailing local businesses whats the best way to put my message across without confusing them as to why I'm doing it for free, and as well as explaining what service I will be providing them with? How do I go about hosting/domains? Just need some advice, thanks.
-
How to automatically append text to a form field?
Basically it uses a single text field that it passes to PayPal for the item description, I need to description to be "GAMEUSERNAME (Donation from site)" whereby the username is entered into the field by the user, and the text in brackets is somehow also added to the end of the video before it is submitted?
-
How to automatically append text to a form field?
I'm creating a donation form with PayPal that I'm creating for help fund a game server. I need to record the users in-game username, I have setup the field that will record the name. Now how can I automatically append some text to that SAME field that the user won't be able to remove or see? Thanks,
-
Minecraft server website feedback
Thanks for the feedback here, that's a good point although I do want the address to be very prominent, but still I agree maybe it shouldn't be larger than the headline. Any other constructive feedback would be hugely appreciated at this point, thank you everyone! Brainstorming and trying out better logo ideas, struggling, trying to think of something unique and creative. Trying to incorporate one of the games mobs (baddies) in there too... any ideas?
-
Minecraft server website feedback
Beggining to move on to designing the other pages now and it's just hit me, how do I go about removing the slider for the content pages (I should remove it on the other pages right?), how do I remove it yet keep the design looking good? Any suggestions?
-
Minecraft server website feedback
I know where your coming from, that's actually the thing that I think needs working on. Just trying to find some ideas for simple, memorable 'minecraft' related logos... any ideas guys?
-
Minecraft server website feedback
Looking for feedback on this Minecraft server website I'm making, please give me any feedback that you have. Opinions, thoughts and ways to improve this would be very appreciated! Let me know what you think about the logo, colours and style. Does it work? Is there too much green? What other colours would complement this (if any)? The slider imagery is just for placeholder purposes. As well as design if you have any thoughts on SEO let me know! I've been struggling to find much inspiration on this, 99% of Minecraft websites seem to have terrible design in my opinion. Thanks everyone!
-
Feedback for Game Server Community Website