[DEV] Item Shop

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Locked
User avatar
RMS
Registered User
Posts: 517
Joined: Sun Apr 21, 2002 1:53 am
Location: I'm not sure

Post by RMS » Wed Feb 12, 2003 10:56 pm

jlin wrote: I think my computer makes some kind of changes to the file after I save it.

I am editing the file under Chinese environment. So if I open and save the files without making any changes, the error will still appear.

can I have your admin_users.php with only the point mod installed? TIA

Jason


Hmm hehe, in that case I'm glad my dad doesn't try to run his computer with all this Chinese stuff built in anymore.
Well, my files are quite extensively modded so I really don't think you would want that. I can just add the stuff the points mod needs to a fresh default file though. However, I'm busy for the rest of today, so you'll have to wait at least until tomorrow.
This is my signature.

Narc0sis
Registered User
Posts: 662
Joined: Tue Apr 09, 2002 12:59 am
Contact:

Post by Narc0sis » Wed Feb 12, 2003 11:44 pm

yeah i had the same thing with the shop inventory mod. one buy link and no sell link. not sure why, the url's are identical. must be something else.

awesome work on the scratch card, ive got it up and running. I'll have to try out the treasure chest one later

mixxxx
Registered User
Posts: 15
Joined: Mon Jan 27, 2003 8:18 pm
Location: Brazil
Contact:

Post by mixxxx » Thu Feb 13, 2003 12:06 am

Can someone please tell me what I should fix here? When I try opening a topic page, it shows me this:

Code: Select all

SQL Error : 1064 You have an error in your SQL syntax near 'FROM phpbb_posts p, phpbb_users u, phpbb_posts_text pt WHERE p.topic_id = 66 ' at line 2

SELECT u.username, u.user_id, u.user_items, u.user_privs, u.user_effects, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, u.user_points, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid, FROM phpbb_posts p, phpbb_users u, phpbb_posts_text pt WHERE p.topic_id = 66 AND pt.post_id = p.post_id AND u.user_id = p.poster_id ORDER BY p.post_time ASC LIMIT 0, 15
It's in the viewtopic.php... Happened after I installed the Shop. Has the order of that things after the SELECT something to do with it? I tried changing the order and nothing changed, so I think it's not that.

I installed the latest point system and the latest shop, with the two upgrades. Only if I missed something when installing, but I haven't found wrong stuff.

Thanks for the patience with a n00b... :wink:

Zarath
Registered User
Posts: 736
Joined: Fri Dec 06, 2002 9:01 am
Contact:

Post by Zarath » Thu Feb 13, 2003 4:13 am

delete the "pt" that's sitting by itself.

jlin
Registered User
Posts: 26
Joined: Sat Feb 01, 2003 5:25 pm

Post by jlin » Thu Feb 13, 2003 8:16 am

RMS wrote:
jlin wrote:
rms can i have your admin_users.php with only point mod...

I can no long update user info from Admin CP... (but users can still edit profile using user cp)

Do you know why?


...basically then, none of your previous mods had need to change that file?
Well, if that's the case, then just get a fresh default file and edit from there. If you still can't manage to do that though and that's what you want, then in that case I might be able to try to do that for you sooner or later.


I fixed it thanks

mixxxx
Registered User
Posts: 15
Joined: Mon Jan 27, 2003 8:18 pm
Location: Brazil
Contact:

Post by mixxxx » Thu Feb 13, 2003 2:34 pm

Zarath wrote: delete the "pt" that's sitting by itself.


Hm... Hasn't worked.

The code in my viewtopic (error location) is here:

Code: Select all

$sql = "SELECT u.username, u.user_level, u.user_id, u.user_items, u.user_privs, u.user_effects, u.user_posts, u.user_from, u.user_website, u.user_email, u.user_icq, u.user_aim, u.user_yim, u.user_regdate, u.user_msnm, u.user_viewemail, u.user_rank, u.user_sig, u.user_sig_bbcode_uid, u.user_avatar, u.user_avatar_type, u.user_allowavatar, u.user_allowsmile, u.user_points, p.*, pt.post_text, pt.post_subject, pt.bbcode_uid,
FROM " . POSTS_TABLE . " p, " . USERS_TABLE . " u, " . POSTS_TEXT_TABLE . " pt
	WHERE p.topic_id = $topic_id
		$limit_posts_time
		AND pt.post_id = p.post_id
		AND u.user_id = p.poster_id
	ORDER BY p.post_time $post_time_order
	LIMIT $start, ".$board_config['posts_per_page'];
	
if ( !($result = $db->sql_query($sql)) )
{
	message_die(GENERAL_ERROR, "Could not obtain post/user information.", '', __LINE__, __FILE__, $sql);
}
Normally when I try changing something in there the error message continues the same.

mixxxx
Registered User
Posts: 15
Joined: Mon Jan 27, 2003 8:18 pm
Location: Brazil
Contact:

Post by mixxxx » Thu Feb 13, 2003 3:06 pm

Fixed it somehow, thanks...

xmulder
Registered User
Posts: 429
Joined: Thu Jun 27, 2002 8:37 pm

Post by xmulder » Thu Feb 13, 2003 5:58 pm

Moogie wrote: I'm afraid the stockmarket isn't a mod - I've been changing the values every day for the past few weeks! :lol:

I thought about automating it, but if I do it probably won't be until next week, kinda busy the rest of this week.


rofl looks like we are in the same boat then! if you do code a way to automate it then i would be evry interested in beccoming a beta tester for it - i have very little programming experience but i can tell you if anything goes wrong...... just not why :S

<<-Mully->>

Henry_n
Registered User
Posts: 93
Joined: Fri Aug 02, 2002 7:25 pm

Post by Henry_n » Thu Feb 13, 2003 10:54 pm

Hey, something went wronge... other people's Avatars won't appear. Can anyone please help me?! I think it's something in the viewtopic.php (well, I practically KNOW that it is!)

Zarath
Registered User
Posts: 736
Joined: Fri Dec 06, 2002 9:01 am
Contact:

Post by Zarath » Fri Feb 14, 2003 2:43 am

Did you enable avatar privileges? Ifso, disable it and their avatars will come back.

Zarath
Registered User
Posts: 736
Joined: Fri Dec 06, 2002 9:01 am
Contact:

Post by Zarath » Fri Feb 14, 2003 2:46 am

xmulder wrote:
Moogie wrote:I'm afraid the stockmarket isn't a mod - I've been changing the values every day for the past few weeks! :lol:

I thought about automating it, but if I do it probably won't be until next week, kinda busy the rest of this week.


rofl looks like we are in the same boat then! if you do code a way to automate it then i would be evry interested in beccoming a beta tester for it - i have very little programming experience but i can tell you if anything goes wrong...... just not why :S

<<-Mully->>


Writing algorithms to control stuff like stock markets is extremely hard and they usually end up massive, as long as you want to keep it realistic. You could just make it totally random but that would be a little lame, imho.

Narc0sis
Registered User
Posts: 662
Joined: Tue Apr 09, 2002 12:59 am
Contact:

Post by Narc0sis » Fri Feb 14, 2003 4:44 am

Moogie wrote: I'm currently trying to modify the item give/trade system so that the item's icon appears beside the drop-down list when the user selects an item.

Not as easy as I thought... at the moment I can only make it display images of one filetype, either .gif or .jpg ... it can't choose which one to use for which item :(

I've tried various JavaScript functions to try to make it detect whether the image file exists and if not, do it with the other extension, but (in IE, at least) that doesn't seem to work at all.

Anyone here got any foolproof code for JavaScript, to check whether a file exists? Or something other than image.onLoad / image.onError which don't see to work for me...?

Otherwise this'll only be useful for people who have used only .gif or only .jpg for their shop item images :(

Well, time to go for now. Glad you're enjoying the mods I've posted. Another big thanks to Zarath, without whom I'd've had nothing to base any of this on, and also for being such a good sport as to let me post this stuff in his topic!


weird, i never knew it would be hard. they had a select avatar on registration mod that did this with the avatars appearing when you selected one in the drop down list

i have a question for u tho moogie. you said something about limiting your users to 2 scratch cards a day. how do you set a limit on the number of scratch cards a user can buy in a day? i realize its not part of the original mod but if its something simple tell me so i can do it too, my users are hording scratch cards lol.

User avatar
Moogie
Registered User
Posts: 363
Joined: Thu Aug 22, 2002 11:39 am
Location: UK
Contact:

Post by Moogie » Fri Feb 14, 2003 9:37 am

Narc0sis: It's not actually set to two a day, but two at a time... and I have it set for all items (except 'shares', of which they can own 35)... I just get the shop_bs.php to check the shop type, and if it's a certain type, it checks how many of an item the user has when they try to buy...

So, they can buy two scratch cards, use them and then buy two more... but at least in the time it takes for them to use those two, other people have had the chance to buy some (ie, no-one buys them all rapidly and hogs them).

Not sure when I'll be able to post more, as my other half has taken a long weekend, and I know my typing all the time annoys him ;)

Still, will try to get on and post more when I can.
Moogie

Spider Slay
I am too lazy to register

Post by Spider Slay » Fri Feb 14, 2003 6:24 pm

I get this when I try to run shop_upgrade1.php I already installed the first version, so that's why I get the error, but how can I fix it?Do I need to delete the shop sql database?

Running :: alter table phpbb_users add `user_items` TEXT -> FAILED ---> Duplicate column name 'user_items'

Running :: create table `phpbb_shopitems` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `name` CHAR (32) NOT NULL, `shop` CHAR (32) NOT NULL, `sdesc` CHAR (80) NOT NULL, `ldesc` TEXT NOT NULL, `cost` INT (20) UNSIGNED DEFAULT '100', `startprice` INT (20) UNSIGNED DEFAULT '100', `raise` INT (20) UNSIGNED DEFAULT '100', `stock` TINYINT (3) UNSIGNED DEFAULT '10', `startstock` TINYINT (3) UNSIGNED DEFAULT '100', `maxstock` TINYINT (3) UNSIGNED DEFAULT '100', `sold` INT (5) UNSIGNED NOT NULL DEFAULT '0', PRIMARY KEY(`id`), INDEX(`name`)) -> FAILED ---> Table 'phpbb_shopitems' already exists

Running :: create table `phpbb_shops` (`id` INT UNSIGNED NOT NULL AUTO_INCREMENT, `shopname` CHAR (32) NOT NULL, `shoptype` CHAR (32) NOT NULL, PRIMARY KEY(`id`), `type` char (32) NOT NULL, `restocktime` INT (20) UNSIGNED DEFAULT '86400', `restockedtime` INT (20) UNSIGNED DEFAULT '0', `restockamount` INT (4) UNSIGNED DEFAULT '5', `amountearnt` INT (20) UNSIGNED DEFAULT '0', INDEX(`shopname`)) -> FAILED ---> Table 'phpbb_shops' already exists

Running :: insert into phpbb_config values ('multibuys', 'on') -> FAILED ---> Duplicate entry 'multibuys' for key 1

Running :: insert into phpbb_config values ('restocks', 'off') -> FAILED ---> Duplicate entry 'restocks' for key 1

Running :: insert into phpbb_config values ('sellrate', '75') -> FAILED ---> Duplicate entry 'sellrate' for key 1

Running :: insert into phpbb_config values ('viewtopic', 'images') -> FAILED ---> Duplicate entry 'viewtopic' for key 1


Finished!
Some of the querys have failed, contact me so I can fix the errors.

Spider Slay
I am too lazy to register

Post by Spider Slay » Fri Feb 14, 2003 6:27 pm

And how does the Special Shop really works? when you get buy Avatar and stuff, I have nothing to select from the drop down menu. How do I change that? You know, Buy Avatar, and then the drop down menu is blank.

Locked

Return to “[2.0.x] MODs in Development”