FanUpdate

May 2, 2005, , , ,

FanUpdate

fanupdate-2.2.1.zip
176.11 KB

FanUpdate (formerly known as phpFanUpdate) is a simple blogging script designed to keep an updates log for one site or an entire collective of websites. It can also be used as a lightweight standalone blog.

Latest version: FanUpdate 2.2.1
Released June 8 2008

NOTE: I will not answer any support requests. I don’t have the time to hold your hand, so please do not ask for help. Please figure out your problems yourself—Google is your friend.

Features

  • Multiple categories/tags for posts—easily add more when writing a new post.

  • Set posts to be published in the future—they won’t be displayed until their scheduled time.

  • Draft status for posts—if you’re working on an article but not quite ready to publish you can save it as a draft.

  • Smilies, easily configured from the admin panel. To add more smiley icons, just upload them to the FanUpdate img/ directory. They will then appear as choices in the smiley configuration panel.

  • Formatting buttons for the admin posting area that insert some basic html tags (such as strong, em, h3, blockquote, a href) around selected text.

  • Automatic paragraph creation and curved quotes (like WordPress) and Markdown parsing for headings and lists.

  • Post summaries, either by a certain number of words, or by manually inserted summary break points.

  • Pagination of blog front page for ease reading.

  • RSS feeds: all posts, posts in a specific category, all comments and comments on a specific post.

  • Basic podcasting support: Links to iTunes supported media files (mp3, mov, pdf, etc) are automatically added as enclosures to RSS feed.

  • Archives by month and category.

  • Full-text search.

  • Date format and number of posts per page can be customized.

  • Easily include the script into your own page design with a snippet of PHP.

  • Templates for posts, comments, comment form, and footer to make customization easier.

  • Notification in your admin panel when a new version is released so you can upgrade ASAP.

  • Can use the fanlisting tables of three popular collective management scripts (Enthusiast 3, Flinx Collective, and Fan Admin) or function separately.

  • Shiny, web 2.0 logo.

  • All coding should validate XHTML 1.0 Strict.

Commenting

  • Reader comments are optional, and can be turned off globally or per-post.

  • Gravatars for commenters can also be optionally displayed and configured.

  • BBCode-esqe formating buttons are included in the comment form, so that readers can put links and emphasis in their comments.

  • Slick AJAX-powered commenting (but comments can also still be posted old-school without JavaScript).

  • Optional notification email when a comment is posted.

Spam Prevention

  • Comment moderation—to combat comment spam, you can elect to have all comments held for admin approval before being displayed on the site.

  • CAPTCHA

  • Blacklist for spammy words

  • Points-based spam filter (new with version 2.2)

    Comments are given positive points for good features and negative points for bad features. Comments must have at least points_approval_threshold to be automatically approved. Comments with less than points_pending_threshold are considered spam, and you are never notified of them. Spam comments can be seen and deleted (if you feel the need) from the Spam tab on the comments admin page. Ideally, the points system should block most spam, and you shouldn’t need comment moderation or the captcha (although both are still available).

    Tests performed include:

    • -4 for blank HTTP_ACCEPT_LANGUAGE header
    • -x number of links for more than 2 links
    • +2 for no links
    • -2 for comment less than 20 characters
    • +1 for comment greater than 20 characters with no links
    • +num approved comments from same email more than 7 days old
    • -num unapproved comments from same email more than 7 days old
    • -2 if ip == hostname
    • -1 for url (it’s a link too!)
    • -2 for url longer than 35 characters
    • -2 for no email address

    Currently, you can’t modify the tests without changing process.php, but you can tweak the approval/spam thresholds if these rules are not ideal for your site.

    Original points system idea from Jonathan Snook:
    http://snook.ca/archives/other/effective_blog_comment_spam_blocker/

Requirements

  • PHP 4.3.0 or higher
  • MySQL 4 or higher
  • CAPTCHA requires FreeType library

Demos

View FanUpdate frontend demo. This is what the default uncustomized installation of FanUpdate looks like. You can easily edit the CSS for styling, and even the PHP coding if you feel confident.

View FanUpdate admin area demo. This is what the admin panel for FanUpdate looks like. Username: admin. Password: pass. Feel free to test it out by adding data; I periodically go through and purge the database.

Installation Instructions

Follow the instructions below (also included in docs/readme.txt in the download above) to install FanUpdate version 2.2.

If you are upgrading from version 2.1 or higher, upload all the new files (overwriting your current files) EXCEPT blog-config.php—you can keep the old file for that. Then run the installer as described in step 3 below.

If you are upgrading from version 2.0/1.6/1.5, you will need to enter your current config settings into the NEW blog-config.php file; there are some important changes to that and the old one won’t work. Then, follow the install instructions below.

There is currently no upgrade script for versions 1.1 and earlier, because no one seems to be using them anymore.

  1. IMPORTANT:
    If you are upgrading from an earlier version, backup your database (and files) before you begin. Just in case.

  2. Edit the config file:
    Open the file blog-config.php in a plain text editor. Edit the variables for your site. (Note: settings go in the single quotes to the right of the = NOT in the square brackets on the left. E.g., $fanupdate['admin_username'] = 'my_login_name';) You MUST change the DATABASE VARIABLES for your MySQL database and the ADMIN VARIABLES for your username and password. The TABLE VARIABLES only need to be changed if you want to use FanUpdate in conjunction with one of the supported collective management scripts (Enthusiast 3, Flinx Collective, or Fan Admin). If so, you must install FanUpdate in the same database as said management script.

  3. Upload FanUpdate files:
    Upload all of the FanUpdate files to an http-accessible directory on your webserver.
    For example, http://yoursite.com/fanupdate/
    (Overwrite your current files if you are upgrading.)

  4. Run install script:
    Run the install.php script by going to http://yoursite.com/FANUPDATE_FOLDER/install.php
    You’ll need to set some more options for your site here, including the location of your main site updates page. Then submit the form to create or update the FanUpdate database tables.

  5. If you see errors about ‘old file xxx not deleted!’ this is OK—you will just need to delete that file manually to keep your install tidy. However, any other errors while installing are a serious problem. If you can’t figure out what is wrong, check the documentation at http://prism-perfect.net/fanupdate

  6. Once you have successfully run the installation script, be sure to delete it from you webserver (you won’t need it anymore). Then you can begin posting entries from the admin panel. If you are using the script stand-alone you’ll first need to add the names of your categories/sites in the ‘Categories’ tab.

  7. Add PHP snippet(s) to your site(s) to display your blog (see below).

Displaying FanUpdate on Your Site

To display your complete blog (all update categories), visit the admin panel home page and follow the link for ‘how to display your blog.’

This will generate a code snippet that you can copy-and-paste into any .php page to display your updates blog.

For a single category blog, visit the ‘Categories’ admin page to get the display code.

If you want to display only ‘Whole Collective’ updates on your main site blog, use a single-category snippet and change the $listingid variable to zero:

$listingid = 0;

Please note: This snippet is not compatible with NL-ConvertToPHP/dynamic includes pages! This means you can’t put the inclusion snippet within any PHP coding similar to

if ($_SERVER['QUERY_STRING'] == 'updates') {

If you’re not sure, the best bet is to put the snippet for FanUpdate in its own .php page, along with whatever other content you want on your news/updates page.

Template Variables

Entry Template

{{id}} ID of entry
{{title}} title of entry
{{url}} URL of single-post page with comments)
{{date}} date posted (formatted according to your date_format setting)
{{category}} categor(y|ies) of entry (as links to category archive page)
{{comment_link}} link to comments page/section
{{body}} complete text of entry

Comment Template

{{id}} ID of comment
{{name}} name of commenter (lined to their URL, if provided)
{{gravatar}} Gravatar of commenter
{{date}} date posted (formatted according to your date_format setting)
{{body}} complete text of comment

Comment Form Template

{{fanuname}} name of commenter, if remembered
{{fanuemail}} email of commenter, if remembered
{{fanuurl}} url of commenter, if remembered
{{captcha_image}} url of captcha image

Footer Template

{{main_url}} url of blog front page (also for search action)
{{archive_url}} url of blog archives page
{{rss_url}} url of RSS feed
{{fanupdate_url}} url of FanUpdate info page (for credit link)
{{fanupdate_version}} version of FanUpdate currently running

A Note on Upgrading

Check changelog.txt for features and changes not mentioned here.

The {{wysiwyg}} comment form template variable has been replaced by automatic JavaScript for adding the wysiwyg controls. The upgrade script will try to remove it from you current comment template, but after upgrading you should go check that it was removed—otherwise, it will show up on your comment form.

Category-level options were previously set in the PHP code snippet you included in your site. For improved spam defense, and to make editing them easier, they are now set from the admin panel. Unfortunately, if you use different configurations for each of your sites, you will need to transfer the settings manually—there’s no simple way for the script to retrieve your settings. However, you do not need to generate new snippets for your sites—your extra variables from previous versions will just be ignored.

Upgrading means replacing all of your current FanUpdate files. If you’ve made substantial modifications to the script, you will need to save your changed files and re-do the changes on the new files. (If necessary. You may be able to achieve your changes with the built-in templates.)

Troubleshooting Common Problems

If you have any problems using FanUpdate, please read the full documentation page here and try Googling any error messages you encounter. If you still can’t solve the problem, please do not email the author for help. I will not answer any support requests. I don’t have the time to hold your hand, so please figure out your problems yourself.

First Thing to Check

If you have any problems, the first thing to check is that you have run the most recent install.php. If you have, it will tell you that you do not need to run it—and if you haven’t, that’s probably your problem!

Error: Could not connect to database server

Solution: You have something incorrect in your database settings.

$fanupdate['dbhost']		= 'localhost';
$fanupdate['dbuser']		= 'admin';
$fanupdate['dbpass']		= 'pass';
$fanupdate['dbname']		= 'database_name';

If you do not know what to put for these, you need to contact your web host. Database connection settings are different for everyone (e.g., your hostname may not be localhost, you may need to create a database before you can use it, etc). Please do not contact the author about this problem; it is very likely I cannot help you.

Problem: Can’t log in to admin panel

Solution: Make sure you are typing the username and password exactly as you have them entered in blog-config.php—both are case-sensitive. Also make sure you have entered them correctly—the password goes inside the md5 function, like md5('my_secrect_password')

$fanupdate['admin_username']	= 'admin';
$fanupdate['admin_password']	= md5('pass');

Error: WARNING: Could not execute query. Table ‘collective.blog_category’ doesn’t exist

Solution: You are probably trying to use FanUpdate with Enthusiast3 (or some other script that has a list of things you would like to use as your post categories). You either a) have not installed FanUpdate in the same database as the other script or b) have put the wrong table name in your configuration file for collective_table (the default value here is for using FanUpdate’s own category table and will not work if you want to use it with Enth, etc.) Check that you have both scripts set to use the same database and that your collective_script and collective_table settings are correct for your database setup. Please refer to the comments in the configuration file.

Error: 404 File Not Found when posting a comment

Solution: You have the wrong setting for install_url and it doesn’t point to where your FanUpdate files actually are. It should be something like http://yoursite.com/fanupdate—fix this from the admin options page.

Other commenting problems: blank process.php, incorrect message about blank comments, etc.

Solution: When modifying the comment form template, do not change the name attribute of any element. Otherwise, your comment will be submitted with variable names that cannot be recognized. If you’ve got this problem, try going back to the default template to see if it fixes your problem.

<h3 id="postcomment">Post A Comment</h3>

<!-- MODERATION -->
<p id="cmt-moderation"><strong>Comment moderation is currently turned on.</strong> Your comment will not be displayed until it has been approved by the site owner.</p>
<!-- END MODERATION -->

<p><label for="name">Name:</label>
<input type="text" id="name" name="name" maxlength="20" size="25" value="{{fanuname}}" />
<label for="remember_me" class="checkbox"><input type="checkbox" id="remember_me" name="remember_me" value="1" checked="checked" /> Remember?</label></p>

<p><label for="email">Email:</label>
<input type="text" id="email" name="email" maxlength="70" size="25" value="{{fanuemail}}" /></p>

<p><label for="url">URL:</label>
<input type="text" id="url" name="url" maxlength="70" size="25" value="{{fanuurl}}" /></p>

<p><label for="myta">Comment:</label>
<textarea id="myta" name="comment" cols="50" rows="8"></textarea></p>

<!-- CAPTCHA -->
<p><label for="captcha">Captcha:</label>
<img id="captcha-img" src="{{captcha_image}}" alt="" />
<input type="text" id="captcha" name="captcha" /></p>
<!-- END CAPTCHA -->

<p><input type="submit" id="submit" name="submit_comment" value="Post Comment" class="submit" /></p>

<p id="cmt-rules">Your email is only for accessing <a href="http://www.gravatar.com/">gravatar.com</a>. No <abbr title="HyperText Markup Language">HTML</abbr> allowed; some formatting can be applied via the buttons above the textarea.</p>

Error: Captcha not showing up

Solution: Look at the captcha.php script in your web browser—it probably has an error message about imagettfbbox. That function requires both the GD library and the FreeType library: http://php.net/imagettfbbox To let comments be posted, you either need to disable the captcha or get your host to install the FreeType library.

Problem: Comment moderation is turned off, but some comments are still being moderated

Solution: If you want comments to never be held for moderation, you also have to set points_scoring to n—the points-based spam filter will also put comments in moderation. Or, if it’s just the moderation emails that are annoying you, you can set points_approval_threshold and points_pending_threshold to the same number (perhaps -4) so that comments are either approved or spam, never put on the pending list.

Problem: Post has been added in admin panel, but is not showing up on public blog

Solution: You probably have your timezone_offset set incorrectly. To figure out what settings you should have, download this test script, upload it to your FanUpdate folder, and look at it in your browser:

fanupdate-timezone-test.zip
829 Bytes

User time should be your local time. If it is off by an hour or two, you need to change timezone_offset to correct it.

Server time and server time calculated should be the same. If they are not, your _server_tz_offset setting is wrong. This is a hidden setting, so you will need to change it from phpMyAdmin or some other was of directly accessing your database.

Greenwich time and entries earlier than should be the same. If they are not but your server times are correct above, your MySQL database is probably too old to have the date functions needed for FanUpdate to work properly.

The last line is the GMT of your last post—if it is later than the Greenwich time displayed above, it will not show up publicly until it is no longer dated in the future. See the features list above.

Error: Fatal error: Class ‘FanUpdate’ not found

Solution: There’s probably something strange with your server configuration where it doesn’t like local paths when including files. FanUpdate uses things like require_once('class/FanUpdate.php'); and your server may not have the correct include_path setting to be able to interpret that. You can try using the full server paths instead, e.g. require_once('/home/username/mysite/fanupdate/class/FanUpdate.php'); Just open all the FanUpdate files in a plain text editor, look for the require_once (or include_once, or similar) at the top of each and change them to be full paths.

Problem: Comment form is ugly!

To get your comment form to line up nicely, try these CSS rules as a starting point:

/	====	Comment Form	====	/

div.comments-form {}

form#comments-form {}

p#cmt-rules {}
p#cmt-moderation {}

label {
	display: block;
	float: left;
	width: 9em;
	text-align: right;
	margin: 0 0.5em 0 0;
}

input, textarea, select, option {
	font-family: Arial, sans-serif;
	font-size: 1em;
}

textarea {
	width: 100%;
}

.wysiwygmenu {
	display: block;
}
.wysiwygmenu a {
	padding: 0.125em 0.25em;
}

Modifications and Add-Ons

Convert from CuteNews

fanupdate-convert-cutenews.zip
2.05 KB

Import your CuteNews archives into FanUpdate 2. Instructions are in the comments at the top of the file.

License

FanUpdate version 2.2.1
Copyright (c) 2008 Jenny Ferenc

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details: http://www.gnu.org/licenses/gpl.html

Credits

JavaScript for table sorting and some basic functions:
(c) 2006 Neil Crosby
http://www.workingwith.me.uk/articles/scripting/standardista_table_sorting

Silk icons in img/ and css/ directories:
Mark James
http://famfamfam.com/lab/icons/silk/

Some text parsing functions in functions.php
Originally from WordPress
http://wordpress.org/

PHP Markdown
(c) 2004-2007 Michel Fortin
http://www.michelf.com/
Based on Markdown
(c) 2003-2006 John Gruber
http://daringfireball.net/
All rights reserved.

CaptchaSecurityImages
(c) 2006 Simon Jarvis
http://www.white-hat-web-design.co.uk/articles/php-captcha.php

SqlConnection class (heavily modified)
Originally by Jay Pipes
http://www.jpipes.com/

FeedWriter and FeedItem classes (heavily modified)
Originally by Anis uddin Ahmad
http://www.ajaxray.com/projects/rss

Future Ideas

I really want to keep the script as simple and un-feature-bloated as possible (if you want lots of features, get WordPress), but here are some things that have been suggested and are under consideration for the future:

  • Banning IP addresses from commenting
  • More options for common modifications that currently require code changes
  • True WYSIWYG editing (I would really like to do this, but it’s going to be very hard to get right)
  • Plugin API—I would really like to make it easy to write plugins, but I don’t know how to support that. Any ideas out there?