m1ll1k3n Posted May 8, 2020 Share Posted May 8, 2020 ive come up with a mad easy way of giving cars images please see a basic sample at criminalempire.co.uk username:tony password:dan123 go to garages and and takea look at the couple of example cars that are there if youde like help on how to do this ( takes around 10 mins ) please pm me Quote Link to comment Share on other sites More sharing options...
URBANZ Posted May 8, 2020 Share Posted May 8, 2020 (edited) 5 hours ago, m1ll1k3n said: ive come up with a mad easy way of giving cars images please see a basic sample at criminalempire.co.uk username:tony password:dan123 go to garages and and takea look at the couple of example cars that are there if youde like help on how to do this ( takes around 10 mins ) please pm me This must be the worst and stupidest way I've ever seen this implemented into a game, you have pretty much just posted the image into a forum topic and just link to the topic id. Why don't you just add a column to the cars table like CA_image and fetch it along with all the other data in garage, so simple to do. you could add a new method if you wanted a car info page but if not you could just put the images on the default garage view. Edited May 8, 2020 by urbanmafia Quote Link to comment Share on other sites More sharing options...
m1ll1k3n Posted May 8, 2020 Author Share Posted May 8, 2020 hense the simple bit becuase you dont have do anything atall like that .. its simple and easy Quote Link to comment Share on other sites More sharing options...
URBANZ Posted May 8, 2020 Share Posted May 8, 2020 (edited) 47 minutes ago, m1ll1k3n said: hense the simple bit becuase you dont have do anything atall like that .. its simple and easy yes but the other way is even more simple it takes 1 column and an img tag on your garage page. Posting each one of them topics up takes alot longer doing it the real way would take around 5 mins and would look a lot more appealing. ALTER TABLE `cars` ADD `CA_pic` VARCHAR(200) NOT NULL AFTER `CA_name`; in garage.tpl.php find on line 15 <th>name</th> add before <th>Image</th> then find on line 34 <td>{name}</td> add before <td><img src="{image}" alt="{name}" width="75" height="75"/></td> in garage.inc.php find on line 27 "name" => $car->CA_name, add before "image" => $car->CA_pic, after update your images of your cars just a basic way of doing it. would still be more advanced ways but this just shows what can be done in short time. This is what the result would be. Edited May 8, 2020 by urbanmafia 3 1 Quote Link to comment Share on other sites More sharing options...
Sim Posted May 8, 2020 Share Posted May 8, 2020 Quick and simple @urbanmafia for beginner. I like it. Quote Link to comment Share on other sites More sharing options...
Djkanna Posted May 8, 2020 Share Posted May 8, 2020 You could just forgo the need to add another entry into the DB table and just store your images in a folder e.g: cars/ with unique names that correlate to something already in the DB e.g CA_id ( presuming here ) then link the image as cars/{ID}.jpg Quote Link to comment Share on other sites More sharing options...
URBANZ Posted May 8, 2020 Share Posted May 8, 2020 1 hour ago, Djkanna said: You could just forgo the need to add another entry into the DB table and just store your images in a folder e.g: cars/ with unique names that correlate to something already in the DB e.g CA_id ( presuming here ) then link the image as cars/{ID}.jpg yes this also works if you don't want to use another entry 1 Quote Link to comment Share on other sites More sharing options...
Dayo Posted May 8, 2020 Share Posted May 8, 2020 The easiest way is to do something like <img src=“modules/installed/theft/images/{id}.png” /> Ahh just saw djkanna’s post 😛 1 Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted May 9, 2020 Share Posted May 9, 2020 Great attempt and interesting approach to things. However, I strongly recommend that you use the framework readily available to make any additions like this; not only is it "the proper way" (debate in a different topic if you wish), but it usually eases future maintenance Quote Link to comment Share on other sites More sharing options...
Sim Posted May 9, 2020 Share Posted May 9, 2020 Who you talking to @Magictallguy Quote Link to comment Share on other sites More sharing options...
Magictallguy Posted May 9, 2020 Share Posted May 9, 2020 9 hours ago, Sim said: Who you talking to @Magictallguy Both directly to @m1ll1k3n and in general to anyone using a framework - it it's there and it's supposed to be; use it! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.