Advertisement:

Author Topic: Based membergroups by thanks_count from mod Say Thanks  (Read 1530 times)

Offline minimono

  • Semi-Newbie
  • *
  • Posts: 22
Based membergroups by thanks_count from mod Say Thanks
« on: March 27, 2018, 04:33:19 AM »
I'm SMF 2.0.15
How to based membergroups by thanks_count from mod Say Thanks.
same mod Karma based membergroups.

Thank You. :)

Offline Steve

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 4,301
  • Gender: Male
  • I have not yet begun to procrastinate.
Re: Based membergroups by thanks_count from mod Say Thanks
« Reply #1 on: March 27, 2018, 01:57:59 PM »
Mod questions for existing mods need to be asked in the support threads for them.
Online Manual

Please do not PM me for support.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 56,463
  • Gender: Male
    • Kindred-999 on GitHub
Re: Based membergroups by thanks_count from mod Say Thanks
« Reply #2 on: March 27, 2018, 03:51:21 PM »
he wants a new mod that adds functionality based on another mod...
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,691
  • Mod King
    • XPtsp.com Community
Re: Based membergroups by thanks_count from mod Say Thanks
« Reply #3 on: March 27, 2018, 10:29:43 PM »
I can write something up for ya....  The changes look easy enough.....  It may be tomorrow when I do, though.  (It's almost 10pm here...  and almost bedtime for me  O:) )
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline minimono

  • Semi-Newbie
  • *
  • Posts: 22
Re: Based membergroups by thanks_count from mod Say Thanks
« Reply #4 on: March 27, 2018, 11:28:57 PM »
Mod is no longer supported so you probably won't receive an answer  :(

I can write something up for ya....  The changes look easy enough.....  It may be tomorrow when I do, though.  (It's almost 10pm here...  and almost bedtime for me  O:) )
;D

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,691
  • Mod King
    • XPtsp.com Community
Re: Based membergroups by thanks_count from mod Say Thanks
« Reply #5 on: March 28, 2018, 10:48:58 AM »
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline minimono

  • Semi-Newbie
  • *
  • Posts: 22
Re: Based membergroups by thanks_count from mod Say Thanks
« Reply #6 on: March 29, 2018, 06:46:06 AM »
I'm test this mod.
mod not refresh membergroups from thanks_count score up/down.
Membergroups refresh when modify number of Thanks Received in ohter group(group not use)
same admin to chang it all time.

Offline minimono

  • Semi-Newbie
  • *
  • Posts: 22
Re: Based membergroups by thanks_count from mod Say Thanks
« Reply #7 on: April 01, 2018, 01:53:11 AM »
Thank you very much for your help.
Try this: Thanks Received Membergroups [nofollow]

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,691
  • Mod King
    • XPtsp.com Community
Re: Based membergroups by thanks_count from mod Say Thanks
« Reply #8 on: April 16, 2018, 10:29:27 PM »
I'm test this mod.
mod not refresh membergroups from thanks_count score up/down.
Membergroups refresh when modify number of Thanks Received in ohter group(group not use)
same admin to chang it all time.
Sorry about the delay in responding to you.  I'm trying to resolve the issues you brought up.....

I've got the mod changing the id_post_group field upon install and uninstall.  I'm going to look into why the updateStats function doesn't fire when giving/retracting thanks....

UPDATE:  I put the parameters in the wrong order....  Silly me....  O:)
« Last Edit: April 16, 2018, 10:43:08 PM by dougiefresh »
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,691
  • Mod King
    • XPtsp.com Community
Re: Based membergroups by thanks_count from mod Say Thanks
« Reply #9 on: April 16, 2018, 10:53:12 PM »
Uploaded v1.0.1 - April 16th, 2018
o Fixed code in SayThanks.php to update postgroups when giving/withdrawing thanks.
o Added entire case for updateStats function in order to restore original postgroups.
o Added a post-install redirect to update the postgroups to reflect thanks counts.
o Added an uninstall script to return the postgroups to reflect post counts.



@minimono:  Try this, please: Thanks Received Membergroups v1.0.1
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline minimono

  • Semi-Newbie
  • *
  • Posts: 22
Re: Based membergroups by thanks_count from mod Say Thanks
« Reply #10 on: May 09, 2018, 09:38:51 AM »
Error Log  Thanks Received Membergroups v1.0.1

when giving/withdrawing thanks.
Code: [Select]
> https://xxx.com/index.php?action=thank;msg=1188;member=53;topic=306;ajax=1;xml=1
> 2: in_array() expects parameter 2 to be array, string given
> File: D:/Inetpub/vhosts/xxx.com/httpdocs/Sources/Subs.php
  Line: 376
Line: 376
Code: [Select]
374: case 'postgroups':
375: // Parameter two is the updated columns: we should check to see if we base groups off any of these.
==>376: if ($parameter2 !== null && !in_array('thanks_count', $parameter2))
377: return;
378:
379: if (($postgroups = cache_get_data('updateStats:postgroups', 360)) == null)
380: {
381: // Fetch the postgroups!
382: $request = $smcFunc['db_query']('', '
383: SELECT id_group, min_posts
384: FROM {db_prefix}membergroups
385: WHERE min_posts != {int:min_posts}',
386: array(
387: 'min_posts' => -1,
388: )
389: );
390: $postgroups = array();
391: while ($row = $smcFunc['db_fetch_assoc']($request))
392: $postgroups[$row['id_group']] = $row['min_posts'];
393: $smcFunc['db_free_result']($request);
+
+

and when edit Membergroups
Code: [Select]
> https://xxx.com/index.php?action=admin;area=membergroups;sa=edit;group=16
> 8: Only variables should be passed by reference
> file D:/Inetpub/vhosts/xxx.com/httpdocs/Sources/Subs.php
   Line: 419
Line: 419
Code: [Select]
414: // A big fat CASE WHEN... END is faster than a zillion UPDATE's ;).
415: $smcFunc['db_query']('', '
416: UPDATE {db_prefix}members AS mem
417: LEFT JOIN {db_prefix}messages_thanks_stats AS mts ON (mts.id_member = mem.id_member)
418: SET mem.id_post_group = CASE ' . $conditions . '
==>419: ELSE ' . end(array_keys($postgroups)) . '
420: END' . ($parameter1 != null ? '
421: WHERE ' . (is_array($parameter1) ? 'mem.id_member IN ({array_int:members})' : 'mem.id_member = {int:members}') : ''),
422: array(
423: 'members' => $parameter1,
424: )
425: );
426: break;
427:
428: case 'original_postgroups':
429: // Parameter two is the updated columns: we should check to see if we base groups off any of these.
430: if ($parameter2 !== null && !in_array('posts', $parameter2))
431: return;
432:
433: if (($postgroups = cache_get_data('updateStats:postgroups', 360)) == null)
434: {
435: // Fetch the postgroups!
436: $request = $smcFunc['db_query']('', '
437: SELECT id_group, min_posts
438: FROM {db_prefix}membergroups
439: WHERE min_posts != {int:min_posts}',
+

Help me to debug this error.
Thank you very much.

Offline minimono

  • Semi-Newbie
  • *
  • Posts: 22
Re: Based membergroups by thanks_count from mod Say Thanks
« Reply #11 on: May 14, 2018, 03:47:26 AM »
 :-[ :-[ :-[

Offline dougiefresh

  • SMF Hero
  • ******
  • Posts: 2,691
  • Mod King
    • XPtsp.com Community
Re: Based membergroups by thanks_count from mod Say Thanks
« Reply #12 on: June 03, 2018, 12:03:38 PM »
I've fixed the bugs reported, but I can't seem to upload to my site.  The CPL is under maintenance, so getting the creds is impossible at the moment....  Oh Bother....
News: Missing GitHub repository...

My Free Simple Machines mods on XPtsp.com, Simple Machines Customization Site, and at GitHub!
Problem uninstalling mods?  Try Arantor's Sortable Packages (and Installed Time) mod!  It's super helpful!

Offline minimono

  • Semi-Newbie
  • *
  • Posts: 22
Re: Based membergroups by thanks_count from mod Say Thanks
« Reply #13 on: June 04, 2018, 03:31:40 AM »
Perfect debug. ;)
Thank You very much.
 ;D ;D ;D