![]() |
#11
|
||||
|
||||
![]()
This works on user bios I assume?
|
#12
|
||||
|
||||
![]()
Yeah, it should. I just haven't tried yet.... at all.... I don't have time and it's not a change I've made to my site.
Personally I was going to do an even heavier overhaul on my bio field to allow for some WYSIWYG controls (buttons for bold, italic, etc). I also know from working on my other site that if I use a div with contenteditable=true it'll respect keyboard shortcuts. Unfortunately, I have to seriously look into that because I'm used to using ajax and a div is not a true form input element, despite respecting keyboard shortcuts in html5 and for whatever reason textarea elements still do not... but I digress!
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. |
#13
|
||||
|
||||
![]()
...okay, so before I can build the report feature I need to actually make a pet bio setup for myself. Ah... still, look it over so our database fields are the same and so you can get the filters in place that will fix the slashes and allow some html to render!!
. . . . Pet Profile Mod: Biography Field If you don't know what a pet profile is, see THIS THREAD to understand how such a thing can be done and find some loose instructions on how to begin with that sort of thing. Already have one? Great! Step One: Database Access your database with phpMyAdmin and open the table adopts_owned_adoptables. You can either manually add a VARCHAR 1500 field by the name of 'bio' yourself or open the Structure tab and enter in this SQL: Code:
ALTER TABLE `adopts_owned_adoptables` ADD `bio` VARCHAR(1500) NULL DEFAULT NULL AFTER `owner`; Inside view/myadoptsview.php's public function manage() add: PHP Code:
Add into view/myadoptsview.php: PHP Code:
PHP Code:
** The filters in these functions will fix slashes after apostrophes AND allow basic HTML elements to render. Add into classes/class_ownedadoptable.php: PHP Code:
Again, if you don't know what a pet profile is, see THIS THREAD to understand how such a thing can be done and find some loose instructions on how to begin with that sort of thing. Already have one? Great! Inside view/levelupview.php you can access the pet bio with {$adopt->getPetBio()}. Inside levelup.php, the same variable must be accessed with {$this->adopt->getPetBio()}. If it is empty, nothing should render. However, say you want to render it inside a div with a header above it that says "Biography". You don't need these elements to render if the bio field is empty, therefore, you need to create an if statement. (This version for view/levelupview.php:) PHP Code:
To test the system thus far, give a pet a bio that says: Code:
Hello! <3 We're going to do some "interesting" things like <b>bold</b> and make text <small>smaller</small>. We're going to now create a page users can go to if they want to report a pet with an inappropriate profile! Inside levelup.php's public function __construct() we need to ADD the following as a condition to the first if statement (on a fresh install it should be around line 18 or so??): PHP Code:
PHP Code:
PHP Code:
PHP Code:
Inside levelup.php's public function click() you'll want to do the same (it's similar, but we need to specify $this): PHP Code:
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. Last edited by Kyttias; 02-20-2016 at 06:37 PM. |
#14
|
||||
|
||||
![]()
Kyttias this is great! *o* That's totally fine, I would attempt it myself but have been busy with other things and I think it might be too advanced for me to figure out. ;-;
But yes, this is awesome and working great so far! <3 Hardly had to edit anything. Thank you so much! |
#15
|
||||
|
||||
![]()
edit: Done! The report feature is now included as step seven above. :3
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. Last edited by Kyttias; 02-20-2016 at 06:37 PM. |
#16
|
||||
|
||||
![]()
Oh my gosh that was so quick! *o* Awesome! I'm gonna get it added asap and report back!
EDIT: it's beautiful! ;-; Thank you Kyttias! <33 Last edited by tahbikat; 02-21-2016 at 11:00 AM. |
#17
|
||||
|
||||
![]()
Been following this as I've been trying to make pet bios as well, haha...I tried to follow your steps, Kyttias, but as usual for some reason it hates me and will not display anything, and when trying to edit (by going to .../myadopts/editbio/ID) I get this error;
You specified an invalid action that cannot be completed. I followed steps 1 through 5 exactly (wanted to get them displaying before worrying about the report function) ![]() I added; PHP Code:
__________________
My Mods Site (1.3.4, 2020 Mods) |
#18
|
||||
|
||||
![]()
Hmm... I just put mine between the rename() and trade() functions that already existed. *shrug* At the end of the file the function will end, then class will end, and then the file will end, so:
PHP Code:
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. Last edited by Kyttias; 02-27-2016 at 12:48 PM. |
#19
|
||||
|
||||
![]()
OK, I have bios working perfectly now <3
Just tried to add the report feature and I get this error when actually trying to submit the report: Fatal error: Call to a member function getAdoptID() on null in /home/arieng/catisserie.net/levelup.php on line 271
__________________
My Mods Site (1.3.4, 2020 Mods) |
#20
|
||||
|
||||
![]()
It doesn't sound like it's getting the adoptable's ID right... can you give me what's on line 271 and around it?
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. |
![]() |
|
|
What's New? |
What's Hot? |
What's Popular? |