Advertisement:

Author Topic: post rank id in code  (Read 1148 times)

Offline wtfwtf

  • Semi-Newbie
  • *
  • Posts: 94
post rank id in code
« on: January 01, 2019, 07:13:22 PM »
hello
is there a way to specify a specific post rank id in the code
example:
 postrank[1]

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,500
  • Gender: Male
    • Kindred-999 on GitHub
Re: post rank id in code
« Reply #1 on: January 01, 2019, 09:53:08 PM »
No. It is calculated,  not specified
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 wtfwtf

  • Semi-Newbie
  • *
  • Posts: 94
Re: post rank id in code
« Reply #2 on: January 02, 2019, 04:14:08 AM »
No. It is calculated,  not specified

is there a way to execute code specific to post count rank ?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,614
    • StoryBB/StoryBB on GitHub
Re: post rank id in code
« Reply #3 on: January 02, 2019, 04:18:27 AM »
Depends what you want to do and where, bearing in mind that post counts are recalculated every single time anyone makes a post, and recalculated for every single user, potentially, at that same time.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,619
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: post rank id in code
« Reply #4 on: January 02, 2019, 04:24:50 AM »
Basically, yes that should be possible by using the membergroup ids, but depending on the specific usecase it might not be the best of ideas.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline wtfwtf

  • Semi-Newbie
  • *
  • Posts: 94
Re: post rank id in code
« Reply #5 on: January 02, 2019, 10:35:40 AM »
guys, i appreciate the opinions and the philosophical input
but i need concrete answers , concrete code to find
so that i can modify

thank you

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 51,267
Re: post rank id in code
« Reply #6 on: January 02, 2019, 10:38:51 AM »
we need concrete answers from you so we can provide you code that will WORK.

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,619
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: post rank id in code
« Reply #7 on: January 02, 2019, 10:47:55 AM »
Would help to know exactly what you want to do and where.

To specify something for a user with less or more than X posts, you can use $user_info['posts']
To specify something for a user in a certain membergroup, you can use $user_info['groups']
https://wiki.simplemachines.org/smf/$user_info

To go further, we would probably all want to know what you are trying to do.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline wtfwtf

  • Semi-Newbie
  • *
  • Posts: 94
Re: post rank id in code
« Reply #8 on: January 02, 2019, 01:45:47 PM »
Would help to know exactly what you want to do and where.

To specify something for a user with less or more than X posts, you can use $user_info['posts']
To specify something for a user in a certain membergroup, you can use $user_info['groups']
https://wiki.simplemachines.org/smf/$user_info

To go further, we would probably all want to know what you are trying to do.

thanks Lex, that would be pretty helpful i think

Offline wtfwtf

  • Semi-Newbie
  • *
  • Posts: 94
Re: post rank id in code
« Reply #9 on: January 02, 2019, 01:46:44 PM »
Would help to know exactly what you want to do and where.

To specify something for a user with less or more than X posts, you can use $user_info['posts']
To specify something for a user in a certain membergroup, you can use $user_info['groups']
https://wiki.simplemachines.org/smf/$user_info

To go further, we would probably all want to know what you are trying to do.

does the $user_info['groups']
also applies for post based groups ?

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,614
    • StoryBB/StoryBB on GitHub
Re: post rank id in code
« Reply #10 on: January 02, 2019, 02:14:57 PM »
Under some circumstances, yes. But more details about what you’re trying to do now would be useful.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,500
  • Gender: Male
    • Kindred-999 on GitHub
Re: post rank id in code
« Reply #11 on: January 02, 2019, 02:47:26 PM »
are you just trying to determine which group a user is in?
(e.g. show this if user is not Newbie)
or, are you trying to SET the group? (which is what you first post suggested)

If the first, then what lex said...  but we can help further if you tell us details like what you are actually trying to do...
if the second, then no, as I said.
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 wtfwtf

  • Semi-Newbie
  • *
  • Posts: 94
Re: post rank id in code
« Reply #12 on: January 02, 2019, 02:59:20 PM »
are you just trying to determine which group a user is in?
(e.g. show this if user is not Newbie)
or, are you trying to SET the group? (which is what you first post suggested)

If the first, then what lex said...  but we can help further if you tell us details like what you are actually trying to do...
if the second, then no, as I said.

i am looking to block post count based on post count, date registered and time online, thus blocking the ranking up until specific conditions are met.
i can do this via a series of conditions that would take place before the update post count take place

Offline Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,619
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: post rank id in code
« Reply #13 on: January 02, 2019, 04:15:49 PM »
Okay, now that's not gonna be so easy. The user_info variables are meant for checking what is, not defining what should be.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,614
    • StoryBB/StoryBB on GitHub
Re: post rank id in code
« Reply #14 on: January 02, 2019, 04:18:11 PM »
are you just trying to determine which group a user is in?
(e.g. show this if user is not Newbie)
or, are you trying to SET the group? (which is what you first post suggested)

If the first, then what lex said...  but we can help further if you tell us details like what you are actually trying to do...
if the second, then no, as I said.

i am looking to block post count based on post count, date registered and time online, thus blocking the ranking up until specific conditions are met.
i can do this via a series of conditions that would take place before the update post count take place

No, you really can’t, not without rewriting how post count group calculation is done.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline wtfwtf

  • Semi-Newbie
  • *
  • Posts: 94
Re: post rank id in code
« Reply #15 on: January 02, 2019, 04:47:41 PM »
Okay, now that's not gonna be so easy. The user_info variables are meant for checking what is, not defining what should be.

 if ($user_info['posts'] == 20  || $user_info['posts'] == 60   || $user_info['posts'] == 100  || $user_info['posts'] == 200 )
    {
      $regy =  time()  - DateRegistered;
      rankPost = $regy  >= (1000 * 3600) ? true : false;
    }
    else
      $rankPost = true;

<![CDATA['update_post_count' => !$user_info['is_guest'] && !isset($_REQUEST['msg']) && $board_info['posts_count'] && $rankPost,]]>


Offline wtfwtf

  • Semi-Newbie
  • *
  • Posts: 94
Re: post rank id in code
« Reply #16 on: January 02, 2019, 06:03:51 PM »
remarks ?

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 58,500
  • Gender: Male
    • Kindred-999 on GitHub
Re: post rank id in code
« Reply #17 on: January 02, 2019, 08:00:43 PM »
Seems overly complicated and basically useless
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 Aleksi "Lex" Kilpinen

  • A Peculiar Finn
  • Lead Support Specialist
  • SMF Super Hero
  • *
  • Posts: 18,619
  • Gender: Male
  • Don't worry, I'm n00b friendly
    • Aleksi.Kilpinen on Facebook
    • LexArma on GitHub
    • aleksi-kilpinen on LinkedIn
    • There's No Place Like 127.0.0.1
Re: post rank id in code
« Reply #18 on: January 03, 2019, 12:49:26 AM »
Can't say much, not a part of SMF codebase I am very familiar with, but I am wondering where you would do this exactly. And if it wouldn't actually break something. But it's always good to experiment I guess.
A Finnish Support Specialist
 Happily running multiple SMF 2.0 installations.
  Fooling around with an i7 990X @ 3,47Ghz / 12Gb / Win 10 x64 / 3840x2160


How you can help SMF

"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum.
 Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,614
    • StoryBB/StoryBB on GitHub
Re: post rank id in code
« Reply #19 on: January 03, 2019, 02:36:18 AM »
Wait, those are your thresholds? No wonder you have issues! There is your problem, make the gaps between them waaaaay bigger. Like a scale more like 0/25/50/100/500/1000/2500/5000.
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.