inherit
260724
0
Jun 26, 2020 9:21:03 GMT -8
HwyStar
31
March 2020
hwystar
|
Post by HwyStar on Mar 28, 2020 13:29:14 GMT -8
iracingusers.proboards.com/I have 6 different jpg image files currently stored on my Google Drive (shared-internet, viewable, link) that I would like to randomly display as the home page/banner-image every time the page is refreshed. I tried using the Random Images plugin from the plugins section and it did not seem to work for me (using either a GDrive URL or uploading the images). Each jpg file is named: 1.jpg, 2.jpg, 3.jpg, etc. Each image is 1200px x 300px. Is there some easy script that I can insert into the header section to perform this lookup/display every time the home page gets refreshed? Thanks for your help. Best, Robert HwyStar
|
|
inherit
252032
0
Apr 26, 2024 23:51:41 GMT -8
Retread
Tribbial Pursuit.
5,017
January 2018
retread
|
Post by Retread on Mar 28, 2020 22:38:58 GMT -8
HwyStar, I don't think you'll be able to use those images on Google Drive. Yes, you can view them, if you go to their page. But I don't believe it's possible to hotlink to the images.
|
|
inherit
260724
0
Jun 26, 2020 9:21:03 GMT -8
HwyStar
31
March 2020
hwystar
|
Post by HwyStar on Mar 29, 2020 4:36:57 GMT -8
Thanks for the reply, Retread!
If it won't work to have my six banner images stored on GDrive (I am cool with that!) then is there another place on my iRacingUsers forum directory tree that the images can be stored and randomly displayed for my Header Banner Image?
If I cannot store them on my directory structure (think "free" for right now, since I am just starting it up), then is there somewhere else free that I can use these images that is quick for ProBoards.net to display from?
Thank you for your help, in advance!
|
|
inherit
252032
0
Apr 26, 2024 23:51:41 GMT -8
Retread
Tribbial Pursuit.
5,017
January 2018
retread
|
Post by Retread on Mar 29, 2020 8:00:28 GMT -8
Sure, HwyStar. There are various solutions to hosting those images. The Help Guide article External Resources lists several free hosts under the heading: Image Hosting. Or you could upload the images to one of your themes under the heading Custom Theme Images . However since they are rather large, you should probably run them through compressor.io/ to get a significant reduction in file size without appreciable degradation of the image quality. Let's work on getting those six images hosted either as theme images or on an external host, first. Then after you have links to the images, one of the more proficient coders can write a script to randomly select one of the images for use as your banner background-image (or as your logo, if you prefer).
|
|
inherit
260724
0
Jun 26, 2020 9:21:03 GMT -8
HwyStar
31
March 2020
hwystar
|
Post by HwyStar on Mar 29, 2020 13:04:35 GMT -8
Thanks once again, Retread for the reply!
I created those six images in Affinity Photo so I can compress them down in there too. Good point about putting those images in the theme photo library. I wasn't so sure that each image would have the same URL directory, but I can try that.
Since I have not made the forum live yet, I may give a whack at getting the old script code I found here earlier today a try:
<script type="text/javascript"> var images = []; var n = 0;
images[n++] = 'Image URL 1'; images[n++] = 'Image URL 2'; images[n++] = 'Image URL 3';
var r = Math.floor(Math.random() * images.length); document.getElementsByTagName('img').item(0).src = images[r]; </script> It is legacy code but it may still work just fine in the header template. That link to the ProBoards Help Guide post is great! Thanks for forwarding it to me, Mate!
|
|
inherit
260724
0
Jun 26, 2020 9:21:03 GMT -8
HwyStar
31
March 2020
hwystar
|
Post by HwyStar on Mar 29, 2020 18:12:48 GMT -8
|
|
inherit
252032
0
Apr 26, 2024 23:51:41 GMT -8
Retread
Tribbial Pursuit.
5,017
January 2018
retread
|
Post by Retread on Mar 29, 2020 20:14:07 GMT -8
You're welcome, HwyStarbtw, including the name/link of the plugin you used to reach your solution is likely to be helpful to someone else wanting to achieve the same goal, so thanks for doing that. *high-five*
|
|