Furry stuff, oekaki stuff, and other stuff.
You are not logged in.
Pages: 1
Hey there, Wac.
I recently got my website working.
However, a lot of things are either buggy or aren't working correctly. Here's what I need help with as mentioned in post #3,012 and we're probably going to take this slowly:
1. On the main page for example, I'm getting a bunch of "Resource id#" errors after switching from the mysql_ to the db_ prefix. in most varibles. Also, the Array variable is being displayed next to the user's artist comment name and in the replies associated with it and on the second page for example a "&page=1" variable is being displayed next to the edit comment and delete button.
2. Ipdating the oekaki caused the ymd() function go undefined. For example, attempting to calculate the age of the user throws a "Fatal error: Call to undefined function ymd() in [b/]/home4/weblined/public_html/ppgrainbow/profile.php[/b] on line 351".
3. Upon replying to a comment, the second reply doesn't even show. The footer on the bottom of the comment field is malformed as some of the tags aren't appeared to be properly closed.
4. Text in the chatbox field isn't displaying anything and the footer in the chatbox is also malformed.
5. When clicking on the local comments database, the error claims that the comments in the database is empty where there is more than one comment made by the said user.
6. When a user has finished a oekaki drawing and when clicking on the animation button (View Animation), an error message, "No animation" popups up and the user has to close the window.
What can I do to correct the following buggy coding errors on my oekaki site as a result of the site upgrade?
Last edited by rainbow (07-24-2011 18:01:25)
Offline
When starting these threads, please do remember to tell people you're using a modified version of the board.
1) It depending on how long it's been since you last updated. I believe I added some CGI variables to the code, including "page", to make sure that the board redirects properly after commenting. You'll just have to look out for any such changes, and make sure the ampersand is encoded correctly. Also, if PHP prints "Array()" instead of a value, that means the array isn't being dereferenced correctly. Make sure you use quotes around array keys, such as $val["key"], instead of $val[key]. I saw that a few times in the code you sent me. Remember that new versions of PHP require long tags, so make sure to use "<?php" instead of "<?". If you don't, some variables might be printed to the screen, rather than interpreted by PHP.
2) Look at your old "common.php" file. It should be in there. Wax Poteto never had a ymd() function, and you have it in more than one of your scripts, so I'm guessing it will be in "common.php".
3) For some reason, I notice that some of the mode and action headers in your code have had the underscores removed. Take a look at any <input name="mode"> and <input name="action"> elements and make sure the names match the $mode and $action references in the code. Remember, "mode" is used for GET requests (clickable links) and "action" is used for POST (forms).
4) The chatroom was recently cleaned up and modified so the chat order is reversed (newest comments at the bottom, rather than the top). If you didn't add any significant features to your chatbox, it may be a good idea to use the standard Wax chat room.
5) The board is checking if $comments is empty. I don't see anything in your code to calculate how many comments there are and set this variable correctly. Did you forget to copy/paste something from your old version?
6) You have more than one db_fetch_array($result) at the top of your code, so the animation viewer is looking at the *next* post, not the one you want. Remove one of the database calls, preferably the one after the adult flag check.
What can I do to correct the following buggy coding errors on my oekaki site as a result of the site upgrade?
You may have no choice but to do a side-by-side audit. That will be difficult with the index, but shouldn't be a big deal with many of the smaller scripts. Make sure you didn't forget to copy over any functions from your old "common.php" and "boot.php" files. Did you extensively change the "functions.php" file?
I recommend taking notes on what you change, and putting it under the copyright notice in each file. Put a comment, such as "// MODIFIED" above any changed sections. This is mandatory if you want to occasionally sync your mod with the official version. Upgrading your text editor might be a good idea, and I'd also recommend looking at KDiff3, a program designed to find differences between two text files (note: at this very second, the KDiff3 web site appears to be down. Check again later).
Offline
Thanks for the help, Wac. I'm using a modified version of the board.
The good news is that most of the bugs have been fixed and I did use KDiff3 to correct some of the errors. I will update the news when all of the bugs have been fixed for the time being.
I did a check in the common.php flie and I found that the ymd() array never even existed in that file. Now looking at the profile.php file on lines 351 and 369:
351: $date = substr(ymd($the_user['age']), 5); 369: $datestamp = ymd($the_user['age']);
Simply, stripping out the depreciated ymd() variable caused the birthday to be displayed in ISO format (yyyy-mm-dd). Now, checking in the common.php file on lines 685 to 692:
685: if (!isset ($_GLOBALS['datef'])) { 686: $datef = array(); 687: $datef['birthdate'] = 'Y/n/j'; 688: $datef['birthmonth'] = 'Y/n'; 689: $datef['birthyear'] = 'Y'; 690: } else { 691: global $datef; 692: }
I found that $datef is being used as a replacement to format the date for $row['age]. How can I reformat the date of the birth back to yyyy/m/d to reflect the change in the common.php file?
Also, I probably will need some help with the issue regarding the comments page (comments.php file). When you try to reply or post a comment, the comment page looks fine with only one comment. However, when you (logged in) try to view a oekaki drawing with one or more replies to the artist's comment, the page will continue to attempt to load and load the comments indefinitely and when you attempt to reply to a comment, you'll end up with a bunch of blank comments flooding the screen. You would have to hit the stop button as soon as possible to see what could be wrong.
Should I send you the comments.php file and investigate what could be wrong?
I'm also thinking about porting the artist's comments and replies (including icons, etc.) from the index.php to the comments.php file to try to correct this.
I'm hoping that I get all of the bugs corrected real as soon as possible.
Last edited by rainbow (07-25-2011 19:54:29)
Offline
Go back to an older version of your board and do a context search for "ymd". You can do this wih the Windows Explorer search tool, and choose the option to search for "Containing text". The function has to be in there somewhere. I'm not sure what the function does, but my guess is that all it does is replaces the hyphens with slashes.
How can I reformat the date of the birth back to yyyy/m/d to reflect the change in the common.php file?
Why do you need to? The birthday code should use the $row['age'] field directly. The $datef array is only used for printing dates, not processing them.
Should I send you the comments.php file and investigate what could be wrong?
I already have it. The comment.php file had a huge chunk missing, most notably the while() statement. I had to fully repair it, and you can get it here. You'll probably have to reformat a lot of stuff, but all the brackets are matched, AFAIK.
I'm also thinking about porting the artist's comments and replies (including icons, etc.) from the index.php to the comments.php file to try to correct this.
Nope. The HTML and avatar handling code is similar, but the while() statement is structured differently.
Offline
Alright, the last two remaining bugs have been fixed.
Using this forum thread from late 2008 as a reference, I had to change the "function age_to_date($in) {" on line 684 of the common.php file back to "function ymd($in) {" or it would throw a fatal error referencing to a undefined function ymd().
Nowm with work on fixing the oekaki behind, I will need to do some testing, including registration, uploading capabilities and picture recovery mechanisms, before I finally give the all clear to let users draw on my oekaki. I may have to get back to you again if I encounter anymore bugs or coding errors on this site.
Thank you so much for the help, Wac. I appreciate it!
I just got one more bug that I need to fix and I'm in the clear for a while as I will explain in my next forum post.
Last edited by rainbow (07-27-2011 01:26:42)
Offline
Pages: 1