Printme

January 8, 2009

New Printme plugin
==============

Printme is an easy to use and simple plugin. enables your bloggers to show their posts in a printer style version.
You just need to create a simple print stylesheet file.

Compatibility:
==============
-wordpress Mu all versions.
-wordpress

Download it from here:

http://wpmudev.org/project/printme

simple calendar script

December 3, 2008

You need to create a simple calendar to be displayed in your website or web applicaiont?

It’s really simple to create a calendar in php, bellow is a small example on how easy it is.

The script gets the current date and builds a table calendar.

You can add day triggers, for example comming from a database, in this case it’s to display a birthdate.

Feel free to use and modify.

****************

<?php
/*
*Calendar script by jorge Alves
* befourdev@gmail.com
* */
$date = time();

$day = date(‘d’, $date) ;
$year = date(‘Y’, $date) ;
$month = ’09’;

#calculate the first day
$first_day = mktime(0,0,0, $month  , 1, $year);

#retrieve the first day
$title = date(‘D’, $first_day);

#Get Month name
$month_name = date(‘F’, $first_day);

#Calculate how many days there are in the month
$days_in_month = date(‘t’,mktime(0,0,0,$month,$month,$year));

#Your birthday birthdate -> you can call any day or add an event::
$birthday = 25;

#Select  on which day of the week it starts the month
switch($title)
{
case “Sun”: $start = 0; break;
case “Mon”: $start = 1; break;
case “Tue”: $start = 2; break;
case “Wed”: $start = 3; break;
case “Thu”: $start = 4; break;
case “Fri”: $start = 5; break;
case “Sat”: $start = 6; break;
}

#Table with our calendar
echo “<table border=1 width=30%>”;
echo “<tr><th colspan=7> $month_name $year  </th></tr>”;
echo “<tr><td width=42>S</td><td width=42>M</td><td width=42>T</td><td width=42>W</td><td width=42>T</td><td width=42>F</td><td width=42>S</td></tr>”;

$counter = 0; // counter for the start fills up the blanks
$rowcounter = 0; //counter for the rows
$daycounter=1; //counter for the month days
echo “<tr>”;
//loop until we reach the end of the month
while ( $daycounter <= $days_in_month )
{
//Draw beginning of row
$output =  ($rowcounter > 6) ?   “<tr>” : “&nbsp;” ;
//resets row counter
$rowcounter = ($rowcounter > 6) ? $rowcounter = 0 : $rowcounter = $rowcounter;
//fill the cells with dates
if  ( $counter < $start )
{
//fill with blank, first day of month starts after
$output .= “<td>&nbsp;</td>”;
}
else
{
//check for birthday
if ($daycounter == $birthday)
{
//prints birthday and adds the daycounter
$output .= “<td style=\”color:blue;\”>$daycounter My Birthday!!</td>”;
$daycounter++;
}
else
{
//prints days and adds the daycounter
$output .=”<td style=\”color:black;\”>$daycounter</td>”;
$daycounter++;
}
}
//Draw end of row
$output .=  ($rowcounter > 6) ?   “</tr>” : “&nbsp;” ;

//echo the calendar
echo  $output;

//ads to rowcounter
$rowcounter++;
//ads to counter
$counter++;
}
//ends calendar table
echo “</table>”;
?>

***********

WordPress Mu development

October 14, 2008

Although WordPress is open source and you can easy check and analyze the code you need more information than that when you are creating your own plugins, themes or hacks.

Thats why I put some links together to help you getting there faster.  They sure helped me. There is lots of information out there, but some times is really hard to find what you really need.

I will start with a site where everybody starts, tons of good tutorials and examples from beginners to more advance, essential information about creating  a wordpress a plugin, theme etc… (Ofiicial also)

http://codex.wordpress.org/WordPressMU

This site contains good information about hooks, filters and actions

http://wphooks.flatearth.org/

This site contains a good tuturial on how to create your own plugin

http://ditio.net/2007/08/09/how-to-create-wordpress-plugin-from-a-scratch/

Most Active Blogs plug in

October 3, 2008

Recently I developed a wordpress Mu called “Most Active Blogs”, this plugin is used as a widget, will appear in your dynamic side bars and enables you to show the most active blogs on your site, includes a link to the blog and the number of Blogs Posts for each blog.

Copy the code below and save it has most ActiveBlogs.php

To install it drop it in your wp mu plugins if yuo want to make this plugin available to your site or drop it in the plugins folder and activate it thru your plugins option on the backend.

If you have any question just send me an email.

Here is the link to download:

http://wpmudev.org/project/most-active-blogs

NOTE:

If your install of wordpress MU is working with sub-directories, change line 90 by this one:

echo ‘<li><a href=”http://&#8217;.$blog[‘domain’]

.$blog[‘path’].'”>’.$blogname.’&nbsp;-&nbsp;’.$blog[‘postcount’].’
posts</a></li>’;
This fix is kindly provided by Stephen Collins

Hi ,

I have developed a small widget for WP and WP MU, its called printeme and it enables  readers to preview the print css version of the page their at, like  printer friendly that you see almost in every media article.

You are able to edit the text to be shown, default is Printer friendly,  you can call it what ever you want 🙂  you can also choose for the printer icon to be shown.

Althoug the installation is very simple and following the standard plugin instalation, you still need to tweak the header of the template with a small php code.

All this is included in a small text readme first file.

If you are interested in this plug in I can make it available for download.