How to add more ajax function in joomsocial?



Today I work with joomsocial ofjoomla 2.5. Joomsocial is a big commercial component, but we sometime have to edit it to fit our require. I has written a new form that let users transfer point from one to one. I try to write new ajax function but it meet some errors.

Firstly, I found the instruction in file jooms.ajax.js to call a new ajax function:

01.joms.ajax.call(sFunc, sArgs, settings)
02.joms.ajax.call('controller,function', [arg1, arg2] {
03.success: function(data) {
04.// What to do when the ajax call is successful
05.},
06.error: function(data) {
07.// What to do when the ajax call is not successful
08.// e.g. timeout, 404, 500, etc.
09.},
10.
11.// For more settings to fiddle with, look up jQuery.ajax() docs.
12.});

And then I write a function

01.function showform()
02.{
03.joms.ajax.call('profile,ajaxGetForm', [echo $userid?>], function(data)
04.{
05.console.log(data.url); // output http://www.jomsocial.com
06.console.log(data.caption); // output JomSocial
07.});
08.
09.}

and add a function ajaxGetForm in profile.php of controller.

but it just displays nothing.

then, i turn on firebug, move to console, I read that error is function not found. I thought that there must be a place for define these function. Finally i found it jax.community.php, and I add this line $jaxFuncNames[] = 'profile,ajaxGetForm'; in line175.

Finally, It run well. Now I have new function ajax in joomsocial. It is so good for us to develop more for joomsocial.

Hope that this is helpful for you.

[Read More...]


How to remove power by joomsocial in email?



If anyone use the version joomsocial 2.6, which runs onjoomla 2.5.x, you easily find that in all emails contain the sentence "power by joomsocial" above the line of copyright.

It takes long time to look around, but people say that you must by pro version to get rid of it.

I look back again the code, and I finally think about listbingo component, maybe it has the same technique, and i'm right. It 's all in CTemplate like in GTemplate of listbingo.

Now I will show you how to remove it. Open the file components/com_community/library/template.php. Go to line 308 and remove the code:

1.if (!COMMUNITY_PRO_VERSION) {
2.//POWERED BY LINK//
3.$jConfig = JFactory::getConfig();
4.$siteName = $jConfig->getValue( 'sitename' );
5.$powerBy = 'Powered by http://www.jomsocial.com/">JomSocial for . JURI::root() . '">' .$siteName . '';
6.}

Test again, everything 's done. Hope this is helpful for you.

[Read More...]


How to remove the tag meta generator" in joomla 1.7 and joomla 2.5?



Some time we want to remove the tag joomla 1.5 ,Joomla 1.7 orjoomla 2.5. I found some ways to do that.

First, you can edit the joomla core file: : \libraries\joomla\document\html\renderer \ head.php at line 91

Finally you can edit at index.php in the template that you use. Please find this line:

1.code="">include type="head" />

And add this just above: setMetaData('generator','my site'); ?>

and finally you have

1.$this->setMetaData('generator','my site'); ?>
2."head" />

In some template, it is in the header blog and maybe in header.php. In template of T3, it is in plugins\system\jat3\jat3\base-themes\default\blocks ... Find this could be difficult for you, but i will help you understand more your template and it good for you in further development.

[Read More...]


 

Link Liên kết

Thông tin liên hệ

YH: huonggiangdhtn
Skype: tthuonggiang
Return to top of page Copyright © 2010 | joomla extensions jw-extension.net