Ajax in Joomla Component
Posted by Link Sutra in Joomla on May 26, 2010
If you already have your own joomla component then it is fine otherwise create new one for yourself within minute. Joomla Component Creator
Lets assume we have component “ajaxcall” and we are making ajaxcall from “com_ajaxcall\views\ajaxcall\tmpl\default.php” file.
We will make ajax call to the format “ajaxcallformat” (i.e. view.ajaxcallformat.php)
javascript code in “com_ajaxcall\views\ajaxcall\tmpl\default.php”
<script type="text/javascript">
function AjaxCall(name)
{
var httpxml;
try
{
// Firefox, Opera 8.0+, Safari
httpxml=new XMLHttpRequest();
}
catch (e)
{
// Internet Explorer
try
{
httpxml=new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
httpxml=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
alert("Your browser does not support AJAX!");
return false;
}
}
}
function statecall()
{
if(httpxml.readyState==4)
{
var resp=httpxml.responseText;
alert(resp);
}
}
var url="index.php?option=com_ajaxcall&view=ajaxcall&format=ajaxcallformat";
var params="name="+name;
httpxml.onreadystatechange=statecall;
httpxml.open("POST",url,true);
//Send the proper header information along with the request
httpxml.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
httpxml.setRequestHeader("Content-length", params.length);
httpxml.setRequestHeader("Connection", "close");
httpxml.send(params);
}
</script>
AjaxCall in “com_ajaxcall\views\ajaxcall\default.php”
<label>Name:</label>
<input type="text" name="name" id="name">
<input type="button" value="Submit"
OnClick="AjaxCall(document.getElementById('name').value);">
view.ajaxcallformat.php will be in (i.e. com_ajaxcall\views\ajaxcall ) folder.
<?php
/**
* Joomla! 1.5 component AjaxCall
*
* @version $Id: view.html.php 2010-05-25 15:58:28 svn $
* @author govind dubey
* @package Joomla
* @subpackage AjaxCall
* @license GNU/GPL
*
* AjaxCall
*
* This component file was created using the Joomla Component Creator by Not Web Design
* http://www.notwebdesign.com/joomla_component_creator/
*
*/
// no direct access
defined('_JEXEC') or die('Restricted access');
jimport( 'joomla.application.component.view');
/**
* HTML View class for the AjaxCall component
*/
class AjaxcallViewAjaxcall extends JView {
function display($tpl = null) {
}
}
echo $_POST['name'];
?>
Linksutra Social Networking Component and Module (2.0)
Posted by Link Sutra in General, Joomla on April 21, 2010

Linksutra Profile Module (needs Linksutra Profile Component)
Linksutra Profile Component
These component and module provides facility to joomla admin to create social networking site easily.
UPDATES:
1) backend admin part to customize profile and translations (no 404 error anymore) .
2) phpthumb support for thumbnail in profile,scraps,friends etc
3) live updates from friend stream on profile
Features:
1) Users Profile
2) friends:
3) scrapbook :
4) Demands
5) Offers
6) album :
Linksutra Component/Module ( first unzip the downloaded file and install component/module separately.)
HELP: 21/10/2009
follow these steps to get linksutra component/module working.
1) download and install linksutra component and module
2) edit/create menu items (i prefer top menu) to linksutra components by “change menu item type” to (profile/demands/offers/scrapbook/friends)
3) publish linksutra module either to left or right position and with registered access.
Linsutra starting 2 way sms!!!
Posted by Link Sutra in General on February 12, 2010
Linksutra is starting 2 way sms soon..its still in testing phase.
Linksutra users with their mobile registered on http://www.linksutra.com can now send their mail, sms to other users and other mail options via their sms to 56263
for SMS texting:
snd SMS to 56263 with keyword LGM and subkeyword as per you required.
LGM to@email.com subject;message (to send mails)
LGM to@email.com message (to send mails)
LGM stop (stop receiving mail feeds in SMS)
LGM start (start receiving mail feeds in SMS)
LGM filterin filter1:filter2 (receive mail feeds only with this keywords separated by “:”)
LGM filterout filter1:filter2 (block mail feeds in sms only with this keywords separated by “:”)
LGM status status1 (to make your profile status as “status1″ in linksutra)
other features also going to be implemented.
Cheers
Linksutra Admin
FREE SMS AND GMAIL IN SMS FROM LINKSUTRA. HAPPY CHRISTMAS!!!
Posted by Link Sutra in General on December 25, 2009
Linksutra starts free sms facility (without ads) to india. users can get their gmail or google hosted mail feed alerts on their sms for free.
just sign up and go to your profile. edit your settings.
users can also send scraps in sms without displaying their phone numbers.
HAPPY CHRISTMAS!!!!!
Linksutra Admin
http://www.linksutra.com
Linksutra Social Networking Component and Module – Joomla 1.5
Posted by Link Sutra in General, Joomla on September 19, 2009
Linksutra Profile Module (needs Linksutra Profile Component)
Linksutra Profile Component
These component and module provides facility to joomla admin to create social networking site easily.
Features:
1) Users Profile
showing the total visits, friends connection, friends, 5 demands and offers of user , basic information of user like about me, city, age, gender etc
2) friends:
showing the list of friends and their basic information
3) scrapbook :
showing the scrapbook of user where user can send scrap or reply.
4) Demands
showing demands posted by all the users and user can also post new demand.
5) Offers
showing offers posted by all the users and user can also post new offer.
6) album :
users can maintain their pics and albums by uploading, editing pics/albums.
Linksutra Component/Module ( first unzip the downloaded file and install component/module separately.)
UPDATED: 13/10/2009
modules and components pointing to joomla installation now.
layout css now working for firefox and IE both.
HELP: 21/10/2009
follow these steps to get linksutra component/module working.
1) download and install linksutra component and module
2) edit/create menu items (i prefer top menu) to linksutra components by “change menu item type” to (profile/demands/offers/scrapbook/friends)
3) publish linksutra module either to left or right position and with registered access.
Office management Software
Posted by Link Sutra in General on September 16, 2009
OfficeIG is an office Management software which is being used mainly by Advocates and Chartered Accountants for time management, managing the database of Client Bills, Receipts, Personal Bills, Staff Deadlines, Cheque Paid/Collected and cheque printing, Files Catalogs, IT Returns Database, Judicial Cases and hearings. Various detailed reports are included which help someone to manage the office in professional way.
Key Features
OfficeIG is multiuser and multifirm Office Management Software which can be operated on LAN and can handle multi firms Databases with admin and user login privileges. Other features are …
1. Reminders of customized important Dates like Birthday’s, Anniversaries, Festivals.
2. Schedule organizer which reminds on the screen for next 2 jobs and optional daily report which includes your whole schedules, important works for that day.
3. Staff Deadlines and their reminders when deadline is over.
4. Client’s Database
5. IT Returns Database
6. Judicial Cases’ Database and reminder of Hearing Dates for each cases.
7. File Catalogs which helps you to organize your soft and hard copy of files and papers.
8. Cheque Collected/Paid Database and Cheque printing facilty for your customized cheque formats.
9. Personal Bills Database and reminder for last date of submission of that bill.
10. Staff Database and Projects Database management as well as project costing and billing depends on the hours devoted by staff members.
11. Detailed Reports of the features mentioned above.
12. SEND SMS using your way2sms account and also you can get SMS alert of important dates, today’s schedule, pending bills, hearing dates, and staff deadlines.
13. Bulk Email and Staff Attendance.
Download (15 days Demo Version)
contact
igensol @ igensol.com
for further information
Joomla and wordpress MU bridge
Posted by Link Sutra in General, Joomla on September 1, 2009
I will try to explain how you can use wordpress MU (2.8.4) inside your joomla (1.5) to create blogs for your joomla users automatically.
you will not want every joomla user to have blogs without actually user wants it to create.
keeping it in mind we follow these things.
1) install wordpress MU inside your joomla main installation directory (i.e if my joomla is installed in ABC/joomla then I would install wordpress inside ABC/Joomla/wordpress
2) when installing your wordpress keep the database same as joomla is using (remember you should not have ur joomla tables prefix “wp_” if it is so then change your joomla tables prefix to something else)
3) configure your wordpress.
4) now come to the button or link on your registered joomla user page where you want to give user an option to create wordpress blogs.
5) following functions you should have
function getUserValue($id,$field){
$db =& JFactory::getDBO();
$query="SELECT $field from #__users Where id=".$id;
$db->setQuery($query);
$result=$db->loadObject($field);
//if(strlen($result->$field)<100){
return nl2br($result->$field);
// }else{
//return ;
// }
}
function isBlogActive($username){
$db =& JFactory::getDBO();
$query="SELECT COUNT(*) FROM wp_blogs Where domain='".$username.".<span style="color: #993300"><strong><em>yourdomain</em></strong></span>.com'";
//echo $query;
$db->setQuery($query);
//echo $db->stdErr();
$results=$db->loadResult();
//echo $results;
return $results;
}
#### now paste given below where you want to give user an option to create blog
</pre>
<pre><?php
$user=& JFactory:getUser();
$id=$user->get('id);
if(isBlogActive(getUserValue($id,'username'))){
echo '<a href="http://'.getUserValue($id,'username').'.<span style="color: #993300"><strong>yourdomain</strong></span>.com">
MY BLOGS</a>';
}else{
?>
<form method="post" action="/wordpress/wp-admin/wpmu-edit.php?action=addblog">
<input name="blog[createblog]" type="hidden" title="<span style="color: #0000ff">some key</span>" value="<span style="color: #0000ff">some key</span>"/>
<input name="blog[domain]" type="hidden"
title="<?php echo getUserValue($id,'username'); ?>"
value="<?php echo getUserValue($id,'username'); ?>"/>
<input type="hidden" name="blog[title]" size="20"
title="<?php echo getUserValue($id,'name'); ?>"
value="<?php echo getUserValue($id,'name'); ?>"/>
<input type="hidden" name="blog[email]" size="20"
title="<?php echo getUserValue($id,'email'); ?>"
value="<?php echo getUserValue($id,'email'); ?>"/>
<input type="submit" name="go" id="go"
Value="Add <?php echo getUserValue($id,'name');?> Blogs" >
</form>
<?php
}
?>
##################################
6) now come to wordpress/wp-admin/wpmu-edit.php file to make some changes
#######CHANGE FROM:##########################
if( is_site_admin() == false ) {
wp_die( __('You do not have permission to access this page.') );
} do_action('wpmuadminedit', '');
if( isset($_GET[ 'id' ]) ) {
$id = intval( $_GET[ 'id' ] );
} elseif( isset($_POST[ 'id' ]) ) {
$id = intval( $_POST[ 'id' ] );
}
if( isset( $_POST['ref'] ) == false && !empty($_SERVER['HTTP_REFERER']) ) {
$_POST['ref'] = $_SERVER['HTTP_REFERER'];
}
####################### CHANGE TO:##########
$blog = $_POST['blog'];
if($blog['createblog']=='<span style="color: #0000ff">some key</span>'){
}else{
if( is_site_admin() == false ) {
wp_die( __('You do not have permission to access this page.') );
}
do_action('wpmuadminedit', '');
if( isset($_GET[ 'id' ]) ) {
$id = intval( $_GET[ 'id' ] );
} elseif( isset($_POST[ 'id' ]) ) {
$id = intval( $_POST[ 'id' ] );
}
}
7) go to case “addblog”: line in wpmu-edit.php and replace check_admin_referer(’add-blog’); line with
$blog = $_POST['blog'];
if($blog['createblog']=='<span style="color: #0000ff"><strong>some key</strong></span>'){
}else{
check_admin_referer('add-blog');
}
to
//auth_redirect();
################
DO NOT FORGET TO CHANGE “some key” and “yourdomain“.
and you are done with it but make sure your wordpress is configured to send user login/passwd after their registeration so that user can get his blog pasword otherwise use “configure smtp” plugin to send mail using gmail or google hosted emails.
HAPPY BLOGGING