Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#193 2012-02-14 20:05:25

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: smd_bio : store additional biographical info about your users

kevinpotts wrote:

Thoughts?

order is a reserved MySQL keyword. You’ll need to rename the field at the moment or, if that’s not possible, change the code to escape the word. Probably this’d do it on line 1469:

$sortout[] = '`' . $sort_col . '` ' . $sort_ord;

Putting the backticks around the sort name should make MySQL happier. If that works I’ll roll thse changes in and re-upload it.

Last edited by Bloke (2012-02-14 20:21:44)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#194 2012-02-15 04:54:33

kevinpotts
Member
From: Ghost Coast
Registered: 2004-12-07
Posts: 370

Re: smd_bio : store additional biographical info about your users

order is a reserved MySQL keyword

You know, I know just enough about MySQL to say I knew this, but not enough to not look dumb. You are right: I changed the name of the field and all worked perfectly. “order” is indeed a naughty word.


Kevin
(graphicpush)

Offline

#195 2012-04-26 18:41:34

drudog
Member
Registered: 2011-02-01
Posts: 20

Re: smd_bio : store additional biographical info about your users

Hello again fellow txperts,

I’ve scanned the smd_bio forum for a solution to my problem but haven’t found anything yet. Now I humbly approach you all in hopes of an answer. Here’s the gist:

I want to facilitate the collection of a user’s contact info for sales conversion processes by making them sign in to access certain files/pages. So far I have mem_self_register and ign_password_protect working to provide some simple authentication and account creation, the thing is, I need to collect MORE information from a user when they sign up. I’m wondering if smd_bio would be a way to make this happen. I need single stroke account activation with required fields for name, email, phone, and a dropdown to select a role (teacher, student, etc.). After filling out the info and adding the account, the user would be receive the login info in their email (just as mem_self_register provides) so they could log in and see the restricted area.

Has anyone done something like this?

Thanks in advance for your thoughts.

Offline

#196 2012-04-26 19:11:02

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: smd_bio : store additional biographical info about your users

If you are using access to the restricted area as a means of collecting user data and don’t actually need your users to have an account, you might want to try an alternative approach using a combination of mem_simple_form + mem_form to create a custom collect form that saves to a custom_database (you need to set this up manually) and smd_access_keys to generate an access code.
If you don’t actually need to store the user data on the system, you could also do a normal zem_contact_reborn form which sends the user data as a mail, and create and show the smd_access_key in the thanks_form that shows after the form has been submitted.


TXP Builders – finely-crafted code, design and txp

Offline

#197 2012-04-26 20:25:49

drudog
Member
Registered: 2011-02-01
Posts: 20

Re: smd_bio : store additional biographical info about your users

Thanks for the ideas, Jakob!

I would like to keep a user’s contact info in a database and have it handled similar to the way postmaster handles it. Specifically, the bit where it allows a CSV export of the fields so that it can be imported elsewhere. (I apologize, scope creep is a #%&). This is getting to be quite a hack and I’m not sure it can be done. Further thoughts are appreciated!

On a side note, I’m having trouble installing the plugin. I’m not excited about it, but I’ve had to install txp on a IIs server for this site if that makes a difference.

EDIT: See next post (below) for more details

Last edited by drudog (2012-04-27 12:57:00)

Offline

#198 2012-04-26 21:52:42

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: smd_bio : store additional biographical info about your users

Hmm, smd_bio certainly is a way to store more information about an author that is registered to the back end, however I’m not sure that this information can be collected at the same time as signing up with mem_self_register.

I suppose you could request the additional information after the new member logs in the first time by making a landing page that asks for the additional fields first. You could do that by making that page check if the required fields already exist in the database (e.g. output one of the smd_bio fields into a txp:variable, then use txp:if_variable name="myvar" value="" to test if it is empty):

  • if required fields are empty show the visitor the form (using mem_simple_form / mem_form for example, or perhaps smd_bio),
  • otherwise proceed straight to showing the content in the restricted area.

That might be a two-step approach that achieves the same thing.

I’m not familiar with postmaster, but you can make your own csv-export page template, for example using a dedicated section that outputs your fields in the structure of the csv and mg_setheader or alternatively with rah_external_output (that handles both code output and content/type) to make txp serve that page as a csv file. Seeing as csv is just a text-only format, you can also save the page straight from the browser. If you’re wondering how to output database fields that are not textpattern articles, either use the smd_bio tags (if you’re using smd_bio to store them) or look at smd_query.

No idea about the error message, sorry.


TXP Builders – finely-crafted code, design and txp

Offline

#199 2012-04-27 12:13:50

drudog
Member
Registered: 2011-02-01
Posts: 20

Re: smd_bio : store additional biographical info about your users

Ok the 2-step approach seems to be a slick method as well, however I’m a little hazy on some of the details (please bear with me!)

1. I use mem-self-register to create the account (got that part!)
2. In the automated email sent upon successful registration the link provided takes the user to a page where they log in with their credentials (ign-if-logged-in): * if certain data is not available from smd-bio it askes for the missing info (this is the hazy part, not sure how to export smd-bio info to a variable and test for that variable) * otherwise proceed to protected page

3. CSV file creation: so you’re saying just make a simple page/section that is created using txp tags and serving that page as simple text so that one can just copy and paste the info?

EDIT: Also, anyone know if this plugin is compatible with a IIs (windoze) server? I’m having trouble accessing the extensions -> Bio_Config tab after installation.

Last edited by drudog (2012-04-27 13:01:04)

Offline

#200 2012-04-27 14:58:55

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,726
Website

Re: smd_bio : store additional biographical info about your users

I haven’t used the most recent version of smd_bio and I believe it has new, improved functionality now. My last attempt at using the plugin was this which is an example of using mem_simple_form to populate to the smd_bio fields (code example in the same thread). That might be some help in creating a form to input the smd_bio data. That example is in an admin tab but it should work in a password-protected front-end pane too.

For 2) You can output smd_bio details using the txp:smd_bio_info tag. The basic principle for testing with if_variable is to output a desired item into a txp:variable. If data has been provided this variable will contain something. Note: it’s important that you just output the item and silence any labels, break, wraptag, blank lines etc. that might count as output even if no data has been provided. You then test to see if the variable you just created is empty … something like this:

<txp:variable name="required_department"><txp:smd_bio_info item="department" label="">{smd_bio_department}</txp:smd_bio_info></txp:variable>
<txp:if_variable name="required_department" value="">
   <!-- required info incomplete : present form here -->
<txp:else />
   <!-- required info exists: show member-only infos -->
</txp:if_variable>

Untested but you get the idea, I hope. If you are having problems, try outputting <txp:variable name="required_department" /> temporarily to see if it really is empty when no data is provided.

3) That’s the principle. A normal page_template just outputs text but it’s served as an html page. If you leave out the html tags, it will output text on the screen. If you want the browser to not try and decipher it, you can set the content-type as described in the other thread you found. You can then use the browser’s “save …” function to save the file. You might have to experiment with your csv delimiter character and line-endings to get a constellation that works well for you or your client (and language, for example in Germany a semi-colon is often used instead of the comma, as commas are used for decimal numbers).

Sorry, I have no idea about windows server. Maybe it’s related to the php-version your IIS server provides?


TXP Builders – finely-crafted code, design and txp

Offline

#201 2012-04-27 15:22:46

drudog
Member
Registered: 2011-02-01
Posts: 20

Re: smd_bio : store additional biographical info about your users

Fantastic rundown, Jakob. One million thanks to you for your input!

I’ll dig in and start to string some of this together and keep you updated on the progress.

Thanks again.

Offline

#202 2012-04-30 22:06:06

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

Re: smd_bio : store additional biographical info about your users

jakob wrote:

I haven’t used the most recent version of smd_bio and I believe it has new, improved functionality now.

Yes, most notably the fact that the concept of authors and fields have their own tags. Also, you don’t necessarily need the txp:variable trick because v0.40beta (which, as far as I’m concerned, is probably the final version in all but name and just needs me to get round to flicking the release switch) has <txp:smd_if_bio> for rudimentary conditional testing of bio field data. That also bypasses all that messy label-silencing malarky.

drudog

I too have no idea about IIS and no way to test it, sorry. If you would like me to take a look in situ, feel free to mail me a login to your site and I’ll see if I can figure it out directly on your server.

Last edited by Bloke (2012-04-30 22:07:24)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#203 2012-05-01 13:34:50

drudog
Member
Registered: 2011-02-01
Posts: 20

Re: smd_bio : store additional biographical info about your users

PM sent. Thanks Bloke.

Offline

#204 2012-05-29 13:21:48

Teemu
Member
From: Shanghai
Registered: 2010-04-27
Posts: 60

Re: smd_bio : store additional biographical info about your users

Stef,

Imputing Chinese characters to a text field returns question marks. Any possibility to get this to support special characters? Latin umlauts seem to work fine though.

Offline

Board footer

Powered by FluxBB