img-cld-net

Today the ipinfodb server went down, creating disruption in all these applications that use the service for identifying a user’s location via their IP address.

The script provided by ipinfodb, does not have a timeout option, resulting in the function hanging for 30 seconds or more (depending on your PHP time out settings.)

The solution: Continue reading

screen-shot-2010-04-08-at-70411-pm

The Mobile Content Switch Plugin is a free Joomla Plugin that will enable you to hide or show content depending if the user is visiting your site from an iPad, iPhone, iPod Touch, or not.

Great to display an embedded Flash video  for non-Apple mobile devices, and a QuickTime movie for Apple mobile devices, or other such uses.

(Thanks to Peter van Westen from www.nonumber.nl for the help with regex)

Usage:

  • {ipad}Display content to visitors ON an iPad.{/ipad}
  • {noipad}Display content to visitors NOT on an iPad{/noipad}
  • {iphone}Display content to visitors ON an iPhone or iPod touch.{/iphone}
  • {noiphone}Display content to visitors NOT on an iPhone or iPod touch.{/noiphone}
  • {applemobile}Display content to visitors in EITHER an iPad, an iPod, or an iPhone{/applemobile}
  • {noapplemobile}Display content to visitors in NEITHER an iPad, an iPod, or an iPhone{/noapplemobile}
  • {android}Display content to visitors on an Android device{/android}
  • {blackberry}Display content to visitors on an BlackBerry{/blackberry}
  • {palm}Display content to visitors on an PalmOS device{/palm}
  • {sonyericsson}Display content to visitors on an SonyEricsson (Nokia) device{/sonyericsson}
  • {symbian}Display content to visitors on an SymbianOS device{/symbian}

joomla_commpow_sm

Important Notes: (updated June 6, 2010)

  • Set in  Global Configuration > Systems > Cache = no for the plugin to work, otherwise what you will see is the cached version of the article, which may have been generated by a device other than the one you are viewing the article on.
  • If you have caching enabled, and your content is in a module, make sure to set the module not to be cached (advanced parameters > caching)
  • If you use the plugin  in a module, make sure that the module is capable of running plugins (such as mod_placehere)

Changelog

Version 2.1 – August 11, 2011

  • Support for Joomla 1.6 (Thanks to Louis Carlos)
  • Added {mobile}{/mobile} {nomobile}{/nomobile} parameters (Thanks to @Mano)

Version 1.7 – January 29, 2011

  • Added support for Android, Palm, Blackbery, Symbian, Palm, and Sony Ericsson

Version 1.6 – June 16, 2010

  • Resolved an issue with iPhone compatibility
  • To upgrade, unzip the plugin and copy the mobilecontentswitch.php and mobilecontentswitch.xml files to /plugins/content

Download the Mobile Content Switch Plugin for Joomla 1.5

Download the Mobile Content Switch Plugin for Joomla 1.6

Found the plugin useful?

All proceeds will be donated to Words of Peace Global

The CalDAV specification has been under development for a few years now, and now there is an open source solution for shared calendaring implementations.

The authors of DAViCal have evaluated the possibilities for shared calendaring,  and have elected to follow the path of implementing CalDAV because they believe it is a good specification and that it will in due course gain client implementations and provide the richest user experience through those client implementations. CalDav extends on WebDAV.

CalDAV is a client-server protocol specific to managing and reporting on collections of calendar resources. In this implementation the authors have chosen to use the Apache web server because it is also widely available. They have also chosen to use the PostgreSQL database, because it is a free, open-source database, which operates on a very wide set of operating environments, and which is fully ACID compliant.

If you have a need, not only to subscribe to shared calendars, but to be able to set permissions to different users and groups of users, such as read/write, read/only (i.e. subscribe), or busy/not-busy, DAViCal is for you.

It works with many Calendar clients such as:

DAViCal CalDAV Server was conceived and written by Andrew McMillan, who can be contacted in IRC (irc.oftc.net#davical).

Links: Home pageWiki

More about the iCalendar standard.

Sphider, the open source PHP spider (aka Web crawler) and search engine, uses the fsockopen() function to get files that are spidered. This means that if the site you are spidering is protected via .htaccess or the Apache directive to protect realms, Sphider will return a “401 unreachable” error when attempting to fetch files during spidering and indexing.

To enable Sphider to access files in a protected realm, we need to modify the functions url_status and getFileContents.

First, create a user such as “sphider” and assign it a password via the shell…

htpasswd yourhtaccessfile sphider

… and provide a password when prompted. This user will be used exclusively for Sphider.

Then, modify the functions in /admin/spiderfuncs.php:

getFileContents function

Replace:

$request = "GET $path HTTP/1.0\r\nHost: $host$portq\r\nAccept: $all\r\n
           User-Agent: $user_agent\r\n\r\n";

with:

$user="sphider";
$pass="abc12345";
$request = "GET $path HTTP/1.1\r\nHost: $host$portq\r\nAuthorization: Basic "  . 
           base64_encode ("$user:$pass") . "\r\n\r\n" .  
           "Accept: $all\r\nUser-Agent: $user_agent\r\n\r\n";

url_status function

Replace:

$request = "HEAD $path HTTP/1.0\r\nHost: $host$portq\r\nAccept: $all\r\n
           User-Agent: $user_agent\r\n\r\n";

with:

$user="sphider";
$pass="abc12345";
$request = "HEAD $path HTTP/1.1\r\nHost: $host$portq\r\nAuthorization: Basic "  . 
           base64_encode ("$user:$pass") . "\r\n\r\n" .  
           "Accept: $all\r\nUser-Agent: $user_agent\r\n\r\n";

The user and password will not be visible to users, as it used solely during indexing.

Download this mod for Sphider (1.3.4)

Download this mod for Sphider Plus (1.6)

Sphider is an open source lightweight web spider and search engine written in PHP, using MySQL as its back-end database. It is used widely in thousands of sites an can be easily expanded to support searching Adobe PDFs and Word docs.

More info here: http://www.sphider.eu/

The mod

Off-the-shelf, Sphider only returns one portion of a document in which the searched keyword is found. With this mod, Sphider will display as many as 5 portions of a document instead:

replace lines 564 to 572 in searchfunctions.php:

$begin_pos = max(0, $places[$begin] - 30);
$fulltxt = substr($fulltxt, $begin_pos, $desc_length);
if ($places[$begin] > 0) {
	$begin_pos = strpos($fulltxt, " ");
}
$fulltxt = substr($fulltxt, $begin_pos, $desc_length);
$fulltxt = substr($fulltxt, 0, strrpos($fulltxt, " "))  ;
$fulltxt = $fulltxt;

}

with this:

$tempfulltxt ="";
$begin_pos = max(0, $places[$begin] - 30);
$tempfulltxt = substr($fulltxt, $begin_pos, $desc_length);

if ($places[$begin] > 0) {
	$begin_pos = strpos($tempfulltxt, " ");
}

$tempfulltxt = substr($tempfulltxt, $begin_pos, $desc_length);
$tempfulltxt = substr($tempfulltxt, 0, strrpos($tempfulltxt, " "))  ;
$text_a = "<ul><li>" . $tempfulltxt . "</li>";

$idx = 0;

while ($idx < count($places) && $idx < 5) {

	if ($idx <> $begin) {
		$tempfulltxt ="";
		$begin_pos = max(0, $places[$idx] - 30);
		$tempfulltxt = substr($fulltxt, $begin_pos, $desc_length);

		if ($places[$idx] > 0) {
			$begin_pos = strpos($tempfulltxt, " ");
		}
		$tempfulltxt = substr($tempfulltxt, $begin_pos, $desc_length);
		$tempfulltxt = substr($tempfulltxt, 0, strrpos($tempfulltxt, " "))  ;
		if ($tempfulltxt<> "")
			$text_a .= "<li>" . $tempfulltxt . "</li>";
	}		

	$idx++;

}

}

$fulltxt= $text_a . "</ul>";
$text_a="";

Download this mod