Simple Machines Community Forum

Customizing SMF => Modifications and Packages => Topic started by: dougiefresh on October 28, 2016, 11:27:37 AM

Title: Topics Created And Participated In
Post by: dougiefresh on October 28, 2016, 11:27:37 AM
Link to Mod (https://custom.simplemachines.org/mods/index.php?mod=4121)


TOPICS CREATED AND PARTICIPATED IN v2.10
By Dougiefresh (http://www.simplemachines.org/community/index.php?action=profile;u=253913) -> Link to Mod (http://custom.simplemachines.org/mods/index.php?mod=4121)


Introduction
This mod adds a new section under Profile called Show User Topics, which shows all the threads that the user has participated in and created.

Admin Settings
There are no admin settings for this mod.  To disable this mod, you must uninstall it.

Compatibility Notes
This mod was tested on SMF 2.0.12, but should work on SMF 2.0 and up.  SMF 1.x is not and will not be supported. 

Translators
o Russian: digger (https://www.simplemachines.org/community/index.php?action=profile;u=97557)
o Spanish Latin: Rock Lee (https://www.simplemachines.org/community/index.php?action=profile;u=322597)

Changelog
The changelog can be viewed at Xptsp.com (http://www.xptsp.com/board/free-modifications/topics-created-and-participated-in/?tab=1).

License
Copyright (c) 2016 - 2018, Douglas Orend
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Title: Re: Topics Created And Participated In
Post by: dougiefresh on December 17, 2016, 09:44:35 AM
Uploaded v2.0 - December 17th, 2016
o Complete overhaul to improve functionality and viewing experience.



@Everybody: You're probably asking "Why the Overhaul?".  Well, I figured out the mod didn't do what it stated in the mod description.  It would have been better described as "Threads Created By User" instead of "Threads Participated In".  So, I combined the two ideas, along with an extreme viewing experience upgrade, in order to get what this mod now is with version 2.0.

I apologize to anybody who didn't feel that the version 1.0 mod lived up to expectations.   Hopefully, you'll give this mod another chance....
Title: Re: Topics Created And Participated In
Post by: akbora on December 18, 2016, 02:57:19 PM
This mod is good.

Notice: Undefined index: description in

When click Show User Topics as a member or visitor, there are upper errors
Title: Re: Topics Created And Participated In
Post by: dougiefresh on December 19, 2016, 10:32:30 AM
Uploaded v2.1 - December 19th, 2016
o Modified code so that topic list can be pulled for any user, by any user.
o Removed erroneous permission check.
o Removed template in exchange for using template inside Attachment template file.



@Everybody:  This update should solve the bug reports found by akbora.   Thank you, akbora!
Title: Re: Topics Created And Participated In
Post by: Steve on December 19, 2016, 12:25:19 PM
Pretty slick and works like a charm as far as I can tell. ;D
Title: Re: Topics Created And Participated In
Post by: akbora on December 20, 2016, 02:56:32 AM
Uploaded v2.1 - December 19th, 2016
o Modified code so that topic list can be pulled for any user, by any user.
o Removed erroneous permission check.
o Removed template in exchange for using template inside Attachment template file.



@Everybody:  This update should solve the bug reports found by akbora.   Thank you, akbora!
Thank you very much everything is fine.

Now Turkish version:

Code: [Select]
$txt['TUPC_topics'] = 'Üyeye ait konuları göster';
$txt['TUPC_topics_desc'] = 'Bu bölüm size bu üyenin açtığı konuları ve hangi konulara katılım yaptığını gösterir.';
$txt['TUPC_user_created'] = 'Üyenin Açtığı Konular';
$txt['TUPC_user_participated'] = 'Üyenin Katıldığı Konular';
$txt['TUPC_no_topics_created'] = 'Üye henüz bir konu açmamıştır';
$txt['TUPC_no_topics_participated'] = 'Üye henüz herhangi bir konuya katılmamıştır.';


utf8 Turkish

Quote
$txt['TUPC_topics'] = 'Üyeye ait konuları göster';
$txt['TUPC_topics_desc'] = 'Bu bölüm size bu üyenin açtığı konuları ve hangi konulara katılım yaptığını gösterir.';
$txt['TUPC_user_created'] = 'Ãœyenin Açtığı Konular';
$txt['TUPC_user_participated'] = 'Üyenin Katıldığı Konular';
$txt['TUPC_no_topics_created'] = 'Üye henüz bir konu açmamıştır';
$txt['TUPC_no_topics_participated'] = 'Üye henüz herhangi bir konuya katılmamıştır.';
Title: Re: Topics Created And Participated In
Post by: akbora on December 20, 2016, 03:14:55 AM
Sorrry I see a problem another:

Users or visitors can see forbıdden board or topics. This is serious problem. Thanks
Title: Re: Topics Created And Participated In
Post by: dougiefresh on December 20, 2016, 09:42:10 AM
Uploaded v2.2 - December 20th, 2016
o Fixed bug where user can see topics made in boards that they don't have access to.


Users or visitors can see forbıdden board or topics. This is serious problem. Thanks
This update should resolve this bug report.  Thank you, akbora!
Title: Re: Topics Created And Participated In
Post by: aegersz on December 22, 2016, 01:35:42 PM
another c00l feature by the sensational dougiefresh.

always well behaved mods that play nicely ... thanks, sir !
Title: Re: Topics Created And Participated In
Post by: Colin on December 22, 2016, 03:04:45 PM
Excellent mod, thanks Dougie.
Title: Re: Topics Created And Participated In
Post by: dougiefresh on December 22, 2016, 09:29:39 PM
Thanks, y'all!
Title: Re: Topics Created And Participated In
Post by: Ian Mc on December 29, 2016, 06:09:29 PM
Really useful mod.

Just one issue I'm having. When I select a users threads or participated in, the order is ascending (which is fine), but when I click on the top of the date row for example, which I assume should change the order to decending, it links back to my own activity rather than reordering the users. Hope that makes sense!
Title: Re: Topics Created And Participated In
Post by: airmon on February 08, 2017, 04:28:38 PM
Thanks for the mod, I keep seeing your name show up on useful stuff.

I'm using this mod on 2.0.13 and it does something odd. Only the "user created" link really worked for me. The "user participated" link took me to page 1 of the correct results, but if I clicked on page 2, or tried to sort so that newer posts came up first, the screen refreshed and went back to the "user created" results.




Title: Re: Topics Created And Participated In
Post by: dougiefresh on February 10, 2017, 11:51:59 AM
Uploaded v2.3 - February 10th, 2017
o Changed default sort direction to descending.
o Fixed issue where clicking on pages in "Participated In" goes back to "Topics Created" page.



@airmon:  This update should fix the bug report that you submitted!  Thank you!
Title: Re: Topics Created And Participated In
Post by: Moonwink on February 10, 2017, 12:02:37 PM
Thanks for the MOD! 

I'm also having trouble seeing recent "Participated In" topics.   By default is sorts to show the oldest topics I replied to and I can't reverse the sort to show the newest topics.  Any attempt to change the sort order of the "Participated In" screen results in seeing the "Created" page again sorted by oldest first. 

As an request for a change, would it be possible to change the default to show the newest topics instead of the oldest topics at the top of the list?  There's a lot of water under the bridge since this oldest topics were current and 99.9% of the time I believe everyone will be interested in seeing and working with the topics they've recently been involved with.

Dougiefresh,
Thanks for the fix!  You posted it just as I clicked to post the message above.  I thought I'd go ahead and post this to ask for the sort order change.
Title: Re: Topics Created And Participated In
Post by: dougiefresh on February 10, 2017, 12:27:21 PM
Thanks for the MOD! 

I'm also having trouble seeing recent "Participated In" topics.   By default is sorts to show the oldest topics I replied to and I can't reverse the sort to show the newest topics.  Any attempt to change the sort order of the "Participated In" screen results in seeing the "Created" page again sorted by oldest first. 

As an request for a change, would it be possible to change the default to show the newest topics instead of the oldest topics at the top of the list?  There's a lot of water under the bridge since this oldest topics were current and 99.9% of the time I believe everyone will be interested in seeing and working with the topics they've recently been involved with.

Dougiefresh,
Thanks for the fix!  You posted it just as I clicked to post the message above.  I thought I'd go ahead and post this to ask for the sort order change.
Since nobody downloaded version 2.3 yet, I updated version 2.3 to include the request to change sort direction by default to descending.  Also updated version 2.3's changelog 2 posts back....
Title: Re: Topics Created And Participated In
Post by: profzelonka on February 26, 2017, 02:10:35 AM
Awesome mod, thank you. !

Wanted to let you know that for some reason 2.3 is showing up as "old version" on the Package Manager page. No issues tho.
Title: Re: Topics Created And Participated In
Post by: MULITRI on February 26, 2017, 02:18:02 PM
Thnaks for this great and neat Mod, excellent job.

I have just installed it in a fresh v2.0.13 version, and it looks great... but i have found an error....hey!! only one :)

With an User with no posts, clicking "Participated in" reports this error:

Code: [Select]
Database error, given array of integer values is empty. (topics)

The other option works fine, it shows the "No topics started" message... and when the User has messages and topics, both options works fine.

I hope you can solve this small issue, it's a great Mod for Users can find overall Topics started by any User, always useful.

Thank you.
Title: Re: Topics Created And Participated In
Post by: dougiefresh on February 26, 2017, 08:12:40 PM
Uploaded v2.4 - February 26th, 2017
o Fixed database error that occurs when user has participated in no topics.



@MULITRI:  Hopefully this update fixes the bug report that you made.  Thank you!
Title: Re: Topics Created And Participated In
Post by: MULITRI on February 28, 2017, 02:16:06 PM
Sure i'm going to try it, just after i can restore my forum for all the errors all around due to an old Mod i tried to add without luck hehe.

I'll let you know, Thanks a lot to be watching at your Mods to get'em up-to-date... Great Job!
Title: Re: Topics Created And Participated In
Post by: MULITRI on March 01, 2017, 01:33:06 PM
Sorry to bump but i cannot modify my last reply.

doogiefresh... you did it again!! the error is fixed with your last update, so now your Mod is perfect!!

Thanks to you for your excellent job... Regards.
Title: Re: Topics Created And Participated In
Post by: dougiefresh on March 01, 2017, 08:08:15 PM
You're welcome!
Title: Re: Topics Created And Participated In
Post by: BellGab.com on April 09, 2017, 11:26:30 PM
Hi.  This mod appears to be generating the following error:

8: Undefined index: TUPC_user_participatedApply Filter: Only show the errors from this file File: /home/michaelv/public_html/bellgab.com/Sources/Subs-Participation.php

Code: [Select]
22: 'label' => $txt['TUPC_topics'],
23: 'file' => 'Profile-Participation.php',
24: 'function' => 'TUPC_showTopics',
25: 'subsections' => array(
26: 'created' => array($txt['TUPC_user_created'], array('profile_view_own', 'profile_view_any')),
==>27: 'participated' => array($txt['TUPC_user_participated'], array('profile_view_own', 'profile_view_any')),
28: ),
29: 'permission' => array(
30: 'own' => array('profile_view_own'),
31: 'any' => array('profile_view_any'),
32: ),
33: );
34: }
35: }

Any thoughts?

And, btw, you've built a lot of great mods.  I use several.  Thanks.
Title: Re: Topics Created And Participated In
Post by: dougiefresh on July 11, 2017, 11:49:26 AM
Uploaded v2.5 - July 11th, 2017
o Replaced IFNULL with COALESCE in database queries for better Postgres support.



@BellGab.com:  Whoops!  I missed this bug report.  I'll look into it!
Title: Re: Topics Created And Participated In
Post by: dougiefresh on July 18, 2017, 12:11:39 AM
Uploaded v2.6 - July 17th, 2017
o Language settings moved from Profile.english.php to TUPC.english.php.



@BellGab.com:  Thank you for the bug report!  This issue has been resolved with the version 2.6 update.
Title: Re: Topics Created And Participated In
Post by: landyvlad on December 18, 2017, 07:29:45 AM
What is the update process please?  Is it just upload and install the new one, or do I uninstall./delete the old one first?
(It'd be cool if this info was included in the description of the mod, for easy reference)

Thanks
Title: Re: Topics Created And Participated In
Post by: dougiefresh on December 18, 2017, 09:16:11 AM
What is the update process please?  Is it just upload and install the new one, or do I uninstall./delete the old one first?
(It'd be cool if this info was included in the description of the mod, for easy reference)
First, Package Manager won't allow you to install a newer version of a mod while an older version is installed.  If the package supports upgrading, Package Manager will give you the option to upgrade to the new version.  Most of my mods do not support upgrades in that fashion, mostly because some servers have issues with multiple install XML files and aren't smart enough to make it work....

The proper way to upgrade any mod that doesn't give the option through Package Manager is to uninstall the current version of the mod, then install  the new version.  Immediately deleting the old version is not mandatory at any stage of the upgrade process, although if you are happy with the new version, deletion of the old version is recommended.
Title: Re: Topics Created And Participated In
Post by: digger on January 15, 2018, 02:43:06 PM
I think wil be better to skip recycled topics.
Russian lang in attachment.
Title: Re: Topics Created And Participated In
Post by: dougiefresh on January 15, 2018, 11:58:15 PM
Uploaded v2.7 - January 15th, 2018
o Added Russian translation, courtsey of digger (https://www.simplemachines.org/community/index.php?action=profile;u=97557)!
o Fixed queries so that recycle boards are omitted from database queries.



@digger:  You're right, recycle boards should definitely be omitted from the queries!  I've also included your Russian translation in this version.  Thank you very much for it!
Title: Re: Topics Created And Participated In
Post by: landyvlad on January 16, 2018, 10:11:51 PM
Thanks Dougie that's a good explanation - much appreciated.
Perhaps that could be included in the SMF documentation? (I couldn't find it there).
Title: Re: Topics Created And Participated In
Post by: digger on January 17, 2018, 07:09:05 AM
o Fixed queries so that recycle boards are omitted from database queries.
This doesn't work because you forgot to add $modSettings to the global scope. Below is a patch with a few minor fixes

Code: [Select]
===================================================================
--- forum/Sources/Profile-Participation.php (date 1516189488867)
+++ forum/Sources/Profile-Participation.php (date 1516189488867)
@@ -14,7 +14,7 @@
 ********************************************************************************/
 function TUPC_showTopics()
 {
- global $context, $txt, $scripturl, $modSettings, $smcFunc, $sourcedir, $user_info;
+ global $context, $txt, $scripturl, $modSettings, $sourcedir, $user_info;
 
  // Set up for listing the "important" topics:
  loadTemplate('ManageAttachments');
@@ -65,7 +65,7 @@
  $user = \'<a href="\' . $scripturl . \'?action=profile;user=\' . $rowData["first_member"] . \'">\' . $rowData[\'first_poster\'] . \'</a>\';
  else
  $user = $rowData["first_member"];
- return $board . " \\\\ " . $topic . \'<div class="smalltext">\' . $txt["started_by"] . " <strong>" . $user . \'</strong></div>\';
+ return $board . " &#187; " . $topic . \'<div class="smalltext">\' . $txt["started_by"] . " <strong>" . $user . \'</strong></div>\';
  '),
  ),
  'sort' => array(
@@ -136,7 +136,8 @@
 ********************************************************************************/
 function TUPC_Created_Count()
 {
- global $smcFunc;
+ global $smcFunc, $modSettings;
+
  $request = $smcFunc['db_query']('', '
  SELECT COUNT(*) AS count
  FROM {db_prefix}topics AS t
@@ -156,7 +157,7 @@
 
 function TUPC_Created($start, $items_per_page, $sort)
 {
- global $smcFunc;
+ global $smcFunc, $modSettings;
 
  $request = $smcFunc['db_query']('', '
  SELECT
@@ -196,7 +197,7 @@
 ********************************************************************************/
 function TUPC_Participated_Count()
 {
- global $smcFunc, $user_info, $context;
+ global $smcFunc, $context, $modSettings;
 
  $request = $smcFunc['db_query']('', '
  SELECT DISTINCT id_topic AS id_topic
@@ -220,7 +221,7 @@
 
 function TUPC_Participated($start, $items_per_page, $sort)
 {
- global $smcFunc, $user_info, $context;
+ global $smcFunc, $context, $modSettings;
 
  // Is the topic list defined?  If not, then do so before continuing:
  if (empty($context['TUPC_topics']))
Title: Re: Topics Created And Participated In
Post by: Study Force on January 17, 2018, 09:46:36 PM
Thanks for the excellent mod!
Title: Re: Topics Created And Participated In
Post by: dougiefresh on January 19, 2018, 08:53:29 PM
Uploaded v2.8 - January 19th, 2018
o Integrated digger (https://www.simplemachines.org/community/index.php?action=profile;u=97557)'s patch, which adds $modSettings as global variable.



@digger:  Thank you for the patch!  It's been integrated into this mod....
Title: Re: Topics Created And Participated In
Post by: shnazzle on February 01, 2018, 07:42:41 PM
Very nice mod! Thanks heaps
Title: Re: Topics Created And Participated In
Post by: nofapturkiye on February 11, 2018, 05:30:16 PM
you are smf hero indeed ,  was looking for something like this
Title: Re: Topics Created And Participated In
Post by: Rock Lee on February 11, 2018, 06:45:09 PM
I leave another translation more, anything you tell me :) @dougiefresh


Regards!
Title: Re: Topics Created And Participated In
Post by: dougiefresh on February 12, 2018, 10:51:20 AM
Uploaded v2.9 - February 12th, 2018
o Added translators section to the readme.txt file.
o Added Spanish Latin translation, courtsey of Rock Lee (https://www.simplemachines.org/community/index.php?action=profile;u=322597).
o Added LICENSE file to the mod, to clarify licensing terms.



@Rock Lee:  Thank you for the translation!  It's been included in this version!
Title: Re: Topics Created And Participated In
Post by: digger on October 16, 2018, 05:27:59 AM
@dougiefresh
Mod doesn't track member id when topics list have more then one page. Urls looks like index.php?action=profile;area=threads;sa=created;sort=lastpost;desc;start=20 without member id in this query. When i go to next page in any profile it redirect to my own profile topics page.
Title: Re: Topics Created And Participated In
Post by: ORIONzitos on October 17, 2018, 07:25:01 AM
PT-BR Translation here! 8) anything you tell me :) @dougiefresh
Title: Re: Topics Created And Participated In
Post by: ORIONzitos on October 17, 2018, 08:40:33 AM
PT-BR Translation here! 8) anything you tell me :) @dougiefresh

Oops! Correction
Title: Re: Topics Created And Participated In
Post by: dougiefresh on November 08, 2018, 10:52:34 PM
Uploaded v2.10 - November 8th, 2018
o No functionality change.
o Updated documentation to point to new website.



@ORIONzitos and @digger:  Sorry, I didn't see these before I published this release.....  I'll address these issues soon!
Title: Re: Topics Created And Participated In
Post by: dougiefresh on November 09, 2018, 09:11:14 PM
Uploaded v2.11 - November 9th, 2018
o Added user parameter to the base URL of the list produced.
o Added Portuguese Brazilian translation, courtsey of ORIONzitos (https://www.simplemachines.org/community/index.php?action=profile;u=598068)!



@digger:  I'm having a hard time reproducing this issue, but I've included the user ID in the base URL.  Hopefully, this change will take care of the issue....

@ORIONzitos:  Thank you for your translation!  It's been included in this version!
Title: Re: Topics Created And Participated In
Post by: digger on November 13, 2018, 10:08:34 AM
@digger:  I'm having a hard time reproducing this issue, but I've included the user ID in the base URL.  Hopefully, this change will take care of the issue....
Yes, it fixed now. Thanks.