are there any plans to port this to Drupal 6?

Comments

jrglasgow’s picture

Status: Active » Needs review
StatusFileSize
new19.37 KB

here is my work porting to D6 - is you need help... I am willing to help as a co-maintainer

lealex’s picture

Thank you, it works for me fine.

I have added the theme function.

$block['content'] = $tag_cloud->getCloud();

replace with

$block['content'] = theme('searchcloud_box',$tag_cloud->getCloud());

added 2 function

function searchcloud_theme() {
  return array(
    'searchcloud_box' => array(
        'arguments' => array('getCloud')
    ),
   );
}

function theme_searchcloud_box($getCloud) {
	return $getCloud;
}
lealex’s picture

StatusFileSize
new1.48 KB

And here is the patch file.

adr1st’s picture

how to instal this D6 patch?
i must download a d5 version serch cloud than patch it or how?
Thx.. completely noobs..

or you can upload it as an full tar.gz file :D

lealex’s picture

StatusFileSize
new9.79 KB

The instruction to apply patches can be found under http://drupal.org/patch/apply.

adr1st’s picture

error on install, but works well. than..

got this error:
warning: Division by zero in /home/***/***.com/modules/searchcloud/classes/tagCloud.class.php on line 98.

obsidiandesign’s picture

StatusFileSize
new12.94 KB

Last month, I created a port for searchcloud to D6, but neglected to upload the patch here (sorry). It works in D6, including the block, but I can't get it to work with the theme patch in #3.

I don't remember what exactly fixed the 'Division by zero' error, but I remember encountering that same error as adr1st in #6. Maybe with a little work, the theme function patch can be incorporated?

Bryan O'Shea
Obsidian Design

lealex’s picture

The theme patch dont effect the install function.

zmove’s picture

Hi,

/subscribe, would be cool to see an official support of the 6.x version of drupal.

jack.r.abbit’s picture

the "Divide by Zero" happens when all terms have the same number of search hits which then breaks the "maxcount - mincount" part of the calculation in Line 98 where it tries to determine the font size. What I did was a few lines before that when you actually calculate the Min and Max, I just calculated the DeltaCount there and made sure that it was at least 1. Then just use the DeltaCount in the formula instead of calculating it each time. The Delta will not change while looping the terms anyway.

I don't know how to make a patch but here is the code snippets to change in tagCloud.class.php:

	private $_iMinCount;
	private $_iMaxCount;
+	private $_iDeltaCount;
	private $_sFinalHtmlCloud;
	private $_iMinimumTagLength;

and

		$this->_iMinCount = $this->_aTermsCounts[0];
		$this->_iMaxCount = $this->_aTermsCounts[count($this->_aTermsCounts)-1];
+		$this->_iDeltaCount = $this->_iMaxCount-$this->_iMinCount;
+		$this->_iDeltaCount = ($this->_iDeltaCount?$this->_iDeltaCount:1);
		// apply the formula for each term:
		for ($i=0; $i<count($this->_aTerms); $i++) {
			if (count($this->_aTerms) > 1) {
-				$this->_aTerms[$i]['font_size'] = intval(((($this->_aTerms[$i]['count']-$this->_iMinCount)*($this->_iMaxFontSize-$this->_iMinFontSize))/($this->_iMaxCount-$this->_iMinCount))+$this->_iMinFontSize);
+				$this->_aTerms[$i]['font_size'] = intval(((($this->_aTerms[$i]['count']-$this->_iMinCount)*($this->_iMaxFontSize-$this->_iMinFontSize))/($this->_iDeltaCount))+$this->_iMinFontSize);
			}
			else {

This module (and D6 patch) work awesome. thnx

CloneVince’s picture

Hello, I tried to patch the package for drupal 5.

the install work, but the link in admin menu disappear.

Can somebody share the full working D6 package ? Here or in list modules, as you want.

Thx :)

perandre’s picture

Good work. Is this patched version stable?

lazly’s picture

Please if this is work made a -dev package.
How can we adopt the module from spinicrus to somebody who want to do this? :\

Bye

marvix’s picture

is it stable to use it with D6 ?

AmrMostafa’s picture

Status: Needs review » Fixed

I've committed a patch based on #1 and #7 with some tweaks. Then committed the division by zero fix in #10.

For the theming issue at #2, I've created a new issue for it #794244 as it deserves special attentions and needs more work IMHO :)

I've created a -dev release for the D6 version, and soon a release candidate (if I get at least one positive feedback) then a release. I'm personally willing to devote the time to quickly get a release out, there are few interesting features we can get there once we get to that state.

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.