This is the blog of Adam Kalsey. Unusual depth and complexity. Rich, full body with a hint of nutty earthiness.
Excerpt: A Movable Type plugin that inserts entries that are in the same category as the current entry. Now version 1.1. Read the whole article…
Awesome! Thanks! I posted about it at scriptygoddess.com - hope you don't mind!
Thanks for the Plugin! It works like a charm! Tip for MT newbies (like myself): make sure the "Licence" file stays out of the "plugins"-folder - otherwise super-easy to install and use thanks to the instructions above :-)
Yes, Movable Type 2.21 tries to use all files in the plugins directory as a plugin. That will be fixed in a future version of MT.
Hi Thanks for the plugin of Related Entries. But can u guide me on how to find related entries based on the words given in the Excerpt. Thanks and Regards Bharde Tajuddin Software Engineer Netcore Solutions Pvt . Ltd
I'm planning a new release of the plugin that would support that.
Hello I had installed the plugin for Related Entries but it seems that the program RelatedEntries.pl does not work at my end nor does it give me any error. Can u help me out. Regards BHarde Tajuddin
Hi Adam Can I know when the new plugin for RelatedEntries which will look for teh keywords in the Excerpt will be available. Regards Tajuddin
There's a wide variety of things that could cause the plugin to fail. You could be using the wrong version of MT. To use most plugins you'll need MT 2.21 or later. You could have the plugins directory set up wrong. It needs to be in the directory where MT is installed and needs to be all lower case. You might have extra files in the plugins directory. Remove any file that doesn't end in .pl You might need to set permissions. The minimum permissions for the file is 644. You might be using the plugin outside of an entry. You'll need to use this on your individual archives in order for it to work. You can't use this inside of an MTEntries container. (Well you can with a funky MTInclude template hack, but it's best not to.) There are lots of other reasons why it wouldn't work. Perhaps you could explain more what you are trying to do and how you are trying to do it. A URL can often help as well.
I don't have a particular release date in mind for the next revision of the plugin. The syntax will be similar to the related syntax of MTAmazon.
Hello Thanks for the suggestion on where I had gone wrong in the installation of Related Entries. I found out that it was my mistake. Now the Related Entries is working fine Regards Bharde Tajuddin
Thanks for the plug-in, I installed it on http://joi.ito.com/ . One question - if an entry has multiple categories, does this plug-in choose from among all of them the most recent? Or only for the first category associated with that entry?
The plugin only uses the primary category.
Adam, installation went smoothly, and I am using your example code to pull in the last three entries on my individual entries template - would there be an obvious reason why it's pulling in the three latest entries regardless of category? Thank you!
Looking at your HTML source, the closing MTRelatedEntries tag is showing up there. That means that there was an error while running the plugin. Could you take a look at your server's error logs and let me know what that error was?
Adam - This is the error message: plugins/RelatedEntries.pl did not return a true value at /home/nammer/public_html/mt/lib/MT.pm line 79.
After a private email exchange with Donna, we figured out that the plugin had not been uploaded in ASCII mode. Uploading it as an ASCII file fixed the problem.
Adam, Congratulations of such a nice job with Related Entries. I have a question for you though. I'm curious if alphabetization or ordering of the related entries is now, or perhaps someday will be, an option with the this plugin.
At the moment, the entries are shown in reverse chronological order. But there's going to be some changes coming when MT 2.5 is released, so I can look into including that as well.
This plugin is a great idea! Only, I'm having the same problem as Donna did, above: The plugin seems to work, but shows the 3 most recent entries of any kind, instead of filtering by category. I tried re-uploading the plugin in ASCII mode but that didn't seem to fix it. Am I missing something?
Yes. It seems I am the third one to encounter the problem Dylan Tweney described. Can anyone give us a sample template that works. Thanks
I found tag is still in my HTML, but no starting tag . I don't have access to my server log. There is what I did: 1. Create a folder named plugins (all in lower case, and with "s" in the name) under mt folder, where the mt.cgi resides. 2. Upload "RelatedEntries.pl" (1.82K) to the folder. It is the only file in that folder and I tried to upload in ASCII mode. 3. Put the you gave to the Individual archive template. 4. Here is the result page: http://home.wangjianshuo.com/archives/20021012_where_is_daocheng.htm#000043 Can anyone help me to figur out the reason? I am posting the detail repro steps since I believe I am not the first one in the world to encounter this problem. Thanks.
Looks like the Related Entries only pickup on the Primary Category. Is there any way to make it look at the Additional Multiple Categories?
Donna's problem was fixed by uploading the plugin in ASCII mode. The template is not the problem. Having the final related entries tag appear in the code indicates that the plugin didn't finish running. That could be for a variety of reasons, and not having access the error log will make this very difficult to troubleshoot. If I don't know what's going wrong, how can I fix it? I looked at your sample page, but I don't see the closing tag appearing in your HTML. That would indicate to me that the plugin is now working.
Changing the plugin to work with categories beyond the primary one would cause the rebuild process to be very very slow.
That was my first "Plugin" for MT. Thank you so much. I feel very accomplished now.
When I first create an Entry, this plugin produces a list of the N previous entries in the same category. But, if I ever rebuild my blog, this is replaced by a list of the CURRENT N most recent entries in that category. how do I prevent this? There must be a way to set the context so that <MTEntryID> is the starting point of the list produced by this plugin.
Well, I ended up looking at the sourcecode for the plugin, and found that it was a fairly easy hack to get it to do what I want. Details at: http://www.movabletype.org/cgi-bin/ikonboard/ikonboard.cgi?s=3dde95054f54ffff;act=ST;f=14;t=10827
That was a popular request recently. Thanks for the patch.
Bit of a problem... when I include the date with the listing as follows: ">» : The very last entry doesnt display a date. I've even tried shuffling the entry dates on items around to see if it was a specific entry, but whatever item I move to the last slot doesnt get a date.
Ignore my last post.. not only did the code go away but I realized I was just doing something stupid anyway... so sorry .
It's a nice plug-ins but there's an error when i try to rebuild my individual entries, like this ones... who appear in the rebuild window: MT::App::CMS=HASH(0x81511c0) Use of uninitialized value in length at /var/sites/minid.net/cgi-bin/mt/plugins/RelatedEntries.pl line 19. MT::App::CMS=HASH(0x81511c0) Use of uninitialized value in length at /var/sites/minid.net/cgi-bin/mt/plugins/RelatedEntries.pl line 19. MT::App::CMS=HASH(0x81511c0) Use of uninitialized value in length at /var/sites/minid.net/cgi-bin/mt/plugins/RelatedEntries.pl line 19. MT::App::CMS=HASH(0x81511c0) Use of uninitialized value in length at /var/sites/minid.net/cgi-bin/mt/plugins/RelatedEntries.pl line 19. MT::App::CMS=HASH(0x81511c0) splice() offset past end of array at /var/sites/minid.net/cgi-bin/mt/plugins/RelatedEntries.pl line 77. I try to discover what's happen or what i did wrong i've uploaded the plug-in to my plugin folder and set 755 permissions but it seems it's not ok... i've copy/paste exactly like you wrote the examples and it seems i'm not so wrong at now...
Apparently, mini-d you are not the only one, me too noticed the 'error' message each time I rebuilt the site. Nontheless, everything seems to be working fine. Puzzled!
Hello, i've installed your plugin, which is great. But I have the same problem as Diego (mini-d) Posts relacionados Use of uninitialized value in length at /home/alt1040/public_html/cgi-bin/mt/plugins/RelatedEntries.pl ...etc etc etc Uploaded in ASCII, no strange files in the plugin directory, 755 permissions, etc, etc, etc and I am using Movable Type 2.51 Still the plugin works. It shows up the related entries with the correct category filtering, but i removed it fearing of a database corruption. Hope you can help me :-)
I am getting a hash error on rebuild - lots of them, actually, and it does not seem fatal or stop the build. The message is - MT::App::CMS=HASH(0x83313a8) Use of uninitialized value in length at /virtual/rcogley/public_html/mt/plugins/RelatedEntries.pl line 19. And it is repeated many time. I suspect it might be related to my entries with no category assigned, but can you please explain what it means? Thank you. Kind regards Rick Cogley
I've also encountered the error message mentioned by the last few commenters. However, I'm also experiencing a problem not reported by anyone else. At first I thought the plugin was skipping the 10 most recent related entries and displaying the next 10 entries after those. But, checking other individual entry pages, it appears that an arbitrary set of 10 consecutive related entries is being displayed rather than the 10 most recent related entries. There is no related entries tag in the HTML nor are there any suspicious messages in the error log. Thanks...
The "Use of uninitialized value in length" error is a known bug. I'll fix it when I get a chance. It doesn't have any negative side effects, other than that warning message. The plugin still does what it's supposed to and readers of your blog won't encounter any problems. The other problem with the 10 random entries is odd. I've never seen anything like it and can't think of why it may be happening. I'll email you privately and see if we can't figure it out.
I want to thank you for this tag, it's *extremely* useful. I was wondering if it could be made to list related entries by month? I need the ability to display entries that are in the same month as the current entry. I do have monthly archives, but I have no idea how to get MT to show the titles of those related monthly entries on each Individual Archive page. Any help or advice would be much appreciated.
The plugin doesn't currently have that feature, and I can't think of any way to do it using existing MT template tags.
I couldn't think of one either! The only option that seems promising is doing a direct database query using MTSQL, but I don't yet know the proper syntax for checking the year-month part of the entry_created_on date string. I posted the problem to the MT boards; let's see if anyone has the answer. In the meantime, would you please consider adding that functionality to this plugin? I think it's a natural extension of Related Extries.
Got it working using the mtsql plugin. I'll post the code on MT once their boards are back up and running.
Excerpt: ich habe heute mal das Related Entries Plugin installiert. den effekt sieht man auf den individuellen seiten der beitrage (die
I installed your plug in and got some noisy warnings: MT::App::CMS=HASH(0x8356070) Use of uninitialized value in length at plugins/RelatedEntries.pl line 19. Here's a work-around I put in to quiet it down: my $arglen = ($args->{field$}) ? length($args->{field} : 0; my $method = ($arglen) ? $args->{field} : "primary_category"; I suspect this may have to do with the way Perl is installed on my system, but the above work around wouldn't be harmful current implementations.
You know that last code change I suggested? Forget it. It stops the error but enumerates all entries in all categories. Instead, I've tested the following, a bit kludgier, but it works: my $method = "primary_category"; $method = (length($args->{field}) > 0) ? $args->{field} : "primary_category" if($args->{field}); Sorry about that other one.
That fix by Mr. Peters (feb 24, 2003) worked great for me. My web site is on a Microsoft-IIS/5.0 with perl version 5.006001 (perl compile version MSWin32). Great plugin, thanks. -Rich
Excerpt: Installation of a plugin leaving a link–trail to related posts (by category).
Thanks for a v.useful plugin. I too am getting the noisy warnings which it would be nice to get rid of. Any news on a fix?
Is there a way to do this for *secondary* categories as well? For example, let's say I have an entry up about eating an apple. This has the main category of "Fruit" and the secondary category of "Things I Did Today". Right now, this plugin will let me display other entries in the main category, Fruit. Can I also display a separate section for other entries from Things I Did Today? How about a section that lists all entries that are in both Fruit and Things I Did Today, just as this entry is?
The plugin doesn't do that. It only works with the primary category or the keywords field. I'd love to do it, but I've got a variety of projects going right now that have me pretty booked up. Realistically, it will be June before I have the time to devote to this. Although, if someone wants to contribute a patch, I'd be glad to fold it into a release.
Hi, I downloaded and installed plug-in as instructed. But, when I published, MT gave me this notice: MT::App::CMS=HASH(0x8352170) Use of uninitialized value in length at /....blablabla/RelatedEntries.pl line 19. It worked though, gave me all the related entris I had. But whatever does that error message mean?
Thanks for the plugin. I'll be the second with Philip's type of problem. If you look at this page http://coldforged.org/archives/2003/04/08/a_chorus_line.html the related entries are quite far in the past, even though I've rebuilt the pages as recently as 10 minutes ago. And, curiously, it starts 10 entries from the entry it should (going by the "humor" index). Did you and Philip come to any decision regarding the cause of this?
As a follow-up, the "Humor" category appears to be the only one with this malady. Okay, that's odd.
Excerpt: Slow day, traditional Sunday to spend on shopping. I got some links-n-read: Jeremy Zawodny: Revisiting FreeBSD vs. Linux for MySQL MySQL doc: FreeBSD Notes Kalsey: Related Entries Plugin Kalsey: Related Entries Revisited Simon Willison: Experimental fe...
Thanks for the pluggin. It's great, and I had it up and running in no time. Dunc
Excerpt: I have rebuilt the design from the ground up...again. I used a couple plugins for some of the features I...
I posted a more detailed message yesterday in the MT forums.. basically the related entries plugin throws an error on rebuilding but seems to rebuild fine, although slowly. Will you be doing any further work an this plugin? It is very usefull indeed. Here is the link to the MT forum thread: http://www.movabletype.org/support/index.php?s=854c578a4e4928964f0fb7af97a91b08&act=ST&f=20&t=5652&st=15
Well I added the fix suggested above in the comments, and MT is now silent. It still rebuilds a lot slower with this plugin than without, and I have only about 60 entries. Would the MTSQL version you have elsewhere be faster? I understand it is quite a bit better, but even this plugin is good enough for me, and saves the hassle of deailing the the sql/php whatnot.
Thank you for a *great* tool, I got it installed and running in under 5 minutes and workes beautifully! Example running @ my site is http://john.hoke.org/archives/2003/06/saving_private_jessica.php The only issue I have is the over reported issue with line 19.. no biggie still flies, but if I get sometime to tweak it I will see if I can squash it ;) THanks again! -John
Thanks for the plug-in. Until today we had it up and running just fine. I re-categorized my articles to have 1 of 5 primary categories and then different secondary categories. After making this change, Related Entries does not show the latest 5 entries for 2 of my primary categories, instead choosing 5 starting some random day in the past. This works for the other 3. This problem is similar to ones described earlier by ColdForged and Philip. Was there any resolution to this? Thanks.
I have separated my navbar into its own template so that I can have it loaded with other index files on the fly. This way I only have to update the navbar in one place and it shows up everywhere else. The Recent Entries section shows entries from all the different categories, not just the one category that you are looking at. How do I get this to work in this fashion? The navbar is being put into the main index files with the MTInclude command. Any help would be appreciated. -Jaime
The plugin seems to be working fine, but on rebuild I get this: MT::App::CMS=HASH(0x835971c) Use of uninitialized value in length at plugins/RelatedEntries.pl line 19. Any ideas?
Hi, Great plugin, just what i need. However i am having a small problem in that it displays all entries for all categories rather than the related entries from one category. I think otherpeople had the same problem, which thinking related to uplaoding in ASCII, which i have done. but it still displays all entries.
I am noticing some strange behavior. The plugin is grabbing the OLDEST articles in the category, not the newest. Example: http://john.hoke.org/archives/2003/07/erza_pray_for_biden.php There are many more recent entries that are in the same category Ideas?
Sorry, I really had to remove the plugin until I could figgure out why it was returning such old entries even after a full rebuild so the link above wont show the issue anymore -john
Thanks so much for your hard work. I used Dean peter's work around and it is awesome. Please keep up the good work.
Excerpt: This Blog equipped the Kalsey's Related Entries.. http://www.kalsey.com/2002/07/related_entries_plugin/...
I would like to add a bullet such as: → before each link, remove the date and have a line break at the end of each entry ala recent posts. I get cms hash undefined error message which happens when I alter the code in the ind. archives template. All I did was remove the date and accompaning 1 and p tag. add a br to the end of the a href tag and enclosed in bold tags → before the a href tag. Sice this post doesnt accept html I cant post the actual code sample. bkynn blynn
You are probably getting the "line 19" message. Look through the comments for a fix.
Firstly, thanks for the plugin. It's a very nice piece of work. I've been using it since I installed MT and it has served me well. Just a question... Has the problem reported in the comments above about a splice offset past the end of array in line 77 been solved? I ask because I just upgraded to MT 2.64 while moving to a new hosting provider, and I'm consistently getting this error on some entries. The error effectively prevents the entry from being rebuilt, and it seems to happen when the entry has fewer related entried than specified in the plugin parameters.
There are two bugs in the Perl script: a. use of uninitialized value in line 19; b. splice extending past the end of the array. Here are the diffs to fix the script: --- /home/aks/RelatedEntries.pl Tue Dec 17 11:12:44 2002 +++ RelatedEntries.pl Wed Nov 12 12:10:24 2003 @@ -16,7 +16,10 @@ my($ctx, $args) = @_; use MT::Entry; use MT::Placement; - my $method = (length($args->{field}) > 0) ? $args->{field} : "primary_category"; + my $method = (%args + && exists($args->{field}) + && length($args->{field}) > 0) + ? $args->{field} : "primary_category"; my $blog_id = $ctx->stash('blog_id'); defined(my $ctx_entry = $ctx->stash('entry')) or return $ctx->error("No entry found. Perhaps you used outside your ind ividual archive?"); @@ -74,7 +77,7 @@ }) or return ''; push(@entries, @entriesNew); - splice(@entries, $lastn); + splice(@entries, $lastn) if $lastn id == $id; # it's own Related list @@ -107,4 +110,4 @@ } } return "25"; -} +}
Great plugin. Thanks. Being picky, could you help me to stop it inserting a line space between each of the related entries? Its taking up a lot of room.
It's odd. It works well in some categories, doesn't in others. what's the problem? i can't figure out. in bad cases, this plugin shows some related entries in their category. but, they are not recent. some "related" entries are too old-dated, not recent.
Righteous Plugin... but I can't get that patch to work, when I run it I get - Patching file RelatedEntries.pl using Plan A... patch: **** malformed patch at line 4: my($ctx, $args) = @_; Anyone else suffer this fate? I wouldn't care about those line 19 errors, but this is for a client who will get nervous if he sees 'em
Hello. Great plug-in! But: there is a way to show the current post in the "related post" and have it not clickable? I need it for a list of products, the list should be the same, but i don't wont the link to the product i'm looking. thanks M
Excerpt: Related Entries Pluginより。 ニュースサイトのように関連記事を表示したかったので導入してみました。...
Excerpt: 自ブログ内の関連する記事を 自動で拾う方法はないかと、考えていました。 カテゴリで区切ってある程度は うまくいきますが 忘れている記事や、同じようなタイトル、また連載の...
Excerpt: 利用Keyword来进行MT的「关联文章」的表示方法已经有介绍了。今天又看到了一...
I just install your plugin (MT3.14), but I get this error: Use of uninitialized value in length at /Library/WebServer/CGI-Executables/plugins/RelatedEntries.pl line 19. splice() offset past end of array at /Library/WebServer/CGI-Executables/plugins/RelatedEntries.pl line 77. What must I do? Thanks.
This discussion has been closed.
Michael
July 26, 2002 8:35 PM
Very, very nice. Exactly what I needed. Thanks.