TagCloud for phpwcms [Update v2.3.1]

Post custom hacks and enhancements for phpwcms here only. Maybe some of these things will be included in official release later.
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: TagCloud for phpwcms [Update v1.2]

Post by Jensensen »

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 19. Sep 2008, 20:22, edited 1 time in total.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
marketingmensch
Posts: 16
Joined: Fri 13. May 2005, 11:01
Location: Berlin, Germany
Contact:

Re: TagCloud for phpwcms [Update v1.2]

Post by marketingmensch »

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
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

TagCloud for phpwcms [Update v1.3]

Post by Jensensen »

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...
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
Oliver Georgi
Site Admin
Posts: 9888
Joined: Fri 3. Oct 2003, 22:22
Contact:

Re: TagCloud for phpwcms [Update v1.3]

Post by Oliver Georgi »

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 | GitHub | LinkedIn | Систрон
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: TagCloud for phpwcms [Update v1.4]

Post by Jensensen »

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 26. Sep 2008, 03:52, edited 12 times in total.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: TagCloud for phpwcms [Update v1.4]

Post by update »

really a nice one :)
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: TagCloud for phpwcms [Update v1.4]

Post by Jensensen »

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"
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
jsw_nz
Posts: 907
Joined: Fri 2. Apr 2004, 02:42
Location: New Zealand

Re: TagCloud for phpwcms [Update v1.4]

Post by jsw_nz »

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
Didl
Posts: 96
Joined: Tue 8. Mar 2005, 12:07

TagCloud CSS Frage

Post by Didl »

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?
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: TagCloud for phpwcms [Update v1.4]

Post by Jensensen »

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.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: TagCloud for phpwcms [Update v1.4]

Post by Jensensen »

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

RTFM: http://forum.phpwcms.org/viewtopic.php?f=8&t=17884
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

TagCloud for phpwcms [Update v1.5]

Post by Jensensen »

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: http://forum.phpwcms.org/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:
http://forum.phpwcms.org/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...¿
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: TagCloud for phpwcms [Update v1.6]

Post by Jensensen »

optimized for phpwcms v1.4.0 release date: 2008/12/04
http://forum.phpwcms.org/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 14. Feb 2009, 18:46, edited 1 time in total.
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
Jensensen
Posts: 3000
Joined: Tue 17. Oct 2006, 21:11
Location: auf der mlauer

Re: TagCloud CSS Frage

Post by Jensensen »

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;}
...
{so_much} | Knick-Knack. | GitHub
Umlaute im URL sind meistens immer Kacke.
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: TagCloud for phpwcms [Update v1.6]

Post by update »

Now the time has come to hover this one over to a little project of mine! This will be a real nice toy :D
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
Post Reply