Gossamer Forum
Home : Products : Gossamer Forum : Development, Plugins and Globals :

Added fields in message display

Quote Reply
Added fields in message display
Is it possible to include the No. posts and users location (displayed in Profiles) in each message view alike the User icon / Forum leval etc... also (pushing my luck now), how easy would it be to have the User image (or an image) change with each level of of posts....???? Smile
Quote Reply
Re: [David_D] Added fields in message display In reply to
Hi,

Yes, you have all the attributes of the user available in the template, so you could just put:

Posts: <%user_posts%>
Location: <%user_location%>

wherever you want them displayed.

You can do the image as well with something like:

<%if user_status eq 'New User%>
<img src="/path/to/new.gif">
<%elsif user_status eq 'User'%>
<img src="/path/to/user.gif">
...
<%endif%>

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Added fields in message display In reply to
Oops you missed a '

<%if user_status eq 'New User'%>

Quote Reply
Re: [RedRum] Added fields in message display In reply to
Many thanks - I'll give it go.... Smile
Quote Reply
Re: [Alex] Added fields in message display In reply to
The value of user_status is (as of the latest version - 0.9.4 has it the old way) is a number, 0 being anonymous, 1 => Not validated, 2 => Registered, and 3 => Administrator.

The values (such as "New User") are defined by language variables, and so aren't so reliable.

The values are now stored in the variable "user_status_string".

So, you should either do:
<%if user_status = 1%>Non-validated
<%elseif user_status = 2%>User
<%endif%>

or

<%if user_status_string eq 'Whatever you have set language variable USERSTATUS_NOT_VALIDATED to'%>Not-validated
<%elsif user_status_string eq 'Whatever you have set language variable USERSTATUS_REGISTERED to'%>User
<%endif%>

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Added fields in message display In reply to
Ooops! Blush

You could also just do:

<img src="/images/users_status<%user_status%>.gif">

and make sure you have a user_status0.gif, user_status1.gif, user_status2.gif, etc.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Added fields in message display In reply to
I'm getting a little confused. What are the numbers actually refering to, order of execution ??? With 9.4 I had broken up the five increments into a futher 20 !!! This seemed to work although it wasn't possible to check 10,000 posts !!! I decided to go with Alex's simplier method of naming the images <%user_status%>.gif"> (1.gif, 2.gif etc) and calling them via img src= ......but it does not not seem to work..... Unsure
Quote Reply
Re: [David_D] Added fields in message display In reply to
Alright. Let's start again.

The user_status field contains (as of 0.9.6) a single number, 0, 1, 2, or 3.

If a user has their user_status field set to 0, it indicates that the user is actually an anonymous poster. user_status set to 1 means a not-validated user. user_status 2 means a normal user, and, depending on your forum, most users will fall into this category. user_status 3 is for an administrator - a user who gets moderator and ban rights across the entire forum.

So, if you were to make 4 images:

status0.gif, status1.gif, status2.gif, and status3.gif, you could link to those images by putting:

<img src="/path/to/images/status<%user_status%>.gif">

If you put the images in the GForum image directory, you could use "<%image_url%>" like this:

<img src="<%image_url%>/status<%user_status%>.gif"> - which is how all the images in the released GForum are written.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Added fields in message display In reply to
Thanks for your reply..I understood the numbering system and I have used the method you advised which works with reference to the four tier 0,1,2,3 system i.e I have 1.gif, 2.gif ....What I'm wondering however is ,are there only 4 possible levels hard coded in because if they are then they're not synchronised with the "extended levels" I've set up in Admin - Setup - Users section. Please don't laugh but I've created 21 user levels to make life a little more fun (all of the characters from the Simpsons i.e

0 => Maggie
5 => Todd Flanders
50 => Ned Flanders
100 => Ralph
200 => Millhouse
300 => Lisa
400 => Chief Wiggum
500 => Smithers
600 => Mr Burns
700 => Marge
800 => Barney
900 => Moe
1000 => Apu
1250 => Snake
1500 => Fat Tony
1750 => Itchy
2000 => Scratchy
2500 => Homer
5000 => Bart
7000 => Radioactive Man
10000 => Grandpa


So far with both versions 9.4 and 9.6 these are working fine but the images still appear to be using the 4 stage ranking... If I'm still totally off the point and apparently clueless, don't worry because I'm more than happy with the 21 level ranking...the images are just a bonus.....
Quote Reply
Re: [David_D] Added fields in message display In reply to
Quote:
If a user has their user_status field set to 0, it indicates that the user is actually an anonymous poster. user_status set to 1 means a not-validated user. user_status 2 means a normal user, and, depending on your forum, most users will fall into this category. user_status 3 is for an administrator - a user who gets moderator and ban rights across the entire forum.
The user_status fields that Jason is talking about is different from the ones you are talking about Smile The ones that you are referring to are only given to registered users (ie. user_status 2), and are calculated using the number of their posts, not their status.

I haven't looked at the templates, so I can't really comment on how you would accomplish what you want to do (it's late, must zzz). I'm sure it's possible Wink You should be using the user's post count rather than their user_status to figure out the image to use.


Adrian
Quote Reply
Re: [David_D] Added fields in message display In reply to
ROFL! Where's your board ??

- wil
Quote Reply
Re: [brewt] Added fields in message display In reply to
It's been looking me in the face all the time...your right!!! - I'm off to have another go....Thanks.....Wink
Quote Reply
Re: [Wil] Added fields in message display In reply to
At the moment it's on my work's NT server and behind a firewall so it can't be accessed by the public (although I have bypassed a few times to test from home..!!) - I'm playing about with it before attempting to go live. Effectively, once the templates are right I sould be able to replace the defaults on a fresh install with my provider.....
Quote Reply
Re: [David_D] Added fields in message display In reply to
Yes. Should be no problem. Let me know the link when it's up! :-)

- wil
Quote Reply
Re: [David_D] Added fields in message display In reply to
In Reply To:
0 => Maggie
5 => Todd Flanders
50 => Ned Flanders
100 => Ralph
200 => Millhouse
300 => Lisa
400 => Chief Wiggum
500 => Smithers
600 => Mr Burns
700 => Marge
800 => Barney
900 => Moe
1000 => Apu
1250 => Snake
1500 => Fat Tony
1750 => Itchy
2000 => Scratchy
2500 => Homer
5000 => Bart
7000 => Radioactive Man
10000 => Grandpa

Oh, okay, I see now. What you want to use is user_title, which is based off user_posts - not user_status, which simply differentiates between guest, non validated, registered, and administrative users (and as such, its use is mainly internal to the program).

The best way to do it is to create "Todd Flanders.gif", "Ned Flanders.gif", etc. and then in your template have something like:
Code:
<img src="/path/to/images/<%user_title%>">
If you have specified custom User Titles for individual users in the admin, such as "Administrator" or "Staff" on our forums, you will also need to make sure that you create Administrator.gif or Staff.gif, or whatever you may be using.

Hope this helps!

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [David_D] Added fields in message display In reply to
Ah, you want <%user_title%> which is what the users title is. You could do:

<img src="/images/titles/<%user_title%>.gif">

and have one image for each of the titles.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] Added fields in message display In reply to
Ha! Beat you to it Wink

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Added fields in message display In reply to
lol
Quote Reply
Re: [jagerman] Added fields in message display In reply to
Thanks to both of you for all the help...I think I'm on the right track now...trouble is I can't leave the thing alone, it's a shame I don't have real reason for having a discussion board myself (although I do) but regardless of that I've installed nearly all of them, UBB, Ultraboard, wwwthreads, DCForum etc but I can honestly say that this is already my fave and it's not even out of beta.... Smile
Quote Reply
Re: [David_D] Added fields in message display In reply to
Excellent! That's exactly the reaction we are hoping for. Cool

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Added fields in message display In reply to
And the cheques in the post ;-))

- wil