Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[PHP] WindPHP: "Whistler" [R26]

Status
Not open for further replies.
Ask me about Daoism
Loyal Member
Joined
Nov 6, 2010
Messages
1,560
Reaction score
393
FullmetalPride - [PHP] WindPHP: "Whistler" [R26] - RaGEZONE Forums

Hello, everyone. I've had a little project in development for quite some time now, and only now have I decided to post a project listing, because I feel it's starting to mature.


What is WindPHP?

Cliche, much, but I'll bite. WindPHP is an advanced content management system (etc.) written from scratch with small features that would have turned out the same, anyways, ripped from PHPRetro. It's in its baby stages of development but a lot of progress has been made thus far, and I feel good things to come from this project.

Why a v26 CMS? Don't we have enough CMSs? Shockwave is dead, anyways.

I chose V26 because I realized that only the PHPRetro edits by ePixel work straight out-of-the-box. Even then, the CMS's are ridden with undefined variable notices, PHP warnings, and deprecated functions. If we can build something 10x as secure and much smarter than any of the others, maybe Shockwave has a fighting chance.

What makes it spectacular?

I fused retro (pun intended) looks with sleek, speedy code from what PHPRetro would call the future, as well as functionality with HoloEmu. WindPHP is intended to be completely cross-compatible with PHPRetro AND the HoloEmu database.

What makes you think this will help Shockwave?

Hopefully it will make people realize how much more fun it is :closedeyes:

Specs:

  • MySQLi Engine
  • Template System
  • User System
  • Ban System
  • Login
  • Register
  • Housekeeping
  • Groups and Homes



Build 4024 Whistler/"Dilla-J"
GitHub:

Test site: [Removed for DDoS protection. Sad that the community turned out this way but I can't take risks like that.]



Debuting alongside the project, hopefully, will be an edit of the emulator that Force was built from, written by one of their programmers. Not sure if this will fall through but I'm really rooting for it.

Credits:

Meth0d for designing HoloCMS
Yifan Lu for designing PHPRetro FROM HoloCMS which, in turn, helped me by teaching me how the site works and for designing various systems which I would base mine from.

UberCMS for tab functions and various ideas.

Azaidi/Amir Zaidi for giving me the JS to make bodies dynamic in each page without obstructing the tabs or the page :)

If I can be honest, this is only a small contribution to the project. Not to understate their work, of course, but most of the labor is done by me. Nonetheless, I bow before their statues :closedeyes:

 
Last edited:
Joined
Jun 23, 2010
Messages
2,323
Reaction score
2,195
Aah nice try and good luck with it.

The first file I opened.


Please, dont use globals it looks sloppy and you set a not defined variable ($this->mysqli).

Also, I see you use namespaces. Make a good use of them and use a autoloader it's worth it.

If you like, I could show you some of my latest work, which has some nice features.

I'm open to awnser some questions.

Goodluck with it!
 
Ask me about Daoism
Loyal Member
Joined
Nov 6, 2010
Messages
1,560
Reaction score
393
Aah nice try and good luck with it.

The first file I opened.


Please, dont use globals it looks sloppy and you set a not defined variable ($this->mysqli).

Also, I see you use namespaces. Make a good use of them and use a autoloader it's worth it.

If you like, I could show you some of my latest work, which has some nice features.

I'm open to awnser some questions.

Goodluck with it!

Sigh, I know I'm not supposed to use globals :(

I tried everything to work with the scope before I finally just decided that it was ok to cheat this one time, and worth it. As for that autoload, I'm going to implement it soon. :)


Notice: Only a week in, I've run into a problem. Since PHPRetro doesn't work well, and there are no longer R26 retros around, I no longer have access to the old HTML necessary without having to make major edits to the individual pages of PHPRetro. That's inefficient half the time, as I've learned.
 
"(still lacks brains)"
Loyal Member
Joined
Sep 2, 2011
Messages
2,371
Reaction score
1,361
I'm pretty sure this will not get used when completed but I hope you complete it, by the way; don't use percentages for how far completed everything is in the bullet point list. Colour code it instead, much easier and not retarded ;)
 
Ask me about Daoism
Loyal Member
Joined
Nov 6, 2010
Messages
1,560
Reaction score
393
I'm pretty sure this will not get used when completed but I hope you complete it, by the way; don't use percentages for how far completed everything is in the bullet point list. Colour code it instead, much easier and not retarded ;)

I work better with numbers. As I was writing them I thought "God I'm going to look like a Ducking noob :L"

But I made the switch. Only for you <3

Can someone review my registration code? ($user->insertUser(); and register.php) It's basically stating that $_POST["bean.(x)"] variables aren't being sent when I do an if-else to check if they're set.
 
Last edited:
Joined
Aug 10, 2011
Messages
7,399
Reaction score
3,303
I work better with numbers. As I was writing them I thought "God I'm going to look like a Ducking noob :L"

But I made the switch. Only for you <3

Can someone review my registration code? ($user->insertUser(); and register.php) It's basically stating that $_POST["bean.(x)"] variables aren't being sent when I do an if-else to check if they're set.

Try var_dump(); for debugging instead of echo ing them?
 
Ask me about Daoism
Loyal Member
Joined
Nov 6, 2010
Messages
1,560
Reaction score
393
I've decided not to code Habbo club. Instead, it will simply be a default feature.

I never understood why we bothered not doing this in the first place? It's one of those things that, basically instigated the creation of retros. We built them partly to circumvent paying for Habbo club.

So whats the point of asking a user to waste credits on buying it? If someone gives me a good reason I'll be happy to program it in but for now I'm questioning the whole community's practice of it.
 
Run, but I'll find you.
Joined
Jan 29, 2011
Messages
777
Reaction score
327
I've always had a thing for v26 CMS's :')

Good luck with your project. Can't wait to see groups and homes!
 
Joined
Apr 30, 2007
Messages
2,339
Reaction score
1,547
Re: [PHP] WindPHP: &quot;Whistler&quot; [R26]

Just a tip.. if you're gonna be writing OO MySQLi, then use OO fully not a mix of procedural and OO.

eg you have

PHP:
$system = mysqli_fetch_array($mysqli->query("SELECT * FROM system"));

when it should be

PHP:
 if($getsystem = $mysqli->query("SELECT * FROM system")) { while($data = $getsystem->fetch_array()) { $name = $data[0]; } }

Row 0 being the name of the site. You could also do a fetch_assoc() and can use $data["name"] instead of row count.



Oh &...

PHP:
if(!file_exists("C:/inetpub/wwwroot/system/pages/" . $tplId .  ".pop")) {
					return "Stop messing around and get back to the hotel :@";
				}

What if i dont have it installed to C:\? You can use ./pages/tplname.pop as class.page is in system.
 
Ask me about Daoism
Loyal Member
Joined
Nov 6, 2010
Messages
1,560
Reaction score
393
Re: [PHP] WindPHP: &quot;Whistler&quot; [R26]

Just a tip.. if you're gonna be writing OO MySQLi, then use OO fully not a mix of procedural and OO.

eg you have

PHP:
$system = mysqli_fetch_array($mysqli->query("SELECT * FROM system"));

when it should be

PHP:
 if($getsystem = $mysqli->query("SELECT * FROM system")) { while($data = $getsystem->fetch_array()) { $name = $data[0]; } }

Row 0 being the name of the site. You could also do a fetch_assoc() and can use $data["name"] instead of row count.



Oh &...

PHP:
if(!file_exists("C:/inetpub/wwwroot/system/pages/" . $tplId .  ".pop")) {
					return "Stop messing around and get back to the hotel :@";
				}

What if i dont have it installed to C:\? You can use ./pages/tplname.pop as class.page is in system.

It's easier to debug when I write out the full path, that way it will show the full path where the error is being caused.


As for the OO MySQLi tip, $mysqli->fetch_array() started to be an invalid function, for some reason. I couldn't figure out why, so I figured in the interest of time, it's just more efficient if I mix PDO in with it.

Sometimes $mysqli->fetch_array works, other times it says it's an undefined function. I don't know why.
 
Joined
Apr 30, 2007
Messages
2,339
Reaction score
1,547
Re: [PHP] WindPHP: &quot;Whistler&quot; [R26]

It's easier to debug when I write out the full path, that way it will show the full path where the error is being caused.


As for the OO MySQLi tip, $mysqli->fetch_array() started to be an invalid function, for some reason. I couldn't figure out why, so I figured in the interest of time, it's just more efficient if I mix PDO in with it.

Sometimes $mysqli->fetch_array works, other times it says it's an undefined function. I don't know why.

PHP:
if(!file_exists("./pages/" . $tplId . ".pop")) { die("no such template: " . $tplId); }

seems much easier to me, tells you the tpl having the problemo.

If fetch_array or assoc comes up as invalid, then your query has failed. As for mixing PDO with MySQLi, you're going to create 2 different connections? As far as I know, unless you're gonna do that, then you can only use one or the other.
 
Ask me about Daoism
Loyal Member
Joined
Nov 6, 2010
Messages
1,560
Reaction score
393
Re: [PHP] WindPHP: &quot;Whistler&quot; [R26]

PHP:
if(!file_exists("./pages/" . $tplId . ".pop")) { die("no such template: " . $tplId); }

seems much easier to me, tells you the tpl having the problemo.

If fetch_array or assoc comes up as invalid, then your query has failed. As for mixing PDO with MySQLi, you're going to create 2 different connections? As far as I know, unless you're gonna do that, then you can only use one or the other.

No it seems to work as long as you don't use mysqli_query. When you fetch an array, associative or not, it's an "offline" function. Same with mysqli_real_escape_string. They just change the datatypes of the already-defined results or inputs.
 
Joined
Apr 30, 2007
Messages
2,339
Reaction score
1,547
Re: [PHP] WindPHP: &quot;Whistler&quot; [R26]

No it seems to work as long as you don't use mysqli_query. When you fetch an array, associative or not, it's an "offline" function. Same with mysqli_real_escape_string. They just change the datatypes of the already-defined results or inputs.

lol wat

What is an "offline" function? In order to use them, you need a connection to the database in order to modify values with them or use values from them.

I said use $mysqli->query, not mysqli_query. if you use mysqli_query, then you need to pass the connection as a variable after you have set the query which is procedural and disgusting.

Not telling you how to do it, just providing tips. The way you're doing this is not nice, is not user friendly, and is not consistent. MySQLi has great support for OO, so you should use it as it's meant to be used. I used this to learn: - give it a read.
 
Ask me about Daoism
Loyal Member
Joined
Nov 6, 2010
Messages
1,560
Reaction score
393
Re: [PHP] WindPHP: &quot;Whistler&quot; [R26]

lol wat

What is an "offline" function? In order to use them, you need a connection to the database in order to modify values with them or use values from them.

I said use $mysqli->query, not mysqli_query. if you use mysqli_query, then you need to pass the connection as a variable after you have set the query which is procedural and disgusting.

Not telling you how to do it, just providing tips. The way you're doing this is not nice, is not user friendly, and is not consistent. MySQLi has great support for OO, so you should use it as it's meant to be used. I used this to learn: - give it a read.

Offline as in, you don't have to have an uplink to use mysqli_real_escape_string, or fetch_array, or whatever. You just have to have an input or a result set.

It's not that hard to convert the functions anyways, so I'll just do that now.
 
Joined
Apr 30, 2007
Messages
2,339
Reaction score
1,547
Re: [PHP] WindPHP: &quot;Whistler&quot; [R26]

Offline as in, you don't have to have an uplink to use mysqli_real_escape_string, or fetch_array, or whatever. You just have to have an input or a result set.

It's not that hard to convert the functions anyways, so I'll just do that now.

Indeed it is easy, however you're wrong; you need to be connected to the database in order to use mysqli::real_escape_string or fetch_array etc.

If you need any help, send me a PM :)
 
Ask me about Daoism
Loyal Member
Joined
Nov 6, 2010
Messages
1,560
Reaction score
393
Re: [PHP] WindPHP: &quot;Whistler&quot; [R26]

Indeed it is easy, however you're wrong; you need to be connected to the database in order to use mysqli::real_escape_string or fetch_array etc.

If you need any help, send me a PM :)

Oh I didn't know that.

Thanks m8. I have something to ask right now actually.
 
Ask me about Daoism
Loyal Member
Joined
Nov 6, 2010
Messages
1,560
Reaction score
393
Finished some me page features.


  • User Statistics (HC, Coins, Notifications [Except groups..])
  • News Article Carousel
  • Hot Campaigns

I changed my mind about the HC statistics. But, I don't know if I'm going to do minimail. I'm considering changing it to a better, custom system. I'm going to be programming Staff Picks.

Not sure about tags, either. They're not that helpful, and god knows I never used them.
 
Status
Not open for further replies.
Back
Top