![]() |
|
Porsche, and the Porsche crest are registered trademarks of Dr. Ing. h.c. F. Porsche AG.
This site is not affiliated with Porsche in any way. Its only purpose is to provide an online forum for car enthusiasts. All other trademarks are property of their respective owners. |
|
![]() ![]() |
![]() |
Osnabruck914 |
![]()
Post
#1
|
Member ![]() ![]() Group: Members Posts: 160 Joined: 19-December 22 From: United States Member No.: 27,038 Region Association: South East States ![]() |
I've brought this up once or twice before, but I'm going to suggest this again. We all love the orange 914 "pic of the month" on the site's homepage, but after a year or so it is getting a bit long in the tooth.
Instead of pic submittals and choosing a "monthly" winner to be posted on the homepage, why can't a random pic be selected from a master file of pics of all our 914s each time we log on to the website? This would give everyone who wants to participate a chance to have their car appear on the homepage. It would also eliminate the labor element of conducting the "monthly" poll and posting the new pic. In a given day, you might get to see a dozen (or a lot more) other member's 914s, depending on how many times you log in. To be clear, I know nothing about website content creation and manipulation, but I do know how to ask Google AI for advice on how to do this sort of thing, which I include below. I am sure Sir Andy and Co. can make sense out of it and perhaps give this a try. I know this is asking a lot, at a time when the admins are dealing with denial of service attacks, but maybe it could be addressed as part of the site revamp they are now proposing. Osnabruck914 Info From Google AI Search: To display a random image from a file on a website's homepage, you can use JavaScript to select a random image from a folder and update the src attribute of an image element. First, store the image files in a folder on your server. Then, create a JavaScript function that generates a random number within the range of your image files, and uses this number to construct the path to a random image file. Finally, update the src attribute of an image element on your page to display the selected image. Here's a breakdown of the steps: 1. Store Images: Organize your images into a dedicated folder on your server (e.g., /images/). Ensure you know how many images you have or can easily determine it (e.g., by counting files in the directory). 2. JavaScript Function: JavaScript function displayRandomImage() { const imageFolder = '/images/'; // Replace with your image folder path const imageCount = 5; // Replace with the actual number of images const randomNumber = Math.floor(Math.random() * imageCount) + 1; // Generates a random number between 1 and imageCount const imagePath = imageFolder + randomNumber + '.jpg'; // Assuming images are named 1.jpg, 2.jpg, etc. Adjust the extension if needed. const imageElement = document.getElementById('randomImage'); // Replace 'randomImage' with the ID of your image element if (imageElement) { imageElement.src = imagePath; } else { console.error("Image element with ID 'randomImage' not found."); } } 3. HTML Setup: Code <img id="randomImage" src="" alt="Random Image"> Add an <img> tag to your HTML where you want the image to appear. Give it an id attribute (e.g., randomImage) so the JavaScript can find it. Set the src attribute to an empty string or a placeholder image initially. 4. Call the Function: JavaScript document.addEventListener('DOMContentLoaded', function() { displayRandomImage(); }); Use the DOMContentLoaded event to ensure the JavaScript runs after the HTML content is loaded. Call the displayRandomImage() function to trigger the image selection and update. Example: Let's say you have 5 images named 1.jpg, 2.jpg, 3.jpg, 4.jpg, and 5.jpg in a folder called /images/. Code <!DOCTYPE html> <html> <head> <title>Random Image Example</title> </head> <body> <img id="randomImage" src="" alt="Random Image"> <script> function displayRandomImage() { const imageFolder = '/images/'; const imageCount = 5; const randomNumber = Math.floor(Math.random() * imageCount) + 1; const imagePath = imageFolder + randomNumber + '.jpg'; const imageElement = document.getElementById('randomImage'); if (imageElement) { imageElement.src = imagePath; } else { console.error("Image element with ID 'randomImage' not found."); } } document.addEventListener('DOMContentLoaded', function() { displayRandomImage(); }); </script> </body> </html> Important Considerations: File Paths: Ensure the imageFolder variable in the JavaScript code is set to the correct relative or absolute path to your image directory. Image Naming: Adjust the imagePath variable in the script if your images have different naming conventions (e.g., image1.png, image2.png, etc.). Error Handling: The example includes basic error handling for the case where the image element is not found. You can expand this to handle other potential issues (e.g., images not loading, invalid file paths). Server-Side Solutions: While JavaScript is sufficient for simpler cases, for more complex scenarios (e.g., dynamic image updates, larger datasets), using a server-side language (like PHP, Python, Node.js) to handle image selection and delivery can offer better performance and security. |
mepstein |
![]()
Post
#2
|
914-6 GT in waiting ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 20,001 Joined: 19-September 09 From: Landenberg, PA/Wilmington, DE Member No.: 10,825 Region Association: MidAtlantic Region ![]() ![]() |
|
Osnabruck914 |
![]()
Post
#3
|
Member ![]() ![]() Group: Members Posts: 160 Joined: 19-December 22 From: United States Member No.: 27,038 Region Association: South East States ![]() |
Gee, over 20,000 members and only 2 think this is a good idea? If no one pipes up, this will never happen. Oh well, I tried...
Osnabruck914 |
Jamie |
![]()
Post
#4
|
Senior Member ![]() ![]() ![]() Group: Members Posts: 1,135 Joined: 13-October 04 From: Georgetown,KY Member No.: 2,939 Region Association: South East States ![]() ![]() |
Gee, over 20,000 members and only 2 think this is a good idea? If no one pipes up, this will never happen. Oh well, I tried... Osnabruck914 We have a home page? Can't remember the last time I opened it, but there it is! (IMG:style_emoticons/default/beer.gif) |
JeffBowlsby |
![]()
Post
#5
|
914 Wiring Harnesses & Beekeeper ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 8,999 Joined: 7-January 03 From: San Ramon CA Member No.: 104 Region Association: None ![]() ![]() |
|
friethmiller |
![]()
Post
#6
|
Senior Member ![]() ![]() ![]() Group: Members Posts: 971 Joined: 10-February 19 From: Austin, TX Member No.: 22,863 Region Association: Southwest Region ![]() ![]() |
Javascript has had a few issues with math over the years, however it'll be fine for this implementation. (IMG:style_emoticons/default/beer.gif) The code is going to need to calculate the number of images on-the-fly 'cause the folder is going to be growing as people upload photos. I really like the idea, btw. (IMG:style_emoticons/default/first.gif)
|
Montreal914 |
![]()
Post
#7
|
Senior Member ![]() ![]() ![]() Group: Members Posts: 1,883 Joined: 8-August 10 From: Claremont, CA Member No.: 12,023 Region Association: Southern California ![]() ![]() |
Great idea. (IMG:style_emoticons/default/smile.gif)
At the moment, I am simply very greatful for this site to be kept alive. Thank you Andy, Clay, and all involved admins. (IMG:style_emoticons/default/pray.gif) |
Nogoodwithusernames |
![]()
Post
#8
|
Member ![]() ![]() Group: Members Posts: 292 Joined: 31-May 16 From: Sutter, CA Member No.: 20,051 Region Association: None ![]() |
Having a thread/folder where members can upload their own photos and one of our awesome admins isn't needing be hands on constantly once setup is done seems like a pretty slick solution.
One thing do add, and I don't know how difficult/if there would be a way to limit each user to something like 5-10 photos each, and each user at capacity would need to remove one before you can add another so it doesn't get overly crowded or spammed with only a few cars? I doubt most of our members would be spamming photos in there, but would help keep admins as hands-off as possible as time goes on and keep the folder from becoming overly bloated. From the standpoint of a user not having to do any coding and implementation it sounds awesome! |
mate914 |
![]()
Post
#9
|
Matt ![]() ![]() ![]() Group: Members Posts: 879 Joined: 27-February 09 From: Eagles mere, PA Member No.: 10,102 Region Association: North East States ![]() ![]() |
I think its a great idea also... I love seeing all the different teeners out there.
|
rjames |
![]()
Post
#10
|
I'm made of metal ![]() ![]() ![]() ![]() Group: Members Posts: 4,336 Joined: 24-July 05 From: Shoreline, WA Member No.: 4,467 Region Association: Pacific Northwest ![]() ![]() |
Nice idea!
|
JeffBowlsby |
![]()
Post
#11
|
914 Wiring Harnesses & Beekeeper ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 8,999 Joined: 7-January 03 From: San Ramon CA Member No.: 104 Region Association: None ![]() ![]() |
Also suggest no commercial use of this feature. Nothing for promotion, no events, no advertisements, nothing for sale or trade. Anything other than photos of 914s is subject to admin removal. So I guess some level of admin oversight will be needed.
|
slowrodent |
![]()
Post
#12
|
Member ![]() ![]() Group: Members Posts: 201 Joined: 29-February 20 From: Tucson/Oro Valley Member No.: 23,981 Region Association: Southwest Region ![]() ![]() |
Very solid idea...A little variety would do us all some good. (IMG:style_emoticons/default/cheer.gif)
|
ClayPerrine |
![]()
Post
#13
|
Life's been good to me so far..... ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Admin Posts: 16,496 Joined: 11-September 03 From: Hurst, TX. Member No.: 1,143 Region Association: NineFourteenerVille ![]() ![]() |
This is a good idea. How about we postpone this until after we get the new site up and running???
|
Osnabruck914 |
![]()
Post
#14
|
Member ![]() ![]() Group: Members Posts: 160 Joined: 19-December 22 From: United States Member No.: 27,038 Region Association: South East States ![]() |
Totally agree Clay. I alluded to that in my original post. Might as well start fresh. Good to see members coming on board with this.
Osnabruck914 |
Craigers17 |
![]()
Post
#15
|
Senior Member ![]() ![]() ![]() Group: Members Posts: 864 Joined: 5-August 17 From: Rome, GA Member No.: 21,317 Region Association: South East States ![]() ![]() |
100% Yes. Great idea!
|
914werke |
![]()
Post
#16
|
"I got blisters on me fingers" ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 11,328 Joined: 22-March 03 From: USofA Member No.: 453 Region Association: Pacific Northwest ![]() ![]() |
Not A coding guy but spit balling here, rather that another repository of images could not that code be pointed to select from existing images? For instance the records for owners cars in the VIN DB could be used? The side benefit being further incentivizing the update of that DB
|
Maury4 |
![]()
Post
#17
|
Newbie ![]() Group: Members Posts: 27 Joined: 15-October 15 From: SC Member No.: 19,265 Region Association: South East States ![]() |
|
Steve |
![]()
Post
#18
|
914 Guru ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 5,904 Joined: 14-June 03 From: Laguna Niguel, CA Member No.: 822 Region Association: Southern California ![]() ![]() |
I would also love to see random pictures from a folder, but agree we have to first get this site stable.
|
Tonyooc |
![]()
Post
#19
|
1974 2.0 ![]() ![]() ![]() Group: Members Posts: 730 Joined: 6-January 18 From: Fort Mill, SC Member No.: 21,763 Region Association: South East States ![]() ![]() |
Do it.. (IMG:style_emoticons/default/icon_bump.gif)
|
TheCabinetmaker |
![]()
Post
#20
|
I drive my car everyday ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 8,350 Joined: 8-May 03 From: Tulsa, Ok. Member No.: 666 ![]() |
|
![]() ![]() |
![]() |
Lo-Fi Version | Time is now: 10th August 2025 - 11:05 AM |
All rights reserved 914World.com © since 2002 |
914World.com is the fastest growing online 914 community! We have it all, classifieds, events, forums, vendors, parts, autocross, racing, technical articles, events calendar, newsletter, restoration, gallery, archives, history and more for your Porsche 914 ... |