Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Re: smd_bio : store additional biographical info about your users
johnstephens wrote:
the page showed that it was loading indefinitely, for at least ten minutes.+
The Admin-Users page? Freaky. So perhaps it is something to do with the asset reassignment step. I do a check in smd_bio to see if that’s set and if not, bomb out early. I wonder if that has any bearing on things. Hmmmmm.
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
Re: smd_bio : store additional biographical info about your users
Bloke wrote:
OK, then that wipes out the ‘random ether’ argument. So after restoring it again, and disabling smd_bio, if it doesn’t destroy anything I’ll get ready to eat my words. I wonder if there are any plugin clashes that might cause this behaviour. Perhaps smd_bio is unhappy with something else in the system.
Bracing myself for another DB restore, I disabled smd_bio and deleted the user again, in the name of science. And this time, it deleted the user and reloaded immediately, without changing anything else in my database.
If there’s any further info you can supply about the user in question — name, role, anything I can get my teeth into — or possible pluigns that might have an impact or perhaps even a login to some area where I can have a poke around if I may be so cheeky then I’d be most grateful.
Okay here’s what happened: the author in question was the result of a text-file import from Movable Type 3.2. Importing from the DB resulted in all the articles being truncated, so I did my homework on the MT article tags and created an export template in MT to generate the text file. The result worked perfectly, but I made a mistake in the template so that the Author Real Names were exported in place of AuthorUserNames. This resulted in duplicate author entries, and the duplicates were assigned “Publisher” privs.
The user I was deleting was “Carl Sirname, Jr.”, a Publisher-privelege user with no assets and no bio information— not even an eMail address.
I wonder if the problems stem from the comma in the username? Anyway, I hope this report is useful!
Offline
Re: smd_bio : store additional biographical info about your users
Update: The problem manifests differently when smd_bio is disabled, but it persists. If you continue to ponder this problem, I reckon it falls under the “TXP developer” role instead of “plugin author”.
Although I can delete the specific author above without any problems, when I begin to delete other duplicate imported MT authors, I eventually get the same result, requiring me to restore the DB.
Offline
Re: smd_bio : store additional biographical info about your users
OMG!
You’r TXP GOD!!
Amazing plugin!
Last edited by Katalonian (2010-07-07 10:07:20)
<txp:txp_me />
Offline
Re: smd_bio : store additional biographical info about your users
Stef,
When creating an image item, the “size” value is simply to give the image a size in the Users panel, right? It’s not intended to define the size of the image as it should appear in the frontend, right?
At first I thought the intention of size was to actually define the image size as it would appear in the site, but that doesn’t seem to be the case. I’m fine with that, and my CSS does the job as usual, but I just want to make sure I understand the function.
Offline
Re: smd_bio : store additional biographical info about your users
Destry wrote:
When creating an image item, the “size” value is simply to give the image a size in the Users panel, right?
Correctamundo.
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
Re: smd_bio : store additional biographical info about your users
New question…
Is there a way to do a conditional check on a given bio field?
In this case, some users are board members having bio articles, and some users are just guest authors. In the case for board members, the article form is designed so that their headshot thumbnail and name are links to the biography articles. This is setup in smd_bio.
However, as it is now if a user does not have a bio, a link is still added and is broken, naturally. I’d like some kind of conditional solution so that if no biography link/title is provided in the smd_bio profile, no link is addeded to the photo/name at all.
The only way I can think to do this is with a conditional wrapper on the block of smd_bio form data, but I’m blanking on how that might be.
Is it possible? A simple hypothetical example I might run with?
Offline
Re: smd_bio : store additional biographical info about your users
Destry wrote:
Is there a way to do a conditional check on a given bio field?
Currently not natively but I could try and add a conditional tag that might help. I’ll see if I can figure out how you set your system up from your post and mess around with some solutions on my dev box.
For now you can try a variation on the TXP:variable dance which might get you out of the hole.
Last edited by Bloke (2010-09-09 10:24:30)
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
Re: smd_bio : store additional biographical info about your users
Stef, maybe this will help. :)
The relevant pieces of the profile fields setup in admin-side:
Name | Title | Type | Size | Value | Position
teamrole | Team Role | – | – | – | –
jobtitle | Job Title | – | – | – | -
company | Company | – | – | – | -
stcaffiliation | STC Affiliation | – | – | – | -
bioid | Bio Article ID | – | – | – | -
photothumb | Photo | – | – | – | -
urltitle | URL-only Title | – | – | – | -
The tags structure in the form:
<txp:smd_bio_info items="name">
<a href="<txp:site_url /><txp:section name='leaders' />/<txp:smd_bio_info author='{smd_bio_info_item}' items='bioid' label='' />/<txp:smd_bio_info author='{smd_bio_info_item}' items='urltitle' label='' />" title="Bio link"><img class="author-thumb" src="/images/<txp:smd_bio_info author='{smd_bio_info_item}' items='photothumb' label='' />.jpg" /></a>
<p class="author"><a href="<txp:site_url /><txp:section name='leaders' />/<txp:smd_bio_info author='{smd_bio_info_item}' items='bioid' label='' />/<txp:smd_bio_info author='{smd_bio_info_item}' items='urltitle' label='' />" title="Bio link"><txp:smd_bio_info author='{smd_bio_info_item}' items='RealName' label='' /></a></p>
<p class="authorinfo"><txp:smd_bio_info author='{smd_bio_info_item}' items='teamrole' label='' />,<br />
<txp:smd_bio_info author='{smd_bio_info_item}' items='stcaffiliation' label='' /></p>
</txp:smd_bio_info>
And here’s an example of the code in use for a user having a biography (thumbnail and name links), and one for a user having no biography (broken links).
I’ll have a look at your alternate suggestion too.
Last edited by Destry (2010-09-09 11:04:36)
Offline
Re: smd_bio : store additional biographical info about your users
Hello Stef,
I’m using your plugin to output the result of a bio item with the title: “What are you eating for breakfast ?” with 3 values: Bananas, Oranges, Kiwis
I would like to define other <txp:variables /> (plurals, first-capital…) based on the values returned by <txp:smd_bio_info />
So I’ve setup a form (myform) containing new empty variables:
<txp:variable name="flavor" value='<txp:smd_bio_info items="radioitems" label="">' />
<txp:if_variable name="flavor" value="bananas">
<txp:variable name="fs" value="Banana" />
<txp:variable name="fp" value="Bananas" />
</txp:if_variable>
<txp:if_variable name="flavor" value="oranges">
<txp:variable name="fs" value="Orange" />
<txp:variable name="fp" value="Oranges" />
</txp:if_variable>
<txp:if_variable name="flavor" value="kiwis">
<txp:variable name="fs" value="Kiwi" />
<txp:variable name="fp" value="Kiwis" />
</txp:if_variable>
When I try to output:
<txp:variable name="fs" />
It should, depending on what the user has selected as a breakfast item, output: Banana, Orange or Kiwi…
But through:
<txp:smd_bio_info items="radioitems" label="" form="myform"><txp:variable name="fs" /></txp:smd_bio_info>
It outputs nothing…
What am I missing here ?
Thanks !
Last edited by hablablow (2010-09-09 20:54:18)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline
Re: smd_bio : store additional biographical info about your users
hablablow wrote:
Is this a way to go ?
Without trying it out myself I’m not quite sure what you’re trying to achieve with the code. But my first question is: what is the closing smd_bio tag for? You have already self-closed it in the first line.
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
Re: smd_bio : store additional biographical info about your users
Sorry my explanation wasn’t clear and it contained typos… So I changed it above…
Hopefully it’ll make more sense this time…
Thanks for your comprehension…
Last edited by hablablow (2010-09-09 17:10:32)
_
_I plant seeds for future visions. Farmer of your eyes. Subliminal engineer of your minds. eion founder__
Offline