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.
Latest topics
» This or That
by brandon_g Yesterday at 10:30 am

» Count to 2000
by brandon_g Yesterday at 10:25 am

» Easter Themes
by SLGray Thu Feb 23, 2017 12:33 pm

» Easter Themes
by SLGray Thu Feb 23, 2017 12:32 pm

» Easter Themes
by SLGray Thu Feb 23, 2017 12:31 pm

Similar Topics

View previous topic View next topic Go down

JScript
Tutor
Reputation : 2
Points : 306
Posts : 15
View user profile

PostJScript 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
SLGray
Administrator
Reputation : 297
Points : 1666
Posts : 3790
View user profile http://fmthemes.forumotion.com

PostSLGray 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.
JScript
Tutor
Reputation : 2
Points : 306
Posts : 15
View user profile

PostJScript on Mon Jun 08, 2015 2:09 pm

Ok friend, thank you!

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

JS
SLGray
Administrator
Reputation : 297
Points : 1666
Posts : 3790
View user profile http://fmthemes.forumotion.com

PostSLGray 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.

View previous topic View next topic Back to top

Create an account or log in to leave a reply

You need to be a member in order to leave a reply.

Create an account

Join our community by creating a new account. It's easy!


Create a new account

Log in

Already have an account? No problem, log in here.


Log in

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