The Joomla! Forum ™



Forum rules


Please use the mailing list here: http://groups.google.com/group/joomla-dev-general rather than this forum.



Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Fri Jul 27, 2012 9:05 am 
Joomla! Apprentice
Joomla! Apprentice

Joined: Tue May 18, 2010 6:09 pm
Posts: 21
I am building an audio component and for social media buttons I'm trying to get it to work with the JFBconnect system plugin.

What I'm trying to accomplish is that when a user clicks on a "Share" button an Ajax call will call an external file containing the JFBconnect plugin tags. The output (Like buttons) have to be shown in a div.

I got the Ajax call right (at least it calls the file and pushes the output to the div)...

Quote:
window.addEvent('domready', function(){
$('ajax-replace').addEvent('click', function(event) {
//prevent the page from changing
event.stop();
//make the ajax call, replace text
var req = new Request.HTML({
method: 'get',
url: 'components/com_cooltracks/assets/lib/social.php?format=raw',
data: { 'do' : '1' },
onRequest: function() { alert('Request made. Please wait...'); },
update: $('message-here'),
onComplete: function(response) { alert('Request completed successfully.'); $('message-here').setStyle('background','#fffea1');
}
}).send();
});


This is the code in the external file...

Code:
<?php
//init Joomla Framework

define( '_JEXEC', 1 );
define( '_VALID_MOS', 1 );
define( 'DS', DIRECTORY_SEPARATOR );
define( 'JPATH_BASE', realpath(dirname(__FILE__).'/../../../..' ));
require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe = JFactory::getApplication('site');


JPluginHelper::importPlugin('system');
$dispatcher = &JDispatcher::getInstance();
$dispatcher->trigger('onBeforeDisplayContent');
?>

{JFBCLike href=http://www.sourcecoast.com layout=standard show_faces=true show_send_button=true width=300 action=like font=verdana colorscheme=light}


This will output the system tag "{JFBCLike href=http://www.sourcecoast.com…}" and not the actual plugin output.

I've been searching for days to get this to work and with the little info I can find my code should work. I'm hoping someone could shine a light on why it doesn't.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 



Who is online

Users browsing this forum: Tonie and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group