WP-Print – show me the link ONLY!

I had to use a WP-Print for a recent WordPress project and, because the way i work, i started to search for plugins AFTER the psd was converted into html and a big part of code was already up & running. So, i downloaded latest version of WP-Print and I tried to use a basic setup:


The problem is that the plugin display the whole link tag (a href="...") and I only needed the href value. I edited wp-print.php (which is inside of you wp-content/plugins/wp-print folder) and i looked for print_link() function.

I saw the function accept three parameters: with first two you can set some extra text and the third (which is boolean) is for setting the way how function behave. So, you can call the function like the previous example or like this:



For showing the way you want. But, because i wanted only the link to that page, i edited wp-print.php and i changed the return of the function when the last parameter was boolean:

if($echo) {
	echo $output."\n";
} else {
	return $output;
}

Became:

if($echo) {
	echo $output."\n";
} else {
	return $print_link;
}

So now, i can use it like this:

  • PRINT !
  • Easy, isn’t it? :)

    E-texteditor and open source

    Yes, is somehow true. E-texteditor goes open source. Or something like that. From Alexander blog post i extracted this:

    • The source will be made available in few days;
    • Even though the source will be public, the software will not be.. free. Licensing code will not be public
    • Yes, there will be (finally!) a linux version. Which will be free :)

    I can only hope that the TEAM will work on three aspects: stability (a lot of bug fixes), speed (sometimes i encounter some “slow motion” when i open large files; also, on old computers will simply… won’t work) and networking (FTP client can be better than that). Also, a 64 bit version would be nice :D

    Let’s wait and see the evolution of the new Open Company.

    Simple jQuery Accordion tutorial

    Today I will show you how you can do a small and very simple – yet powerful – accordion script.

    The html code is very basic and consist in a standard DL/DT/DD structure:

    Title
    Content
    Another title
    Another content

    Because is very possible to want to use this kind of accordion in many places, i did a small function:

    function ntzAccordion(e) {
    	$(e).find('dd').hide();
    	$(e).find('dt').bind('mouseover click', function(){
    		if($(e).find('dd').is(':animated') || $(this).next('dd').is(':visible')) {return false;}
    			$(e).find('dt.opened').removeClass('opened');
    			$(e).find('dd:visible').slideUp('slow');
    			$(this).next('dd').slideDown('slow').end().addClass('opened');
    	});
    	$(e).find('.active').trigger('click');
    };//ntzAccordion
    

    Of course, we don’t forget to call this function on page load:

    $().ready(function(){
    	ntzAccordion($('.ntzAccordion')); // we call function with DL selector as parameter
    });
    

    Let’s see how is made

    1. We find all DD’s inside of the e variable (which is $('.ntzAccordion')) and we hide them;

    2. We bind mouse over and click events on DT. You can have both or none of them (you can use almost all events available on javascipt); Also, we will reffer to current DT as $(this);

    3. If there is a DD which is hiding or showing in that moment, we return false. This way you can avoid odd behaviour and jumps;

    3.1. Also, we check to see if the ‘victim’ (DD) is visible. Again, if this is visible, we return false to avoid repetitive close/open of DD;

    4. We remove .opened class from all DT elements. We use this class to be able to add/change different style for different states of DT;

    5. If there is an opened DD, we close it.

    6. Because we use a structure like DT/DD, the next element right after DT is… a DD (doh!). We slide down that DD and we return back to DT (using .end()) and add the ‘opened’ class. It’s the exactly the one that we remove few steps above;

    7. If you want to have a default element that is opened on page load, this line will do the trick: we trigger an event that is binded few lines above.

    8. You sit back and enjoy :) 8)

    Attention!

    For some reasons that I think is a jQuery bug, you need to add one for those extra CSS for DD’s:

    • float:left;clear:left
    • position:relative
    • height:ZZpx;
    • width:ZZpx

    If you don’t do this way and the DD have padding/margin, you will have a weird (and annoying too!) jump when the accordion expands or contract.

    Also, don’t forget to view source on demo page ;)

    Trhy it!

    Ntz Antispam WordPress Plugin

    Wassup guys?

    I’ve worked a LOT lately and i didn’t have time to do too much things. I know i had promised you some free WordPress themes, but right now I really don’t know when i will launch them.

    Anyhow, few months ago i posted a very effective spam trick. Because that method was somehow hard to apply and everytime you update wordpress or change your theme you had to redo some steps, i though is better to make a plugin for this.

    Is a small plugin, is free to use and redistribute (even i ask you to do so!).

    How to use?

    1. Extract in your wp-content/plugins folder
    2. Activate from your admin area
    3. Watch your spam queue. ZERO. Nothing, NADA!

    How effective is this ?

    I use this trick for over six months. Before I use this, i had around 50 spams/day catched by Akismet. After i put this, i have MAXIMUM five spams/week. Very impressive, isn’t it?

    Dowload from here:

    [download id="1"]

    You don’t have to pay a dime. Anyhow, any link love is well appreciated :D

    Update:

    I also can be found HERE.

    Saturday’s short news&links