Jump to the post that solved this thread.
Solved: 3 Years, 5 Months, 1 Week ago How to install the same plugin twice?
#1
Solved: 3 Years, 5 Months, 1 Week ago
Hello,

I would like to install recent thread twice. I know I have to make changes in the copied and renamed plugin files, but maybe not so much?

Anybody have some advice how to begin?
Reply
#2
Solved: 3 Years, 5 Months, 1 Week ago
You'll have to change the name of the file (for sure), all functions names and all settings names.
Tchat en français
Do not ask me help through PM or Discord

Reply
#3
Solved: 3 Years, 5 Months, 1 Week ago
This plugin consists of a couple of PHP files for code and language. So its more complicated to achieve...
IMO there are two ways to set this plugin up twice.

1) Copy all files to a different name and replace all base functions within these files. You also need to rename files and subfolders of the second install to not get in conflict with the first one.
Tricky work with a loss on performance. I would not go this way to be fair.

2) Investigate all files of this plugin for dependencies to install a base setup - then build up a second instance with files (and name of functions) that needs to be independent.
In general most of the plugin files for a single installation can be re-used in a second instance. You need to figure out the static code files and just edit the second instance files accordingly.
More tricky work with a benefit of performance.

I'm not familiar with this plugin but would really like to know why to use it twice (on the same page?)?

[ExiTuS]

PS. @skrilaxrev, Schöne Grüße (-:
Reply
#4
Solved: 3 Years, 5 Months, 1 Week ago
Hallo Exitus!^^

I want to show 2 recent thread tables on the index. One with the recent thread from all forums and one with the recent thread only from 1 specific forum.

In the past I used prostats and recent threads at the same time, but prostats is not updated anymore. Also, I think, recent threads is the better choice anyway to show the last active threads on index (better performance). Before my update, I used recent threads for showing only the last active posts from one specific forum, because I had prostats for all forums.

So, what I need is to show the 10 last active threads from a specific forum in the style of recent threads, but I already use recent threads to show them from all forums.

PS. Hoffe, du verstehst mein Denglisch. Big Grin
Reply
#5
Solved: 3 Years, 5 Months, 1 Week ago
So, this is my last unsolved thread before my big update is finished (from a 5 years old mybb version). I got so much help here, thank you!

Hope to find a solution for this too. Maybe somebody knows another plugin for showing the recent threads / last active threads of one specific forum?

Edit: I found "active threads" and try it now.

Edit 2: Unfortunately this is not showing the threads in index but under a /activethreads.php I need them on index from a specific forum.
Reply
#6
Solved: 3 Years, 5 Months, 1 Week ago
(2021-06-22, 07:08 PM)Crazycat Wrote: You'll have to change the name of the file (for sure), all functions names and all settings names.

Pretty sure I did this in every file and with the files itself, but after installation I get a 500.

Take a look if you want (zip attached)

(2021-06-22, 11:52 PM)[ExiTuS] Wrote: 2) Investigate all files of this plugin for dependencies to install a base setup - then build up a second instance with files (and name of functions) that needs to be independent.
In general most of the plugin files for a single installation can be re-used in a second instance. You need to figure out the static code files and just edit the second instance files accordingly.
More tricky work with a benefit of performance.

[ExiTuS]

Would be nice if I could look though this code, but to be honest, I understand even less as normal with this amount of files the plugin has.


Attached Files
.zip   recentthreads-master - Kopie.zip (Size: 25.19 KB / Downloads: 43)
Reply
#7
Solved: 3 Years, 5 Months, 1 Week ago
Error 500 means you probably have a PHP syntax error, check your server logs.

I'll have an eye on your code in a few hours
Tchat en français
Do not ask me help through PM or Discord

Reply
#8
Solved: 3 Years, 5 Months, 1 Week ago
Okay, thank you, but last entry in MYBB error.log is 3 days old and was an MYSQL error because of an other plugin.

To be honest, I made it very easy. I simply renamed all files and then searched for "recentthread" and replaced it with "recentthread2" in all files at once with Notepad++. So it should not be a PHP syntax error. I checked the files, some "recentthreads" are renamed "recentthread2s", but it was the same execution for all files (replacing "recentthread" to "recentthread2") and I made the exact same thing with the files/folders (recentthread = recentthread2 and recentthreads = recentthread2s).

I thought this should work.

Please notice, the attached file above is not up to date. Here is the newest version with all changes I made, mentioned in this post.

So, I turned on PHP errors in the htaccess and this is what I get:


Fatal error: Cannot redeclare recenttthread_admin_tools_get_admin_log_action() (previously declared in **************/new/forumupdate/inc/plugins/recentthreads/hooks.php:663) in **************/new/forumupdate/inc/plugins/recentthread2s/hooks.php on line 663

I will check this line now...

Seems like a typo, because "recentthread" was written with 3x "t" in this function, so I renamed it to "recenttthread2_admin_tools_get_admin_log_action" now and the 500 is gone.


Attached Files
.zip   recentthreads-master - Kopie.zip (Size: 25.19 KB / Downloads: 42)
Reply
#9
Solved: 3 Years, 5 Months, 1 Week ago
And you have a lot of recentthread2s to replace with recentthreads2 in the different files, which provocs some errors.
Tchat en français
Do not ask me help through PM or Discord

Reply
#10
Solved: 3 Years, 5 Months, 1 Week ago
Mh, no actually it is working now with "recentthread2s". As long as it is everywhere the same, it seems to work.
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)