How to create Tag Cloud Page in wordpress

Posted by druva | HTML, php, utils, wordpress | Tuesday 26 January 2010 4:43 am

After exploring to create a cloud page  this is the way i have created one for my site

Follow the steps

1) create a php file with tagcloud.php

<?php
/*
Template Name: Tag Cloud
*/
?>

<?php get_header(); ?>

    <div id="content" class="narrowcolumn">
 		<h3 style="font-family:Arial, Helvetica, sans-serif; color:#CC6600">Tags Cloud</h3>
        <div class="tag_cloud">
            <?php wp_tag_cloud('number=0'); ?>
        </div>

    </div>

<?php get_sidebar(); ?>

<?php get_footer(); ?>

2) upload this file to server in your theme folder
in my case as i am using default theme i have uploaded to “totusinfo\blog\wp-content\themes\default”

3) Login to admin section click on create a page
4) Enter title of your page
5) Choose Tag Cloud from the Template Drop Down and click update/create

Now your tag cloud page is ready
EnJoy!!!!!

 

How to Get Values from popup to parent

Posted by druva | HTML, JS, utils | Wednesday 9 December 2009 7:19 am

The requirement is
I had a button wen i click it a popup window will display with some values.
I have to select those values. the selected values must display in the parent window.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

 <body>

 <form>

 <table border=1>
 <th>Name</th>
 <th>Country</th>
 <tr>
 <td><input id="name" name="name" /></td>
 <td><input id="country" name="country" /></td>
 </tr>
 </table>

 <input type="button" name="choice" onClick="window.open('popup.html','popuppage',' width=350,toolbar=1,resizable=1,scrollbars=yes, height=300,top=100,left=100');" value="Add">

 </form>

 </body>

</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
 <head>

 <SCRIPT LANGUAGE="JavaScript">
 <!-- Begin
 function sendValue (n, c){
 var name = n.value;
 var country = c.value;
 window.opener.document.getElementById('name').value = name;
 window.opener.document.getElementById('country').value = country;
 window.close();
 }
 //  End -->
 </script>

 </head>
 <body>

 <form name="selectform">

 <table width="250">

 <tr>
 <td>
 Enter your name:
 </td>
 <td>
 <input type="text" name="name" id="name">
 </td>
 </tr>

 <tr>
 <td>
 Select your country:
 </td>
 <td>
 <select name="country">
 <option value="India">India</option>
 <option value="United States">United States</option>
 <option value="United Kingdom">United Kingdom</option>
 <option value="Germany">Germany</option>
 <option value="France">France</option>
 </select>
 </td>
 </tr>

 <tr>
 <td>
 <input type=button value="submit" onClick="sendValue(this.form.name, this.form.country);">
 </td>
 </tr>

 </table>

 </form>

 </body>
</html>
 

How to Avoid ugly border around images & links using css

Posted by admin | CSS, HTML | Thursday 1 October 2009 10:36 am

Every web developer would come across this issue. In Firefox, when you’d clicked a image or link there you’ll see a dotted border around the image or link. It makes ugly to the website. I googled around this issue & found a way to resolve it. If you see the image below you could easily identify the bug.

To resolve this issue just a single line css is enough.

&lt;style type=&quot;text/css&quot;&gt;
a:active, a:focus{outline: 0;}
&lt;/style&gt;;

Courtesy:  mycodings.blogspot.com

 

Include PHP files in HTML pages using .HTACCESS

Posted by admin | HTML, php, utils | Tuesday 8 September 2009 12:40 am

Usually, its not possible to include PHP files into HTML pages. Here i got a way for this which works. Its nothing but using .HTACCESS.

Create a .HTACCESS file in the root folder or a specified folder.
Add the below code  into your .HTACCESS file

Options +FollowSymLinks
AddType application/x-httpd-php .htm

Thats it

Now, you can include PHP files into your Static HTML Pages.

 

How to remove html tags from given text using PHP

Posted by druva | HTML, php, utils | Wednesday 24 December 2008 7:42 am

function stripHtmlTags($text){

	$strippedtext = preg_replace(
					array(
						'@<head[^>]*?>.*?</head>@siu','@<style[^>]*?>.*?</style>@siu','@<script[^>]*?.*?</script>@siu','@<object[^>]*?.*?</object>@siu',
						'@<embed[^>]*?.*?</embed>@siu','@<applet[^>]*?.*?</applet>@siu','@<noframes[^>]*?.*?</noframes>@siu',
						'@<noscript[^>]*?.*?</noscript>@siu','@<noembed[^>]*?.*?</noembed>@siu',

						'@<((br)|(hr))@iu','@</?((address)|(blockquote)|(center)|(del))@iu','@</?((div)|(h[1-9])|(ins)|(isindex)|(p)|(pre))@iu',
						'@</?((dir)|(dl)|(dt)|(dd)|(li)|(menu)|(ol)|(ul))@iu','@</?((table)|(th)|(td)|(caption))@iu',
						'@</?((form)|(button)|(fieldset)|(legend)|(input))@iu','@</?((label)|(select)|(optgroup)|(option)|(textarea))@iu',
						'@</?((frameset)|(frame)|(iframe))@iu',
					),
					array(
						' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',"\n\$0", "\n\$0", "\n\$0", "\n\$0", "\n\$0", "\n\$0","\n\$0", "\n\$0",
					),
					$text );

	return strip_tags($strippedtext);
}

echo stripHtmlTags("<div><strong>blog.totusinfo.com</strong></div>");
 

CSS unicode-bidi using html

Posted by druva | CSS, HTML, utils | Thursday 18 December 2008 7:03 am

This code shows how to display text with different reading directions


<html>
	<body>
		<p style="direction:rtl;">
			Text using right to left direction
		</p>

		<p style="direction:rtl; unicode-bidi:bidi-override">
			Text using right to left direction and unicode-bidi
		</p>
	</body>
</html>