Cronwerks MCCode/MCCodes Forums

Please login or register.

Login with username, password and session length

News:

Have you purchased a mod and lost your copy? Just file a support ticket through your "My Mods" page.


This forum is now closed and has moved to a new location! Click here to find out why.
Pages: [1] 2

AuthorTopic: Items with Images mod.  (Read 1431 times)

cjholder

  • Basic Member
  • *
  • Reputation Power: 7
  • cjholder has no influence.
  • Offline Offline
  • Posts: 14
    • View Profile
    • Email
Items with Images mod.
« on: December 30, 2009, 05:29:49 PM »
Topic: Items with Images mod.

I was playing some RPGs and noticed that they had Images with there items and I thought that would be great with my game ;)
So if anyone has a mod like this that would be great! But if you dont and you make a mod like this could i have a copy please?

Thank you-

-CJ-
Logged

Redex

  • Basic Member
  • *
  • Reputation Power: 9
  • Redex has no influence.
  • Offline Offline
  • Posts: 19
    • MSN Messenger - redex1995@hotmail.com
    • View Profile
    • Email
Re: Items with Images mod.
« Reply #1 on: December 31, 2009, 05:37:57 AM »
It's not a modification, you have to upload the image to your file manager and then link it for whatever file you want  :D
Logged

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Items with Images mod.
« Reply #2 on: December 31, 2009, 09:57:50 AM »
It is a modification. Your modifing a file.
Logged
Project Choosen - 10%
Daniel - Hanson . Com

gambino

  • Active Member
  • **
  • Reputation Power: 0
  • gambino is looked down upon.gambino is looked down upon.gambino is looked down upon.
  • Offline Offline
  • Posts: 113
    • View Profile
Re: Items with Images mod.
« Reply #3 on: April 05, 2010, 06:32:35 PM »
just put right next to the name of the weapon/armor/mesc. with a <img src='{$r['item_image']}' width='wide' height='high' /> and just put in a new table in the database for the item with item_image and edit the add item in the staff panel and add an upload box and have it name the file, put it in the destination, and have it write the image name and location in the database. easy for me to do. it is easy enough to do it in dreamweaver where I wouldn't need experience.
Logged

Storytella

  • Basic Member
  • *
  • Reputation Power: 23
  • Storytella has no influence.
  • Offline Offline
  • Posts: 13
    • View Profile
    • Email
Re: Items with Images mod.
« Reply #4 on: April 12, 2010, 12:30:39 AM »
Hello this is my first post here on cronwerks. But is there anyone who can create this mod or go more in depth on how add images to your items, that would be great. ;D
Logged
Lifes a garden, dig it!!!

dave1981

  • Basic Member
  • *
  • Reputation Power: 4
  • dave1981 has no influence.
  • Offline Offline
  • Posts: 9
    • View Profile
Re: Items with Images mod.
« Reply #5 on: April 13, 2010, 03:18:14 PM »
This bit will add a field when making an item to throw in the url of a picture for your item. 

*it will not display it, i'll post that in a new post*

In phpmyadmin:

add 1 field after itmdesc:
Field: itmpic
Type: VARCHAR
Lenght: 255
Default: none

open up "staff_items.php"

find: (line 27)
Code: [Select]
Item Desc.: <input type='text' name='itmdesc' value='' /><br />
add below:
Code: [Select]
Item Pic.: <input type='text' name='itmpic' value='' /><br />
find: (line 139)
Code: [Select]
$itmdesc=$db->escape($_POST['itmdesc']);
add below:
Code: [Select]
$itmpic=$db->escape($_POST['itmpic']);
next find (line 146):
Code: [Select]
VALUES('',{$_POST['itmtype']},'$itmname','$itmdesc',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},$itmbuy, '{$_POST['effect1on']}', '$efx1', '{$_POST['effect2on']}', '$efx2', '{$_POST['effect3on']}', '$efx3', $weapon, $armor)");
change to:
Code: [Select]
VALUES('',{$_POST['itmtype']},'$itmname','$itmdesc','$itmpic',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},$itmbuy, '{$_POST['effect1on']}', '$efx1', '{$_POST['effect2on']}', '$efx2', '{$_POST['effect3on']}', '$efx3', $weapon, $armor)");
next find (line 237):
Code: [Select]
Item Desc.: <input type='text' name='itmdesc' value='{$itemi['itmdesc']}' /><br />
add below:
Code: [Select]
Item Pic.: <input type='text' name='itmpic' value='{$itemi['itmpic']}' /><br />
next find (line 330):
Code: [Select]
$itmdesc=$_POST['itmdesc'];add below:
Code: [Select]
$itmpic=$_POST['itmpic'];
next find (line 338):
Code: [Select]
VALUES('{$_POST['itmid']}',{$_POST['itmtype']},'$itmname','$itmdesc',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},$itmbuy, '{$_POST['effect1on']}', '$efx1', '{$_POST['effect2on']}', '$efx2', '{$_POST['effect3on']}', '$efx3', $weapon, $armor)");
replace with
Code: [Select]
VALUES('{$_POST['itmid']}',{$_POST['itmtype']},'$itmname','$itmdesc','$itmpic',{$_POST['itmbuyprice']},{$_POST['itmsellprice']},$itmbuy, '{$_POST['effect1on']}', '$efx1', '{$_POST['effect2on']}', '$efx2', '{$_POST['effect3on']}', '$efx3', $weapon, $armor)");
close and save.
« Last Edit: April 13, 2010, 03:22:22 PM by dave1981 »
Logged

dave1981

  • Basic Member
  • *
  • Reputation Power: 4
  • dave1981 has no influence.
  • Offline Offline
  • Posts: 9
    • View Profile
Re: Items with Images mod.
« Reply #6 on: April 13, 2010, 03:36:26 PM »
in shops.php

find: (line 24)
Code: [Select]
<th>Item</th><th>Description</th><th>Price</th>
add before
Code: [Select]
<th>Picture</th>
find: (line 32)
Code: [Select]
print "\n<tr style='background: gray;'><th colspan=5>{$lt}</th></tr>";
change to:
Code: [Select]
print "\n<tr style='background: gray;'><th colspan=6>{$lt}</th></tr>";
find: (line 34)
Code: [Select]
<td>{$r['itmname']}</td>
add before:
Code: [Select]
<td><img src='{$r['itmpic']}'></td>
Logged

dave1981

  • Basic Member
  • *
  • Reputation Power: 4
  • dave1981 has no influence.
  • Offline Offline
  • Posts: 9
    • View Profile
Re: Items with Images mod.
« Reply #7 on: April 13, 2010, 03:56:29 PM »
inventory.php

find: (line 58)
Code: [Select]
<td class=\"h\">Item</td>
add above:
Code: [Select]
<td class=\"h\">Picture</td>
find (70)
Code: [Select]
print "\n<tr><td colspan=4><b>{$lt}</b></td></tr>";
replace:
Code: [Select]
print "\n<tr><td colspan=5><b>{$lt}</b></td></tr>";
find: (line 80)
Code: [Select]
print "<tr><td>{$i['itmname']}"javascript:void(0);
replace:
Code: [Select]
print "<tr><td><img src='{$i['itmpic']}'></td><td>{$i['itmname']}";
Logged

dave1981

  • Basic Member
  • *
  • Reputation Power: 4
  • dave1981 has no influence.
  • Offline Offline
  • Posts: 9
    • View Profile
Re: Items with Images mod.
« Reply #8 on: April 13, 2010, 03:57:13 PM »
when adding images use this format:

Code: [Select]
image.png
« Last Edit: April 13, 2010, 04:09:30 PM by dave1981 »
Logged

dave1981

  • Basic Member
  • *
  • Reputation Power: 4
  • dave1981 has no influence.
  • Offline Offline
  • Posts: 9
    • View Profile
Re: Items with Images mod.
« Reply #9 on: April 13, 2010, 04:18:11 PM »
im not sure if it matters where you make the field in the db, so i did it that way, the way its done on mine.  any problems, well its not hard to figure it out.  you can add, edit images.. it should work, because works for me,  i would just send my files, but as they have a lot of edits, and paid mod's i wont do that.
Logged

Storytella

  • Basic Member
  • *
  • Reputation Power: 23
  • Storytella has no influence.
  • Offline Offline
  • Posts: 13
    • View Profile
    • Email
Re: Items with Images mod.
« Reply #10 on: April 14, 2010, 01:56:05 AM »
Thanks for the detailed info. Soon as i get the chance i will do the modifications and post later.
Logged
Lifes a garden, dig it!!!

Danny696

  • Senior Member
  • ****
  • Reputation Power: 317
  • Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.Danny696 is a force to reckon with.
  • Offline Offline
  • Posts: 540
    • View Profile
    • WWW
Re: Items with Images mod.
« Reply #11 on: April 14, 2010, 09:51:35 AM »
Lol, why clog up the database with another coloum. The database is bad enought
Logged
Project Choosen - 10%
Daniel - Hanson . Com

dave1981

  • Basic Member
  • *
  • Reputation Power: 4
  • dave1981 has no influence.
  • Offline Offline
  • Posts: 9
    • View Profile
Re: Items with Images mod.
« Reply #12 on: April 14, 2010, 11:00:33 AM »
Lol, why clog up the database with another coloum. The database is bad enought

its 1 new field, and its in the items, its not like its really going to slow it down THAT much.  and it reads 1 little line. (image.png) Thats it.  besides how many items do you have in a game, lets say 500 TOPS.. ok your query takes a whole .001 seconds longer.  its not like its the users table.
Logged

Storytella

  • Basic Member
  • *
  • Reputation Power: 23
  • Storytella has no influence.
  • Offline Offline
  • Posts: 13
    • View Profile
    • Email
Re: Items with Images mod.
« Reply #13 on: April 14, 2010, 12:39:26 PM »
I have everything added and changed as needed but when i put in an image through the admin panel it does not show in the shops. am i to upload the pic and add to my php files are am i supposed to use a url for the pic?
Logged
Lifes a garden, dig it!!!

dave1981

  • Basic Member
  • *
  • Reputation Power: 4
  • dave1981 has no influence.
  • Offline Offline
  • Posts: 9
    • View Profile
Re: Items with Images mod.
« Reply #14 on: April 14, 2010, 12:43:21 PM »
if you put them in the same dir as the game, it would just link the files, if you want a cleaner look.. and put them in images then use "images/imagename.png" or what ever file extension it is.
Logged
Pages: [1] 2
« previous next »
 


This forum is now closed and has moved to a new location! Click here to find out why.