Hi Richard,
I am so sorry for not being able to help more with this. I am right in
the middle of a very intense 1 month program that is keeping me busy
from early morning to late at night. But I would really like your help
with the docs, and will do my best to explain things to you. Just some
times I get swamped and have some trouble.
PHP
The goal behind BoltWire was to be something you could use without
knowing PHP. I think if you can get the basic hang of things, you can
probably do all you want without knowing PHP. But to fix our docs
problem, looking at the code will be helpful.
When you do look at the code you will see everything is pretty much
organized into several scripts (all in the scripts folder):
engine -- starts it all up
library -- all the system functions
functions, commands, conditions, markups, variables -- just what they say
In most of them, the functions are alphabetized so you can find what
you want pretty fast. When I can't remember something, I always look
at the code to figure out the syntax of something--and therefore never
look at the docs. It's faster for me. But that also means I must rely
on others to keep the docs updated. So far that has been somewhat
limited.
PLUGINS
To add functionality (like the crypt function) you can cut and past
the code directly into config.php, which should begin with the first
line below. It needs to be created and saved in the field/config
folder. BoltWire is designed to look for this script and load it
automatically if it exists--on every page.
<?php if (!defined('BOLTWIRE')) exit();
## put functions here...
Plugin scripts like crypt.php can be saved as a separate file to
config.php as well but they need to be enabled. You do this by adding
a line like the following to site.config in the section at the bottom
of the page:
enableCrypt: action.login
enableComments: blog*,forum*,action.comment
enableCounter
The first is enabled only on action.login, the second on any page that
begins with blog or forum and a comment action. And the third is
sitewide. Since we only want this script on one page I would use this
approach, rather than config.php. But it makes no real difference
either way.
If a plugin doesn't seem to be working, or some code in your
config.php file isn't working you can check to make sure it is being
called by adding a line like this on the page:
pp('hello world');
That will blank out your screen and show the designated message if the
script is being called properly. That's the first thing to check.
You can also use this to debug things. For example, in the crypt
plugin I could add these lines to check whether it is getting the
password, whether it is getting my cryptkey, and whether it is
properly encrypting it:
function BOLTXencrypt($value, $field) {
global $cryptkey;
p("Value: $value");
p("CryptKey: $cryptkey");
pp("Encrypted: " . crypt($value, $cryptkey));
return crypt($value, $cryptkey);
}
Both p and pp are system debugging functions in BoltWire that print
info to the page, but pp stops the script. Because of the way BoltWire
renders a page, p messages will not be displayed like this unless you
stop the script with pp.
SPECIFIC COMMANDS
Ok, here are some explanations about the commands. Feel free to ask
for more info:
authkey: if you set [command authkey test] on a form then you can put
on site.auth.write the line blog*: @key_test and that form will be
allowed to write to a blog page the user does not normally have write
permissions to. It basically allows a form to override a users normal
permissions. Because I don't want to allow non-logged in users to
write to member pages, I have to add an authkey to the register form.
And there must be a corresponding entry in site.auth.write. Both are
there by default.
passdata: this takes the specified field and passes them to the next
page as GET variables. It doesn't have anything to do with saving
extra fields to a member's profile page. That line is in the system
function just for some advanced navigation issues to make it easier
for a new user when they use the action.register form. You can pretty
easily follow the logic of action.register if you care to think
through the if statements.
register: this command is used to register people. It looks for an id
POST field (usually from [text id]) and a password (usually from
[text password]) to create a login page (member.id). If the cryptkey
is set in your config.php file, the password will be encrypted.
Otherwise it will be saved plaintext.
Here's a greatly simplified register form--let me know if something is
unclear. The system function just adds more functionality:
[form]
Member: [text id]
Password: [password password] [submit value=REGISTER]
[command authkey register]
[command register]
[form]
If you want to simultaneously log them in, you just change the form. I
mention this only to show it's pretty easy to built interactive
processes in BoltWire if you know commands.
[form]
Member: [text id]
Password: [password password] [submit value=REGISTER]
[command authkey register]
[command register]
[command login]
[form]
To add additional fields, you don't use passdata. Rather you simply
list the extra fields you want to save as a csv list in the register
command for example:
[form]
Member ID: [text id]
Real Name: [text title]
Email: [text email]
Password: [password password] [submit value=REGISTER]
[command authkey register]
[command register title,email]
[form]
I call the Real Name var "title" because titles have special
properties in BoltWire. It allows me to link to [[member.id|+]] (or
the shortcut [[~id]]) and see their name automatically. I also added
email as per your suggestion. Now notice the register command has two
fields in it: title and email. Basically this is a shortcut for the
savedata function (password are saved automaticallly).
I would normally have done it this way as well if I didn't know that
BoltWire trick:
[form]
Member ID: [text id]
Real Name: [text title]
Email: [text email]
Password: [password password] [submit value=REGISTER]
[command authkey register]
[command register]
[command savedata title,email page=member.{=id}]
[form]
This saves the title and email as a separate step, using the id field
supplied by the user.
ACTIONS
You can put this form on any page you want: main.register, etc. But
your permissions need to be adjust to authorize writing to the page
you choose, and you need to load the plugin on the page you are using
if you are going that route. The advantage of action pages is you can
lay them over another page and have the user automatically return.
That is I can go to main&action=register to go to action.register and
then when the form submits it returns to main. To do something similar
on main.register I would add still another line:
! Register
!! Laying on top of page {p}
[form]
Member ID: [text id]
Real Name: [text title]
Email: [text email]
Password: [password password] [submit value=REGISTER]
[command authkey register]
[command register]
[command savedata title,email page=member.{=id}]
[command nextpage main]
[form]
I added the second line just to show you that the variables of the
underlying page are available on the action page. In the case above,
the second line would display "main", or whatever page I was calling
the action from.
If you look at the system form (action.register) you will see it is
even more complex--mostly to make it easy for new users. But none of
that is really necessary, and you can modify it however you want. You
can customize any BoltWire form you want or create any new form you
want.
OUTSTANDING QUESTIONS
Just wondering, did you ever get the password changer function to work?
Did you ever get your google maps to work?
Did you have any questions about either of them you would like a
little help with?
Cheers
Dan
On 7/1/14, TheOldFellow <[email protected]> wrote:
> In order to help with the documentation, which I really want to do, I need
> to understand how to make it work.
> And by the way, I am fairly skilled at that, as the folks at Linux from
> Scratch will tell you.
>
> I am now resigned to doing this from the PHP. It will take longer that's
> all. First I need to learn PHP, no problem, I started in this business in
> 1968, I can write Algol, Fortran, and wrote operating systems in 8080
> machine code, PHP is a cinch.
>
> I am missing something fundamental about Boltwire. Your suggestion below
> doesn't work, and I don't understand why. If I add the code you supply to
> action.register at the point stated, the registration fails completely (no
> member.xyz file is created), and the form is re-displayed. Now, please do
> not reply with another suggested method. I want to understand the design
> principles for Boltwire Action Forms. I will do this myself now.
>
> I will post again if I need more help.
>
> Thanks for trying.
> TOF.
>
> On Tuesday, 1 July 2014 17:28:51 UTC+1, mz wrote:
>>
>> Well that is the deal: you get something that helps and you help others,
>> e.g. with documentation.
>>
>> Of course you can take a look into the source code. It is well structured
>>
>> and mostly not too difficult to understand. And it comes with a small
>> documentation.
>> In the scripts folder that comes with Boltwire you find the code for
>> commands, for functions etc.
>>
>> As we are dealing with command here you can check commands.php.
>> It explains authkey, passdata and register.
>>
>> By looking into command register, it seems to restrict the saved data to
>> the password.
>> Therefore I would offer a second form that comes on register success and
>> ask for the email.
>>
>> Put it here in action.register
>>
>> An account has successfully been created for **{?id}** and you are logged
>>
>> in.
>>
>> and write a classic form:
>>
>> [form]
>> Email: [text email size=20]
>> [command savedata email page=member.{id}] //save value from email text
>> field on member page
>> [command nextpage main] //optional: what page to show next
>> [form]
>>
>> Greetings, Martin
>>
>> Am Dienstag, 1. Juli 2014 15:53:41 UTC+2 schrieb TheOldFellow:
>>>
>>> Thanks Martin, you are a great resource!!!
>>>
>>> But I had worked that much out. I despair over this system, it is so
>>> good, and works so well, but is so badly documented. Dan implements what
>>>
>>> he find useful, but leave the rest of us to work it out. He would like
>>> it
>>> to be well used, and it should be, but nothing is 'evident'. Or perhaps
>>> I
>>> am just thick. However I'm not going to wade through the PHP to find
>>> things out. //end of rant//
>>>
>>> What does the:
>>>
>>> [command authdata register]
>>> [command register]
>>>
>>> before the
>>>
>>> [command passdata id,email,register]
>>>
>>> do?
>>>
>>> I'm more interested in understanding the supplied form, before adapting
>>> it, than just having a recipe. Where does the data supplied to the
>>> passdata command go (I looked in the member.xyz file, and it isn't
>>> there),
>>> how does one access it? What does the 'register' item in the arg list
>>> imply?
>>>
>>> TOF
>>>
>>>
>>> On Tuesday, 1 July 2014 14:09:44 UTC+1, mz wrote:
>>>>
>>>> action.register is only a form. You can just add text fields.
>>>>
>>>> Email: [text email size=20]
>>>>
>>>> and you need to add email to command passdata.
>>>>
>>>> [command passdata id,email,register]
>>>>
>>>> Another option is to ask for username and password first (using
>>>> action.register) and show another second form to get more details.
>>>> For this you simply can use action.register and replace the success
>>>> information (Congratulations...) with another form. Like:
>>>>
>>>> !Welcome
>>>>
>>>> Please add some details:
>>>> [form]
>>>> Email: [text email size=20]
>>>> Age: [text age size=5]
>>>> [command savedata email,age]
>>>> [submit OK]
>>>>
>>>> Greetings, Martin
>>>>
>>>> Am Dienstag, 1. Juli 2014 13:59:27 UTC+2 schrieb TheOldFellow:
>>>>>
>>>>> Next problem, sorry.
>>>>>
>>>>> I can't make head nor tail of the documentation on adding new fields
>>>>> during registration. I want to add an email address. Reading:
>>>>>
>>>>> docs.concepts.members
>>>>>
>>>>> does not line up with what is in the action.register form in a new
>>>>> install. And the only documentation on the action.register commands is
>>>>>
>>>>> php, not English.
>>>>>
>>>>> TOF.
>>>>>
>>>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "BoltWire" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/boltwire.
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups
"BoltWire" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/boltwire.
For more options, visit https://groups.google.com/d/optout.