Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - bigjoe11a

Pages: [1]
1
Bugs / Bug Found and fixed in shopadmin.php
« on: March 22, 2011, 10:42:03 pm »
After not getting any help and since I know PHP. I fount some errors. and I fixed them. For the web masters who use the item_info1, 2, 3 and 4. Using the filedownload and creating my own items I fount out that there are some errors in the code that I had to fix. So when I loaded in an item, it wouldn't return all 0's in my $item_info

For the ones who want to do it by hand. Open the /sources/shop/shpadmin.php file and go to line 438.
You will see this
Code: [Select]
$item_info[1] = $row['info1'];
$item_info[2] = $row['info2'];
$item_info[3] = $row['info3'];
$item_info[4] = $row['info4'];
change it to this
Code: [Select]
$item_info[1] = strval($row['info1']);
$item_info[2] = strval($row['info2']);
$item_info[3] = strval($row['info3']);
$item_info[4] = strval($row['info4']);

then go to line 515 and you will see this

Code: [Select]

if (isset($_POST['info1']))
$additional .= ', `info1` = "' . intval(($_POST['info1']) . '"';
if (isset($_POST['info2']))
$additional .= ', `info2` = "' . intval($_POST['info2']) . '"';
        if (isset($_POST['info3']))
$additional .= ', `info3` = "' . intval($_POST['info3']) . '"';
if (isset($_POST['info4']))
$additional .= ', `info4` = "' . intval($_POST['info4']) . '"';

and then change the lines to this
Code: [Select]
if (isset($_POST['info1']))
$additional .= ', `info1` = "' . strval($_POST['info1']) . '"';
if (isset($_POST['info2']))
$additional .= ', `info2` = "' . strval($_POST['info2']) . '"';
if (isset($_POST['info3']))
$additional .= ', `info3` = "' . strval($_POST['info3']) . '"';
if (isset($_POST['info4']))
$additional .= ', `info4` = "' . strval($_POST['info4']) . '"';

What was happening is that the script was loading in the intval and not a strval. This is why it was returning nothing but a 0.

Then save it and load your FTP client in. and connect to your FTP server. Then go to
root/sources/shop and upload the edited shopadmin.php to your solder replacing the old on.

Then the next time to edit an item. It will return the settings to set for the $imtem_info[] values

You may have to edit some of your edits and and your new items. to make sure the right values are being saved.

and for the ones that don't want to edit the ShopAdmin.php I attached it for you. Have fun

2
Bugs / filesdownload.php problem
« on: March 21, 2011, 10:13:46 am »

1) I tried creating a new item files download. and well there is some thing wrong with this.
I add a new item to download a file. I leave the 2 lower fields the same and I created and files/file_name_here.txt and I tried to download it. when I tried to download the the file. and for some reason. This is what it tried to send me.

_files_file_name_here.txt //well as you know the file name should have been file_name_here.txt

Ok, so I wanted to edit the item, and I save it. and then the file name to download was 0.
So there's some thing really wrong right.

When I edited the filesdownload.php file. The 2 input fields the web master enters the file name and the path of the file. For some reason it saves a 0 to both fields. I attached an image to show you.


3
I just tried to create my own Item and I was wondering was this happens. I have it setup the same way the others are all set up. I'm lost here.

4
Items / Selling Items on SMFShop for credits
« on: March 16, 2011, 10:13:50 am »
Creating my own Item for SMF Shop.

I setting up a PHP script to let me add Items into my shop, with some new changes and I'm a little lost on this, since I never coded in PHP like this before.

1) Can I add my own fields in.
2) how do I get the users current credits and subtract them.
3) I need to setup a new table and add data to it.
4) Sending emails

See my idea is for users who post messages can get credits. With these credits they can buy games, Since my forums section is all about games.

1) I need to add an option to it called Shipping. This is the amount of credits the user needs to ship the game to them. This can be changed when I'm adding a new item.

2) I need to get the users credits and subtract the shipping credits from there total. If they don't have enough credits. Its stops there.

3) I want to be able to save this to a mysql table. {db_prefix}invoices

4) I need to send the buyer and seller an email.

I attached to files that I started on. It would be great if some one could help me..

Pages: [1]