I’ve hacked this plug-in. If you want it to work with spaces, you can now enter an underscore (_) in the name= field and spaces will be replaced. Just add the following line of code to the .php file for the plug-in:

#HACK - Elana Shenton - http://www.clampcampus.com
#Replace all underscores with a space for nicer display on page.
$name=str_replace(’_',’ ‘,$name);

This should go right before this comment in the code:

#create the span and div to replace the ‘pracut’ tag

I also changed the words ‘View’ and ‘Hide’ to ‘+’ and ‘-’. Then changed the style so the + and - were no longer underlined and set the font to a fixed width font (Courier) so they don’t move around. Here’s the new code:


#create the span and div to replace the 'pracut' tag
#HACK - Elana Shenton - http://www.clampcampus.com
#Change the words 'View' and 'Hide' to '+' and '-' respectively.
#Change the font on the '+' and '-' to Courier and remove underline.
#Only the name is underlined.

$viewspan="<span id='V$id'
style='display:inline;cursor:pointer;cursor:hand;'
onclick=\"this.style.display='none';
document.getElementById('D$id').style.display='block';
document.getElementById('H$id').style.display='inline';\"><span style='font-family: Courier;'>+ </span><span style='text-decoration:underline;'>$name</span></span>";

$hidespan="<span id='H$id'
style='display:none;cursor:pointer;cursor:hand;'
onclick=\"this.style.display='none';
document.getElementById('D$id').style.display='none';
document.getElementById('V$id').style.display='inline';\"><span style='font-family: Courier;'>- </span><span style='text-decoration:underline;'>$name</span></span>";

And the final product looks like this:

+ Sample Hide Code

 

 

Join me at: SparkPeople.com

Get a Free Online Diet

 

 

 




Spam Karma 2 has sent 76586 comments to hell and 75 comments to purgatory. The total spam karma of this blog is -2753. What's your karma?