TagCloud for phpwcms [Update v1.9]

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.

Re: TagCloud for phpwcms [Update v1.2]

Postby Jensensen » Wed Aug 06, 2008 19:23

TagCloud (default) delivers wrong links, when you've set "rewrite" on!
The script still is fully functional but you have to change one line of code you shouldn't /needn't to touch - usually.

QUICK-FIX (for sites only using REWRITE):

Change line 96ff:
[x]


ATTENTION:
change --> SEARCH in the code snippet above to your --> page ALIAS of your search page!!!



When there's time, I'll fix...
Thank you.
Last edited by Jensensen on Fri Sep 19, 2008 18:22, edited 1 time in total.
Tip: Watch my avatar full screen at a distance of around 5 meters and keep the [aspect] ratio{nality}.
btw Thanks to Goldener Hirsch Horst has lost.
User avatar
Jensensen
 
Posts: 2685
Joined: Tue Oct 17, 2006 19:11
Location: Rhein-Ruhr-Stever-Verse

Re: TagCloud for phpwcms [Update v1.2]

Postby marketingmensch » Thu Sep 04, 2008 21:13

TagCloud v1.2 works great for me. I used it for a larger site and only a few adjustments brought the cloud to life. Thanks for support in very special questions to Jens!

Regards, Günther
User avatar
marketingmensch
 
Posts: 16
Joined: Fri May 13, 2005 09:01
Location: Berlin, Germany

TagCloud for phpwcms [Update v1.3]

Postby Jensensen » Fri Sep 05, 2008 22:44

TagCloud v1.3 for phpwcms:
This version has some new enhancements again, new variables and it has a (little bit) new concept.
Now it should be easier to manage / control the cloud's output.

Enhancements:
- Content of content part 'WYSIWYG' included to the cloud.
- Works well when you use --> rewrite
- much easier to work with --> Landing Pages (instead of the Search)


New variables:
$inc_or_ex = "0"; // --> can be 0=exclude or 1=include
Switch to 0 or 1 for match cloud against words in exlude or include list.

Words to exclude or include now can be edited in two additional external files:
tagcloud_exclude.php
tagcloud_include.php

Save these files encoded as UTF-8 no BOM !!! (next to the cloud script in the frontend_render directory !!!)


$rw_alias = 'PAGE_ALIAS';
When you use rewrite, then add the page alias of your Search Page here.
(support for rewrite and using landing pages (L-Mode) might follow)


Take care:
Expressions which have less characters than you've set in $min_chars are kicked out of the cloud, even when you've added that word to tagcloud_include.php !!!

Remember:
that you can use the script multiple times on different pages. So, for example, it is possible to publish a dedicated TagCloud for a certain (each) category.


Tip for clean, pretty clouds with many tags that have relevance:
- run script once with $inc_or_ex = "0";
- copy expressions of the cloud
- add the words that have the most importance for you (your audience) to --> tagcloud_include.php
- turn $inc_or_ex = "1";


When you need support or want to get more tips, feel free to ask.
Any feedback appreciated. Thank you.
Have fun with the newest --> Tag Cloud v1.3 for phpwcms...
Tip: Watch my avatar full screen at a distance of around 5 meters and keep the [aspect] ratio{nality}.
btw Thanks to Goldener Hirsch Horst has lost.
User avatar
Jensensen
 
Posts: 2685
Joined: Tue Oct 17, 2006 19:11
Location: Rhein-Ruhr-Stever-Verse

Re: TagCloud for phpwcms [Update v1.3]

Postby Oliver Georgi » Sat Sep 06, 2008 07:35

Just some things: Do never use settings the way you use it in frontend_render. tagcloud_exclude.php/tagcloud_include.php should be part of tagcloud_v1.3.php. Every *.php file located in frontend_render or frontend_init will be included while rendering process!

Your way will icnlude these multiple times and these are 4 times too much (maybe).

Place settings outside of functions for end users:

Code: Select all
$mysetting1 = array();
$mysetting1['a'] = 'something';
$mysetting2 = array();
$mysetting2['a'] = 'something';

foobar($mysetting1);

function foobar(&$settings) {
  $mysettings2 =& $GLOBALS['mysetting2'];
  echo $mysettings2['a'];
  echo $settings['a'];
}


Oliver
Oliver Georgi | phpwcms Developer
Hegerplatz 7, 06846 Dessau, Germany
phpwcms | webverbund.de | LinkedIn | XING | Make it loud!!!
User avatar
Oliver Georgi
Site Admin
 
Posts: 6600
Joined: Fri Oct 03, 2003 20:22
Location: Dessau

Re: TagCloud for phpwcms [Update v1.4]

Postby Jensensen » Sat Sep 06, 2008 14:52

TagCloud v1.4 for phpwcms:
Unique for easily published tag clouds of all articles in any category you want.

Hi Oliver,
Hi friends and folks,

thank you for your annotation!
So, I worked on the code to get a cleaner structure.

This version has some new enhancements, new variables and - it's only one file again.
It still could be easier for you to manage / control the cloud's output.

Enhancements:
- Content of content part 'WYSIWYG html' included to the cloud. (all CPs are captured)
- Supports --> rewrite
- Much easier to work with --> Landing Pages (instead of the Search Page)
- Improvement of CSS

New Concept:
Choose either EXCLUDE or INCLUDE for words to control the appearance of the cloud.

New Variables:
At the top of the script file you can SET UP SOME VARIABLES for customization!


Be aware:
Expressions which have less characters than you've set in --> $my_min_chars are kicked out of the cloud, EVEN when you've added that word to --> $my_include !!!
(keep it clean for --> speed)

Remember:
* You can use the script multiple times on different pages. So, for example, it is possible to publish a dedicated TagCloud for a certain (each) category.
* You can also include or exclude articles of certain categories for your needs
(as well as in/exclude certain expressions).
So, this is a kind of double in-ex.


Tip for clean, pretty clouds with many tags that have relevance:
- run script some times with $my_inc_or_ex = "0";
- copy expressions of the cloud
- add the words that have the most importance for you (your audience) to --> $my_include
- turn $my_inc_or_ex = "1";



When you are interested in TCv1.4 please PMme!
Last edited by Jensensen on Fri Sep 26, 2008 01:52, edited 12 times in total.
Tip: Watch my avatar full screen at a distance of around 5 meters and keep the [aspect] ratio{nality}.
btw Thanks to Goldener Hirsch Horst has lost.
User avatar
Jensensen
 
Posts: 2685
Joined: Tue Oct 17, 2006 19:11
Location: Rhein-Ruhr-Stever-Verse

Re: TagCloud for phpwcms [Update v1.4]

Postby claus » Sat Sep 06, 2008 21:14

really a nice one :)
The following (and the previous) wouldn't have happened if there had been a GURM!
update process in progress 99% - Please stand by.. don't hit any key. Hold your breath ... until the day when pigs can fly ...
update: seems so as if pigs just start learning how to fly...
User avatar
claus
 
Posts: 3073
Joined: Mon Jan 10, 2005 16:29
Location: germany / outdoor

Re: TagCloud for phpwcms [Update v1.4]

Postby Jensensen » Sat Sep 06, 2008 21:25

thank you. yes i think NOW it's a really nice peace of code seriously - relying on improved - proven - proofs.

btw: it seems that
--> exclude ==> "dark clouds"
--> include ==> "bright clouds"
Tip: Watch my avatar full screen at a distance of around 5 meters and keep the [aspect] ratio{nality}.
btw Thanks to Goldener Hirsch Horst has lost.
User avatar
Jensensen
 
Posts: 2685
Joined: Tue Oct 17, 2006 19:11
Location: Rhein-Ruhr-Stever-Verse

Re: TagCloud for phpwcms [Update v1.4]

Postby jsw_nz » Sat Sep 13, 2008 16:35

Hi Jensensen
- wow - very nice RP for wcms - 1.4 setup was painless -

thinking that the code as it exists
could easily be adopted to use only keyword column in article table
and RP would be something like {KEYWORD_CLOUD} or {KEYWORD_TABLE}
i might play around with something along these lines

TagCloud for phpwcms [Update v1.4]
is nice addition - should be in core methinks

:D
User avatar
jsw_nz
 
Posts: 845
Joined: Fri Apr 02, 2004 00:42
Location: New Zealand

TagCloud CSS Frage

Postby Didl » Sat Sep 20, 2008 09:41

Eine Frage zu diesem tollen mod:
Kann man für unterschiedliche Kategorien, deren Tags ausgeworfen werden sollen irgendwie unterschiedliche CSS formate einstellen ohne eine zweite CSS-Datei zu erstellen?
Konkreter:
Kategorie ID-1 ist Hersteller X
Kategorie ID-2 ist Hersteller Y

Nun soll "eine" TagCloud erstellt werden, die die Linkfarben der zwei Kategorien in einer Wolke unterschiedich ausgibt.
Geht das?
Didl
 
Posts: 96
Joined: Tue Mar 08, 2005 11:07

Re: TagCloud for phpwcms [Update v1.4]

Postby Jensensen » Mon Sep 22, 2008 18:56

Hi Didl,

bei dem Skript handelt es sich hauptsächlich um eine statistische Anwendung. "TagCloud" zählt nur - und zwar die Häufigkeit von Begriffen innerhalb der Artikel gegebener "Site Structure Level". Die Angabe von ID's der jeweiligen Kategorien dient nur der Festlegung, für welche Bereiche des CMS eine Auswertung der Artikelinformation erfolgen soll.
Für die Darstellung der Ergebnisse, in der Form einer so genannten "Tag Cloud", ist eine Kategorisierung (im Sinne der Frage) hingegen unerheblich. Infolge geht der Bezug zu Kategorien (im Sinne der Frage) komplett verloren (Ballast).

Tatsächlich etabliert sich nur eine einzige, neue Ordnung, durch die Abbildung der Ergebnisse auf einer Skala von 0 - 10. Als einzige Information, ist nun aber nur noch die Häufigkeit bestimmter Begriffe enthalten (Rangordnung), deren Ausprägung mittels CSS visualisiert werden kann. Zur Gestaltung der TagCloud stehen derzeit 11 CSS Klassen zur Verfügung.

Die Begriffe sind zudem nicht nur über mehrere Artikel, sondern eben auch über mehrere "CMS-Kategorien" verteilt, d.h. sie stehen nicht zwangsläufig in einem linearen Verhältnis.

Das wird bei der Betrachtung der Ergebnisse auf der "SearchPage" deutlich. Hierbei erfolgt - quasi rückwärts - wieder eine (eindeutige) Zuordnung von Begriffen zu einzelnen Artikeln in bestimmten Kategorien.


Alternativ kommt die "LandingPage" in Betracht. Dort kann zu jedem Begriff der Cloud, ein separater CP, bspw. HTML, eingesetzt werden. Einzelne Links der Cloud verweisen in diesem Fall zu einem Anker. Dieser Anker muss jedoch in der Landingpage (im jeweiligen CP) separat, d.h. "von Hand" gesetzt werden.

Dieses Verfahren eignet sich besonders dann, wenn nur die Häufigkeit bestimmter Begriffe ausgewertet werden soll (Include-Liste).

Zudem beinhaltet der "Include-Mode" den Vorteil, dass die Liste der zu untersuchenden Begriffe tendenziell eher kürzer ist. Damit verbessern sich die Kontrollmöglichkeiten und der Durchlauf des Skriptes erfolgt schneller.


Unabhängig davon könnte eine weitere Kategorisierung erfolgen, die zusätzlich - quasi übergestülpt wird. Das bedeutete, soweit ich das momentan überschaue, mehr Code, weitere ARRAYs, die wiederum von Hand zunächst editiert werden müssen und weitere PHP-Funktionen durchlaufen müssen...

Allerdings besteht die Zielsetzung darin, das Skript möglichst klein zu halten, auch bei großen Web Sites möglichst schnell zu funktionieren und lange Ladezeiten auszuschließen.


Im Moment habe ich dazu keine Idee, auch, wie dann noch die Universalität des Skriptes beibehalten werden kann. Insbesondere deshalb, da ich Art, Umfang usw. weiterer --> beliebiger Kategorien usw. nicht kenne, deren Notwendigkeit (im Sinne einer TagCloud) ebenso wenig erkenne. Aber ich behalte Deinen Vorschlag mal im Hinterkopf...



PS: Bei strenger Auslegung ist "Tag Cloud for phpwcms" eine "Word Cloud", da hierbei nicht nur --> reine Links berücksichtigt werden und schon gar nicht solche, die etwa von Dritten, sprich --> Usern der Site (Web 2.0) angelegt wurden.
Tip: Watch my avatar full screen at a distance of around 5 meters and keep the [aspect] ratio{nality}.
btw Thanks to Goldener Hirsch Horst has lost.
User avatar
Jensensen
 
Posts: 2685
Joined: Tue Oct 17, 2006 19:11
Location: Rhein-Ruhr-Stever-Verse

Re: TagCloud for phpwcms [Update v1.4]

Postby Jensensen » Thu Sep 25, 2008 18:03

For those who are interested in "Clouds" there are good news: TagCloud now has its little brother, called: KeyCloud for phpwcms

RTFM: viewtopic.php?f=8&t=17884
Tip: Watch my avatar full screen at a distance of around 5 meters and keep the [aspect] ratio{nality}.
btw Thanks to Goldener Hirsch Horst has lost.
User avatar
Jensensen
 
Posts: 2685
Joined: Tue Oct 17, 2006 19:11
Location: Rhein-Ruhr-Stever-Verse

TagCloud for phpwcms [Update v1.5]

Postby Jensensen » Thu Sep 25, 2008 21:34

TagCloud v1.5 for phpwcms
Unique for easily published tag clouds of all articles in any category you want.

so fresh, so hot, so must have! :wink: ¿ :shock: :lol: :?: :!: :arrow:

Enhancements:
1) Optimized for phpwcms v1.3.9
8) :?:
[really is!]
Did some optimization regarding DB.
(especially DB connection-select-requests as it was discussed here: viewtopic.php?f=9&t=17476 )

Late, last, latest TagCloud v1.4 that works with older versions of the CMS (1.2.x and above) can be found here:
viewtopic.php?p=108897#p108897

2) minor improvements regarding source code (output)
* space and so on.
* 95% barrier free.

3) No need to touch --> frontend.css
When ever needed, the special CSS library loads dynamically!

Just copy "tagcloud.css" to /template/inc_css/specific/tagcloud.css
Just read the README in the archive!


4) Ever thought: "Hi, ho, hmm, very nice, in some way, but I want to have my own CSS attached to *Show Count*"?
==> Now you can have your own wrappers wrapped around --> ShowCount!

defaults:
// ShowCount wrapper
$mySC_before = "<span>(";
$mySC_after = ")</span>";

example: setting up
$mySC_before = " *";
$mySC_after = "*";

you'll get:
MyCloudTag *17*

and so on...

Have fun......!
Feel free to boo when there's something wrong...or messing up...missing...¿
Tip: Watch my avatar full screen at a distance of around 5 meters and keep the [aspect] ratio{nality}.
btw Thanks to Goldener Hirsch Horst has lost.
User avatar
Jensensen
 
Posts: 2685
Joined: Tue Oct 17, 2006 19:11
Location: Rhein-Ruhr-Stever-Verse

Re: TagCloud for phpwcms [Update v1.6]

Postby Jensensen » Wed Dec 10, 2008 21:41

optimized for phpwcms v1.4.0 release date: 2008/12/04
viewtopic.php?p=111716#p111716

Have fun. Feel free to boo when there's something wrong...or messing up...missing...¿
Last edited by Jensensen on Sat Feb 14, 2009 17:46, edited 1 time in total.
Tip: Watch my avatar full screen at a distance of around 5 meters and keep the [aspect] ratio{nality}.
btw Thanks to Goldener Hirsch Horst has lost.
User avatar
Jensensen
 
Posts: 2685
Joined: Tue Oct 17, 2006 19:11
Location: Rhein-Ruhr-Stever-Verse

Re: TagCloud CSS Frage

Postby Jensensen » Fri Jan 16, 2009 23:10

Didl wrote:... Kann man für unterschiedliche Kategorien, deren Tags ausgeworfen werden sollen irgendwie unterschiedliche CSS formate einstellen ohne eine zweite CSS-Datei zu erstellen?
Konkreter:
Kategorie ID-1 ist Hersteller X
Kategorie ID-2 ist Hersteller Y

Nun soll "eine" TagCloud erstellt werden, die die Linkfarben der zwei Kategorien in einer Wolke unterschiedich ausgibt.
Geht das?


Hi Didl,

bist Du noch on Board?
Ich habe den Eindruck, dass ich Dich damals, bei lauter php-code vor der Nase und im Hirn, total missverstanden haben könnte.
Man könnte das Script dementsprechend erweitern, aber wahrscheinlich ist es ohnehin schon kompliziert genug. (Wie gesagt, ist das noch immer im Hinterkopf.)

Alternativ, wenn ich die Frage richtig verstehe, kannst Du die Linkfarben je nach Kategorie wie folgt (per CSS) anpassen:

Einfach einen DIV wrapper drumherum ergänzen, beispielsweise so:
Code: Select all
<div class="MY_TAGCLOUD_WRAPPER">{TAGCLOUD:I:0,1:S:7}</div>


und in --> tagcloud.css ergänzen:
Code: Select all
.MY_TAGCLOUD_WRAPPER .tagcloud a.tcfs0 { my_style: this;}
.MY_TAGCLOUD_WRAPPER .tagcloud a.tcfs1 { my_style: this;}
.MY_TAGCLOUD_WRAPPER .tagcloud a.tcfs2 { my_style: this;}
.MY_TAGCLOUD_WRAPPER .tagcloud a.tcfs3 { my_style: this;}
...
Tip: Watch my avatar full screen at a distance of around 5 meters and keep the [aspect] ratio{nality}.
btw Thanks to Goldener Hirsch Horst has lost.
User avatar
Jensensen
 
Posts: 2685
Joined: Tue Oct 17, 2006 19:11
Location: Rhein-Ruhr-Stever-Verse

Re: TagCloud for phpwcms [Update v1.6]

Postby claus » Sat Jan 17, 2009 00:20

Now the time has come to hover this one over to a little project of mine! This will be a real nice toy :D
The following (and the previous) wouldn't have happened if there had been a GURM!
update process in progress 99% - Please stand by.. don't hit any key. Hold your breath ... until the day when pigs can fly ...
update: seems so as if pigs just start learning how to fly...
User avatar
claus
 
Posts: 3073
Joined: Mon Jan 10, 2005 16:29
Location: germany / outdoor

PreviousNext

Return to hacks & enhancements

Who is online

Users browsing this forum: Alexa [Bot] and 0 guests