Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2009-09-26 13:56:15

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,834
Website

Re: smd_bio : store additional biographical info about your users

Vienuolis wrote:

<txp:smd_bio_info type="image" /> … simply display an image in its context? With no error actions if some image does not exist?

Hmmm I tried to do that first but it was too limiting. Some people wold complain that outputting the thumbnail by default is “wrong”; others would complain if I used the full size image. So I left the choice to you :-)

The code:

<txp:smd_bio_info items="foto" class="author-photo" label="" wraptag="p" break="">
   <txp:image id="{smd_bio_foto}" />
</txp:smd_bio_info>

will display nothing and produce no error if there is no image to display. If you wish to display a default ‘no avatar’ image you might do this first:

<txp:variable name="has_bio_image" value='<txp:smd_bio_info items="mug">{smd_bio_mug}</txp:smd_bio_info>' />
<txp:if_variable name="has_bio_image" value=""> 
   <p><txp:image name="no-avatar" /></p>
<txp:else />
   <txp:smd_bio_info items="mug" label="" wraptag="p" break="">
      <txp:image id="{smd_bio_mug}" />
   </txp:smd_bio_info>
</txp:if_variable>

I have already raised an enhancement about the break in the labels. Nobody has complained yet so it might make it to the core. If not I’ll have to fix it in the plugins and not use the core’s label functionality.


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

#22 2009-09-26 14:20:01

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 184
Website

Re: smd_bio : store additional biographical info about your users

so it should work like Example 3 in the plugin help.
<txp:smd_bio_info items="photo" label="">
<txp:thumbnail id="{smd_bio_photo}" />
</txp:smd_bio_info>
That will display a small author’s photo on the page — assuming a thumbnail exists.

Sorry, all is fine only on the admin side, but on live articles — big versions instead of thumbnails. I have tested 52, 52t, and 52t.jpg — the same result.

Offline

#23 2009-09-26 14:33:23

Vienuolis
Member
From: Vilnius, Lithuania
Registered: 2009-06-14
Posts: 184
Website

Re: smd_bio : store additional biographical info about your users

will display nothing and produce no error if there is no image to display.

Thanks, that’s perfect for this my site.

If you wish to display a default ‘no avatar’ image you might do this first:

The great tip — I will save it for the future, thank you very much!

Offline

#24 2009-11-10 15:24:28

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: smd_bio : store additional biographical info about your users

Hi Stef,

Great idea for a plug-in, just about to finalise a blog and this will be perfect. I’m running TXP 4.2.0 (and PHP 5.1.6) but when I click on the Bio Config tab I get the following error:

The server encountered an internal error and was unable to complete your request.
Error message:
Premature end of script headers: php-fcgi-starter

Any idea what it all means?

Last edited by decoderltd (2009-11-10 15:24:59)

Offline

#25 2009-11-10 15:58:35

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,834
Website

Re: smd_bio : store additional biographical info about your users

decoderltd wrote:

Premature end of script headers: php-fcgi-starter

Bizarre. That normally indicates a PHP environment config problem but why the plugin triggers it I have no idea. Don’t think it’s doing anything out of the ordinary on that tab.

Are you running this on a live site or a local XAMPP? Anything in the log files that might shine some more light on it?


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

#26 2009-11-10 16:15:58

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: smd_bio : store additional biographical info about your users

Hi Stef,

I’m running it on a live site, I’ve checked the Diagnostics tab and everything seems fine.

Offline

#27 2009-11-10 16:30:59

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,834
Website

Re: smd_bio : store additional biographical info about your users

Sorry, I meant the server’s log files. Do you have access to those? While you’re in the Diagnostics tab, though, what are the following reported as:

Server
PHP Server API
Server OS

and are you using a stock .htaccess file?

/me clutching at straws

Last edited by Bloke (2009-11-10 16:31:20)


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

#28 2009-11-10 16:54:42

decoderltd
Member
From: London
Registered: 2006-06-20
Posts: 248
Website

Re: smd_bio : store additional biographical info about your users

Hi Stef,

Sorry, I don’t have access to the server logs, but here’s the other info you asked for-

Server: Apache
PHP Server API: cgi-fcgi
Server OS: Linux 2.6.17-11-server

I’m using the following .htaccess settings:

# DirectoryIndex index.php index.html
# Options +FollowSymLinks
# RewriteBase /relative/web/path/

<IfModule mod_rewrite.c>
 RewriteEngine On
 RewriteCond %{REQUEST_FILENAME} -f [OR]
 RewriteCond %{REQUEST_FILENAME} -d
 RewriteRule ^(.+) - [PT,L]

 RewriteRule ^(.*) index.php
</IfModule>

Offline

#29 2009-11-24 19:04:01

rsskga
Member
From: San Francisco, CA USA
Registered: 2007-06-23
Posts: 50
Website

Re: smd_bio : store additional biographical info about your users

I think this may be the right place to ask this question… I’ve read through the regarding community-drive TXP article, and am at least somewhat familiar with Manfre’s and Stef’s plugins, as well as Jonathon’s snooz site, Zem_Contact_Reborn, etc.

I’m wondering if anyone has enabled functionality that allows for sending emails to anonymized addresses – i.e. like on a dating site where the recipient’s email address needs to be obscured. On the surface, it seems like this shouldn’t be too hard… Maybe just mapping the anonymized email address to the user’s real email address somehow. Hopefully that way the anonymized emails wouldn’t actually have to exist as a real email address setup at a domain (which I would have no idea how to do dynamically). I don’t want to have to set up actual email forwarding, just a sleight of hand thing. I think that’s adequately secure for my purposes, but I could be naive.

Anyone have any thoughts on this? Advice for how I might approach it? I have some programming skills… should be able to edit and add to other people’s code. Probably not skilled enough to start a plugin from scratch though I’m going to go read the plugin development guidelines.

Thanks!


Swim Kitten, A Magento Site
When nothing but incredibly revealing dresses and swimwear will do

Offline

#30 2009-11-24 19:18:20

ruud
Developer emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: smd_bio : store additional biographical info about your users

Raina, perhaps this example will get you started

Offline

Board footer

Powered by FluxBB