|
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
|
|
|
|
Joined: Aug 2006
Posts: 1,358
Veteran
|
Veteran
Joined: Aug 2006
Posts: 1,358 |
|
|
|
|
Joined: Mar 2008
Posts: 262
enthusiast
|
enthusiast
Joined: Mar 2008
Posts: 262 |
Details?
|
|
|
|
Joined: Aug 2006
Posts: 1,358
Veteran
|
Veteran
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.
|
|
|
|
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 We are looking for something like where yours shows UBB Beta Tester. Ian
|
|
|
|
Joined: Aug 2006
Posts: 1,358
Veteran
|
Veteran
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.
|
|
|
|
Joined: Mar 2008
Posts: 262
enthusiast
|
enthusiast
Joined: Mar 2008
Posts: 262 |
We do let the users use custom titles.
|
|
|
|
Joined: Aug 2006
Posts: 1,358
Veteran
|
Veteran
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.
|
|
|
|
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 <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 />
|
|
|
|
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
|
|
|
|
Joined: Aug 2006
Posts: 1,358
Veteran
|
Veteran
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.
|
|
|
|
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
|
|
|
|
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
|
|
|
|
Joined: Aug 2006
Posts: 1,358
Veteran
|
Veteran
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.
|
|
|
|
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
|
|
|
|
Joined: Aug 2006
Posts: 1,358
Veteran
|
Veteran
Joined: Aug 2006
Posts: 1,358 |
For others interested in a possible solution, there is one on ubbdev now.
|
|
|
Bots
by Outdoorking - 04/13/2024 5:08 PM
|
|
|
|
|
|
1 members (Mors),
833
guests, and
197
robots. |
Key:
Admin,
Global Mod,
Mod
|
|
|
|