Alan Posted June 11, 2013 Share Posted June 11, 2013 Any reasons why to?Because " is not a valid delimiter i this context. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Would be the obvious solution after reading the heredoc reference in detail. Quote Link to comment Share on other sites More sharing options...
Dragon Blade Posted June 11, 2013 Share Posted June 11, 2013 I have realised and thanks for solving my problem. Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted June 11, 2013 Author Share Posted June 11, 2013 Because " is not a valid delimiter i this context. You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Would be the obvious solution after reading the heredoc reference in detail. Good lookin out Alan. I really can't stand heredoc and nowdock so anytime I see them I remove them, I'm sure somewhere they serve a good purpose but just my preference and style to end my strings etc one by one, plus it makes things easier to read with the syntax highlighting of a text editor Quote Link to comment Share on other sites More sharing options...
Alan Posted June 11, 2013 Share Posted June 11, 2013 If you consider the different forms of string handling within PHP, it should become pretty apparent that each serves a specific purpose; I'm a fan of using heredoc if I'm forced to use raw SQL queries rather than simple calls to stored-procedures as it makes copying and pasting the query into (for example) MySQL-Workbench very easy. There is also a strong case for using heredoc when outputting a mix of HTML and JavaScript however, I veer towards template solutions wherever possible saving me from this otherwise onerous task. Consider the following: You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. vs You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Ask yourself which is easier to read, and in 6-weeks, 6-months, or 6-years time easier to maintain? Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted June 11, 2013 Author Share Posted June 11, 2013 (edited) well, when you put it like that for sure the top snippet is by far easier but in all honesty I wouldn't have done it that way either :p on another note I don't do any sort of javascript so ill chalk it up as a +1 for you. and like I said I found in my ventures no real use for it but that neither here nor there and thanks for the lesson ill try to remember it Also original post is updated to add the userstats in Edited June 11, 2013 by KyleMassacre Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted June 12, 2013 Author Share Posted June 12, 2013 So, I was wondering if anyone would like an expansion of this, like more features to player classes. I can do items, properties, and even gangs. Quote Link to comment Share on other sites More sharing options...
Veramys Posted June 25, 2013 Share Posted June 25, 2013 that would be pretty awesome if you add all the other stuff! good job to you sir! Quote Link to comment Share on other sites More sharing options...
Relentless- Posted September 27, 2013 Share Posted September 27, 2013 Hi, very nice mod. Is it possible to make it so a specific class chosen upon registration gives x bonus in x stat throughout the full game? For example upon registration you could choose to be a thug or businessman, the businessman may have a 25% IQ bonus whilst the thug will have a 20% strength bonus? Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted September 27, 2013 Author Share Posted September 27, 2013 are you talking about through the training system and education system? Quote Link to comment Share on other sites More sharing options...
DeathXXX Posted February 23, 2014 Share Posted February 23, 2014 i cannot get it to work in register???? Quote Link to comment Share on other sites More sharing options...
Guest Posted February 23, 2014 Share Posted February 23, 2014 i cannot get it to work in register???? More useful posts, great! Care to elaborate? Quote Link to comment Share on other sites More sharing options...
DeathXXX Posted February 23, 2014 Share Posted February 23, 2014 basically i dont know were to add it and if i do add it in register ie this print " <tr> <td>Player Class</td> <td colspan='2'>".class_dropdown(NULL, "classID")." </td> </tr>"; I it dont work i get this error Fatal error: Call to undefined function class_dropdown() in /home/mafiali2/public_html/register.php on line 339 and on that line is this <td colspan='2'>".class_dropdown(NULL, "classID")." Quote Link to comment Share on other sites More sharing options...
jcvenom Posted February 23, 2014 Share Posted February 23, 2014 basically i dont know were to add it and if i do add it in register ie this print " <tr> <td>Player Class</td> <td colspan='2'>".class_dropdown(NULL, "classID")." </td> </tr>"; I it dont work i get this error Fatal error: Call to undefined function class_dropdown() in /home/mafiali2/public_html/register.php on line 339 and on that line is this <td colspan='2'>".class_dropdown(NULL, "classID")." Ahh you add your tr etc after the last tr in register script mainly below the email section also you are getting an error because you haven't declared class_dropdown() as a function meaning you must add You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Somewhere if im not mistaken correct me if i am. Quote Link to comment Share on other sites More sharing options...
DeathXXX Posted February 23, 2014 Share Posted February 23, 2014 sorry i do not understand that ?/ could u make it clearer please?... Quote Link to comment Share on other sites More sharing options...
Guest Posted February 23, 2014 Share Posted February 23, 2014 Ahh you add your tr etc after the last tr in register script mainly below the email section also you are getting an error because you haven't declared class_dropdown() as a function meaning you must add You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Somewhere if im not mistaken correct me if i am. Your just calling the function again? Meaning he will get another error for undefined function. You need to DEFINE the function, I'm guessing your not including a file as it can't locate the function. Quote Link to comment Share on other sites More sharing options...
jcvenom Posted February 23, 2014 Share Posted February 23, 2014 sorry i do not understand that ?/ could u make it clearer please?... Ahh i see now it already asks you to include some functions in your global_funcs file meaning you probably haven't included the file to your register.php To fix do as follows below Add this to global_funcs You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Then in your register.php add You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 23, 2014 Share Posted February 23, 2014 Ahh i see now it already asks you to include some functions in your global_funcs file meaning you probably haven't included the file to your register.php To fix do as follows below Add this to global_funcs You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Then in your register.php add You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. If your game is in sub directory this won't work Quote Link to comment Share on other sites More sharing options...
jcvenom Posted February 23, 2014 Share Posted February 23, 2014 If your game is in sub directory this won't work but who said his game was in the sub directory but in an incident that the game is in a sub directory you could use You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted February 24, 2014 Author Share Posted February 24, 2014 If you added the part to global funcs like I said in the original post everything should work out fine. In the event that you are getting an error for a function that doesn't exists open up your register and make sure you included global funcs in your page. If it is alread included then you didn't add the part for the drop down in your global funcs file. Quote Link to comment Share on other sites More sharing options...
DeathXXX Posted February 24, 2014 Share Posted February 24, 2014 (edited) this is staff_classes.php? ok so i fixed it but when i wanted to create a class i kept getting this Whats the point of having 2 classes with the same name? > Goto Main You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Edited February 24, 2014 by KyleMassacre Added code instead of quote tags Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted February 24, 2014 Author Share Posted February 24, 2014 Probably because you have 2 class names that are the same name Quote Link to comment Share on other sites More sharing options...
Samurai Legend Posted June 7, 2014 Share Posted June 7, 2014 Thanks for this Kyle! And I can't wait for your registration modification! Quote Link to comment Share on other sites More sharing options...
Samurai Legend Posted September 14, 2014 Share Posted September 14, 2014 Just added this to my game. The staff file had few minor errors. Wouldn't even say errors. Thanks for this! You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. As you can see You're unable to view this code. Viewing code within this forum requires registration, you can register here for free. Quote Link to comment Share on other sites More sharing options...
KyleMassacre Posted September 14, 2014 Author Share Posted September 14, 2014 Oops good looking out. I would edit it but I'm on my phone. Must have been some copy/paste errors Quote Link to comment Share on other sites More sharing options...
Tangled Posted September 17, 2014 Share Posted September 17, 2014 So, I was wondering if anyone would like an expansion of this, like more features to player classes. I can do items, properties, and even gangs. Kyle I would love something like this. What I'm looking for tho is player advancement. If they reach so many goals they advance to the next lvl 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.