by Manoj Kumar

BuddyPress theme for bbPress.

You can download bbPress theme from here which looks like BuddyPress.

Note: Its still not sharing/using any BuddyPress functionality.

Download Link

BuddyPress Theme for bbPress

21 June 2009 at 17:50 - Comments
Levent at 05:08 on 22 June 2009
you r great Manoj..
burtadsit at 06:49 on 22 June 2009
Ha! Way cool Manoj.
by Manoj Kumar

iPhone 3.0 and Internet Tethering

I have written a post on Internet Tethering with iPhone 3.0 on http://futurechat.in, please have a look :)

Link : iPhone 3.0 and Internet Tethering

.

18 June 2009 at 17:06 - Comments
by Manoj Kumar

New WordPress 2.8 has arrived

New WordPress 2.8 named after trumpeter and vocalist Chet Baker. It more or less looks like the same as 2.7 with bug fixes

There is long list of features available here, But what I like most as a User or Admin are listed below

1. Faster Loading of admin interface.
2. New Theme installer like plugin browser. Now you can browse and install a theme from admin interface itself.
3. Earlier there used to be problems with widgets as one had to select where one wants to put a widget and then select a widget from available widgets. But now its very simple with new drag & drop interface.
4. Now you can customize your dashboard up-to four columns.
5. Timezones and daylight settings used to be a problem, now will have a list of cites to choose from.
6. Auto Save with Control/ Command+S.
7. Upgrade Processes during database upgrades.
8. Allow case-insensitive logins.
9. Make user_nicknames unique during registration.
10. TinyMCE 3.2.4.1

Have a look at following demo video

References:

1. 2.8 Release Jazzes Themes and Widgets

2. Codex Version_2.8

3. WordPress trac

11 June 2009 at 11:30 - Comments
nfl jerseys at 14:12 on 12 June 2009
This 2.8 upgrade include database upgrade, i got my database covered yesterday:(
by Manoj Kumar

bpPicture Album plugin for BuddyPress (Some Screenshots)

Plugin Download Link

New Beta Version Download Link

Fixes

1. IE Problem with <

2. Language Support

3. Typo and code

Please test and confirm :)

Following are some screenshots of bpPicture Album plugin…

1. Picture Album Thumbnail Screen

user-checking-friends-album

2. Picture Album Full Screen

user-checking-full-pic-view-and-posting-wire-on-pic

3. Picture Album Upload Screen

picture-upload-form

28 May 2009 at 17:48 - Comments
DjZoNe at 20:05 on 29 May 2009
Seems awesome, I'll try it out tonight :)
Roy at 04:49 on 30 May 2009
CANT WAIT! Trying it when I get off work.
by Manoj Kumar

Mobile Device and Web

With mobile internet usage increasing, how important is to for your web presence to be mobile friendly and is also tracked ?

A 2008 Nielsen Media Research highlights that there is an average lift of 13% in mobile web audience and Jakob Nielson’s alertbox says Mobile Web 2009 = Desktop Web 1998, certainly mobile web has a significant role to play. But the question is there are hundreds of devices and models, so where do we start ? Here tracking your mobile web presence is important.

While with the help of google analytics tool you can easily track screen size, bowser and the OS, but if you want to provide a remarkable experience to your audience you should also know about the models being used . Then figure out the capability of that device so you can provide a better experience.

Recently I came across a site called percentmobile.com which provides us a comprehensive analysis on mobile devices, below is a screenshot of there sample report.

PercentMobile

Now we know enough about our site to start work :

A site developer can create a mobile friendly site without much changes in existing code, but certainly there are some important things that they should keep in mind while developing a site for mobile. They are

1. Highest used device for his site
2. Screen size
3. CPU speed
4. Network capabilities etc.

HTML 4 Specifications allows you to use specific style sheet for your target device. To know more about what works on which device, mobile test suites are listed

1. Media descriptors
2. Mobile Test Harness

24 May 2009 at 16:25 - Comments
by Manoj Kumar

Tech. Nostalgia

When I looked back and think about sharing the work done in the past, it doesn’t make sense as those technologies has limited relevance today. One may say sad, but I think its the beauty of technology as it keeps evolving. Keeps me on a journey of learning more.

Going back in time when I started my career as software developer. On the first day I was asked to do the data entry for a customer, I was stunned but I did that with full dedication and passion without any complaint resulted. I got a live project the very next day.

After that there was a 3 to 4 year journey from converting existing Foxpro projects to Visual Basic Applications and new development. In that journey I had developed applications for companies in automobile, education, garments, carpets, healthcare and chemical sectors. The software used included Visual Basic, Crystal Reports, MS Access, MS SQL and DTS services.

While working with Futurescape I have done some great projects with industry leaders. If I jog my memory these come to mind…

I feel proud to be a part of one of the first successful CRM implementation in Indian healthcare industry. While the maker of the CRM software hardly bothered to support the implementation, we still did good and it felt good to have learnt so much and also ensured smiles for our client.

I never thought I was creative but I once did something very nice with SCALA. It was just an experiment but I felt good doing it. I had mixed feelings when the client said “Everything went bad in the meeting except the presentation made by you for which I got an award”. It felt nice that my client was appreciated even though the meeting could have been better. I was really happy that i discovered another part of me.

Another time, a concept developed started as a small internal site for a HR department of a company but it got so successful that it was implemented at Global Level.

There are simple joys like developing a concept that allowed a healthcare company to send emails to people and in turn they could interact in the email to calculate their health problems .

To more complicated ones…

Isn’t it great that you have developed an analytics cubes in MS SQL Analytics Services which gives you so much information from various dimensions about business which previously took days to fetch. For the same client you create Drill Down Crystal Reports which starts from Locations -> to -> Gender -> to -> Age Group -> to -> Age -> to -> Department -> to -> Customer -> to -> Single invoice itself, thats so much data was available on the client intranet.

Pivot Table web reports developed using OWC (Office Web Component) for a client which gives information and comparison for various States, Cites, Time Period and so on. It was a challenge as most users was using various version of MS Office and finding help on OWC for Pivot Table was like going through hell.

Two years ago, when i first started my journey with open source, it was with Dot Net Nuke. It was logical since I came from a background of Microsoft tools . As you are aware DNN is based on ASP.NET. It thrills me that we used this ASP.NET based product to develop a portal for a franchisee network. It has everything that the business requires for their day to day operations. I will not bore you with the details except that it has been running successfully for the last two years and is this is also an case study for the client.

Just writing all the good memories made me smile . Wish I had started my blog earlier , because then I would have shared more and learnt even more from all the people around. But I guess it is never too late and technology always evolves.

About two years ago, i discovered Wordpress and it has started a new journey. It is an appropriate time as I write this, the new BuddyPress release came out and it was satisfying and yet a huge surprise to see my name in the credits. Thank You Wordpress and the team and most of all to all the clients I have worked with and helped me learn.

3 May 2009 at 19:10 - Comments
Atin Gupta at 13:56 on 4 May 2009
Just fix a typo "Everything want bad in..." to "Everything went bad...". Nice flash back, keep sharing some more of your ...
Manoj Kumar at 14:04 on 4 May 2009
@Atin Gupta Thanks for bringing it to my notice.
by Manoj Kumar

Some basic SSH and Linux commands

Several people have been asking me about basic SSH commands to work with Linux server, so I thought let me put some basic commands at one place to refer to.

To connect to the SSH server first of all you need a SSH client. Some of the most popular Free SSH clients are listed below:

1. PuTTY
2. WinSCP
3. Dropbear
4. OpenSSH

 

To connect with SSH Server you can use any of these command,

ssh username@yourhostname.com
# It will prompt you for password #
ssh -l username yourhostname.com

Some of SSH server may deny direct root login to the server so you need
to first login from any user and then switch to root with following command

su -
# You will be asked for the root password #

Since you are a root user and might want to check who had logged in earlier, you can use. It will give you who logged in and when.

last

 

User creation commands

To create user

adduser <user-name>

For deleting user

userdel <user-name>
 
deluser <user-name>
 
rmuser <user-name>

For changing current password

passwd
#You will be asked for entering password#

Getting general help on commands in SSH, here man stands for manual

man <command-name>

 

Working with Files and Directories

To check the current path

pwd

To list all files and folders [ ls ]

ls

To show “hidden” files in current directory

ls -a

To display detailed information about all files in current directory

ls -l

To list all files and subfolders including hidden with their
permissions, owner and groups in human-readable sizes

ls -alh

To go to a particular directory [ cd ]

cd /var/www/vhosts/yourdomainname.com/httpdocs

For copy file or folder to the specified location or folder [ cp ]

cp /directory/you/want/to/copy /directory/where/you/want/to/copy/to

For moving file or folder to the specified location or folder [ mv ]

mv /directory/you/want/to/move /directory/where/you/want/to/move/to

For deleting a file or directory [ rm ]

rm <file-name>

To deletes all the directory and all files including subdirectories recursively.

rm -rf <directory-name>

To create a folder or directory [ mkdir ]

mkdir <directory-name>

For removing the folder or directory [ mkdir ]

rmdir <directory-name>

For creating file zip or archive in a specified directory [ tar cvf ]

tar cvf filename.tar.gz /directory/you/wish/to/archive

For extracting all zip or archive files in current directory [ tar -
xvf ]

tar -xvf filename.tar.gz

To create a zip file [ zip ]

zip yourzipfile.zip filename.php

To unzip files in current directory [ unzip ]

unzip yourzipfile.zip

To change owner of directory or file [ chown ]

chown user:group <directory-name>
 
chown apache avatars

To change file or directory permissions

chmod permissions <file-name>
 
chmod 755 avatars

Permissions
u = User who owns the file.
g = Group that owns the file.
o = Other.
a = All.
r = Read the file.
w = Write or edit the file.
x = Execute or run the file as a program.

Numeric Permissions:
0 = No permission
1 = Execute only
2 = Write or edit the file.
3 = Execute or run the file as a program.
4 = Read the file.
5 = Read and execute the file.
6 = Read and write Read the file.
7 = Read, write and execute

 

Working with SSH text editors

pico editor

pico <file-name>

vi editor

vi <file-name>

To LogOut from consol

logout

29 April 2009 at 16:40 - Comments
Juan at 00:51 on 18 June 2009
Hello Manoj, Ive followed yours indication to use the Terminal SSH to setup the wp-content/blog.dir 777 permissions. But the sistem ...
Juan at 00:52 on 18 June 2009
More detailed: cannot read directory `httpdocs/wp-content/blogs.dir': Permission denied
by Manoj Kumar

Simple steps for HTML to ASP

There are times when designers create html based sites but are uncomfortable about what needs to be done about making the site password protected. In such times, I have been asked to help .

However to make things simple, I have created a step wise activity so that any html based site can be converted to password protected one. It will help my designer friends and anyone else would needs to do this.

Let us take an example where we have to convert following pages into a password protected site

1. Home page (home.html)
2. About Us (about.html)

Following are the tasks that needed to be completed in the password protected site.

1. Create a login page
2. Password should be encrypted
3. Every pages should be accessible after entering a valid password only
4. Track each login along with IP address and store in database

Here we go…

Step 1 Database Creation

Create a database. Lets say database name is dbsite

Create 2 tables with following fields

Table 1 Name : UsersMaster
Fields : Id (int), UserName(VarChar), Password(VarChar), Name(VarChar), Organisation(VarChar), Designation(VarChar), EmailId(VarChar), Publish (tiny Int), DisplayName(VarChar)

Table 2 Name : UsersLog
Fields: UserId (Int), LoginDateTime(DateTime), IpAddress (VarChar)

Step 2

Create Following pages
1. login.asp
2. verifyuser.asp

Copy following code and paste in login.asp

<%
dim con, rsTemp, rsMaster, strqry
dim cn
cn="Provider=SQLOLEDB.1;Persist Security Info=False;User ID=sa;pwd=pwd;Initial Catalog=dbsite;Data Source=."
set con=Server.CreateObject("ADODB.Connection")
 
set rsTemp=Server.CreateObject("ADODB.Recordset")
set rsMaster=Server.CreateObject("ADODB.Recordset")
 
con.Open cn
 
 
function getNewId(tblname, fldname)
	if rsMaster.State=1 then rsMaster.Close
	strqry="Select max(" & fldname & ") from " & tblname
	set rsMaster=con.Execute(strqry)
	if not rsMaster.EOF then
		if not isnull(rsMaster(0)) and rsMaster(0)<>"" and IsNumeric(rsMaster(0)) then
			getNewId=rsMaster(0)+1
		else
		 getNewId=1
		end if
	else
		getNewId=1
	end if
end function
 
'FORMAT DATE
'----------------------------------------------------------------------------------------------------
function checkdate(mydate)
	if mydate="" or IsNull(mydate) or Not IsDate(mydate) then
		checkdate=false
	else
		checkdate=true
	end if
end function
 
function getdateformat(mydate)
	if isDate(mydate) then
		getdateformat=day(mydate) & "-" & monthname(month(mydate),true) & "-" & year(mydate)
	else
		getdateformat=""
	end if
end function
 
function RTESafe(strText)
	'returns safe code for preloading in the RTE
	dim tmpString
 
	tmpString = trim(strText)
 
	'convert all types of single quotes
	tmpString = replace(tmpString, chr(145), chr(39))
	tmpString = replace(tmpString, chr(146), chr(39))
	tmpString = replace(tmpString, "'", "&#39;")
 
	'convert all types of double quotes
	tmpString = replace(tmpString, chr(147), chr(34))
	tmpString = replace(tmpString, chr(148), chr(34))
'	tmpString = replace(tmpString, """", "\""")
 
	'replace carriage returns & line feeds
	tmpString = replace(tmpString, chr(10), " ")
	tmpString = replace(tmpString, chr(13), " ")
 
	RTESafe = tmpString
end function
 
Function GetSecureVal(param)
	If IsEmpty(param) Or param = "" Then
		GetSecureVal = param
		Exit Function
	End If
 
	If IsNumeric(param) Then
		'GetSecureVal = CLng(param)
		GetSecureVal = CDbl(param)
	Else
		param = Replace(CStr(param), "'", "''",1,-1,1)
		param = Replace(CStr(param), ";", ",",1,-1,1)
		param = Replace(CStr(param), "..", "",1,-1,1)
 
		//Here you can add additional code as per your requirement
 
		GetSecureVal = param
	End If
End Function%>
 
<!--#include virtual="encryptalgo.inc"-->
 
<%
session("UserId")=0
session("UserName")=""
session("UserDisplayName")=""
session("IsLoggedIn")=""
 
Dim log_success
 
log_success=1
 
if Request.QueryString("submit")=1 then
	dim loginid, pwd	
	Dim Mail
	loginid=LCase(Request.Form("txtloginid"))
	pwd=Request.Form("txtpassword")
 
   dim psw, txt
   dim strTemp
 
 
	 psw=pwd
	 txt=loginid
 
   strTemp = EnDeCrypt(psw, txt)
   pwd=server.urlencode(strTemp)
 
	strqry="Select Id, Password, Name,DisplayName from UsersMaster where UserName='" & GetSecureVal(loginid) & "' and Publish=1"
	if rsTemp.State=1 then rsTemp.Close
	set rsTemp=con.Execute(strqry)
	if not rsTemp.EOF then
		while not rsTemp.EOF			
			if strComp(rsTemp(1), pwd)=0 then
				session("UserId")=rsTemp(0)
				session("UserName")=rsTemp(2)
				session("UserDisplayName")=rsTemp(3)
				session("IsLoggedIn")="nfxkqur89124ejxtex7254241242j4bux8"
 
				strqry="insert into UsersLog values(" & rsTemp(0) & ", '" & Now() & "','" & Request.ServerVariables("REMOTE_ADDR") & "')"
				con.Execute(strqry)
 
				Session.TimeOut=30
				Response.Redirect "home.asp"
				Response.End
			end if
			rsTemp.MoveNext
		wend
		log_success=0
	else
		log_success=0
	end if
end if
%>
 
<html>
<head>
	<meta NAME="GENERATOR" Content="Microsoft FrontPage 4.0" />
	<title>Login Page</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
			<%if log_success=0 then
				response.write "<p><strong>Invalid Login ID or Password.</strong></p>"
			end if%>
			<span style="font-weight: 700; text-decoration: underline; font-size: 110%;">Enter your login details:</span><br /><br />
			<form id="frm" name="frm" method="post" action="login.asp?submit=1">
				<label for="txtloginid" class="lblogin">Login ID</label><br />
				<input type="text" id="txtloginid" name="txtloginid" value="" class="tbstyle" /><br /><br />
 
				<label for="txtpassword" class="lblogin">Password</label><br />
				<input type="password" id="txtpassword" name="txtpassword" value="" class="tbstyle" /><br /><br />
 
				<input type="submit" id="cmdlogin" name="cmdlogin" value="Login" class="btnstyle" />
			</form>
</body>
</html>

Note: change “nfxkqur89124ejxtex7254241242j4bux8″ and “IsLoggedIn” line in login.asp and verifyuser.asp to something unique so two webiste sessions doesn’t clash with each other.

You can write additional programming code in verifyuser.asp for extra security.

Change connection settings as per your server

Step 3

Paste following code in verifyuser.asp

<%if session("IsLoggedIn")<>"nfxkqur89124ejxtex7254241242j4bux8" then
	response.redirect "login.asp"
	response.end
end if%>

Step 4

Make following changes in all html pages

1. Change the extension of all html pages to asp, so now we have (home.asp, about.asp)

2. Paste following line just below DOCTYPE Meta in all pages converted from html to asp

<!--#include file="verifyuser.asp"-->

3. Change all hyperlinks in pages from home.html to home.asp and about.html to about.asp

Step 5

Paste encryptalgo.inc file in root directory

Sample.zip

28 April 2009 at 16:39 - Comments
by Manoj Kumar

User Import for BuddyPress (All Fields)

With this plugin now you can import users with all xprofile fields to your BuddyPress installation.

This plugin will automatically activate all user accounts and send notification as selected by the admin at the time of import.

It currently works with WordPressMU + BuddyPress installation.

Download (Version 1.0)

 

Data formatting instructions

Formatting Data is the vital while to ensure error free import of records into Buddy Press.

For your reference, follow the examples below for each field and type.

 

Check number of Delimiter

1. Count the Number of Fields in your Buddypress xprofile installation. The screenshot provides the explanation

Profile fields

In the example, these are the fields .

1. Full Name
2. About
3. Gender
4. Interests
5. Favorite Food
6. Date of Birth
7. Country

Thus
Fields – 7
Delimiter – Fields + 1 = 8. The | is the delimiter.

So our data string should be like :

username|email@dmainname.com|||||||

i.e. username + | + email@domainname.com + 7 Delimiters

 

Text Box Type

2. Let us now take our first field Full Name whose Field Type is textbox (Shown in 1 Image)

For textbox field type you can enter any string like : Andy, Manoj Kumar or YourName etc.

I am taking field value as “Manoj Kumar” for full name

So our data string now should be like :

username|email@dmainname.com|Manoj Kumar||||||

i.e. username + | + email@domainname.com + | + Full Name + 6 Delimiters

 

Textarea Type

3. Second Filed in my installation is of textarea type by name About

Let us assume that field value for About is “This is the field value for About field whose Field Type is textarea”

So our data string now should be like :

username|email@dmainname.com|Manoj Kumar|This is the field value for About field whose Field Type is textarea|||||

i.e. username + | + email@domainname.com + | + Full Name Value + | + About Value + 5 Delimiters

 

Radio Type

4. Our next field is Gender which is of radio type. By nature radio type field can take only one value form given options.

I have following options in my installation

Option 1 – Male
Option 2 – Female

Lets say I want to select Male value for Gender field

Note: All Field Types except textbox and textarea are case sensitive. i.e. If you enter value “male” instead of “Male” it will not work.

So now data string should be like :

username|email@dmainname.com|Manoj Kumar|This is the field value for About field whose Field Type is textarea|Male||||

i.e. username + | + email@domainname.com + | + Full Name Value + | + About Value + | + Gender + 4 Delimiters

 

Multi Select Box Type

5. Next field is multiselectbox by name Interests. Multiselect box can take one or more values, so we are delimiting values more then one by (Tilde Sign [~] ).

I have following options in my installation for Interests

Option 1 – Movies
Option 2 – Traveling
Option 3 – Driving
Option 4 – Dancing

Lets say I want to select Movies as well as Dancing value for Interests field, my data string for this field should be “Movies~Dancing”

Note: All Field Types except textbox and textarea are case sensitive. i.e. If you enter value “movies” or “mOvies” instead of “Movies” it will not work.

So now data string should be like :

username|email@dmainname.com|Manoj Kumar|This is the field value for About field whose Field Type is textarea|Male|Movies~Dancing|||

i.e. username + | + email@domainname.com + | + Full Name Value + | + About Value + | + Gender + | + Interests + 3 Delimiters

 

Check Box Type

6. Next field is Favorite Food which is of checkbox type. Data formatting for Check Box Field types are same as Multi Select Box. i.e. Delimiting more then one values by (Tilde Sign [~] )

I have following options in my installation for Favorite Food

Option 1 – Pizza
Option 2 – Hot dogs
Option 3 – Sweet potato
Option 4 – Pasta

Lets say I want to select Pizza and Hot dogs value for Favorite Food field, my data string for this field should be “Pizza~Hot dogs”

Note: All Field Types except textbox and textarea are case sensitive. i.e. If you enter value “Hot Dogs” or “hot dogs” instead of “Hot dogs” it will not work.

So now data string should be like :

username|email@dmainname.com|Manoj Kumar|This is the field value for About field whose Field Type is textarea|Male|Movies~Dancing|Pizza~Hot dogs||

i.e. username + | + email@domainname.com + | + Full Name Value + | + About Value + | + Gender + | + Interests + | + Favorite Food value + 2 Delimiters

 

Date Box Type

7. My next field is Date of Birth of datebox type. Its really simple to format datebox type field simply enter date in as “1 January 2009″. i.e. Date in numer + Space + Month (Like January, February, March etc) + Space + Year in numbers (like 1995, 2001, 2005 etc)

I am taking “1 January 2009″ as Date of Birth – This is an example

So now data string should be like :

username|email@dmainname.com|Manoj Kumar|This is the field value for About field whose Field Type is textarea|Male|Movies~Dancing|Pizza~Hot dogs|1 January 2009|

i.e. username + | + email@domainname.com + | + Full Name Value + | + About Value + | + Gender + | + Interests + | + Favorite Food value + | + Date Value + 1 Delimiter

 

Select Box Type

8. Last field in my installation is country which is of selectbox type. Formatting for Select Box Type is same as textbox and textarea type, Difference is just selectbox is case sensitive.

Note: All Field Types except textbox and textarea are case sensitive. i.e. If you enter value “india” or “INDIA” instead of “India” it will not work.

I am taking “India” as value for this field

So now data string should be like :

username|email@dmainname.com|Manoj Kumar|This is the field value for About field whose Field Type is textarea|Male|Movies~Dancing|Pizza~Hot dogs|1 January 2009|India

i.e. username + | + email@domainname.com + | + Full Name Value + | + About Value + | + Gender + | + Interests + | + Favorite Food Value + | + Date Value + | + Country Value

 

Blank or field with no value

9. If you do not have value for any specific field you can leave it as blank for example if we don’t have interests field value for a particular record our data string will look like

username|email@dmainname.com|Manoj Kumar|This is the field value for About field whose Field Type is textarea|Male||Pizza~Hot dogs|1 January 2009|India

All suggestions are welcome.

1 April 2009 at 19:24 - Comments
baron at 19:35 on 1 April 2009
Works great, thank you
The Big K at 00:12 on 7 April 2009
Hi Manoj, How does this work when the fields are distributed among various groups? For example, I have 'Base', "Personal Information", ...
by Manoj Kumar

Bulk Import Members (Users) Plugin for BuddyPress Site

We wanted to provide seekers at Unstructure , with a better experience and a richer profile. Keeping this in mind, we decided to include Buddypress .

While the site has been configured with Buddypress, one of the tasks that was required was to migrate users from a standard wordpress installation to the new buddypress members format. On finding, no plugin or tool available to do the same, I decided to write one.

The following defines how the plugin works, let me know your thoughts on this :)

1. You can import UserName, FirstName, Lastname and Email. Where FirstName + LastName becomes FullName for BuddyPress

2. Delimit your data with “[|]” (pipe sign) like username|firstname lastname|email@domainname.com

3. Paste your data in the given box

4. Choose any of the 3 Email notification options

5. Click on the import user button

Download plugin from here (Version 0.1)

Download For New BuddyPress 1.0.1

23 March 2009 at 18:20 - Comments
baron at 22:24 on 24 March 2009
Works great, thank you
Kyle at 02:45 on 26 March 2009
hey, great plugin! this saved my day... questions for you I've changed the Full Name (buddypress) field to be just "First Name" and ...