The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
How to treat logged...
 
Notifications
Clear all

[Solved] How to treat logged in users as guest?

10 Posts
3 Users
2 Reactions
2,769 Views
(@cortega)
Posts: 9
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 
[#1390]

I have a weird request, and don't know where to go in the code to make this happen.

How can I have all users treated as a guest, when they post a comment, so they are allowed to choose their own name, and e-mail at the time of posting something?

Thanks for the help.


 
Posted : 03/12/2020 1:11 am
(@orakel)
Posts: 107
Estimable Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Isn´t somethink like "dont allow registration"?


 
Posted : 03/12/2020 1:16 am
(@cortega)
Posts: 9
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 
Posted by: @orakel

Isn´t somethink like "dont allow registration"?

Not sure what you mean ?

Trying to basically get the form, that in the file Form.php is labled under classname ".wpd-form-foot" to always show up, and actually work. I can get it to show up, when someone is logged in, but filling it out and submitting it doesn't actually display the selected name.

 

Basically trying to make everyone in the comments anonymous, while they are logged in. 


 
Posted : 03/12/2020 2:38 am
(@orakel)
Posts: 107
Estimable Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 
Posted by: @cortega

Basically trying to make everyone in the comments anonymous, while they are logged in. 

Ah ok, i understand now.....sorry for the mistake...i will look if i have a simple code for that. Asti helps me so much and sent me a lot of codes.

Maybe he is faster, but i try =)


 
Posted : 03/12/2020 3:00 am
(@orakel)
Posts: 107
Estimable Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

I cant find a code at the moment, but i am sure, this would be 2 or 3 lines to rename all roles to "guest" and remove the labels.

Sorry, i am sure Asti will help fast

 

Orakel


 
Posted : 03/12/2020 3:15 am
Asti
 Asti
(@asti)
Posts: 8259
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@cortega,

We're really sorry, but wpDiscuz doesn't show the name and email fields if the user is already logged in. There is no way to do it. 

Basically trying to make everyone in the comments anonymous, while they are logged in. 

In case if you want to make all comments made by both registered users' and guests as anonymous, let us know. We'll provide you a JS code that will replace the names of the commenters with "Anonymous" phrase.

 


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 03/12/2020 1:12 pm
(@cortega)
Posts: 9
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@asti Sure! I think I can make that work. Thanks for the help.

If I figure a solution out I'll post it here, in case someone in the future needs this. I seem to be making some progress using the "preprocess_comment" filter.

 


 
Posted : 03/12/2020 8:17 pm
Asti reacted
(@cortega)
Posts: 9
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@orakel You're fine. I really appreciate you trying to help. Have a great one!


 
Posted : 03/12/2020 8:18 pm
Asti reacted
(@cortega)
Posts: 9
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Actually I forgot I wrote this yesterday. Here is some code that makes users post as anonymous unless they have a certain role. Hopefully it helps someone in the future. 

 

add_filter("wpdiscuz_comment_author", function ($authorName, $comment) {

    $allowed_roles = array('editor','administrator','author','super admin');

    $user_id   = $comment->user_id;

    $user_roles = get_userdata($user_id);

    if(is_object($user_roles)){

        if(!array_intersect($user_roles->roles, $allowed_roles)){

            $authorName = 'Anonymous';

        }

    }

    return $authorName;

}, 10, 2);

 
Posted : 03/12/2020 8:24 pm
Asti
 Asti
(@asti)
Posts: 8259
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Thank you for taking a time and share the solution We really appreciate it.


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 04/12/2020 11:41 am