Friday, August 28, 2009

Refereshing PHP

It was a really nice experience doing a internal website for Mubasher.... I was able to recall lot of stuff which i learned ealier.. also new things. It was a wordpress customization and whist doing it i came across some cool plugins which i think might b worth sharing and also some little code modifications aswell.

Plugins:

WP-Table Reloaded - excellent plugin for table creation and it allows you to sort the table content as well.
wp-dtree-30 - This is one of the nice sidebar widget shows expand/collapsing links

WP-Highslide- this is also a awsome plugin which ucan use instead of a pop-up or even thickbox. You have multiple options and also examples of usage


Tips:
1.When you click on the image iframe, the parent image get hidden. Solution is to go to the highslide.css and change the property of .highslide-active-anchor to visible
2. To hide sidebar from multiple pages use the following code (page IDs are 451, 714):

<?php if (is_page('451')|('714')) : ?>
<?php else : ?>
<?php get_sidebar(); ?>
<?php endif; ?>



3. I had to use a collapsing and expanding table within a highslide and i used the following java ascript which helped me to get this job done:

< script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"> </script >
< script >
$(function() {
$('tr.parent')
.css("cursor","pointer")
.attr("title","Click to expand/collapse")
.click(function(){
$(this).siblings('.child-'+this.id).toggle();
});
$('tr[@class^=child-]').hide().children('td');
}); </script >

<table id="detail_table" class="detail wp-table-reloaded" border="0" > <caption > <strong > Click on the Request to Expand </strong > </caption >
<tbody >
<tr id="row1" class="parent" >
<td >Authentication Request </td >
</tr >
<tr class="child-row1" ?>
<td >Tag</td >
<td >Field</td >
</tr >
<tr class="child-row1" >
<td >9</td >
<td >User Name</td >
</tr >
</tbody ></table >

1 comment:

Unknown said...

Thanks for sharing this information with us good Job.