RIP Murray Walker (1923-2021)

The rebirth of the Crash Photos Database

Our pioneering project aims to identify and catalogue every crash photo in racing history. We cannot do it alone, so if you have any spare time, view this forum and sign up to help!
User avatar
PTRACER
Forum Administrator
Forum Administrator
Posts: 39308
Joined: 17 years ago
Real Name: Paul
Favourite Motorsport: Formula 1
Favourite Racing Car: Lotus 49
Favourite Driver: Gilles Villeneuve, James Hunt
Favourite Circuit: Nordschleife
Location: U.K.
Contact:

Re: The rebirth of the Crash Photos Database

Post by PTRACER » 5 years ago

Latest post of the previous page:

Many of these problems now solved. Who inputted the latest Bandini/Hill crash?

Just a tip - for more than one image, place each URL on a new line. Do the same for multiple drivers!

Motorsportrace: I'll eventually add another box called 'Involved' so if a spectator is killed, or a marshall, you put their name in that box instead.

This is evolving so beautifully :happy:
King of the Race Track, Destroyer of Tyres, Breaker of Lap Records

User avatar
PTRACER
Forum Administrator
Forum Administrator
Posts: 39308
Joined: 17 years ago
Real Name: Paul
Favourite Motorsport: Formula 1
Favourite Racing Car: Lotus 49
Favourite Driver: Gilles Villeneuve, James Hunt
Favourite Circuit: Nordschleife
Location: U.K.
Contact:

Post by PTRACER » 5 years ago

We need a placeholder for fatal crashes. The first image of the sequence is the thumbnail, but the thumbnail will display on the Index. Maybe some people don't want to see fatal crashes so we should censor them as always.
King of the Race Track, Destroyer of Tyres, Breaker of Lap Records

User avatar
Ian-S
Ultimate Member
Ultimate Member
Posts: 9984
Joined: 13 years ago

Post by Ian-S » 5 years ago

PTRACER wrote:I'm in the middle of editing it so it's not quite right at the moment.

And yes, by design it can be edited by anyone right now.

I'd like to have a lightbox yeah. At the moment the only way to get an image to display is to use $value = <img src="'.$value.'" /> I want multiple images to display, so you can put more than one URL in the box and separate it with a comma.

If you know how to get the images to display in an array based on comma separated values inside a lightbox solely using PHP code, feel free to tell me :tongue:
How is it laid out in the database?

You can do multiple images in a light box, or a group of images, or only specific images from a page, but it depends how the information is stored in the database.

Just based on my opinion (I don't know how you're database is setup), I'd have a row such as:

Unique Id, random info, all the other bits, image1, image2, etc. etc. So that when a client requests a specific image, you could group the lightbox images together through the uniqueid. And of course there would be one row for each crash.

If that makes any sense lol
I am very sorry if you find my posts long and boring, I like to type and often go off on a tangent.
If this is the case, you may click here to solve the problem, or alternatively here too.

User avatar
PTRACER
Forum Administrator
Forum Administrator
Posts: 39308
Joined: 17 years ago
Real Name: Paul
Favourite Motorsport: Formula 1
Favourite Racing Car: Lotus 49
Favourite Driver: Gilles Villeneuve, James Hunt
Favourite Circuit: Nordschleife
Location: U.K.
Contact:

Post by PTRACER » 5 years ago

Kind of, haha. I just have a single field in the database called 'Pictures' and then this code allows me to display multiple images in full size - one URL per line = one image per line. The maximum width an image can be is 1024px.

Code: Select all

$images = explode("\n", $value );

$value = '';
foreach ($images as $im){
    $value .= '<img src="'. $im . '" style="max-width:1024px"/> <br />';
}
$value = The box where I type in the URL
\n = 'Each new image is on a new line'

If you can find a way to add a lightbox with clickable thumbs, ONLY by editing the above... :tongue:
King of the Race Track, Destroyer of Tyres, Breaker of Lap Records

User avatar
Ian-S
Ultimate Member
Ultimate Member
Posts: 9984
Joined: 13 years ago

Post by Ian-S » 5 years ago

Is this for the thumbnails on the main page?

Code: Select all

foreach ($images as $im){
    $value .= '<a href="'. $im . '" rel=\"nofollow\" onclick=\"return openTopSBX(this);\"><img src="'. $im . 'x"/></A> <br />';
}
That should open the image in a lightbox when it's clicked on (not sure why you've got a max width in there for a thumbnail).

(depending on your php version the code may fail, it'll just need the " or \" adjusting).

I'm buggered if I can remember which js/css this lightbox uses and I've put a few in over the years, but this is the code in the header of our pages, feel free to pull the scripts, or I can zip them up if you want.
<link rel="stylesheet" type="text/css" href="shadowbox.css">
<script type="text/javascript" src="shadowbox.js"></script>
<script type="text/javascript">
Shadowbox.init();
</script>
<script type="text/javascript">
var sbx = window.parent.Shadowbox;
function openTopSBX(el){
if(sbx){
sbx.open( { content : el.href
, player : 'img'
, title : el.title||''
, gallery : 'MyPics'
//could include width/height/options if desired
}
);
return false;
}else{ //no Shadowbox in parent window!
return true;
}
}
</script>
Getting a thumbnail image to display the full image in a lightbox is piss easy, even with php, the problems start when you want to add subtext or stuff like that, or even finding a decent lightbox that isn't so bloated it takes 15 seconds to open.
I am very sorry if you find my posts long and boring, I like to type and often go off on a tangent.
If this is the case, you may click here to solve the problem, or alternatively here too.

User avatar
Ian-S
Ultimate Member
Ultimate Member
Posts: 9984
Joined: 13 years ago

Post by Ian-S » 5 years ago

Thinking about it I think onclick=\"return openTopSBX(this);\" was a hack I used to launch the light/shadowbox outside of it's nested iframe, so it might not be needed.

If you want I can pull up the zip file tomorrow that I got and thrash out the details for you, as the authors website doesn't seem to be working now.
I am very sorry if you find my posts long and boring, I like to type and often go off on a tangent.
If this is the case, you may click here to solve the problem, or alternatively here too.

User avatar
PTRACER
Forum Administrator
Forum Administrator
Posts: 39308
Joined: 17 years ago
Real Name: Paul
Favourite Motorsport: Formula 1
Favourite Racing Car: Lotus 49
Favourite Driver: Gilles Villeneuve, James Hunt
Favourite Circuit: Nordschleife
Location: U.K.
Contact:

Post by PTRACER » 5 years ago

The thumbnail is literally just the first image in the field resized to 150px. I have no auto thumbnail generation or anything like that:

Code: Select all

$images = array_slice(explode("\n", $value), 0, 1);

$value = '';
foreach ($images as $im){
    $value .= '<img src="'. $im . '" style="width:150px"/>';
}
I am no expert (nor even amateur) in coding, I work by either googling, trial and error, or more often than not, getting someone else to code it for me (on stackoverflow). As I say, if you can give me the complete code that I can just copy and paste into the box, replacing that exact code, and it's ready to go, I'll do it.
King of the Race Track, Destroyer of Tyres, Breaker of Lap Records

User avatar
Ian-S
Ultimate Member
Ultimate Member
Posts: 9984
Joined: 13 years ago

Post by Ian-S » 5 years ago

Might be easier if you sent me the php page so I can see how it's all generated, then I can shoehorn it in, but I'll get you the zip tomorrow either way.

You'd slot the light box code into where the thumbnail is generated.
I am very sorry if you find my posts long and boring, I like to type and often go off on a tangent.
If this is the case, you may click here to solve the problem, or alternatively here too.

User avatar
Ian-S
Ultimate Member
Ultimate Member
Posts: 9984
Joined: 13 years ago

Post by Ian-S » 5 years ago

Ah yes now I see what you mean about the multiple images, maybe not so easy to get that, and all the description data into a light box.
I am very sorry if you find my posts long and boring, I like to type and often go off on a tangent.
If this is the case, you may click here to solve the problem, or alternatively here too.

User avatar
PTRACER
Forum Administrator
Forum Administrator
Posts: 39308
Joined: 17 years ago
Real Name: Paul
Favourite Motorsport: Formula 1
Favourite Racing Car: Lotus 49
Favourite Driver: Gilles Villeneuve, James Hunt
Favourite Circuit: Nordschleife
Location: U.K.
Contact:

Post by PTRACER » 5 years ago

I'm using a program called PHPRunner to create all of this.

The code literally looks at what's within a text field and then tries to display it as an image. So whatever code you give me must do this at a basic level.
King of the Race Track, Destroyer of Tyres, Breaker of Lap Records

User avatar
Ian-S
Ultimate Member
Ultimate Member
Posts: 9984
Joined: 13 years ago

Post by Ian-S » 5 years ago

Lol no you're gonna need to get notepad out and edit the files manually if you want light boxes in there.

Notepad is my goto toolbox for php, I don't use and external programs.
I am very sorry if you find my posts long and boring, I like to type and often go off on a tangent.
If this is the case, you may click here to solve the problem, or alternatively here too.

User avatar
PTRACER
Forum Administrator
Forum Administrator
Posts: 39308
Joined: 17 years ago
Real Name: Paul
Favourite Motorsport: Formula 1
Favourite Racing Car: Lotus 49
Favourite Driver: Gilles Villeneuve, James Hunt
Favourite Circuit: Nordschleife
Location: U.K.
Contact:

Post by PTRACER » 5 years ago

This database is anything but simple :tongue: Using PHPRunner is just invaluable as it does so much for you without needing coding. It's just if you want to do anything special, it gives you the option to incoporate custom PHP
King of the Race Track, Destroyer of Tyres, Breaker of Lap Records

User avatar
Motorsportrace
Senior Member
Senior Member
Posts: 3406
Joined: 10 years ago
Real Name: M
Location: Milan

Post by Motorsportrace » 5 years ago

PTRACER wrote:Who inputted the latest Bandini/Hill crash?
It was me. I wanted to see how the database works, and that was the first image I had in my hands. It's evolving really beautifully. :happy:

Thanks for the information: I'll do some other tests.
Motorsportrace

User avatar
PTRACER
Forum Administrator
Forum Administrator
Posts: 39308
Joined: 17 years ago
Real Name: Paul
Favourite Motorsport: Formula 1
Favourite Racing Car: Lotus 49
Favourite Driver: Gilles Villeneuve, James Hunt
Favourite Circuit: Nordschleife
Location: U.K.
Contact:

Post by PTRACER » 5 years ago

Motorsportrace wrote:
PTRACER wrote:Who inputted the latest Bandini/Hill crash?
It was me. I wanted to see how the database works, and that was the first image I had in my hands. It's evolving really beautifully. :happy:

Thanks for the information: I'll do some other tests.
It is! I'm so glad you asked about the database, my only wish is that I hadn't abandoned/deleted the original one. We had 65 pages of the Openwheel thread completed, but so many people were against it. :sorrow:

Btw, I hope you realise how much work this will involve :tongue:
King of the Race Track, Destroyer of Tyres, Breaker of Lap Records

User avatar
Motorsportrace
Senior Member
Senior Member
Posts: 3406
Joined: 10 years ago
Real Name: M
Location: Milan

Post by Motorsportrace » 5 years ago

PTRACER wrote:It is! I'm so glad you asked about the database, my only wish is that I hadn't abandoned/deleted the original one. We had 65 pages of the Openwheel thread completed, but so many people were against it. :sorrow:
That's strange. Why should they be against it?
PTRACER wrote:Btw, I hope you realise how much work this will involve :tongue:
Well, yes. I can do something when I have some time.

About the "publicly available" question: I asked if the database will be published so that everyone can see it without logging into the forum.
But I doubt it would be a good idea: just look at what the idiots at documentingreality did and are still doing. Many people joined that website (paying) just because of those crash photos, not knowing they could've seen them totally free here.
Motorsportrace

User avatar
PTRACER
Forum Administrator
Forum Administrator
Posts: 39308
Joined: 17 years ago
Real Name: Paul
Favourite Motorsport: Formula 1
Favourite Racing Car: Lotus 49
Favourite Driver: Gilles Villeneuve, James Hunt
Favourite Circuit: Nordschleife
Location: U.K.
Contact:

Post by PTRACER » 5 years ago

Motorsportrace wrote:
PTRACER wrote:It is! I'm so glad you asked about the database, my only wish is that I hadn't abandoned/deleted the original one. We had 65 pages of the Openwheel thread completed, but so many people were against it. :sorrow:
That's strange. Why should they be against it?
Some people are scared of the copyright implications. Don't forget this is before YouTube. Some top members with hundreds (or thousands) of posts literally said, "If you don't stop this project, I'm leaving". Crazy right?
Motorsportrace wrote:
PTRACER wrote:Btw, I hope you realise how much work this will involve :tongue:
Well, yes. I can do something when I have some time.

About the "publicly available" question: I asked if the database will be published so that everyone can see it without logging into the forum.
But I doubt it would be a good idea: just look at what the idiots at documentingreality did and are still doing. Many people joined that website (paying) just because of those crash photos, not knowing they could've seen them totally free here.
Well asking people to pay would be illegal. I intend to keep the database public so anyone can see it, but only a small number of people can edit it (using a password) :) Unless you think I should link it to their forum account (which may be possible?)
King of the Race Track, Destroyer of Tyres, Breaker of Lap Records

Post Reply