July 21, 2010

AUTHENTICATION WHILE DOWNLOADING for josdewplayer

AUTHENTICATION WHILE DOWNLOADING
-----------------------------------------------------------

CODE FOR GETTING THE LOGIN INFORMATION:

$jAp= & JFactory::getApplication();
$user =& JFactory::getUser();
$user_id=$user->get('id');//variable $user_id hold user login_id
$user_username=$user->get('username');variable $user_username hold user login_username

VERIFICATION WHETHER THE USER IS AUTHORIZED PERSON OR NOT:

$refer_variable//may be $user_id or $user_username
$result=mysql_query("select * from jos_users where id='$refer_variable'");


PLUGIN NAME::::::::::josdewplayer_plugin.zip

FILE TO BE EDIT::::::josdewplayer.php

PATH FOR THE FILE:”\joomla\plugins\content\”


-------------Put onclick() event in the file josdewplayer.php

Line::::::4th line from bottom

$text = '{ type="application/x-shockwave-flash" data="'. $LiveSite .'plugins/content/'.$player. $path .'&autoplay='.$autoplay.'&autoreplay='.$autoreplay.'&showtime=1" onclick="test()" width="'.$width.'" height="20">
">


test(){
var id="{php echo $user_id;}";
if(id=="") window.location ="";////path to regiteration login form

alert("U must register or login before accessing it");
}
else
{

alert("Authorized user");

alert("U may now acess it");
}

}

{/script}

LOGIN-MODULE DATABASE NAME::::::: jos_users


LOGIN-MODULE DATABASE NAME::::::: jos_users


LOGIN-MODULE DATABASE NAME::::::: jos_users


SHORT PROCEDURE:::

---------->PUT onclick() event .Because while user try to dowload it will invoke

--------->In onclick() function. Redirect the page to registeration form page for registeration

---------->Get the User_login_id.It may be new user or old-user logination

--------->So for old-user.. U must check his availabilty by SELECT sql function.

---------->After registeration...permitt the user to download the desire content

Gantry Framework - Flexible and Powerful Web Platform

How does Gantry make theming easier and more powerful?

Gantry is a comprehensive set of building blocks to enable the rapid development and realization of a design into a flexible and powerful web platform theme.

Gantry Overview

Gantry was born when the RocketTheme development team wanted to consolidate our extensive set of custom Joomla template functionality into a simple, easy to use framework. However, we wanted to ensure we didn’t lock ourselves into a rigid framework that would stifle the creativity and bleeding-edge design features that we had become known for. It had to be powerful enough to do everything our templates already handled, but allow us to easily extend and build-on these features with a minimum of effort and complexity.

We wanted to have a solid base we could build on top of when creating a new Joomla template. Anything that was common to all templates was a prime candidate to be put in the core of Gantry, and anything specific to the template design itself should be part of the template itself. Traditionally the Joomla layout options are limited, but Gantry was built to provide a new layer on top of this traditional module configuration to give an unprecedented level of control and flexibility.


Refer : http://www.gantry-framework.org/

How to get user id in joomla1.5

hi guys


defined('_JEXEC') OR defined('_VALID_MOS') OR die( "Direct Access Is Not Allowed" );

echo "Hello";
echo "

User: ";

$jAp= & JFactory::getApplication();
$user =& JFactory::getUser();
$user->get('id');
echo $user;
?>

July 7, 2010

Multi language option in PHP

hi guys

i'm going to share multi language option in PHP

<*? $_REQUEST["lang"]==1?include('en.php'):include('fr.php'); ?>

<**a href="langauge.php?lang=1"*>English<*/a*><*a href="langauge.php?lang=2"*>French<*/a*>

<*table width="100%" border="1" cellspacing="0" cellpadding="0"**>

<*tr*>



<*th scope="col"*><*?php echo _CMN_NAME; ?*><*/th*>



<*/tr*>

<*/table*>

use as index.php

and make two files to define macro for languages

en.php

fr.php

en.php

<*?PHP DEFINE('_CMN_NAME','Name'); ?>



fr.php

<*?PHP DEFINE('_CMN_NAME','Nom'); ?>


Note: Guys please remove Astrix *