News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

post rank id in code

Started by wtfwtf, January 01, 2019, 07:13:22 PM

Previous topic - Next topic

wtfwtf

hello
is there a way to specify a specific post rank id in the code
example:
postrank[1]

Kindred

No. It is calculated,  not specified
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

wtfwtf

Quote from: Kindred on January 01, 2019, 09:53:08 PM
No. It is calculated,  not specified

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

Arantor

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.

Aleksi "Lex" Kilpinen

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.
Slava
Ukraini!


"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

How you can help SMF

wtfwtf

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

Illori

we need concrete answers from you so we can provide you code that will WORK.

Aleksi "Lex" Kilpinen

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.
Slava
Ukraini!


"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

How you can help SMF

wtfwtf

Quote from: Aleksi "Lex" Kilpinen 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.

thanks Lex, that would be pretty helpful i think

wtfwtf

Quote from: Aleksi "Lex" Kilpinen 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.

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

Arantor

Under some circumstances, yes. But more details about what you're trying to do now would be useful.

Kindred

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.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

wtfwtf

Quote from: Kindred 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.

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

Aleksi "Lex" Kilpinen

Okay, now that's not gonna be so easy. The user_info variables are meant for checking what is, not defining what should be.
Slava
Ukraini!


"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

How you can help SMF

Arantor

Quote from: wtfwtf on January 02, 2019, 02:59:20 PM
Quote from: Kindred 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.

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.

wtfwtf

Quote from: Aleksi "Lex" Kilpinen 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.

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,]]>


wtfwtf


Kindred

Seems overly complicated and basically useless
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Aleksi "Lex" Kilpinen

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.
Slava
Ukraini!


"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

How you can help SMF

Arantor

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.

Advertisement: