Leaving a database record's "snapshot" at a post. [SOLVED]
(2019-01-04, 02:50 AM)enrolmudas Wrote: Edit: Almost forgot it. I like how this is going and I hope that you can solve my problem but I have another question: Is there a wat to add an option to the text editor so the users can click it and it would add the "[hoja_de_personaje]" inside their post? I know, that's like using a nuke to kill a single bug, but it would help me on future tasks if I came with more complex tags.

See https://www.sceditor.com/documentation/custom-commands/ - these could be added to jscripts/bbcodes_sceditor.js or custom .js files.

Quote:Edit 2: Hi!, well, this was quite difficult but I did it and it works. Either way, I would like to know if any of you think if this is a good method or if I should modify it.
Currently the HTML is rendered and inserted into the database - it might be easier (now or in the future, e.g. when the layout needs changes) to simply save a copy of the raw data in multiple table columns (or a single column, using serialize() if the field structure changes often) and then render it with the template on output (in character_post_preview_show()). That's also where the data should be escaped (MyBB uses htmlspecialchars_uni()) to make sure that HTML code that may be inserted by users doesn't work there (it may break the layout and introduce security problems).
Additionally, all columns values should be escaped with $db->escape_string() before being inserted (in character_post_preview_save()).
devilshakerz.com/pgp (DF3A 34D9 A627 42E5 BC6A 6750 1F2F B8AA 28FF E1BC) ▪ keybase.io/devilshakerz

Messages In This Thread
RE: Leaving a database record's "snapshot" at a post. - by Devilshakerz - 2019-01-04, 10:20 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)