[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - How to properly design a PHP website (Quaddicted)?

How to properly design a PHP website (Quaddicted)?

Discuss programming topics for any language, any source base. If it is programming related but doesn't fit in one of the below categories, it goes here.

Moderator: InsideQC Admins

How to properly design a PHP website (Quaddicted)?

Postby Spirit » Sun Feb 09, 2014 3:46 pm

Some day(tm) I want to rewrite the map database system of Quaddicted, https://www.quaddicted.com/reviews/

What stops me from doing it is that a) right now it is the worst kind of spaghetti as I was learning as I was going and b) I have no idea how to properly design it program-wise.

I have a script that handles the single map view: https://github.com/SpiritQuaddicted/Qua ... etails.php -> (webserver turns *.html into details.php?map=*) -> https://www.quaddicted.com/reviews/sksp2b.html

On it you see some static stuff pulled from the database like the map's title, author, etc. But there are also dynamic parts. Users can add comments and tags to it using a POST to the same script (so I have a huge ifthisifthat block at the head of the file). Users can also rate the map with a GET request to a via AJAX.

User authentication is handled through the cookies of a FluxBB installation which just increases the mess.

I am not using functions nor MVC because I have no clue how. :(

Earlier I wanted to implement (eg "maps i have played" or "worst maps evar!!1"). I started drafting some functions (for example addMapToList() that would take the map id and the list id and do the SQL) but gave up when I realised it would just increase the current mess.

Ideally I guess I would have just a bunch of functions like addTag($map, $tag), editComment($id, $newtext) which I could then use without having my scripts explode with SQL here and sanitation there. But then where would I do the authentication for example? Would I have one main script like a main function that handles all requests? How do I do messages after users interacted with the site?

I did look into frameworks once but that just confused me more. :(
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
Spirit
 
Posts: 1037
Joined: Sat Nov 20, 2004 9:00 pm

Re: How to properly design a PHP website (Quaddicted)?

Postby qbism » Thu Feb 13, 2014 2:52 am

Maybe find similar open-source php scripts to examine. Something like hotel or movie reviews? The live filtering of the maplist is unique and I can't think of anything like it. lvl is the first other map review site that comes to mind but it does not have the compact map spreadsheet with sort and filter options.
User avatar
qbism
 
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am

Re: How to properly design a PHP website (Quaddicted)?

Postby Spirit » Thu Feb 13, 2014 4:07 pm

I am a bit afraid those sites' codes would just overwhelm me plus I would not be able to see if they were insane like me or actually well designed.

The big table is something very important to me. I started making some fancy paginated version once but stopped when I realised it would be pointless without order options and selections (by author, year, tags etc):
https://www.quaddicted.com/reviews/notsexyindex2.php
https://www.quaddicted.com/reviews/notsexyindex3.php
https://www.quaddicted.com/reviews/notsexyindex4.php

The live filtering is just client-side JS. I found it somewhere on the internet once. You can see I have no clue how it works (in depth) as I duplicated the code twice for different scenarios. :P
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
Spirit
 
Posts: 1037
Joined: Sat Nov 20, 2004 9:00 pm

Re: How to properly design a PHP website (Quaddicted)?

Postby JasonX » Thu Feb 13, 2014 9:45 pm

Use Symfony: http://symfony.com/
JasonX
 
Posts: 422
Joined: Tue Apr 21, 2009 2:08 pm

Re: How to properly design a PHP website (Quaddicted)?

Postby Spirit » Fri Feb 14, 2014 6:41 pm

That's completely overwhelming. Could you say why specifically symfony and how I would plan it?
Improve Quaddicted, send me a pull request: https://github.com/SpiritQuaddicted/Quaddicted-reviews
Spirit
 
Posts: 1037
Joined: Sat Nov 20, 2004 9:00 pm

Re: How to properly design a PHP website (Quaddicted)?

Postby JasonX » Mon Feb 17, 2014 8:53 pm

JasonX
 
Posts: 422
Joined: Tue Apr 21, 2009 2:08 pm


Return to General Programming

Who is online

Users browsing this forum: No registered users and 1 guest