Jump to content
DC Message Boards
  • entries
    7
  • comment
    1
  • views
    27,693

Blog Fixes... Feed Fixes

Sign in to follow this  
mrbinky3000

399 views

Feed Fixes

 

First off, I visited dcmessageboards.com only to be greeted by a PHP error in a scrip that I wrote. The bug was located the script that displays that facebook-like event feed on dcmessageboards.com and dcpages.com. I didn't change the script, so something must have changed on the server. Anyhow, I figured out a work around and learned some more about how IP.Board works.

 

For the most part, any PHP code not located in a class or function gets parsed before the page is even displayed. That's why when things go wrong, we get those "headers already sent" messages at the top of the page. PHP already displayed error messages before the IP.Board could set cookies or set headers.

 

Want your code to run only when needed. Put it in a function, or better yet, a class and then make it a IP.Board hook.

 

Also note that the <php> </php> template tags to execute PHP code. But you can't use them to echo or print things in the template. They don't work that way. They seem to run before the rest of the page is even loaded. It goes back to what I said about any code not located in a class or function. Only in this case, the code will always print to the page before the template is even loaded... even if it is in a class or function. The only way to get code to display "in place" is to use a template hook.

 

I'm kinda bummed that IPS still hasn't released the documentation for this project. They have bits of it up here and there, but very little on the "behind the scenes" class methods and properties available to us--otherwise known as an API. The say it will happen soon. In the mean time, seemingly simple updates will continue to take hours instead of minutes. Most of that time is spent trying to deduce just what variables and objects are available for my use in the template. The other time is spent trying to find the template in the first place.

 

Blog Fixes

 

I was asked to make it more obvious when a blog requires comments to be approved. People were filling out comments and they were not instantaneously appearing under the blog. It gave people the impression that their comment went straight into the trash or fell victim to a bug of some sort. In reality, their comments were just waiting to be approved by the blog author.

 

So now, when a blog's comment approval level is set to 'all' (meaning all comments must be approved) or 'guests' (meaning that only guest comments need to be approved), the user sees a note right above the text editor.

Sign in to follow this  


1 Comment


Recommended Comments

Guest
You are commenting as a guest. If you have an account, please sign in.
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×