Previous Thread
Next Thread
Print Thread
Hop To
#220508 12/26/2008 6:18 PM
Joined: Mar 2008
Posts: 262
enthusiast
enthusiast
Joined: Mar 2008
Posts: 262
We run a UBB board for our club members and non members too. We would like to have something show up by their avatars or titles, but don't want them to have to set it, and be set by group membership..

Is this something easy, or is it a hack.

Thanks,

Ian


Ian
http://www.firstgenmc.com/ubbthreads

"Experience is a hard teacher because she gives the test first, the lesson afterwords."
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
It's (an easy) hack.


[Linked Image from siemons.org]
Joined: Mar 2008
Posts: 262
enthusiast
enthusiast
Joined: Mar 2008
Posts: 262
Details? smile


Ian
http://www.firstgenmc.com/ubbthreads

"Experience is a hard teacher because she gives the test first, the lesson afterwords."
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
For a do-it-yourself approach, look for the places where an avatar is shown, and add a little code that checks group membership, and adds some html to the mix to show whatever you want.

For actual code, ubbdev is the place to be. How much work it is basicly depends on where you want to show it, and what you want to show.


[Linked Image from siemons.org]
Joined: Mar 2008
Posts: 262
enthusiast
enthusiast
Joined: Mar 2008
Posts: 262
Thanks for the suggestion, I am not much of a coder, but I will look smile We are looking for something like where yours shows UBB Beta Tester.

Ian


Ian
http://www.firstgenmc.com/ubbthreads

"Experience is a hard teacher because she gives the test first, the lesson afterwords."
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
Do you use the custom title functionality on your board?

If not, what you want could be done in 5 minutes or less. Even if you do use 'm it could be done without any code modification, you do need to add some programming to a custom island.

Last edited by blaaskaak; 12/27/2008 8:18 AM.

[Linked Image from siemons.org]
Joined: Mar 2008
Posts: 262
enthusiast
enthusiast
Joined: Mar 2008
Posts: 262
We do let the users use custom titles.


Ian
http://www.firstgenmc.com/ubbthreads

"Experience is a hard teacher because she gives the test first, the lesson afterwords."
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
You could code something that adds that icon/graphic to the custom title based on their group.

Everywhere the custom title would be shown, the added graphic would also be displayed.

Since you let users set their own membertitle, you would need to add a little code to the edit profile script to remove/add that special html.


[Linked Image from siemons.org]
Joined: Mar 2008
Posts: 262
enthusiast
enthusiast
Joined: Mar 2008
Posts: 262
Ok If I am reading the template files right I need to add something like this? Not sure if $user_group is the correct variable...

How would using a custom island help here?

Thanks,
Ian

Code
<span class="small">
{if $postrow[post].CustomTitle}
{$postrow[post].CustomTitle}
<br />
{if $user_group = 10}
<img src="{$config.BASE_URL}/images/member.gif" alt="Member" />
{/if}
<br />
{/if}
{$postrow[post].Title}
<br />
{if $postrow[post].Rating}
{$postrow[post].Rating}
<br />


Ian
http://www.firstgenmc.com/ubbthreads

"Experience is a hard teacher because she gives the test first, the lesson afterwords."
Joined: Mar 2008
Posts: 262
enthusiast
enthusiast
Joined: Mar 2008
Posts: 262
I was able to get a gif to show up by using $groups = 10 but now I get a error at the top of the page.. And the error seems to come and go...

Error #256: Smarty error: [in post_side.tpl line 47]: syntax error: unidentified token '=' (Smarty_Compiler.class.php, line 1405)
Line: 1092
File: /homepages/40/d201708859/htdocs/testing/ubbthreads/libs/smarty/Smarty.class.php


Ian
http://www.firstgenmc.com/ubbthreads

"Experience is a hard teacher because she gives the test first, the lesson afterwords."
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
Approach 1:

Adjust the code everywhere to display a graphic whenever the membertitle is displayed.

Approach 2:
Adjust the actual custom title to add the graphic.

In approach 2 a custom island is a bit of an alternative to a cronjob. You could execute code every "x" minutes to get those graphics straight with the users that are supposed to have them.

The island itself would never be shown. It's the easiest way to drop in some code without having to mod the actual software.


[Linked Image from siemons.org]
Joined: Mar 2008
Posts: 262
enthusiast
enthusiast
Joined: Mar 2008
Posts: 262
OK I think I need a little more info on what calls post_side.tpl I realized all I did was insert the gif... What builds the variables for that page. I am good and following code that others have written, but not writing it from scratch.

Thanks,
Ian


Ian
http://www.firstgenmc.com/ubbthreads

"Experience is a hard teacher because she gives the test first, the lesson afterwords."
Joined: Mar 2008
Posts: 262
enthusiast
enthusiast
Joined: Mar 2008
Posts: 262
Ok I think I have it figured out, but is $groups a site wide variable? I was trying to use {if (in_array("10",$groups))} where 10 would be the group that gets the gif.

I see $groups be defined in user.inc.php but not in showflat.inc.php

I will tell you that my brain hurts, but I am definital getting a better understand as to how the whole board works now.

Thanks again,
Ian


Ian
http://www.firstgenmc.com/ubbthreads

"Experience is a hard teacher because she gives the test first, the lesson afterwords."
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
No, there is no variabele where you can see the membership.

Is there a permission linked to those members only? If so, you could add code to check for that permission. That's the easiest.


[Linked Image from siemons.org]
Joined: Mar 2008
Posts: 262
enthusiast
enthusiast
Joined: Mar 2008
Posts: 262
We have a members only section that they are the only ones with access. Where can I check for the permission? Is it in a table, or a variable?

Thanks,
Ian


Ian
http://www.firstgenmc.com/ubbthreads

"Experience is a hard teacher because she gives the test first, the lesson afterwords."
Joined: Aug 2006
Posts: 1,358
Y
Veteran
Veteran
Y Offline
Joined: Aug 2006
Posts: 1,358
For others interested in a possible solution, there is one on ubbdev now.


[Linked Image from siemons.org]

Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
spam issues
by ECNet - 03/19/2024 11:45 PM
Looking for a forum
by azr - 03/15/2024 11:26 PM
Editing Links in Post
by Outdoorking - 03/15/2024 9:31 AM
Question on barkrowler and the like
by Mors - 02/29/2024 6:51 PM
Member Permissions Help
by domspeak - 02/27/2024 6:31 PM
Who's Online Now
1 members (Havenofsobriety), 522 guests, and 99 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)