Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter

In this Discussion

[Extension] WeightedWords 1.0

I just uploaded my first extension. I ported a WordPress plugin called Weigthed Words hoping it will be a useful additon to the Vanilla Add-Ons. I got the idea from reading various discussions about tags and keywords. Let me know if you have any problems or have suggestions to make it better.
«1

Comments

  • It will be nice, if only it doesn't reparse the database EVERY reload. It's a HUGE amount of CPU time even on my little forum with less than 5k comments...

    For programs like that you shoult consider as a MUST a caching of some sort. :)
  • One thing that might be a problem (as one person has indicated), if you don't have any Discussions or Comments, you'll get an array error. I will need to check for this scenario in the next version of the extension, as well as looking into caching. However, I would like those who have downloaded the ectension to tell me how it is performing on your forum and about how many discussions and comments you have. That would help me a lot. Thanks again for all your help with my first Vanilla extension.
  • theres a problem with öäü words. i cant put them in the overusedwords array
  • If you are using Windows, you can use the Character Map accessory. It should be in your System tools. Start it up. Select Times New Roman as the type style. Find the character. Press the Select button and then the Copy button. The in editting the default.php, you can paste the character. I think this should work.
  • Jimw, how often does this thing refresh? I'm thinking of adding it when I reinstall later for some Web 2.0 goodness.

    And how would I exclude certain words?
  • I'm still learning this stuff and how Vanilla works. I believe it will refresh each time you click on Discussions or Categories. But maybe someone smarter than me can advise how an extension is executed (especially with the checking of which page you're on before it goes through it's code). To add more words to exclude, you'll have to edit the default.php and add the words to the overusedwords array.
  • the extension adds a blank line to my atom feed. the öäü words works... thanks!
  • Glad you were able to enter your words. Concerning the feed problem, I don't use feeds at all and so am unfamiliar with how they work, especially in Vanilla. Maybe someone else can advise me so I can try and fix the problem.
  • anyone got a link so i can see this in action?
  • http://www.coolr.de öhm ... btw: the output of the extension is not valid :(
  • Has anyone who's using this noticed significant slowdowns due to increaded DB access by this extension? Thanks.
  • great ext this is probably aa css question, but my list of weightedwords is leaking off my forum sidebar somewhat (see here http://huge-entity.com/forum/ ). how can i keep them in the lines? cheers
  • As said, on about ~5.000 comments in the forum the script on my machine takes about 1/2 minutes to open a page, each time, while without it it takes less than 0.5 seconds.

    jimw, look at the RSSCache.class.php contained with my extension to see some code on how to cache things on the filesystem.
  • Obvious, I'm applying for membership to your forum so I can see the problem. folletto, thanks. I'll look at your code.
  • Thanks muchly... I hope your application comes through quickly ;)
  • Since this seems to be taking a while, can you email me a screenshot which shows your problem?
  • I've looked at the feedreader extension code and looked at how Vanilla executes things. This may take a little while for me to comprehend this. Since I've worked with WordPress for a lot longer than with Vanilla, I'm trying to understand the differences and why the time to generate the keywords isn't an issue in WP. One other item that I found is the the count when you hover over a word and the actual number of times the word is found in the comments is different. So, please don't use the hover count for anything important until I can figure out the difference.
  • As far as I know, each "cloud" generetor I've used (i.e. UltimateTagWarrior) uses a pre-generated list, stored in a database table, and that's queried only once when it is displayed. The table is refreshed each time a new post is added.
  • did you not apply? my forum shouldn't need a wait period... use this: username: test password: test
  • Sorry it took me so long. I used your test id. You need to do two things (which I will put in the next version). First you need to create a style.css file in the WeightedWord folder and put the following in it: p.weightedwordlist { width:180px; } Then edit the default.php in the WeightWord folder and add the $Head line below after the $Panel line (It's at the very end of the php file): $Panel->AddString($wwordsDisplay, 200); $Head->AddStyleSheet('extensions/WeightedWords/style.css'); That should do the trick. Although you may have to adjust the width in the css file. I set it to 180px which is the width of the Lussumo product info.
  • Thanks a huge amount for that... Great stuff
  • Obvious, glad it worked. folletto, having done a little more research, the concept of the WeightedWords plugin was to regenerate (or reindex) the keywords as the index file was executed.. I spoke with the plugin author and he never had any complaint about lengthy times regenerating the keywords. But, then, maybe there was never a WordPress user who stressed tested the plugin. I will have to think about re-designing the extension to work better in Vanilla. In the meantime, how do you think it should be changed to better perform on forums with a large number of Comments? How about putting keyword generation soley under the admin's control by adding a button to initiate the regeneration of the keywords? Or how about a timer like RSS seems to do? I'm open to any suggestions.
  • As many products works, the best architectural choice is to refresh the DB when a new comment is submitted: a small amount of parsing will be performed and so the plugin will result quite invisible, since when it's displayed it just takes the "top" hits in the database table (containing the words and their weight).

    You could of course add an Admin side command to Rebuild All, but that shouldn't be the norm. If you could chunk the elaboration on each post and cache it in a DB, it's surely the best choice with the greatest efficiency. :)
  • nice addon, but i'm testing vanilla right now and when i delete a comment, weighted word still count those words ! it's not a big problem, but if a user want to have it's account deleted, all words will still be indexed. How refresh the extension ? if i desactivate and reactivate, the extension don't remember the text already there. Everything is empty. it's not a big problem because i don't think i will delete user or comment but it will be nice to think about that :)
  • That's strange because mysql query is only selecting when the deleted field is zero. When you delete a comment, did you try refreshing your browser?
  • yes :/ That's why i don't understand, i was thinking that, in phpmyadmin, maybe there were a keywords value (no). Then, i don't know. But maybe it's because im testing too much (extensions, etc. before publishing) Anyway, i don't really want to delete some comments so i don't think it will be a problem. It's just that i like understand why things doesn't work.
  • How are you deleting a comment? You must be using the Delete Comments extension. From what I read, it actually removes the comment from the database. So, it shouldn't interfere with my extension (famous last words). In reading the supprt forum, I found that you had problems with it. I assume they were resolved. I'll download the extension and test it. Okay, downloaded and activated it. Seems to work fine. The problem, I think, is a lingering problem with the count you see when you hover over a keyword. It is not accurate. In my test, my comment was deleted and I expected to see one less in the count, but I didn't. The count didn't change. I will keep looking into this. Sorry. So, if the comments are deleted, then they will not be displayed in the list when you click on a keyword. However, the count will be wrong. If a user is deleted, I'll have to check to see what actually happens (whether the record is deleted ot a field is just updated with a stauts).
  • Actually, the remove comment does not work (hum) so im deleting the comment / discussion directly inside the database. But i will test it again "on the road", im just tire of deleting test ;) But for now, everything seems ok (same thing when you go to the dentist : since youre there, everything allright). Maybe i desactivate an extension that solve the bugs... i don't know. Too much vanilla tests theses days ;) i tried almost everything ! hahaha Ive seen the bug for the count too ! It reminds me to translate it ;) but if you found a way to have the good count... let me know. Thank you so much for the help :)
  • The remove comment extension did work for me once I authorized my admin user to delete comments. I did narrow down the word count problem to the php strip_tags() function. In my test forum, I have an Excel formula in my comment. The function stripped the entire comment. So, my count was off, but the search did identify all associated comments, including the one with the formula. There may be other instances when there might be a language-related problem as you indicate. Not sure how to get around the language problem. If there are any php wizards out there who could help me with this, I would appreciate it.
  • I am working on a new version to only refresh when a new comment or discussion is made.
This discussion has been closed.