Welcome Guest, Not a member yet? Register   Sign In
MeNeedz Cloud
#1

[eluser]davidbehler[/eluser]
Some of you might still remember or even use my auth library and maybe you are interested in my newest creation: A small library to create a tag cloud.

The name “MeNeedz Cloud” might be kinda strange to you (it derives from the working title of my current project) but don’t let that stop you from testing it!

All you have to do is simply feed my library with your tags, their count and the url they should link to and my library does the rest and returns you a tag cloud with font size of the tags depending on their count. If you don't want that font-size stuff you can get a plain text list with no problem.

Wanna try?
Download: --&gt; click me <--
User guide (also included in the download): --&gt; click me <--

I am really looking forward to your comments and your suggestions on how to improve the library!

Greets,
waldmeister
#2

[eluser]Iverson[/eluser]
Sweet. These are exactly the kind of packages I'm looking to find and create for CI! Pretty much taking technologies that are common on the web and consolidating it all into our framework. Can you imagine that? :bug:
#3

[eluser]davidbehler[/eluser]
Glad you like the idea Smile

Any other feature or library you might need?
#4

[eluser]meteor[/eluser]
Good job man, I like your libraries, both of them Smile)
Thanks for your efforts.
best regards
demaio
#5

[eluser]meteor[/eluser]
Your library seems to list tags string according to count parameter of subsequent tags which is ok, but what if somebody wants the string to be of random order... I took the liberty of incorporating reshuffling of $this->tags array:
it looks like this:
133.
134.
135.
136 $cloud = "";
if($shuffle){
shuffle($this->tags);
}
and added the fourth parameter to the get_cloud function which looks like this :
$shuffle = true;

This way setting this variable you can get result ordered pseudorandomly ...
I had not noticed this small pece of functionality in your library before I added this quick fix(i might have missed it because i have not looked into it very carefully), by the way ... It is simple to add either as object property or in a fashion i have proposed above Smile

hope you add this small piece of code to your library.
Best regards and thanks for your continuing conribution Smile)
#6

[eluser]davidbehler[/eluser]
Yeah, that's a nice idea!
I have updated the library and added the third parameter just like you proposed.
The only difference of my implementation is, that I use an additional variable to store the shuffled tags instead of $this->tags. That way the tags can be outputted both ways without having to add all tags again.

Download and guide are updated.
#7

[eluser]meteor[/eluser]
another thing which I have noticed today after using your lib for the first time ...
in line 134 : $size_increase_per_count = ...
It is possible to get error because $count_difference can be 0, which is what happend to me ...for nom i have fixed it
a bit changing this line as follows :
$size_increase_per_count = $count_difference == 0 ? 1 : $size_difference / $count_difference;
I have no time to look into it properly, and the library has no comments so for now this fix is enough ... if you could check this line of code as well I would be grateful Smile
regards
#8

[eluser]davidbehler[/eluser]
Fixed Smile

I kinda tend not to document my libraries, I'm sorry.
Maybe I should start to do so Big Grin
#9

[eluser]meteor[/eluser]
he he ... You would better start before your code amount grows to unmanageable number of lines and files Wink)
It is pointless to write something just to learn after a few months you do not know how to use it Smile)
Good tests + good docs are crucial Wink)

Anyway, great job,besides i do like your howtos Wink))
#10

[eluser]meteor[/eluser]
just tried to write some tests for your library today ... unfortunatelly this library is impossible to be tested correctly. Methods are to long, could not have controled vars (not using debugging). This library is too coupled with CI. Man try to write something independent next time. Testing such libraries with phpunit is nightmare. Libraries should be independet from the rest of the code excluding their own dependiencies ... Functions in your libs are way to long, you do not use flags ... You will be in trouble trying to change something in your code after a few months of not looking into it.

Regards




Theme © iAndrew 2016 - Forum software by © MyBB