News:

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

Main Menu

A few questions regarding using SMF 2

Started by isrusr, March 24, 2012, 01:25:11 PM

Previous topic - Next topic

isrusr

Hi, a few questions:

1. Can I somehow add a static security token that users would be required to enter in order to register as a new user to the system ?
2. Is there an option to have a forum that new posts (first post in a discussion only) in it will follow some sort of template instead of showing a white space to enter text ?
3. Is there an option to have a forum where only the forum moderators and the original post author can write on that discussion ?

MrPhil


  • What are you trying to accomplish here? Can you give an example of a "static security token", and how you would use it? If you're trying to limit your membership to a specific group of people, the easiest ways would be to either use Administrator Approval on signup and deny anyone you don't recognize, or preregister (as administrator) only those people you want (and send them their IDs and passwords), and then leave member signup "off".
  • I've seen this asked for before, but I don't know if there's a mod to do it. Since SMF knows that a post is the first in a topic, I wouldn't think it would be too hard to prefill the message body with some sort of fixed template text. Note that this text can be overwritten or erased, and does not constrain where a member types in anything.
  • Normally permissions are granted by group membership, but in this case I think you'd have to do some custom coding so that not only the moderator group can post, but also the OP (even if they're not in the moderator group).

emanuele



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

isrusr

Quote from: MrPhil on March 24, 2012, 03:31:19 PM

  • What are you trying to accomplish here? Can you give an example of a "static security token", and how you would use it? If you're trying to limit your membership to a specific group of people, the easiest ways would be to either use Administrator Approval on signup and deny anyone you don't recognize, or preregister (as administrator) only those people you want (and send them their IDs and passwords), and then leave member signup "off".
  • I've seen this asked for before, but I don't know if there's a mod to do it. Since SMF knows that a post is the first in a topic, I wouldn't think it would be too hard to prefill the message body with some sort of fixed template text. Note that this text can be overwritten or erased, and does not constrain where a member types in anything.
  • Normally permissions are granted by group membership, but in this case I think you'd have to do some custom coding so that not only the moderator group can post, but also the OP (even if they're not in the moderator group).
1. For the security token, I want to email a group of users some keyword that they will enter in the registration phase, and that will allow the to register, others without it wouldn't be able to. I know this is a very low-tech and lame way to block access, but it's sufficient for my needs. I do not want to use a system where I have to preregister or approve on each person basis.
2. Wouldn't be hard to prefill how ? I don't seem to see an option for this.
3. custom coding sucks :) I would rather have some plugin / something builtin. Nobody had a situation where Some discussion needs to talk between the opener and the forum moderators  ? (what is OP) ?

MrPhil


  • Maybe you could set just one "user question" on registration to be "Enter the security code", and the answer is the code you sent out. Keep in mind that if you have enough invited members that you don't want to preregister them or approve them individually, that someone is going to leak the security code. Count on it.
  • Unless someone has written a mod for it, there is no pre-existing option to do this. It would be new (custom) coding.
  • Per emanuele, there might be a combination of permissions to do this.

Consider setting up a test SMF forum and seeing if you can implement these things to your satisfaction. For #2 (prefilled text on Original Posting), if there is no mod for it you will have to modify the code yourself. As I said, I've seen requests for this, but I don't know if anyone ever implemented it.

Sir Osis of Liver


You can use verification questions for the security token.  Just set up a question that asks 'Please enter security code', and the answer would be your security token.

Admin -> Security and Moderation -> Anti-Spam

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

isrusr

#6
Quote from: MrPhil on March 24, 2012, 11:27:22 PM

  • Maybe you could set just one "user question" on registration to be "Enter the security code", and the answer is the code you sent out. Keep in mind that if you have enough invited members that you don't want to preregister them or approve them individually, that someone is going to leak the security code. Count on it.
  • Unless someone has written a mod for it, there is no pre-existing option to do this. It would be new (custom) coding.
  • Per emanuele, there might be a combination of permissions to do this.

Consider setting up a test SMF forum and seeing if you can implement these things to your satisfaction. For #2 (prefilled text on Original Posting), if there is no mod for it you will have to modify the code yourself. As I said, I've seen requests for this, but I don't know if anyone ever implemented it.
I'll def check that user question in security code. As for someone writing a mod or not, I have no clue, I was hoping someone here could help me out figuring this (I can't be the first one that wants this ? :) ). Also stuff like "there might be"... isn't helpfull, I'm here to get answers, not re-asking my questions :)

OK, I figure most of it out, now how can i add a "template" to new topics in a forum ?

MrPhil

I took a look through the code, but am unable to test this out at the current time. It looks like in Themes/<your theme>/scripts/topic.js you'll want to find the function
QuickModify.prototype.onMessageReceived = function (XMLDoc)
A few lines down is
// Replace the body part.
for (var i = 0; i < XMLDoc.getElementsByTagName("message")[0].childNodes.length; i++)
sBodyText += XMLDoc.getElementsByTagName("message")[0].childNodes[i].nodeValue;
this.oCurMessageDiv = document.getElementById(this.sCurMessageId);

I suspect that after sBodyText is built up that you want to check if it's still empty '', and if so, replace it with your template. Something like:
// Replace the body part.
for (var i = 0; i < XMLDoc.getElementsByTagName("message")[0].childNodes.length; i++)
sBodyText += XMLDoc.getElementsByTagName("message")[0].childNodes[i].nodeValue;
        if (sBodyText == '')
                sBodyText = "whatever template you want, here";
this.oCurMessageDiv = document.getElementById(this.sCurMessageId);

If you want multiple lines in your template, I would try standard HTML tags (<br>, etc.). Give it a try (it's a simple enough change). If that doesn't do it, maybe someone else has some ideas.

isrusr

would be cool if this mod would support 2.0.2:
http://www.simplemachines.org/community/index.php?topic=459477.0
anybody know how I can get it to work (or something simmilar) ?

(your idea is nice, but requires javascript to be on to work).

isrusr

Quote from: isrusr on March 27, 2012, 06:48:05 PM
would be cool if this mod would support 2.0.2:
http://www.simplemachines.org/community/index.php?topic=459477.0
anybody know how I can get it to work (or something simmilar) ?

(your idea is nice, but requires javascript to be on to work).
no ideas ?

Kindred

The custom forms mod works fine on 2.0.2
Сл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."

isrusr

http://custom.simplemachines.org/mods/index.php?mod=1279 says it's just for 2.0RC5, when i tried installing on 2.0.2 I got quite a few errors (using the web auto installation), ideas why ? should i do something or install it in a different way ?

Sir Osis of Liver


Try using RC5 emulation ('Advanced' link at bottom of mod list).

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

isrusr

any side effects i should be alert ? security issue ? what does this emulation do ? is it global or per mod ?

TheListener

Quote from: isrusr on April 12, 2012, 06:11:46 PM
any side effects i should be alert ? security issue ? what does this emulation do ? is it global or per mod ?

@isrusr

The Mod Emulation link in my sig will help you understand how it works.

:)

Sir Osis of Liver


Just remember to set emulation back to 2.0.2 when you're done.  I believe it saves the setting, which may bugger future installations.

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Advertisement: