Points of Required Attention™
Acmlmboard 2 Released
Github/GIT | @acmlmboard | IRC: #abdev
Chatting Places
IRC: #kafuka | Discord

Affiliates
Super Mario Bros. X | Kuribo64
Views: 4,786,988
Main | FAQ | IRC chat | Memberlist | Active users | Latest posts | Calendar | Stats | Ranks | Online users | Search
01-22-18 09:47 PM
Guest: Register | Login

0 users currently in AcmlmBoard Developer Zone | 1 guest

Main - AcmlmBoard Developer Zone - Enhancing all the form code (and instant redirects) (1)
Next newer thread | Next older thread

Pages: 1 2

StapleButter
Posted on 10-29-14 03:41 PM Link | ID: 78007
Developer
Acmlmboard has... side effects
Level: 69


Posts: 631/1548
EXP: 2862702
Next: 7041

Since: 01-05-12
From: France

Last post: 4 days
Last view: 2 days
First question, why do we have the option to choose the redirect type? Most people are going to either choose instant redirects or not care. While it's nice to give them the choice, I don't believe it's very useful.


Then, I looked into the code, and the way it's done isn't the cleanest. I may give some help in adopting a cleaner code structure when I find some time/will.

How I typically do these things is basically:

1. check if a POST action was requested (if not, jump to 4)
2. if so, run the appropriate checks on the input. Raise some error flag if something is wrong.
3. If no error happened, perform the action, send Location header and die()

4. start HTML output (pageheader() for Acmlmboard)
5. if an error was raised, display it
6. display the form, with the appropriate data


That's basically how I did it for editprofile. This method also addresses the issue of 'when to send header()s/cookies without getting "headers already sent"'.

It also makes error reporting more user-friendly. Right now, if your submission has an error, it sends you to a separate error page that invites you to just come back to the forum/thread instead of going back to correct your input.


Relatedly: newthread/newreply/editpost/sendprivate have their form code duplicated between normal and preview modes. That has no reason to be.


This isn't to complain about the code, but to give pointers for the code cleanup/refactor that we're planning.

____________________
Kuribo64 - we hack shit

Emuz
Posted on 10-29-14 06:05 PM Link | ID: 78009
Acmlmistrator

11 Hit Combo:
Mother's Rosario
Level: 92


Posts: 2455/2933
EXP: 7475880
Next: 281057

Since: 12-30-11
From: Akron, Ohio; USA

Last post: 1 hour
Last view: 22 min.
Posted by StapleButter
First question, why do we have the option to choose the redirect type? Most people are going to either choose instant redirects or not care. While it's nice to give them the choice, I don't believe it's very useful.


Then, I looked into the code, and the way it's done isn't the cleanest. I may give some help in adopting a cleaner code structure when I find some time/will.

How I typically do these things is basically:

1. check if a POST action was requested (if not, jump to 4)
2. if so, run the appropriate checks on the input. Raise some error flag if something is wrong.
3. If no error happened, perform the action, send Location header and die()

4. start HTML output (pageheader() for Acmlmboard)
5. if an error was raised, display it
6. display the form, with the appropriate data


That's basically how I did it for editprofile. This method also addresses the issue of 'when to send header()s/cookies without getting "headers already sent"'.

It also makes error reporting more user-friendly. Right now, if your submission has an error, it sends you to a separate error page that invites you to just come back to the forum/thread instead of going back to correct your input.


Relatedly: newthread/newreply/editpost/sendprivate have their form code duplicated between normal and preview modes. That has no reason to be.


This isn't to complain about the code, but to give pointers for the code cleanup/refactor that we're planning.


I could run a query and see how many people on Kafuka used the feature. I don't think getting rid of it in 2.5/6 without serious discussion first due to it's legacy nature.

You tend think of things more on the code end, and I tend to think of it more on the end user side. While to everyone else in the world would never use the redirects, there are a few (and shrinking) people who may or will use it for the Acmlmboard nature. So it may not hurt to still include a check and to always show it. That little bit of extra run time/sql is likely worth it. If we rework it, and we find no one does use it can pull it out if we deem in completely bloaty. We'll need some more input but we can talk more about it.

Otherwise I agree. I like approach for an unified notfication/editing system. We also need to reduce or eliminate all duplicate code as you just said.

No complaints.. they are just observations :)

The Dynamic Profile Administrator™


"Wastashi Dake ga Inai Boaado"

Emuz
Posted on 11-03-14 05:32 PM Link | ID: 78218
Acmlmistrator

11 Hit Combo:
Mother's Rosario
Level: 92


Posts: 2465/2933
EXP: 7475880
Next: 281057

Since: 12-30-11
From: Akron, Ohio; USA

Last post: 1 hour
Last view: 22 min.
Actually I think we should push for the overhaul as SB layed out. I'd still like more options so I've moved this into the public discussion area. Feel free to throw in your two cents!

The Dynamic Profile Administrator™


"Wastashi Dake ga Inai Boaado"

Squiddy
Posted on 02-13-15 12:41 AM Link | ID: 81807
Banned
Unspecificed Cooling Off Period. Be Safe
Bisexual Empress of the Stolen Title?
Level: 126


Posts: 5518/6751
EXP: 22536770
Next: 547334

Since: 07-17-13

Last post: 922 days
Last view: 830 days
This is a bit of a bump but I've eliminated the duplicate form code in preview mode for newreply. Once I do the same for newthread, editpost, and sendprivate, I'll add it to my fork. I've also added editing announcement titles to editpost but I need to fix the "No changes detected." message. <_<>_>

____________________
Sunshine Realm
Welcome to Aqmlm's, the only board with Al-Aq'mlmistrators!

StapleButter
Posted on 02-13-15 12:49 AM Link | ID: 81808
Developer
Acmlmboard has... side effects
Level: 69


Posts: 670/1548
EXP: 2862702
Next: 7041

Since: 01-05-12
From: France

Last post: 4 days
Last view: 2 days
My custom AB2.0a1 version has that duplicate code elimiated for newthread/newreply/editpost as well as instant redirects and reporting errors the way I described. As a bonus, newthread/newreply maintain the offline posting feature.

If anyone's interested, I could hand over the code.

I haven't treated sendprivate because I plan to implement PM threads, and I might just add it to the regular thread handling code.

____________________
Kuribo64 - we hack shit

Squiddy
Posted on 02-13-15 01:06 AM Link | ID: 81809
Banned
Unspecificed Cooling Off Period. Be Safe
Bisexual Empress of the Stolen Title?
Level: 126


Posts: 5519/6751
EXP: 22536770
Next: 547334

Since: 07-17-13

Last post: 922 days
Last view: 830 days
I'd be interested in the instant redirects. I've tried to implement the instant redirect option into editprofile -> profile but it never quite worked as it would leave you on editprofile rather than redirect you to your profile. Yes, I even added the instant redirect message to profile pages but it still did not work. I put it aside to work on other stuff for now.

____________________
Sunshine Realm
Welcome to Aqmlm's, the only board with Al-Aq'mlmistrators!

Epele
Posted on 02-13-15 01:30 AM Link | ID: 81811
Administrator
The Sorceress.
Totally crushing on a certain french girl.

Level: 191


Posts: 13406/16123
EXP: 96307209
Next: 1766884

Since: 01-01-12
From: UK

Last post: 6 hours
Last view: 2 hours
The way I made the redirect messages work the first time, was with a cookie. You can probably reuse the same cookie name, since it's a cookie designed to self-terminate upon the next page load. Elsewise, someone could properly code the board to use sessions to transfer the information from page to page. Likewise, that could also be used as a method of logging in. >_>


The Hero In Every Pretty Pervy Yuri - Thieppy

Emuz
Posted on 02-13-15 06:45 PM Link | ID: 81865
Acmlmistrator

11 Hit Combo:
Mother's Rosario
Level: 92


Posts: 2547/2933
EXP: 7475880
Next: 281057

Since: 12-30-11
From: Akron, Ohio; USA

Last post: 1 hour
Last view: 22 min.
Staplebutter: indeed. I would. Sounds like it's progressed further than our current setup (as suspected).

The Dynamic Profile Administrator™


"Wastashi Dake ga Inai Boaado"

StapleButter
Posted on 02-13-15 07:16 PM Link | ID: 81866
Developer
Acmlmboard has... side effects
Level: 69


Posts: 671/1548
EXP: 2862702
Next: 7041

Since: 01-05-12
From: France

Last post: 4 days
Last view: 2 days
I wouldn't say my code is better or worse, it still lacks some features that are part of 2.5 or even 2.1. It's just following a different direction. Pretty much like ABXD vs Blargboard back then.

However I do think that 2.5 needs simplification. The permission system should be simplified (things like group inheritance are understandable but in practice they tend to overcomplicate things, esp. GUI wise), and some other changes should be done to generally make the codebase cleaner, more consistent and more efficient.

It's still using a ton of queries per page. That's better than storing the entire database in RAM, though.

Also, things like the NEW counters. Those should be static images. In fact: see there, announcement about numgfx. It's kinda like we're going backwards there :P

The sprite system should be an addon. It's not a generally wanted board feature, it's something that is made for this board and gives it character, pretty much like Board2's dodongos or Jul's Ikachan.

____________________
Kuribo64 - we hack shit

Squiddy
Posted on 02-13-15 07:52 PM Link | ID: 81870
Banned
Unspecificed Cooling Off Period. Be Safe
Bisexual Empress of the Stolen Title?
Level: 126


Posts: 5535/6751
EXP: 22536770
Next: 547334

Since: 07-17-13

Last post: 922 days
Last view: 830 days
I added a $config option for disabling the sprite system. All it does it keep sprites from appearing no matter and removes the sprite info in the FAQ. I guess I could have it 404 editsprites.php and sprites.php. Maybe the $config option for disabling the badge system could also 404 assignbadges.php, badges.php, and editbadges.php.

____________________
Sunshine Realm
Welcome to Aqmlm's, the only board with Al-Aq'mlmistrators!

Emuz
Posted on 02-13-15 07:55 PM Link | ID: 81871
Acmlmistrator

11 Hit Combo:
Mother's Rosario
Level: 92


Posts: 2548/2933
EXP: 7475880
Next: 281057

Since: 12-30-11
From: Akron, Ohio; USA

Last post: 1 hour
Last view: 22 min.
Posted by StapleButter
I wouldn't say my code is better or worse, it still lacks some features that are part of 2.5 or even 2.1. It's just following a different direction. Pretty much like ABXD vs Blargboard back then.

However I do think that 2.5 needs simplification. The permission system should be simplified (things like group inheritance are understandable but in practice they tend to overcomplicate things, esp. GUI wise), and some other changes should be done to generally make the codebase cleaner, more consistent and more efficient.

It's still using a ton of queries per page. That's better than storing the entire database in RAM, though.

Also, things like the NEW counters. Those should be static images. In fact: see there, announcement about numgfx. It's kinda like we're going backwards there :P

The sprite system should be an addon. It's not a generally wanted board feature, it's something that is made for this board and gives it character, pretty much like Board2's dodongos or Jul's Ikachan.


Sprites are indeed meant to be an Addon.. just we've never really bothered to create an addon system lol. Agreed. I want to have it out for the migration to github so we can not have to flood the tree with BLOB images.

Templates are another thing that's needed. I don't know if you are templateing your fork but I think that's a required step for any real board going forward.

Actually all of the images used are static images pulled with individual Image tags. We Should have limited to no dynamic images save the RPG one on the profile. Really there is no difference on output 1 or a *img src=meh/1.png /* that's a client side issue.

I agree for the perms, We could limit it down to the point of making sense. Right now if your not familure enough with this code it's like another language. I doubt anyone is doing a spec sheet on it anytime soon. ;D

Actually to be perfectly honest I really think what you are doing for your board is the right path. So you don't really have to twist my arm Lol. I really don't want to abandon what has been done however. If anything Maybe an official fork or revision (2.6) could be done to wrangle it in and not have to lose everything put in already.

I don't have the time to code anymore. Really I only have enough to time to put in my two cents. My goals from now on to audit code I get and approve or reject it. (Which as you can see are slow as I have about 30 commits from Squiddy that are just sitting there)

So what do you propose (in full)?

The Dynamic Profile Administrator™


"Wastashi Dake ga Inai Boaado"

StapleButter
Posted on 02-13-15 08:03 PM (rev. 3 of 02-13-15 08:12 PM by StapleButter) Link | ID: 81876
Developer
Acmlmboard has... side effects
Level: 69


Posts: 674/1548
EXP: 2862702
Next: 7041

Since: 01-05-12
From: France

Last post: 4 days
Last view: 2 days
Doesn't need to be a proper plugin system, just "drop these files in your board directory and run this install file" can do. Dunno.

I'm not doing templates. I prefer having everything in the same place. I also don't intend to distribute my fork publicly, after the failure that Blargboard has been. (I'm willing to give out some code; it just won't be a proper public release etc)

Oh, I didn't notice. Then that's cool, one less thing to do.

Heh, yeah. I had some trouble understanding the permission system when I came into the project.

Well, I'm following whatever path is my preference. Do as you wish :)


As for what I propose, well, dunno. I'm busy with my projects, but I might contribute some code eventually. Maybe try to see if there are other people potentially interested into AB2.5?

Alternately, get 'Acmlmboard 3.0' started in something that isn't PHP. That may attract more people.

____________________
Kuribo64 - we hack shit

Squiddy
Posted on 02-13-15 08:14 PM (rev. 2 of 02-13-15 08:16 PM by Squiddy) Link | ID: 81877
Banned
Unspecificed Cooling Off Period. Be Safe
Bisexual Empress of the Stolen Title?
Level: 126


Posts: 5538/6751
EXP: 22536770
Next: 547334

Since: 07-17-13

Last post: 922 days
Last view: 830 days
Well, my PHP knowledge is still novice so there's really only so much I can do. My test board has an experimental sortorder rankcheck but again, that would use too much RAM. Even though my test board doesn't use nearly as many queries as Kafuka does, that's because it's small.

However, I could try to investigate into simplifying the permission system. But I can't guarantee that it'll work out well. I also think AB2.5 needs some more people who are interested in it. Even though I'm still acquiring knowledge, I'd still like to help with whatever is decided. It'll definitely help me and also the board software. :)

Posted by StapleButter
Alternately, get 'Acmlmboard 3.0' started in something that isn't PHP. That may attract more people.


My suggestion is have 2.6 be the rewrite. Since 2.6 is planned to have "code normalizations, proper headers on code, removal of old code (fix and make work or remove completely)" as Emuz said, I personally feel 2.6 will be a nice candidate for the rewrite.

____________________
Sunshine Realm
Welcome to Aqmlm's, the only board with Al-Aq'mlmistrators!

StapleButter
Posted on 02-13-15 08:28 PM Link | ID: 81878
Developer
Acmlmboard has... side effects
Level: 69


Posts: 675/1548
EXP: 2862702
Next: 7041

Since: 01-05-12
From: France

Last post: 4 days
Last view: 2 days
But that implies that 2.6 would still be PHP. The same codebase but cleaned up.

I was talking about rewriting it in a different language that isn't a pile of hacks.

____________________
Kuribo64 - we hack shit

Squiddy
Posted on 02-13-15 08:32 PM Link | ID: 81879
Banned
Unspecificed Cooling Off Period. Be Safe
Bisexual Empress of the Stolen Title?
Level: 126


Posts: 5539/6751
EXP: 22536770
Next: 547334

Since: 07-17-13

Last post: 922 days
Last view: 830 days
Hmm… yeah. It could cause confusion even if it's written in Python, for example. I've been thinking about eventually making a test index page written in Python once I get to learning Python. If I'm correct, Python works best with PostgreSQL?

____________________
Sunshine Realm
Welcome to Aqmlm's, the only board with Al-Aq'mlmistrators!

Emuz
Posted on 02-13-15 08:34 PM (rev. 2 of 02-13-15 08:35 PM by Emuz) Link | ID: 81880
Acmlmistrator

11 Hit Combo:
Mother's Rosario
Level: 92


Posts: 2549/2933
EXP: 7475880
Next: 281057

Since: 12-30-11
From: Akron, Ohio; USA

Last post: 1 hour
Last view: 22 min.
Well I would rather an Intermediate or higher skill level person tackle that one as it's such a linchpin of the board it needs to be designed, than executed with optimizations on the fly. If you try to do it too 'green' it could end up becoming a bear that eats you.

Acmlmboard 3.0 requires dedicated coders. Last time I checked we don't have enough of those to fill a thimble. (and that's with me included). I think you are absolutely right, but we should only start that if it's going to have the support it needs to succeed. Also I feel we should at least one dev with the python experience to make the code solid from day one. Otherwise we could repeat a mistake that experience would have prevented us from doing. That's not a requirement though.. part of learning is just doing it. Again another factor is I am not in a position to give the time required myself either. I don't have to be for the project to start, but I also can guide it from a mile away either.

A 2.6 rewrite of the PHP board is feasible but the same constraints apply in terms of my time. A real plan would have to be drawn up and we would have to focus on making it lean; removing pointless functions; condensing functions, and make it rock solid.

How is blargboard a failure? I mean people use it don't they?

Edit: Python works with any DB. you aren't stuck with PGSQL

The Dynamic Profile Administrator™


"Wastashi Dake ga Inai Boaado"

StapleButter
Posted on 02-13-15 08:43 PM Link | ID: 81881
Developer
Acmlmboard has... side effects
Level: 69


Posts: 676/1548
EXP: 2862702
Next: 7041

Since: 01-05-12
From: France

Last post: 4 days
Last view: 2 days
Hell we could base if off Ninji's bitBoard. If we got rid of SQLAlchemy that is.


Sure, it's possible to write shit code in any language, but PHP makes it easier to mess shit up. It was built for quick dirty coding, and it shows. Any sane language offers some safety, PHP doesn't.

* use an undefined constant? or typo in a constant name? instead of throwing an error like any sane language does, it assumes you meant the corresponding string (for shit like $array[blarg]). It throws a notice but that's all.

* variables are more or less the same, any non-existing variable is automatically created with an empty value, you don't really declare variables

* function names are case insensitive, but everything else is case sensitive (what?!)

* OOP feels... tacked on, as if you added some weird plugin to PHP

* then there's shit like magic_quotes and register_globals, but those are being removed


The only thing PHP has for it is that it's present everywhere and gets you going quickly.


As for Blargboard, well... this sums it up well. Most of the people who download forum software expect to be able to run it and customize it without needing to edit code or open PMA. It's a tough market.

____________________
Kuribo64 - we hack shit

Emuz
Posted on 02-13-15 09:06 PM Link | ID: 81882
Acmlmistrator

11 Hit Combo:
Mother's Rosario
Level: 92


Posts: 2550/2933
EXP: 7475880
Next: 281057

Since: 12-30-11
From: Akron, Ohio; USA

Last post: 1 hour
Last view: 22 min.
Posted by StapleButter
Hell we could base if off Ninji's bitBoard. If we got rid of SQLAlchemy that is.


Sure, it's possible to write shit code in any language, but PHP makes it easier to mess shit up. It was built for quick dirty coding, and it shows. Any sane language offers some safety, PHP doesn't.

* use an undefined constant? or typo in a constant name? instead of throwing an error like any sane language does, it assumes you meant the corresponding string (for shit like $array[blarg]). It throws a notice but that's all.

* variables are more or less the same, any non-existing variable is automatically created with an empty value, you don't really declare variables

* function names are case insensitive, but everything else is case sensitive (what?!)

* OOP feels... tacked on, as if you added some weird plugin to PHP

* then there's shit like magic_quotes and register_globals, but those are being removed


The only thing PHP has for it is that it's present everywhere and gets you going quickly.


As for Blargboard, well... this sums it up well.


I have thought about bitboard. It's an option indeed. We wouldn't have to start from scratch and Ninji's code could has a chance to continue on. It's not off the table..

To add PHP is a terribly inconstant language that was based off of three totally different language types. I am not a fan of it at all. It is indeed quick to pick up and is often a person's first language in this day in age. What sucks is it allows a lot of things other languages would have issue with.

Most of the people who download forum software expect to be able to run it and customize it without needing to edit code or open PMA. It's a tough market.


Well that's why 2.5 is heavy on the perms and such. However it's not even middle ground of what people want so it's kinda just.. eh. I really don't care if this project is a popular board. Frankly I just want to make sure it exists for those who do want to put the time in to maintain such a board. I also don't want Acmlm's work to die. That's all this is and ever was. At first we did try to make it more inclusive and try to make something that maybe would be considered in a more mainstream way. However if you checkout the code I made sure to tag every major version so that if you wanted to go wind back to very day that we got the code from BH you could (without having to sift the git log or look for the commit hash). That's real goal. Make sure the code sit on some guys HD for ever and no one can ever do anything else with it.

Also for the record I thought Blargboard was successful project. It's by far the most sane and useful of the AB/AB clones for an end user. Sure you still have to mod the files and do a lot of work, and that seems to turn people off. You what, that's fine. Forget them. Just because a project aren't successful in the one area (in this case public option/adoption rates) does not mean it's a failure. Did you have fun doing it? Did you learn something while doing it? Than it's all good. Decided that stopping the project and moving on also doesn't mean it's a failure. You just found something that fits better or gives you more enjoyment/learning chances/etc.


The Dynamic Profile Administrator™


"Wastashi Dake ga Inai Boaado"

StapleButter
Posted on 02-13-15 09:21 PM Link | ID: 81883
Developer
Acmlmboard has... side effects
Level: 69


Posts: 677/1548
EXP: 2862702
Next: 7041

Since: 01-05-12
From: France

Last post: 4 days
Last view: 2 days
Most of the time spent on Blargboard was doing templates, standardizing the code and more of that shit, instead of adding features. That, and it didn't meet the hoped goal of being used for something other than RVLution idiot boards that die within months. And even RVLution itself is going downhill.


I also don't like the way the codebase turned, with all that. It was inconsistent, and making it consistent again meant finishing templates and more tedium. And as I said, for the sake of coding, I prefer not having to deal with templates, and undoing all the templates would have been wasteful.


Oh and the permission system is also overly complex. Among other things. Both ABXD and Blargboard have post parsers that are huge complex machines trying to parse HTML properly, when for most things the old series-of-regexes approach works fine.


And all that.


Blargboard was successful before it went public. It was Kuribo64's own software and made it feel unique etc. Then it went public, the idiots overused it and it lost that magic etc.

____________________
Kuribo64 - we hack shit

Emuz
Posted on 02-14-15 10:00 PM Link | ID: 81944
Acmlmistrator

11 Hit Combo:
Mother's Rosario
Level: 92


Posts: 2552/2933
EXP: 7475880
Next: 281057

Since: 12-30-11
From: Akron, Ohio; USA

Last post: 1 hour
Last view: 22 min.
In this business you can't be disheartening by lolipants. It's going to happen. All of that stuff will put you off indeed. But I can respect your reasons. It's hard not to lose motivation sometimes. Sometimes you have to shut out the noise and just go with your guts.

The Dynamic Profile Administrator™


"Wastashi Dake ga Inai Boaado"
Pages: 1 2


Next newer thread | Next older thread
Main - AcmlmBoard Developer Zone - Enhancing all the form code (and instant redirects) (1)


Acmlmboard v2.5.3 (1/7/2018)
© 2005-2018 Acmlm, Emuz, et al.

Page rendered in 0.080 seconds. (711KB of memory used)
MySQL - queries: 184, rows: 644/668, time: 0.019 seconds.