Step 6: Customization

Changes to the Proxy

The proxy contains several customization options.

You can select between showing only approved comments and showing both unmoderated and approved comments. In Media Factory you can choose to approve to deny comments. Denied comments will never appear on the front end.

define('DISPLAY_UNMODERATED_COMMENTS', true);

If you only want members who are logged in to comment, you can turn off anonymous comments.

define('ALLOW_ANONYMOUS_COMMENTS', true);

If you don't want to show the login box, you can turn it off

define('DISPLAY_LOGIN_FORM', true);

And if you don't want to display the register form, that can be turned off too.

define('DISPLAY_REGISTER_FORM', true);

If you want to better organize your comments, you'll want to put them in a channel inside of Media Factory. Once you or your Multimedia Comments provider creates the channel, change a setting in the proxy.php file. On approximately line 27, change the zero in the follow code to the channel ID

define('COMMENT_CHANNEL',0);
Changes to JavaScript

The Multimedia Comments Application has tons of customizable options. Simply add the property and value pair to your settings object to customize your comments. Heres an example on how to add a ajax pager to your comments and limit the number of comments per page to 5.

<script type="text/javascript">

jQuery(document).ready(function() {

jQuery.noConflict();

var settings = {
element : 'commentWrapper',
proxy : '/proxy.php',
vhost : 123,
pager : true,
pagerAjax : true,
pageSize : 5
}

fm.comments.init(settings);

});

</script>

The following is a list of property and possible value pairs. If you wish to build a customized version and have all this code generated for you, visit our Multimedia Comments Demo page. Hit the options tab in the top right and play around with the settings. Once you have a version you like, hit the 'source' tab to grab the JavaScript.

propertydefaultpossible valuesnotes
elementstringThis must the 'id' attribute value of the element where you want the comments to be displayed.
externalId[current url]unique string or unique numberThis must be unique for each set of comments (parent item). By default, it uses the current page URL. However, if you have a multi page article, use article ids or wish to use another way of identifying the current page, you can enter a unique string or number here.
externalTitle[current url]stringThis will be the title of the parent item inside Media Factory
externalUrl[current url]stringThe URL of the page that include this set of comments.
proxyproxy.php[path to your proxy]This file communicates with Filemobile. The path needs to be correct in order for MMC to work
vhost'123'The vhost id we provide you.This id must be correct in order for MMC to work
widnullvalid Media Factory widget id, nullThe video player can be customized inside Media Factory (brand logo, colours etc). If you use a custom video player, put that widget id here.
disableCommentsfalsefalse, trueDisables the users ability to submit comments. All previous comments will still appear.
enableUploadtruetrue, falseDisables the users ability to upload files.
style21, 2, 3, 4The comment layout style.
pageSize10int > 0The number of comments per page.
profilesfalse[url to profile page], falseClicking on the commenter's name or avatar will direct the user to the profile page provided. Only available with Media Factory users.
avatartruetrue, falseShows a users avatar, true, or hides the user's avatar, false.
defaultAvatarhttp://www.filemobile.com/static/1/images/global/male.gif[full url to an image]Show this avatar if the user doesn't have one.
loadingIconhttp://www.filemobile.com/static/mmc/images/loading.gif[full url to an image]Display this image anytime something is loading (new comments, adding a comment, etc)
exactDatefalsetrue, falseDisplay exact dates (Jan/02/10), true, or display relative dates (3 minutes ago), false
longDatetruetrue, falseWhen displaying the exact date, show day of week/day/month/ year/hour/minute/second.
likingtruetrue, falseDisplay the like button and number (true) or hide them (false)
likingInlinetruetrue, falseDisplay the like button inline with the rest of the comment (just like Facebook).
likingShowValuetruetrue, falseShow the number of likes.
sortupload DESC'upload DESC', 'upload ASC', 'votecount DESC'The order the comments will be displayed
sortSelecttruetrue, falseShow or hide the sort select box that will allow users to dynamically sort the comments.
reportreport.phpfalse, [path to report.php]Set to false if you don't want users to report comments, or set it to the location of the report.php file
reportFadefalsetrue, falseAutomatically fade out the report box after reporting a comment
maxLengthNumberfalsefalse, int > 0Set to false to turn off maximum number of characters per comment. Or set it to a number, the max length.
maxLengthDisplaytruetrue, falseDisplay how many characters have been user or how many characters are remaining.
maxLengthCountdowntruetrue, falseToggle displaying the remaining characters. commentLength also needs a value.
pagerfalsetrue, falseShow a pager instead of the "More Comments" button.
pagerAjaxfalsetrue, falseIf you want a pager and don't want the pager to refresh the page, set this to true. If you want the page to refresh, set it to false.
pagerLimit2int > 0 The number of page links displayed on either side of the current page
pagerShowPrevNexttruetrue, falseShow or hide the previous page and next page links
pagerShowFirstLasttruetrue, falseShow or hide the first page and last page links
pagerShowNumberstruetrue, falseShow or hide the number links
pagerCentertruetrue, falseHorizontally enter the pager
webcamfalsetrue, falseShow or hide the webcam uploader for logged in users
scrolltruetrue, falseScroll to the top of the comments list when loading more comments with the pager.
scrollDuration0int >= 0The time it takes to get to the top of the comments list, in milliseconds.
ratingtruetrue, falseTurn on or off the rating widget (you may also want to remove the rating HTML).
ratingEmptyStarhttp://www.filemobile.com/static/mmc/images/empty.pngfull url to an imagePath to blank rating image
ratingFullStarhttp://www.filemobile.com/static/mmc/images/full.pngfull url to an imagePath to active rating image
logHitfalsetrue, falseLog a hit on the parent media in Media Factory every time the MMC app is initialized.
showUsernametruetrue, falseShow the username next to their comment
showFirstNamefalsetrue, falseShow the user's first name next to their comment
showLastNamefalsetrue, falseShow the user's first name next to their comment
imageTranscoder14intThe transcoder ID to use for displaying images
videoTranscoder21intThe transcoder ID to use for displaying videos
videoPlayerWidth320intThe width of the video player
videoPlayerHeight240intThe width of the video player
layout['header','comments','more','add']arrayThe display order of the commenting sections. You are free to reorganize the array to display a different layout or even remove an section if needed.

0 comments

Be the first to comment on Step 6: Customization.

Add a Comment

  • captcha