TagCloud for phpwcms [Update v1.7]

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 v0.5a (works with UTF and ISO latin)!

Postby Jensensen on Sat Mar 08, 2008 21:29

Hi marcus,

seems you are always in a hurry. Pilots would call this "touch and go". I'm sure that you are a PHP pro, aren't you? So thank you very much for dropping in and comment on this!

Well, no, this function already was mentioned within that really very old :wink: releases before but was not working as desired [don't know why!?].

Anyway, one of the most relevant improvements was to change the way how to strip off/cut out HTML code, Java Script, (unsecure) PHP code and particularly other common {PHPWCMS}-tags.

When following your proposal, I had a look at the phpwcms search and other files again but this time found a variety of useful functions there. For the actual version I could rely on these built in (loaded, available) functions[*]. The results seem to be [very] clean code [also] on which all the analytic stuff can be applied to.


Statistically all evaluations[*] on my test server [one web site set up with utf-8 and another with iso latin] prove that Tag Cloud for phpwcms not only promises but does exactly what it was built for: to deliver reliable, valid results...

[*]RUNNING FASTER !!?!!


Think about SPEED:
Usually only one!! {the actual} PAGE (article with other FERScripts assigned) will be rendered [on server request] and sent to the [client{s}] browser. TagCloud for phpwcms [subsequently by request] has to read/analyse all! PAGEs (articles) [--> DB] content [as defined!] --> additionally - ON THE FLY.

BTW: That's why I'm interested in how [acceptable fast] TagCloud is running on sites with many [>10] categories and/or more than >10 articles per category...


Hey fellows, ARE there any experiences regarding speed???
Halte ein Päckchen Reis, genauso Dill, niemals verkehrt herum, wenn Du Dir nicht sicher bist und Dir kein A gesagt hat, dass es bereits geöffnet war!
User avatar
Jensensen
 
Posts: 2571
Joined: Tue Oct 17, 2006 19:11
Location: outer deep space, 1/2 impulse drive, checking

Re: TagCloud for phpwcms v0.5a (works with UTF and ISO latin)!

Postby marcus@localhorst on Mon Mar 10, 2008 08:20

hi, oh well I'm not really a php pro - I never studied php or programming, but there was a need and interest to learn it and to take closer look on existing scripts.
phpwcms programming code is very easy to understand - because it's very linear written i would say.

In my first tests, the speed depends on used values in $min. but at all - it works fast enought I think.
greetings
marcus

PS if I have enought time to play with, I will tell you my experience.
„go out and love everyone“ (Akron/Family)
User avatar
marcus@localhorst
 
Posts: 731
Joined: Fri May 28, 2004 09:31
Location: localhorst

Re: TagCloud for phpwcms v0.5a (works with UTF and ISO latin)!

Postby marcus@localhorst on Mon Mar 10, 2008 10:18

hi,
i've found this function inside phpwcms optimizeForSearch();

just place it here:
Code: Select all
/*****************************************************************
and do some convertions
*****************************************************************/
optimizeForSearch();
...


it should do most of tag stripping etc. ?!
(I'm not shure about backwardscompatibility)

greetings marcus
„go out and love everyone“ (Akron/Family)
User avatar
marcus@localhorst
 
Posts: 731
Joined: Fri May 28, 2004 09:31
Location: localhorst

Re: TagCloud for phpwcms v0.5a (works with UTF and ISO latin)!

Postby Jensensen on Mon Mar 10, 2008 18:30

marcus@localhorst wrote:...just place it here:
Code: Select all
/*****************************************************************
and do some convertions
*****************************************************************/
optimizeForSearch();
...


it should do most of tag stripping etc. ?!...


Yes it does, but it is made for working on the submitted search words! Thus and because it is 'optimize[d]ForSearch' it strips off not only tags and that stuff but almost ALL double expressions (but needed here). So, this function works similar to what we could need but --> right in the opposite direction (somehow). When using this function you'll get no valid results!

These work well in preparation on counting, deletion, excluding, decode_entities...
Code: Select all
clean_replacement_tags($tagtext);
remove_unsecure_rptags($tagtext);
stripped_cache_content($tagtext);


So far, I don't know if in any way the order of this functions affect the results...

[EDIT]I guess it needs no: remove_unsecure_rptags(); because (debug, seems) they already are eliminated by clean_replacement_tags();[/EDIT]
Halte ein Päckchen Reis, genauso Dill, niemals verkehrt herum, wenn Du Dir nicht sicher bist und Dir kein A gesagt hat, dass es bereits geöffnet war!
User avatar
Jensensen
 
Posts: 2571
Joined: Tue Oct 17, 2006 19:11
Location: outer deep space, 1/2 impulse drive, checking

Re: TagCloud for phpwcms v0.5a (works with UTF and ISO latin)!

Postby DF6IH on Mon Mar 10, 2008 20:38

your friend is:

Code: Select all
remove_unsecure_rptags(clean_slweg($dings));


but if there is no input ... 8)
User avatar
DF6IH
 
Posts: 2598
Joined: Mon Jan 10, 2005 17:10
Location: Hoffenheim (fast)

Re: TagCloud for phpwcms v0.5a (works with UTF and ISO latin)!

Postby Jensensen on Mon Mar 10, 2008 21:34

Hi Jürgen,

thank you!
This function does a good job, as well, but does not strip off {PHPWCMS} tags. So, the best base to apply math. analytics to [as far I can see] I got using:
[x]

Result is plain text just separated by space ' '

I'm glad v0.5a already delivers valid results. Some limitations: guest book entries, recipes and image caption aren't mapped. Need to understand SQL LEFT JOIN....
Last edited by Jensensen on Fri Sep 19, 2008 18:18, edited 1 time in total.
Halte ein Päckchen Reis, genauso Dill, niemals verkehrt herum, wenn Du Dir nicht sicher bist und Dir kein A gesagt hat, dass es bereits geöffnet war!
User avatar
Jensensen
 
Posts: 2571
Joined: Tue Oct 17, 2006 19:11
Location: outer deep space, 1/2 impulse drive, checking

TagCloud for phpwcms v0.6a

Postby Jensensen on Mon Mar 17, 2008 23:03

Hi folks,

new --> fastest version 0.6a of TagCloud for phpwcms is available today!
This version contains some minor improvements and ONE MAJOR:

A, one, --> the first page request now will be --> cached by MySQL!
By this, --> TagCloud will be ready to be included on your pages without need to be newly rendered/rebuilt! This speeds up page rendering:
Searches for a single row in a single-row table are 238% faster with the query cache than without it.


Works well with MySQL 4.1 and newer and [by --> DEFAULT] in MOST CASE NEEDS NO CHANGES...but you can...
run phpMyAdmin and

--> check your database if there is caching available:
Code: Select all
SHOW VARIABLES LIKE 'have_query_cache';


--> check your database HOW BIG the cache was set
Code: Select all
SHOW VARIABLES LIKE 'query_cache_size';


and/or change MySQL CACHE SIZE by your need:
http://dev.mysql.com/doc/refman/5.0/en/ ... ation.html

Download latest fastest v.06a and have fun:
Halte ein Päckchen Reis, genauso Dill, niemals verkehrt herum, wenn Du Dir nicht sicher bist und Dir kein A gesagt hat, dass es bereits geöffnet war!
User avatar
Jensensen
 
Posts: 2571
Joined: Tue Oct 17, 2006 19:11
Location: outer deep space, 1/2 impulse drive, checking

TagCloud for phpwcms [v1.0]

Postby Jensensen on Thu Mar 20, 2008 00:31

Hi webmasters, site owners, folks and friends - this is for you: TagCloud v1.0 for phpwcms starts today!
[Thanks to marcus@localhorst who made the missing tunes and
thanks to DF6IH for inspiration]


Ever thought: "Well, nice tool but I have really many [too much] categories to type into the RT {TAGCLOUD...} by hand - simply annoying, irritating?!?! --> Why not vice versa!?"

That's why TagCloud for phpwcms was optimized for, once again!
Now {with v1.0} it's much easier than ever to run/place your tag cloud [clouds!] anywhere on your pages --> with minimal effort.

For example, webmasters, admins or site owners do not need to add/type all site structure level [category] id's to the replacement tag for matching all articles which resides in there. You now can do it vice versa --> JUST choose --> render mode I or E!


Hmm, Render Mode? What's this?

EXAMPLE: render mode I --> include (articles in) categories
Let's say you want to have/place a tag cloud based on all articles(' content) in category (site structure level) with category-ID: 0,1,7,8,9,12,18,35,49,52,63,78,88,112,124,152,154,168,169,170,171,172,173,174,225,226,801,802,911.

For this you could use RT:
{TAGCLOUD:I:0,1,7,8,9,12,18,35,49,52,63,78,88,112,124,152,154,168,169,170,172,173,174,225,226,801,802,911:S:40}

Render mode: I ==> includes all articles in category 0,1,7,8,9,12,18,35,49,52,63,78,88,112,124,152,154,168,169,170,172,173,174,225,226,801,802,911 and
Tag Cloud Links will link to -> S = phpwcms [your] search page which {article} ID is 40



Now let's do it vice versa.
Think about you're running a really huge web site with many categories and with many articles. Then checking, typing the relevant cat-IDs can be annoying... but now render mode 'E' does the job for you:

EXAMPLE: render mode E --> exclude (articles in) categories
In this case just remember those category-ID's in which the articles are [in] you DO NOT WANT to be matched to the 'cloud'. Therefor you can now use

Render mode: E ==> exclude (articles in) category ID x,y,z. The RT replacement tag might looks like:

{TAGCLOUD:E:2,6,162:L:57}

This means ANY content of ANY articles within ANY CATEGORY OF YOUR WEB SITE will be analyzed BUT NOT THOSE articles which are in --> this [exclude 2,6,162] category you've added to the RT! and the Tag Cloud Links will link to -> L = your Landing page which {article} ID is 57


more EXAMPLEs:

I --> include categories

{TAGCLOUD:I:0,1,3,12........:L:127}
127 = Article ID of "Landing page"

0,1,3,12... ==> IDs of Site structure levels / categories in all the articles reside you want to match/analyse the cloud.

E --> exclude categories
{TAGCLOUD:E:5,18,24,124........:S:314}
314 = Article ID of "SEARCH page"

5,18,24,124... ==> IDs of Site structure levels / categories in all the articles reside you DO NOT want to be matched/analyzed the cloud of.


Conclusion/Summary: TAGCLOUD RT
in brief and for example:
{TAGCLOUD:E:2,6,162:S:57} or
{TAGCLOUD:I:1,5,16,18:L:128}


TagCloud for phpwcms works fine, reliable, stable and [--> because of SQL_CACHE] --> runs very fast! When you are a WebAdmin just run TagCloud once for testing/preview and then --> your site visitors [Boom, Bang!] will have the cloud already rendered and saved [read/fetched from --> MySQL_CACHE] during [msec] milliseconds. [as long as content wasn't changed -- but, anyway, after the new, changed content was called {again just} once, the subsequent visitors {Boom, Bang!} will have the {cached again new} cloud...displayed on the page.]


PLEASE NOTICE: (RTFM := read the fckn manual inside code)
still [only] your content of --> blogs, recipes will be ignored [agreeable? otherwise -->]
ANY improvements, suggestions, experience appreciated!!!
ANY questions? --> VSeeme ID: jens or post to this thread...

Happy Easter 2008!

################################# download newest v.1.1
viewtopic.php?p=101848#p101848
####################################################
Last edited by Jensensen on Thu Apr 03, 2008 22:35, edited 2 times in total.
Halte ein Päckchen Reis, genauso Dill, niemals verkehrt herum, wenn Du Dir nicht sicher bist und Dir kein A gesagt hat, dass es bereits geöffnet war!
User avatar
Jensensen
 
Posts: 2571
Joined: Tue Oct 17, 2006 19:11
Location: outer deep space, 1/2 impulse drive, checking

Re: TagCloud for phpwcms [v1.0]

Postby claus on Thu Mar 20, 2008 01:53

This sounds like a perfect cloud :)
German: is ja ne Wolke ;)
The following (and the previous) wouldn't have happened if there had been a GURM!
update process in progress 90% - Please stand by.. don't hit any key. Hold your breath ... until the day when pigs can fly ...
User avatar
claus
 
Posts: 2658
Joined: Mon Jan 10, 2005 16:29
Location: germany / outdoor

Re: TagCloud for phpwcms [v1.0]

Postby Jensensen on Thu Mar 20, 2008 03:36

Hi claus,

[i'm glad you are back with your 64bit-peek-poke-supercomputer-teraGB-workstation]
board's post will now be {pleasant} worth reading again!]

this is just "Schall und Rauch" - all hollow words, you know, somehow [aero-celestial-religious-cosmetic-popular-useful-visual-impressive-game-stuff] in a way that even market-researcher are undetermined. Well, for phpwcms it wasn't that easy because we [default] --> have no --> landing page [for each tag cloud link] but with S your links run into your search page...you have one? {actual i have none} --> but is very convenient...was marcus' idea..less editing work.

L:x for landing page ID:x still is working and can be useful but means [much] more work additionally --> placing all needed anchor tags on landing page {article ID:x}

claus wrote:This sounds like a perfect cloud :)...

It really is that way perfect that there is no need to add TagCloud as a MODule, as I mentioned at the beginning, because now it is SQL_cached and available whenever needed/requested and [even on huge web sites] as fast as the page itself on which to be displayed...
Halte ein Päckchen Reis, genauso Dill, niemals verkehrt herum, wenn Du Dir nicht sicher bist und Dir kein A gesagt hat, dass es bereits geöffnet war!
User avatar
Jensensen
 
Posts: 2571
Joined: Tue Oct 17, 2006 19:11
Location: outer deep space, 1/2 impulse drive, checking

Re: TagCloud for phpwcms [v1.0]

Postby heliotrope on Wed Mar 26, 2008 15:35

Hi Jensensen ,
Great hack this TagCloud !
Installed successfully in 10 minutes...
Great to have the possibility to choose which elements you want to include into match (article title, subtitle, summary...etc )
The "exclude" function is also usefull !! (thanks marcus@localhorst)
BUT
Is there a possibility to choose ONLY "*keywords*" (added in "keywords" field of each article) ??
Thanks a lot !
User avatar
heliotrope
 
Posts: 33
Joined: Fri Sep 14, 2007 13:21

Re: TagCloud for phpwcms [v1.0]

Postby Jensensen on Wed Mar 26, 2008 22:42

heliotrope wrote:...Is there a possibility to choose ONLY "*keywords*" (added in "keywords" field of each article) ??...


Hi heliotrope,
thank you for your feedback. I am pleased you like it...

To "cloud" only --> article keywords could be possible but 'keywords only' would contradict the originally idea of "Tag Clouds"...which usually are based on the 'whole' {analyzed} content of a web site. Do you really need...a "keyword_only_cloud"?
Last edited by Jensensen on Fri Aug 01, 2008 22:33, edited 3 times in total.
Halte ein Päckchen Reis, genauso Dill, niemals verkehrt herum, wenn Du Dir nicht sicher bist und Dir kein A gesagt hat, dass es bereits geöffnet war!
User avatar
Jensensen
 
Posts: 2571
Joined: Tue Oct 17, 2006 19:11
Location: outer deep space, 1/2 impulse drive, checking

TagCloud for phpwcms [v1.1]

Postby Jensensen on Thu Apr 03, 2008 20:54

--> for all versions >= v1.2.8 to v.1.3.9++

A) New variable $min_chars introduced
==> Now the fine tuning of the 'cloud' is much easier --> faster editing.
(This time special thanks to Heiko H.)

function: 'cloud' all content --> but only if the word [length] has more than --> characters: x

This means that less words need to/must/can be added to $exclude [speeds up the RT operation].
In other words: You now can easily exclude words like "the", "and", "der", "die", "das" --> just by setting $min_chars = 4 {for example}

Tip for --> fine tuning --> check
1) $min
2) $min_chars
3) $exclude
4) $del
and other variables [see file and comments within]


B) Output [HTML source code] now is completly CSS based.

Add to you CSS file: {all files packaged to ZIP-archive for download)
[x]


TIP
{recommended}
all files in ZIP archive are UTF-8 --> no BOM
but might be a good idea to --> change | save | upload the [WHEN EDITED] file "tagcloud_v1.1.php" encoded with the same charset as defined in -- > /config/phpwcms/conf.inc.php


INSTRUCTIONS
{generally}
viewtopic.php?p=101142#p101142


Any feedback appreciated. Thank you.
Have fun with the newest, improved, certified, checked, approved, fast, reliable, valid --> Tag Cloud v1.1 for phpwcms...
it's --> away !!!
Last edited by Jensensen on Fri Sep 19, 2008 18:20, edited 2 times in total.
Halte ein Päckchen Reis, genauso Dill, niemals verkehrt herum, wenn Du Dir nicht sicher bist und Dir kein A gesagt hat, dass es bereits geöffnet war!
User avatar
Jensensen
 
Posts: 2571
Joined: Tue Oct 17, 2006 19:11
Location: outer deep space, 1/2 impulse drive, checking

Re: TagCloud for phpwcms [Update v1.1]

Postby Jensensen on Fri May 02, 2008 18:10

still works fine [tested today] with v.1.3.9 DEV r_155
but don't forget - just after installation - to switch to

$phpwcms['allow_cntPHP_rt'] = 1; //allow PHP replacement tags and includes in content parts

in
/config/phpwcms/conf.inc.php
Halte ein Päckchen Reis, genauso Dill, niemals verkehrt herum, wenn Du Dir nicht sicher bist und Dir kein A gesagt hat, dass es bereits geöffnet war!
User avatar
Jensensen
 
Posts: 2571
Joined: Tue Oct 17, 2006 19:11
Location: outer deep space, 1/2 impulse drive, checking

Re: TagCloud for phpwcms [Update v1.2]

Postby Jensensen on Mon Aug 04, 2008 16:46

Hi folks and friends,

the new TagCloud v1.2 for phpwcms is available NOW!

changelog:
- some minor/major improvements handling utf-8 and iso latin else characters. (should work on any site now.
I don't know how to work with "locale" but I really hope, that the added function works even faster than "mb_strtolower" to keep "TagCloud" the fastest ever.)
- tested with v1.3.9 r248



INSTRUCTIONS
{generally}
viewtopic.php?p=101142#p101142
viewtopic.php?p=101848#p101848
(keep an eye on comments in the script)


Any feedback appreciated. Thank you.
Have fun with the newest, improved, certified, checked, approved, fast, reliable, valid --> Tag Cloud v1.2 for phpwcms...
it's --> free !!!
Last edited by Jensensen on Fri Sep 05, 2008 22:47, edited 1 time in total.
Halte ein Päckchen Reis, genauso Dill, niemals verkehrt herum, wenn Du Dir nicht sicher bist und Dir kein A gesagt hat, dass es bereits geöffnet war!
User avatar
Jensensen
 
Posts: 2571
Joined: Tue Oct 17, 2006 19:11
Location: outer deep space, 1/2 impulse drive, checking

PreviousNext

Return to hacks & enhancements

Who is online

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