Haunted Dawg Posted May 10, 2009 Posted May 10, 2009 I have made this stock market for people to use, i was going to sell but then thought about rather releasing as i have been releasing alot paid lately. I mainly made this for a client who had the old stock market but insecure and useless. Stocks can crash on here, if a stock crashes. The user will loose their shares. So well. Here we go. Create file stocks.php And add: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Now Run these SQLs: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Now add this code to your five minute cron/timestamp. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Now the staff panel. Call it staff_stocks.php You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Links: Stocks<hr /> -> Edit Stock -> Add Stock -> Delete Stock This can be seen working on http://www.convictsunleashed.com/demo/ , The cron on the test site is built into the stocks.php so people can see the change. The mod was tested by me & karlos. But created by me. Enjoy! Quote
Bubbl3z Posted May 10, 2009 Posted May 10, 2009 Re: [mccode v2] Stock Market. Working + Secured Sweet mod :-D Quote
Sethenor Posted May 10, 2009 Posted May 10, 2009 Re: [mccode v2] Stock Market. Working + Secured Looks nice man Quote
Haunted Dawg Posted May 10, 2009 Author Posted May 10, 2009 Re: [mccode v2] Stock Market. Working + Secured Code UPDATED Quote
E-Studios Posted May 10, 2009 Posted May 10, 2009 Re: [mccode v2] Stock Market. Working + Secured Very nice man. I Am Liking it, You Get A +1 From me :-) Quote
Uridium Posted May 10, 2009 Posted May 10, 2009 Re: [mccode v2] Stock Market. Working + Secured HAUNTED just gets an Instant +1 without me even adding his script cos the Chances of it NOT working are very slim Great mod pal :) Quote
jds137 Posted May 11, 2009 Posted May 11, 2009 Re: [mccode v2] Stock Market. Working + Secured Great mod as far as I can see. I found that there is 1 error. When you add a stock, lets say for 2 k for ex. When it loses a little money, the whole amount goes negative. See below, the stock is still positive, but its listed as negative. Stock Name Stock Orig Price Stock Now Price Price Change View Smigs $2,000 - $1,859 - $169 ? Buy Or View Quote
E-Studios Posted May 11, 2009 Posted May 11, 2009 Re: [mccode v2] Stock Market. Working + Secured Look's fine to me.... NOTE I Only just added Sake thats why it hasnt gone up or down..... My one look's a little different to the original as i have changed the table's and so on to match the rest of the game..... But all credit due to Haunted Dawg for the mod +1 HD Quote
Lithium Posted May 11, 2009 Posted May 11, 2009 Re: [mccode v2] Stock Market. Working + Secured Quite nice, though i tried it, and you can win quite a load of cash, as stock prices would change upon each page refresh... not a good idea to allow this. besides that, the only note is the negative "price now". if it goes to minus, you could/should restrain it to either 0 and/or make users that have those stock shares, to lose them as price hits 0. ;) Quote
bocco Posted May 11, 2009 Posted May 11, 2009 Re: [mccode v2] Stock Market. Working + Secured first thing is he added the cron to the page to show you how it would change, that is not in the real code.... 2nd there is one error if you have 100 dollars on hand and the stock is at 100 you cant buy it it should only be a <money rather then <=money Quote
Haunted Dawg Posted May 11, 2009 Author Posted May 11, 2009 Re: [mccode v2] Stock Market. Working + Secured @ JDS: It show's a - infront of the now price to show that the user is loosing out on cash. It never went negative. @ Lithium: On the demo site it's setup to be on the page per load. As i do not run cron's atm on the test site. So therfor i tell people to put it in the 5 minute cron to change every five minute's. @ Bocco: if <= is set as far as i know it's set to be if lower or equal to that price then say no. Quote
Haunted Dawg Posted May 11, 2009 Author Posted May 11, 2009 Re: [mccode v2] Stock Market. Working + Secured Due to some of you misserable little kids/bastar*s, i have locked down almost all editing now from the demo site. To that little person who think's they ruining my life by putting "Killah i hate you you fu**ing n00b, im going to ruin your life!" Think again. To that little person who hate's black's. Good for you keep it to your self, IM NOT BLACK! To that little person who hates cyanide.. goood for you, take it up to him and say it in his face. AND! to that little person who hates bluedevil23's gym. STFU it's better than what you could ever make in your entire life... Quote
Pieces Posted May 12, 2009 Posted May 12, 2009 Re: [mccode v2] Stock Market. Working + Secured +1...Had the old stock market which didn't work so thanks :-) Quote
Haunted Dawg Posted May 16, 2009 Author Posted May 16, 2009 Re: [mccode v2] Stock Market. Working + Secured Bump :) Quote
KiX Posted May 21, 2009 Posted May 21, 2009 Re: [mccode v2] Stock Market. Working + Secured Havent tried it yet, but I also am sure it is a winner. +1 mate! Quote
gurpreet Posted May 21, 2009 Posted May 21, 2009 Re: [mccode v2] Stock Market. Working + Secured Stock Name Stock Orig Price Stock Now Price Price Change View BT $2,000 - $1,651 - $205 ? Buy Or View Microsoft $15,000 + $15,106 - $129 ? Buy Or View Death-Wars HQ $200,000 - $199,602 - $163 ? Buy Or View Abbey $20,000 - $19,906 - $214 ? Buy Or View McDonalds $15,000 - $14,830 - $45 ? Buy Or View Stock Name BT Price Change + $160 ? Original Price $2,000 Now Price $1,811 I'm guessing that's not right? Quote
Lithium Posted May 21, 2009 Posted May 21, 2009 Re: [mccode v2] Stock Market. Working + Secured Stock Name BT Price Change + $160 ? Original Price $2,000 Now Price $1,811 I'm guessing that's not right? This can be right... overall progression might had the stock price lowered to let's say... $1651, and at last update increased by $160 to $1811, maintining the price lower than original sell price... Quote
gurpreet Posted May 21, 2009 Posted May 21, 2009 Re: [mccode v2] Stock Market. Working + Secured Oh so it's the change from the last 5 minutes, not overall change? Quote
b4ugobye Posted May 21, 2009 Posted May 21, 2009 Re: [mccode v2] Stock Market. Working + Secured looking good so far. +1 Quote
Raptor_Jesus Posted May 22, 2009 Posted May 22, 2009 Re: [mccode v2] Stock Market. Working + Secured Looks worthy of my recoding for Horizons +1 for ya. Quote
BlueDevil23 Posted May 25, 2009 Posted May 25, 2009 Re: [mccode v2] Stock Market. Working + Secured Good job Killah :) one thing though: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Don't declare a function inside a loop, your only slowing your script down, because the function is being called on every iteration. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote
inferno564 Posted May 30, 2009 Posted May 30, 2009 Re: [mccode v2] Stock Market. Working + Secured for some reason the stocks wont go up or down they just stay the same Quote
Jhunter Posted June 6, 2009 Posted June 6, 2009 Re: [mccode v2] Stock Market. Working + Secured i have tried to add a limit to how many stock you can buy, but every time i try something it doesn't work, is it possible so one can add one then repost the code? Thanks in advance Quote
eido Posted June 9, 2009 Posted June 9, 2009 Re: [mccode v2] Stock Market. Working + Secured It would be good if you could only buy 5 of each shares makes it more intresting and more harder to get money anyone want to tell me how to do it? Quote
Monkeh Posted June 10, 2009 Posted June 10, 2009 Re: [mccode v2] Stock Market. Working + Secured This is really good. Seems like a quality modification and unlike most "awesome coders" around here you actually give quality freebies, will totally be looking into this and learning from it. Thanks. :-D Quote
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.