FM Themes
Welcome to FM Themes
where you can share your punBB, phpBB 2, Invision, & phpBB 3 themes for Forumotion forums.

You are viewing the forum as a guest, so you will not be able to use the full forum. To use all the features of the forum, you need to log in or create a FREE account by registering.

Similar Topics

View previous topic View next topic Go down

Similar Topics

Post by JScript on Mon Apr 27, 2015 8:00 pm

Similar Topics
Hello everybody, I saw this topic [You must be registered and logged in to see this link.] and it occurred to me this idea: Similar Topics
But I only tested in the phpbb3 version of the help forum! I'm out of time now to make it compatible with other versions, if any of you have time for that, I thank you!

Here's the code:
Code:

// JScript
// Similar topics
// PHPBB3
// Date: 2015-04-27
//
var iAmount = 5;
// It is important to know that some people write wrong and often do not accentuate the letters,
// then search for words without the accent is much better!
// Not to mention that the title will be functional in all versions!!!
var aTitle = location.pathname.replace(/-/g, ' +').split(' ').slice(1);
var sTitle = '';
[You must be registered and logged in to see this link.] aTitle);
// Important: delete words containing less than 4 characters to search!
// With this we avoid searching for words like: one, and, of ...
jQuery.each(aTitle, function(index, data) {
 if (data.length > 4) {
 sTitle += data;
 }
});
sTitle = sTitle.substr(1);
[You must be registered and logged in to see this link.] sTitle);

// Tested in PHPBB3 version!
var memDiv = jQuery('<div>');
memDiv.load('/search?search_keywords=' + sTitle + ' .forabg', function() {
 memDiv.find('dt').text('Similar Topics');
 var oTopics = memDiv.find('.topiclist > .row');
 oTopics[0].remove();
 oTopics.slice(iAmount + 1, oTopics.length).remove();
 if (oTopics.length) {
 memDiv.insertAfter('.topic-actions:last');
 }
});

Result:


So long,

JS
Written by JScript

JScript
Tutor

Reputation : 2
Points : 306
Posts : 15

View user profile

Back to top Go down

Re: Similar Topics

Post by SLGray on Sun Jun 07, 2015 10:58 pm

[You must be registered and logged in to see this link.]

Since this does work on phpBB 3, I am going ahead and approve it.  If you are going to make it work on all four versions you can add to the topic.

SLGray
Administrator

Reputation : 294
Points : 1597
Posts : 3723

View user profile http://fmthemes.forumotion.com

Back to top Go down

Re: Similar Topics

Post by JScript on Mon Jun 08, 2015 2:09 pm

Ok friend, thank you!

I'm finishing another code and then I will finish this.

JS

JScript
Tutor

Reputation : 2
Points : 306
Posts : 15

View user profile

Back to top Go down

Re: Similar Topics

Post by SLGray on Tue Jun 09, 2015 2:31 pm

[You must be registered and logged in to see this link.] wrote:Ok friend, thank you!

I'm finishing another code and then I will finish this.

JS
Thanks for the update. I will move it to correct section when you add the other information.

SLGray
Administrator

Reputation : 294
Points : 1597
Posts : 3723

View user profile http://fmthemes.forumotion.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum