Sinisakrisan (Talk | contribs) (Created page with "===Background on Wall features=== Walls / comments is simply a commenting system in Jom Social. It allows comments to be placed on 3rd party applications within the system jus...") |
|||
Line 1: | Line 1: | ||
− | ===Background on Wall | + | ===Background on Wall Features=== |
− | Walls / comments is simply a commenting system in | + | Walls / comments is simply a commenting system in JomSocial. It allows comments to be placed through Third-Party applications within the system just like the walls / comments you see on the core applications. Before even beginning to write the code to integrate the walls / comments into your Third-Party application, you should have a solid understanding of how JomSocial works and should try to have at least a little knowledge about the Joomla MVC framework. |
− | ===Including | + | ===Including Necessary Libraries=== |
The first step, is to include the necessary library so that your application can start using them. | The first step, is to include the necessary library so that your application can start using them. | ||
<syntaxhighlight lang="php"> | <syntaxhighlight lang="php"> |
Revision as of 03:49, 8 March 2013
Background on Wall Features
Walls / comments is simply a commenting system in JomSocial. It allows comments to be placed through Third-Party applications within the system just like the walls / comments you see on the core applications. Before even beginning to write the code to integrate the walls / comments into your Third-Party application, you should have a solid understanding of how JomSocial works and should try to have at least a little knowledge about the Joomla MVC framework.
Including Necessary Libraries
The first step, is to include the necessary library so that your application can start using them.
require_once( JPATH_COMPONENT . DS . 'libraries' . DS . 'wall.php' );
Usage
After including the necessary files, all you have to do now is to get the form for the walls /comments and the contents of the walls / comments.
Getting the forms
To get the form's HTML content, you simply need to issue the following block of codes. The parameters are explained below,
$form = CWallLibrary::getWall( $uniqueID , $applicationName );
$uniqueID : This parameter is required and it tells the wall system that a wall / comment is made on this specific unique id.
$applicationName : This parameter is required and it tells the wall system to call your AJAX methods within your class. It should always have the prefix of 'plugins,' followed by your application name. E.g:
This example, selects the unique id for the specific image that is being commented on.
$db =& JFactory::getDBO(); $query = 'SELECT `id` FROM ' . $db->nameQuote('#__myapplication_images'); $db->setQuery( $query ); $uniqueID = $db->loadResult(); if($db->getErrorNum()) { JError::raiseError( 500, $db->stderr()); }