Archive

Archive for the ‘Web Tech Terms’ Category

get the user name using GUID

These below code help us to get the user guid,name & usename in Elgg

$user_guid = get_input(‘user_guid’);
echo $user_guid;
$user = get_user($user_guid);
echo $user->name;

// Similarly for Username like below..

echo $user->username;

get the current user GUID in Elgg

$user_guid = get_input(‘user_guid’);
echo $user_guid;

Id & Class in CSS

It is often hard to decide when to use a class versus an id for an element. Here is an easy way to think of the difference:

Use a class tag if:

  1. The style is used in various places throughout the document.
  2. The style is very general.

Use an id tag if:

  1. The style is only used once ever in the document.
  2. The style is specific to a certain area of the document.

Remember that an id can only appear once in any HTML document. Once you’ve used the id, it should not be used again on that page.

How to set radiobox checked in Elgg

In Normal HTML we can easily set radio box checked as like below..

<input type="radio" name="color" value="Red" />
<input type="radio" name="color" value="Green" checked="checked" />
<input type="radio" name="color" value="Yellow" />
But what we do if we use PHP & also especially in Elgg,
<?php echo elgg_view(‘input/radio’,array(‘internalid’ => ‘cur_radio’,’internalname’ => ’employer’, ‘options’=>array(elgg_echo(‘Current Employer’) => “current”), ‘value’ => $vars[‘entity’]->employer));?>
<?php echo elgg_view(‘input/radio’,array(‘class’ => ’employer’,’internalname’ => ’employer’, ‘options’=>array(elgg_echo(“Previous Employer”) => “previous”), ‘value’ => $vars[‘entity’]->employer));?>
To select one radio button as checked u can do as follows using javascript …
<script type=”text/javascript“>
$(document).ready(function(){
    $(“#cur_radio”).attr(“checked”,”checked”);
});
</script>
Similarly for pulldown use in javascript as follows..
         $(“#cur_radio”).attr(“disabled”,”disabled”);

Function in JQuery

Once i want to execute same set of codes for two common events in jquery. ie, i want to execute the code while

1 . Changes occur in dropdown

2 . While page Load.

At, that time i planned to use bind() function.But if i use bind() i should use the same code for two times.So, i planned to implement that using OR( || ) condition.But, i think it is not available..So i searched jquery.com & finally got one beautiful solution.

That Solution is Normal FUNCTION ( ) like C,C++.i call this function two times only with one set of code.That example is below..

Example:

$(“#level”).change( changes );          // call – 1
$(document).ready( changes );         // call – 2

function changes()

{

——

Set of code

——

}
Reference : http://api.jquery.com/bind/

list in CSS

February 4, 2011 Leave a comment

How to set background image for list item :

Steps:

1.First of all to remove tle default list padding & margin set this as 0px.

padding:0px;

margin:0px;

2.Then,remove the list-style.

list-style-type:none;

3.Then, set the Background image.

background:url( ‘ images/bullet.gif ‘ );

 

Example:

.menu ul

{


padding:0px;

margin:0px;

}

.menu ul li

{

background:url( ‘ images/bullet.gif  ‘ );

}

Reference :

http://css.maxdesign.com.au/listutorial/master.htm

How to Hit?

How to get more people to visit my website?

  • Starting a User Forum.
  • A blog is a good thing.
  • Make a Widget!.
  • Social Networking.
  • Offer a Prize.
  • Make an RSS Feed & Get it Published.

Reference : www.hubpages.com

Delicious

delecious.com

  • It is used to bookmark the URL.
  • To use this go to delicious.com & create an account.
  • Clich the “save a new bookmark” tag in top right corner & then give URL (link)

Ultimate Use :

  • ” Google Searce Engine ” will show one website today & will display another website tomorrow for the SAME TAG.
  • So , Delicious bookmarks avoid that problem & we can use the link depends upon our needs.

RSS Feed

RSS (Rich Site Summary,Really Simple Syndication) is a format for delivering regularly changing web content. Many news-related sites, weblogs and other online publishers syndicate their content as an RSS Feed to whoever wants it.

Hint :

  • Tracker
  • Delivering Web Contents from other Website to Our Website.
  • Latest Version – RSS 0.94
  1. Software : Feed Reader,News Aggregator
  2. Web Based Feed Reader : My Yahoo,Bloglines,Google Reader

USES of RSS :

RSS solves a problem for people who regularly use the web. It allows you to easily stay informed by retrieving the latest content from the sites you are interested in.

You save time by not needing to visit each site individually.

You ensure your privacy, by not needing to join each site’s email newsletter

Reference : http://www.whatisrss.com

Open Source

  • Open Source refers to any program whose source code is available for use & we can modify it depends on thier needs….at free of cost.
  • Open Source software is usually developed as a public colloboration & made freely available…
  • Open Source is owned by “OPEN SOURCE INITIATIVE (OSI)“.

Terms of OSI :

  • The S/W being distributed must be redistributed to anyone else without any Restrictions.
  • The Source code must be made available.

How to make money with Open Source?

  • Ask for donations.
  • Include advertisements on your download page ( You can include Google Adwords as a quick way to get advertisers ).
  • Create custom features for companies ( Many companies who use open source software require special features. Eg.Facebook Applications)
  • Sell related software or hardware.
  • Charge a maintenance fee.
  • Charge a fee for commercial use.
  • Gain job experience.

Example :

  • MySQL is Open Source Software.

Reference :