Auto Post Application on Sign Up?
Hello All,
I have been browsing the web for a while to find an answer to this.
What I want to enable is maybe a complicated function however, it is quite important for our forums.
Basically when a new member wishes to apply for the forums I want to crete a custom application form which they have to fill in. Once they have filled in their application and submitted it I want it to be automatically posted on the forums under an applications section.
From this staff memebers could accept or decline this member based on the info provided.
Second is there a way to delete posts in a certain forum automatically after a period of time.
New "trialists" are on trial for one week, after which it is decided based on member feedback wether they can join the community. Is there a way that these posts would either auto delete or be marked for review after this time period of one week?
Thanks for any feedback you can give guys.
Regards,
Woft
Comments
look into forms creation on the wiki and look in to kaspers api application as well as possibly lincoln's shwaipbot plugin
and the signin event handler.
and it is probably dependent on your version of vanilla that you use. what vanilla version are you using? you may need to 2.1b2 to fully implement easily with the api
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I am using 2.0.18.10 at the moment. I will have a look into what you mentioned as well.
Hello,
I tried reading through this but found it very confusing as we are unexperiencd with code. could you explain the process a little more?
It may be better to use the built-in approval registration method and modify it to fit your needs instead of creating new discussions for the registration applications.
Add Pages to Vanilla with the Basic Pages app
I would also favor using the registration form.
You would have to create a custom plugin. Look at some example plugins for that. It must have following form:
See examples in order to find out what fields are also possible for the $PluginInfo array.
In its setup it must create the application form fields you would like to add:
Function Setup is called once when you activate your plugin. You would have to store your applicant infomration somewhere, it is info concerning the user so add the info to the user by extending the database to keep your information. All that is done with the above code.
You want your applicants to be approved before they become members, right? So set your registration method to approval and override Vanillas register view (you might think in "templates" - in Vanilla they are called views).
Overriding a view could be done by creating a file
/plugins/YourPluginName/views/entry/registerapproval.php
. Copy the content of the file/dashboard/views/entry/registerapproval.php
to your new file and search for the following lines:Replace this with something you need. Could look anyway like this:
See that I've used exactly the same names in the form as for the database columns? That's important! That way, all the field contents will be stored automagically! Great, isn't it?
Now that your users have registered and filled out any info you want to get hold of, you will need a place where you can access this. Create a function
public function SettingsController_YourPluginName_Create($Sender) {echo 'Hello World!';}
. Whatever you do there could be accessed under www.example.com/settings/yourpluginname.So you want to see all user names and all your aditional fields of any user that has registered the last seven days? Maybe an Accept/Decline radio button and the number of accepts/declines? You would need an additional field in the database for that. Info could be stored as a serialized array there.
You would need a form for that. In order to make sure that only staff members can access this site, you would have to create a special permission, but that would be easy.
If I were used to creating forms I would suggest you some code, but I can't, sorry. From now it's up to you alone.
My advice to you is that you start creating the plugin and make it as complete as you can. Whenever you have a specific question come back and there surely will be someone who can and will help you!
:-( Overriding the view isn't as easy as I thought. You would have to create an event hook for that, but if you start working on the plugin, I could show you how to achieve that. Look at the RegistrationRole plugin for an example
WOW thank you for being so detailed, this definately helps. Will get back to you if i have problems...i am sure we will haha
I'm glad you take the challenge!
ok so i have implemented a new application form. I used Javascript to hide unwanted fields until they are clicked on in a radio button list.
The problem is, i have written the radiobutton list in html and want to convert it over to php however, conventiaonal php doesn't seem to apply or this may be a misunderstanding on my part.
i see the gender radio button list is called like this:
however this provides no insight in how to create a radio button list.
this is how i have created it in html:
how would i convert this over?
you could put your info in an associative array or use enumerated options in your database field.
you can search vanilla code for other examples of how radiolist is called from the code.
e.g.
applications/dashboard/views/settings/email.php:63:
the info in class.form.php - might be helpful to look at. since you are calling that function.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Ok, so now I am forgetting about the auto post information on the forums, I simply want to save the custom fields I added to the register page so that on the applicants view I can see the information.
I understand the
DiscoveryText
is shown in the applicants section of the dashboard with this code$this->EventArguments['User'] = $User; $this->FireEvent("ApplicantInfo"); echo '<blockquote>'.$User->DiscoveryText.'</blockquote>';
I know how to add information to this page, but how do I get the information the applicant entered?
is this is saved in the database, how do I add this application information into the database?
ok ignore this, i manually added the database column.
Remember my post from some time ago:
You don't have to add columns manually
would this go in the php file? i am creating the custom registration page by customising the stopbot plugin.
and yes i forgot about this :disappointed:
actually again i have answered my own question i think, i would add your code to the setup function of the plugin, so
public function Setup() { SaveToConfig('Plugins.BotStop.Question', 'What is three plus three?'); SaveToConfig('Plugins.BotStop.Answer1', '6'); SaveToConfig('Plugins.BotStop.Answer2', 'six'); }
becomes
public function Setup() { SaveToConfig('Plugins.BotStop.Question', 'What is three plus three?'); SaveToConfig('Plugins.BotStop.Answer1', '6'); SaveToConfig('Plugins.BotStop.Answer2', 'six'); Gdn::Structure()->Table('User') ->Column('WhateverYouWantToAsk', 'varchar(32)', TRUE) ->Column('SomethingOther', 'int', TRUE) ->Set(FALSE, FALSE); }
I would then have to disable and reenable to plugin for it to create the columns. what happens if the column is already in the database?
the existence of column shouldn't matter.
do yourself a favor and read the comments before each function in
library/database/class.databasestructure.php
you can also peruse the other files in that folder and you will probably learn some things.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@Woft All your changes should go into your plugin. Normally there is no need to change any of the existing files and you shouldn't do it.