Jump to content
Paul C

New free module - PS_Cumulus (Tag Cloud)

Recommended Posts

I was looking for an idea for a new series of Prestashop articles and came across the WP_Cumulus plugin for Wordpress. Here's a WP_Cumulus port to Prestashop - enjoy!

Note that this has only been tested (minimally) on the latest 1.2 final release.

Paul

Share this post


Link to post
Share on other sites

This is perfect. Thank you very much.

Share this post


Link to post
Share on other sites

Yes probably, but you'd need to decide on how you would want to select the pictures to display. I guess you could use it to display the "cover" images for all the featured products, with links, of course.

Would need a better idea of what you're trying to achieve with it - or I guess it could be left as an xml input which you would hand craft in the module directory?

On the PS_Cumulus module - I've had another little play with it and am adding the following "extras" as we speak:

- Enable/Disable "compatibility mode" - This uses one of two methods to embed the flas, should there be problems with display using the standard method. It also works even when javascript is disabled (but flash installed) - not terribly useful for PrestaShop as by default the store needs javascript enabled. It may help someone somewhere though.

- Display "Legacy" tags when flash doesn't work/isn't installed. A tag cloud likely makes no perceptible difference to SEO but why not eh?

- Fixed the class assignments to the links, and added a css file to let you style the links when Flash isn't used (default just proportionally increases the font size from 9px to 18px).

- Added the modules own tag query function and added the option to sort by tag name, frequency (times) or "none". Also an option to specify the sort direction as ascending or descending. This will only have an effect on the non-Flash display.

I think that's all for now :cheese:

Paul
I'll upload the new version to my site later today, when the changes are finished - look for version 2.1.21; if it isn't there, then come back later!

Share this post


Link to post
Share on other sites

Open the zip archive and you'll find a ps_cumulus folder inside - copy this folder into the modules directory of your store (using ftp) and it will appear in the list of modules when you look under the modules tab in your Back Office.

Click install and then configure the settings to suit your colour scheme and it will appear at the bottom of the right column - use the positions feature under modules to move it, or the transplant system to move it to the left, top, home page or footer as required.

Note that you can only have one active at any one time, so you'll have to remove it from the right column if you want it to display somewhere else.

Paul

Share this post


Link to post
Share on other sites

it does not show in moduls when i put the folder in site/moduls

Share this post


Link to post
Share on other sites

it most certainly should do! Are you sure that you've copied the folder inside the Zip archive? you should have a modules/ps_cumulus folder that contains files, and not another subfolder.

Paul

Share this post


Link to post
Share on other sites

I took the photowidget folder with all files and folders inside and copied into tha moduls folder, and nothing show in back office moduls section

Share this post


Link to post
Share on other sites

Really really good little thing :)

May I suggest the following :

in ps_cumulus.php, hookHeader() : do what hookRightColumn() now does, i.e. :

   public function hookHeader($params)
   {
       global $smarty;

       $options = unserialize(Configuration::get($this->name.'_options'));
       $numberTags = $options['nTags'];
       $tags = $this->getMainTags(intval($params['cookie']->id_lang), $numberTags, ($options['sortby'] === 'none' ? '' :  $options['sortby']), ($options['sortdir'] == 'true' ? 'DESC' : 'ASC'));
       if (!sizeof($tags))
           return '';
       $maxFontSize = $options['maxFont'];
       $minFontSize = $options['minFont'];
       $maxNumber = 0;
       foreach ($tags AS $tag)
           $maxNumber = max($maxNumber,intval($tag['times']));

       $classPrefix = 'tag-link-';
       foreach ($tags AS $tag)
       {
           $tag['fontSize'] = floor(($maxFontSize * $tag['times']) / $maxNumber);
           if ($tag['fontSize'] < $minFontSize)
               $tag['fontSize'] = $minFontSize;
           // 2nd version: use CSS class
           $cssSizeclass = round($maxNumber/$tag['times']);
           if ($cssSizeclass>10)
               $tag['class'] = $classPrefix.'10';
           else
               $tag['class'] = $classPrefix.$cssSizeclass;
           $tagcloud.= urlencode(''.$tag['name'].'').'
';
       }

       $smarty->assign('code', $this->ps_cumulus_createflashcode($tagcloud)) ;
       return '<link media="all" type="text/css" rel="stylesheet" href="'._MODULE_DIR_.$this->name.'/ps_cumulus.css"/>';
   }



hookRightHeader becomes :

   public function hookRightColumn($params)
   {
       return $this->display(__FILE__, 'ps_cumulus.tpl');
   }



and add a ps_cumuls.tpl, for example (directly coming from blocktags, because I'm lazy) :

<!-- Block ps_cumulus module -->

{l s='Tags' mod='blocktags'}


{if $tags}
   {$code}
{else}
   {l s='No tags specified yet' mod='blocktags'}
{/if}



<!-- /Block ps_cumulus module -->



Should work ...

Share this post


Link to post
Share on other sites

The reason I didn't use a tpl file was because it doesn't serve any great purpose (doesn't really add any useful function), but does result in a performance hit on your server ;)

You should be able to do any css styling you need with the markup that's there :)

Paul

Share this post


Link to post
Share on other sites

Oh, ok.
So let's say that it's a needed modification only if you have to embed the block cumulus inside another block :P

Share this post


Link to post
Share on other sites

I should maybe add two configuration options then that are:

'HTML Before' and 'HTML After' :cheese: then the default div that's currently surrounding it would be the default value for this, and you could specify any div, class or id you want.

The markup for the actual cloud is tied to the Flash in this case, but yes, it would be handy to be able to modify the "wrapper" code around the "fixed" bit.

Does that sound like a reasonable compromise?

Paul

Share this post


Link to post
Share on other sites

(Becomes difficult to understand for me, english is not my native language. Feel free to laugh :lol: )

I noticed that the flash is already in a div#wpcumuluscontent. I guess this is the default div you are speaking about.
My idea was to do something like in this thread : http://www.prestashop.com/forums/viewreply/81561/ but displaying a dynamic content (any block in fact, so I have to call a tpl that is "loaded" in the header ... see ?) instead of a fixed one.

Well ... I hope my english is not too ugly and that you can understand at least a little bit :red:

Share this post


Link to post
Share on other sites

I tried to download the module linked to that post, but I get an error that it's corrupted!

Paul

Share this post


Link to post
Share on other sites
it most certainly should do! Are you sure that you've copied the folder inside the Zip archive? you should have a modules/ps_cumulus folder that contains files, and not another subfolder.

Paul


I did it that way, but nothing happens. I cant see the module in the backend :-(

Edit: My fault, i was to blind to see it. Sorry.

Share this post


Link to post
Share on other sites

@quatangsangtao.com: It should just work when you turn it on, so no, there's no extra configuration required. I think though that there's a problem using this with non-latin character sets - it's a flash thing, so not something that's going to get fixed any time soon. I'll have a dig and see if that's the case, but I fear it just isn't going to work for you :(

@kdk: Glad you found it :)

Share this post


Link to post
Share on other sites

Hello There,

Unfortunetly I am having problems with this module. I have installed it, and it is hooked half way up the left column of my shop. Even though there is a gap where the module should be, it is completely blank.
I have not used tags before so I am a bit uncertain how to use them. I imported a csv product file wiith a column labelled 'tags' with content in it. The item imported succesfully, even so this content does not show on the tag cloud either and it remains blank.

Any ideas?

Share this post


Link to post
Share on other sites

Does anything show when you enable the original tags module?

Paul

Share this post


Link to post
Share on other sites

That's weird. What version are you using? I've tested only up to 1.2.0.8 (can't keep up with testing these days with the increased update rate!). I'm upgrading my test stores to 1.2.1.0 at the moment so may discover the problem before I see your reply ;-)

Another thought is whether you;re using the default settings? The "transparent" mode for example just gives me a blank box on my browser (the setting was copied unmodified from the WP original). Trying the legacy mode setting may also be worth a shot, depending on what version of the flash plugin you're using.

Paul

Share this post


Link to post
Share on other sites

Paul,

I'm running Prestashop v1.1.0.5, and have tried the module with and without compatibility and with and without transparency.
All times it unfortunetly shows nothing. :-(

Share this post


Link to post
Share on other sites

It was really written for 1.2 onwards, so the format of the tags has obviously changed from 1.1 -- it's almost impossible to keep things working across the versions due to the amount of change involved in each upgrade I'm afraid.

Share this post


Link to post
Share on other sites

Paul,

OK. I shall test it out on my v1.2 test shop.
Even so, thanks for a very good module, excellent idea to port this from Wordpress!

Share this post


Link to post
Share on other sites

encoding problem. got hack attemp when using html special characters, moreover not showing those foreign letters in flash. (should embed font in flash)

Share this post


Link to post
Share on other sites

Hey,

I use the last release of Prestashop (V1.2.2).

When i Use this module, I've got this error :

Notice: Undefined variable: tagcloud in E:\Program Files\EasyPHP 3.0\www\prestashop\modules\ps_cumulus\ps_cumulus.php on line 363

Anyone can help me ??

PS : Sorry for my english, I'am French ;)

Share this post


Link to post
Share on other sites

Hi,

to solve the problem which occurs line 363 , modify the ps_cumulus.php file by adding $tagcloud=''; at the top of the hookRightColumn function (line 338, see below):

public function hookRightColumn($params)
{
$tagcloud='';


Patrice

Share this post


Link to post
Share on other sites

that didn't work patrice, in fact, it breaks the back office module area as well. and in the front office you get a parse error. And yes, i did it exactly as you said. Thanks for trying though

Share this post


Link to post
Share on other sites

Hi mr-c,

it does work well...

Be careful: it's $tagcloud=’‘; (like $tagcloud=’ '; without space between ' and ' ) and not $tagcloud=^;

Patrice

Share this post


Link to post
Share on other sites

The Module isn't displaying at all on my site, the install seemed fine and the settings seem fine. Everything seems fine at the BO really. On FO, nothing shows at all, not even a space where the module should be. I've tried all the different settings, and tried changing the position. I'm running PS version 1.2.1.0

Thanks

Share this post


Link to post
Share on other sites

As Patrice75 says add the following BEFORE line 340 in ps_cumulus.php:

$tagcloud = "";



Double or single quotes work equally well, but this forum doesn't like plain single quotes!

The code around this will now look like:

    public function hookRightColumn($params)
   {
       $tagcloud = "";
       $options = unserialize(Configuration::get($this->name.'_options'));



I'll update thee version on my site in the next day or so, but right now I need to get some sleep ...

Paul

Share this post


Link to post
Share on other sites

On the issue of fonts. Quoted from the original author (remember this is a port, and NOT my original work!!)

Some characters are not showing up
Because of the way Flash handles text, only Latin characters are supported in the current version. This is due to a limitation where in order to be able to animate text fields smoothly the glyphs need to be embedded in the movie. The plugin download includes the Flash movie’s source code, which wil allow you to create a version for your language. There’s a text field in the root of the movie that you can use to embed more characters. If you change to another font, you’ll need to edit the Tag class as well.

Share this post


Link to post
Share on other sites

Thanks Paul C.

Just for info, in local with easyphp I've got this error and I try in line to free.fr, and here, no problem.

Thanks for your module and sorry for my English :)

Share this post


Link to post
Share on other sites

Hi many thanks for this module and many many thanks to Patrice and Paul C for resolved the 363 line bug !!!

have a good day

Share this post


Link to post
Share on other sites

Hello,
thanks Paul for this great module and other persons for the helpful hints.

I have embedded the cumulus block into another like this and seems to work fine.

line366:

$code = ''.$this->ps_cumulus_createflashcode($tagcloud).'';
       return $code;

Share this post


Link to post
Share on other sites

Hello,

when i switch language the module isn't showing in the frontpage and reappear when i switch back to the previous language.

Is there a solution for that ?

Share this post


Link to post
Share on other sites

Ne marche pas chez moi... Presta 1.2.4 !!
Il s'affiche dans le BO, quand je l'active rien ne se passe (marqué non activé), si j'actualise la page, la il est bien activé.
Mais rien ne s'affiche coté FO !!
Dommage cela avait l'aire sympa.

Share this post


Link to post
Share on other sites

Bjr:
J'ai installe le module sur la ver. 1.2.3 et ver. 1.2.4 et ca marcha tres bien. Vous pouvez le voir sur mon site de preuve www.doggieydog.com
A+

Share this post


Link to post
Share on other sites

Is there a way to put this module inside a block div? I want to have a header saying "recent searches", so it fits nicer with the theme. I made a tpl with

 
Recent searches

{$code}




But $code doesn't come up, any ideas?

Share this post


Link to post
Share on other sites

Hi, nice module i love it !!

I just notice one thing, when i click on a picture to zoom, cumulus stay in front of the zoom, someone has the same issue ?

thanks

12963_1xv6OqyV5sKcUO5Nzw0I_t

Share this post


Link to post
Share on other sites
Hi, nice module i love it !!

I just notice one thing, when i click on a picture to zoom, cumulus stay in front of the zoom, someone has the same issue ?

thanks



Same problem for me. I love this module but I disabled it because of this. I really hope someone finds out a way to correct this bug.

Cheers

Share this post


Link to post
Share on other sites

Yeaaaaahhh thanks Trip i read the article and begin to look in the code and in fact there is an option in cumulus module directly inside prestashop : "Use transparent mode" i checked it and it works now !!!

Share this post


Link to post
Share on other sites

Hi!

Great module thanks!

I have some problem, I have some tags and the problem is, if I click on it no results get except for one tag. How could it possible, what could be wrong??
I use some characters because my language, most of them displayed like "á, é"; "ő" is not.. I didn't tested the more character (í,ö,ú) just these yet..
I changed the names, tags without characters "á,é".. but still don't get result...
I use latest PS 1.2.4

HELP! :)

Share this post


Link to post
Share on other sites

To correct links with special characters (à,í, etc)

Line 363 ps_cumulus.php

change

$tagcloud.= urlencode(''.$tag['name'].'').'
';



to

$tagcloud.= urlencode(''.$tag['name'].'').'
';



cheers.

Share this post


Link to post
Share on other sites

Hey, Thanks a lot!

I changed to your code:
(I had there
) I dont know what is that do, but i had to leave there to work without error in the back office)

$tagcloud.= urlencode(''.$tag['name'].'').'
';

Now the links are working perfectly! Just don't shown those characters (example: ő, ű) on the cloud :(

Any idea?

Share this post


Link to post
Share on other sites

hi

does this module work in Version 1.1.0.5 of prestashop
I have added the module and put it in the right hand column and its there but theres nothing in it its just white. It comes up with the creators link when you right click it.

I turned on prestashops own tag module and that displays tags but this flash one doesnt and i really want it!!!

I cant seem to get prestashop to update to 1.2 version it just destoys the whole shop i have tried it 6 times so i have given up with that.

Share this post


Link to post
Share on other sites

Can someone here plx tell me what the tagclaude does good fore?

Share this post


Link to post
Share on other sites

I've incorporated this module with our site since v1.2.5, but recently noticed that it does not work with Firefox v.3.6.8. Nothing appears, I've tested it on 2 different computers... still works on the older FF versions and IE as far as I know.

Is there a fix or update?

Thanks!

Share this post


Link to post
Share on other sites

And how do would work in utf8?

that is visible tags only in English - and I wish that would have been Cyrillic

Share this post


Link to post
Share on other sites

Reply to Fant63 - but with some modifications solution should work also for other characters:

follow the like below and download files from there. Than copy tagcloud file (the one you need) and paste it into module map (replace).
Now should work perfectly.

link for slavic (ex-yu) characters:
http://blog.avramovic.info/2009/08/22/wp-cumulus-i-nasa-slova/

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for making this mod available :-)

The only improvement I can see would be to add a block header ('Tag Cloud' or similar) to match the rest of the block headers in PS.

If anyone has problems seeing this in Firefox, make sure you don't have any ad blocker add-ons installed - the mod uses the 'advertising_block' class, which AdBlock Plus (et al) picks up on and disables.

If you do have problems (and maybe your customers too), copy the 'advertising_block' class in your global.css and rename it to something like 'tag_block' (you'll also need to change the class in ps-cumulus.php to 'tag_block', of course) and you should be ok.

Share this post


Link to post
Share on other sites

has anyone tried to modify this to work on shop search instead of tags? I'd like to create a tag of most popular shop searches.

I think it would be this section that would need to be modified:


private function getMainTags($id_lang, $nb = 10, $sortby = 'times', $sortdir = 'DESC')
   {
       global $cookie;

       return Db::getInstance()->ExecuteS('
       SELECT t.name, COUNT(pt.id_tag) AS times
       FROM `'._DB_PREFIX_.'product_tag` pt
       LEFT JOIN `'._DB_PREFIX_.'tag` t ON t.id_tag = pt.id_tag
       LEFT JOIN `'._DB_PREFIX_.'product` p ON p.id_product = pt.id_product
       LEFT JOIN `'._DB_PREFIX_.'category_product` cp ON (cp.`id_product` = p.`id_product`)
       INNER JOIN `'._DB_PREFIX_.'category_group` ctg ON (ctg.`id_category` = cp.`id_category`)
       INNER JOIN `'._DB_PREFIX_.'customer_group` cg ON (cg.`id_group` = ctg.`id_group`)
       WHERE id_lang = '.intval($id_lang).'
       AND p.active = 1
       AND (cg.`id_customer` = '.intval($cookie->id_customer).' OR ctg.`id_group` = 1)
       GROUP BY t.id_tag ' .
       ($sortby!='' ? 'ORDER BY '.$sortby.' '.$sortdir : ''). 
       ' LIMIT 0, '.intval($nb+1));
   }



if there is a module that does this already, could someone point me to it? thank you :)

Melinda

Share this post


Link to post
Share on other sites

@Pixel and others ;)

Hi!
Have you managed to create a header to this module ?
I don't dare to modify the .PHP without advice

Thx

Share this post


Link to post
Share on other sites

Hey,

very cool widget for prestashop! we also use it here my-sicherheit.de

but we have one problem, it generates "spaghetti-code".

###########################
ir
profi
infrarot
vandalismus
nacht
wlan
vandalen
sanyo
nachtsicht
Außen
###########################

thats way to much information, for exampe the size is already set by "tag-link-x" so the "font-size" is not needed, or?
is it possible to remove just the part / style="font-size:x;" / ?




i guess its here to find and fix, but im to stupid (really) to fix it by my own :(

if you have any ideas, let them floooow :)



###########
public function hookRightColumn($params)
{
$options = unserialize(Configuration::get($this->name.'_options'));
$numberTags = $options['nTags'];
$tags = $this->getMainTags(intval($params['cookie']->id_lang), $numberTags, ($options['sortby'] === 'none' ? '' : $options['sortby']), ($options['sortdir'] == 'true' ? 'DESC' : 'ASC'));
if (!sizeof($tags))
return '';
$maxFontSize = $options['maxFont'];
$minFontSize = $options['minFont'];
$maxNumber = 0;
foreach ($tags AS $tag)
$maxNumber = max($maxNumber,intval($tag['times']));

$classPrefix = 'tag-link-';
foreach ($tags AS $tag)
{
$tag['fontSize'] = floor(($maxFontSize * $tag['times']) / $maxNumber);
if ($tag['fontSize'] < $minFontSize)
$tag['fontSize'] = $minFontSize;
// 2nd version: use CSS class
$cssSizeclass = round($maxNumber/$tag['times']);
if ($cssSizeclass>10)
$tag['class'] = $classPrefix.'10';
else
$tag['class'] = $classPrefix.$cssSizeclass;
$tagcloud.= urlencode(''.$tag['name'].'').'
';
}

$code = $this->ps_cumulus_createflashcode($tagcloud);
return $code;
}
#################

Share this post


Link to post
Share on other sites

Hi,

I have upgraded to 1.4.5.1 and have the followying errors displayed in BO->Modules :

The following module(s) couldn't be loaded:
ps_cumulus (parse error in /modules/ps_cumulus/ps_cumulus.php)
ps_cumulus (class missing in /modules/ps_cumulus/ps_cumulus.php)

The module works though on site.

Any idea, please ?

Share this post


Link to post
Share on other sites

Hello

end of line to:

 

ps_cumulus.php

 

Changing

// End of: ps_cumulus.php

 

To

/* End of: ps_cumulus.php */

 

best regards

Share this post


Link to post
Share on other sites

Hey, Thanks a lot!

I changed to your code:

(I had there

) I dont know what is that do, but i had to leave there to work without error in the back office)

$tagcloud.= urlencode(''.$tag['name'].'').'

';

Now the links are working perfectly! Just don't shown those characters (example: ő, ű) on the cloud :(

Any idea?

 

Please someone found a solution?

Share this post


Link to post
Share on other sites

Hello,

I have installed the cloud, but can't move it to the left??! column.

i use ps 1.4.5.1

Share this post


Link to post
Share on other sites

Solved! I have made a new hook in the left column and delete the old one on the right.

 

Also thanks to cardeal, your solution work for me also.

Share this post


Link to post
Share on other sites

tnx for the module.

 

any idea how i can get it in a block ( same as all blocks on a side ) with a name header?

Share this post


Link to post
Share on other sites

To solve the problem with the module that doesn't want to move from his original position, you need to go to BO/Modules/Positions and before your listed modules, look for +Move modules options, and from there you need only to select Cumulus Module for Prestashop and on wich side to move.

 

:)

Share this post


Link to post
Share on other sites

Hello and tanks for this great module

i have noticed that this module is active only when users are login in, but if a guest visit my store until he lgin in the account he will no be able to see the module

 

Is this module only visible to clients that have login? and not to guest without login?

 

 

Tanks

Share this post


Link to post
Share on other sites

A bit of a time gap but.....

 

I have same issue as Majority in that the module only seems to appear once login. Majority did you get yours fixed ?

 

Info for others perhaps. I also had install problems (Caprice)

I needed to added ?> at end of ps_cumulus.php file and it installed OK.

 

Hope someone still watching this item.

Regards

Share this post


Link to post
Share on other sites

hey kred59 and majority did you guys get the solution for the login problem?

No, sorry, unfortunately i'm busy with other bugs... :unsure:

Share this post


Link to post
Share on other sites

hey kred59 and majority did you guys get the solution for the login problem?

 

No success as yet...can only get module to work if customer logged in :unsure:

Edited by kred59 (see edit history)

Share this post


Link to post
Share on other sites

No success as yet...can only get module to work if customer logged in :unsure:

 

UPDATED

I have managed to SOLVE Tag Cloud working on PS 1.5.4..

 

/modules/ps_cumulus/ps_cumulus.php I REMOVED 2 lines from SELECT code within private function getMainTags

 

Line 646

INNER JOIN `'._DB_PREFIX_.'customer_group` cg ON (cg.`id_group` = ctg.`id_group`)

Line 652

AND (cg.`id_customer` = '.intval($cookie->id_customer).' OR ctg.`id_group` = 1)

 

As far as aware lines refer to customer and customer group which I do not believe are needed (please point out if I'm wrong)

After removal of these lines the Tag Cloud shows whether Customer is logged in or not and is fully operational.

 

Edit - I should say I solved issue with Cumulus Tags when customer logged in or not. There may be other issues for people. My Tag Cloud can be seen at www.AdultToyLounge.co.uk on left column

(ADULT SITE BE WARNED OVER 18 !!)

Edited by kred59 (see edit history)

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More