View Full Version : How do i do this so simple thing user title.
GraphiX2004
05-07-2009, 03:12 PM
in vbulletin you can set users/usergroups with a user title image.
i want the usergroup title image to be a href click able so when a user
clicks on the user title image it takes them to a page dedicated to that user group.
i don't need it to do some wacky coded usergroup page i will design the page
i just want the likes of this to be click able.
User Title <img src=/forum/images/team_icons/recruit.gif>
i've tried <a href="www.gamesite.com/current-recruits.html"><img src=/forum/images/team_icons/recruit.gif></a>
but just converts back to <img src=/forum/images/team_icons/recruit.gif> when you save it.
i know this is going to be a template edit somewhere but i wouldn't know where to
look or which template set to edit.
can someone help me? please
Example: http://img204.imageshack.us/img204/9274/recruit.jpg
Lynne
05-07-2009, 03:36 PM
Probably a template edit in the postbit (or postbit_legacy). You'd want to change this line:
"><div class="smallfont">$post[rank]</div></if>
GraphiX2004
05-07-2009, 03:45 PM
hey lynne but what would i use as the code to replace it with?
the html for it would be <A href="mygamesite.com/group/recruit.php"><img src=/forum/images/team_icons/recruit.gif></a>
but how would i add that to the php $variable dont forget its not just 1 usergroup
it's going to be like 5-6, i just need to be-able to make each user title group image clickable
to link to different webpages with the <a href tag.
Lynne
05-07-2009, 04:28 PM
You should probably write a plugin to define the link ($ranklink), and then go:
<if condition="$post['rank']"><div class="smallfont"><a href="$ranklink">$post[rank]</a></div></if>
GraphiX2004
05-07-2009, 05:07 PM
thanks the the direction lynne but i'm not that advance to write a plugin.
i'd love if someone did make a plugin for this but i wont hold my breath
that code would work also i could just hard code the url to the page
when anyone click any image it would take em to the same page then split
that page up myself with html with the rank images but this is just messy.
how would i define the different ranks in $ranklink
say i had
http://www.mygamesite.com/group/recruit.php
http://www.mygamesite.com/group/admin.php
http://www.mygamesite.com/group/vip.php
http://www.mygamesite.com/group/banned.php
As the web pages how would i set or define these in $ranklink?
where would i find all the variable settings what page or template section.
guessing its the same place $post[rank] is defined?
--------------- Added 1241720966 at 1241720966 ---------------
Lynne it is an update until i get it working but now the image has a border around it, i know the border=0 tag in the image but how do i add this, i need to know which file contains
the variable $post[usertitle]
it's not rank im after changing it's user title i thought it was rank but
when i tried your code it did nothing so tried the same on user title that worked.
but now i have a border around my linkable image and adding border=0 doesnt work.
where can i find where it's defining or declairing the $post[usertitle] variable?
Lynne
05-07-2009, 05:35 PM
I think you're gonna have to just play with it on your test site. Perhaps use the postbit_display_start hook location and do a switch (http://us.php.net/manual/en/control-structures.switch.php) based on the rankid. The rankids are displayed at the top of the Rank Edit page.
GraphiX2004
05-07-2009, 05:43 PM
ok lynne once again thanks for being the only one bothered to reply.
i'm just going to make it simple just need your expert help for my other method.
just going to have the following.
<if condition="$post[usertitle]"><div class="smallfont"><a href="www.mygamesite.com/listofgroups.php">$post[usertitle]</a></div></if>
Problem is i have a border around the image i want it removed.
i dont know which file is the one that holds the $post[usertitle] Variable.
tell me how to remove the border in the above EXACT PHP code
or tell me where i can find the .php file that holds all the $post[] variables to edit. ty
Lynne
05-07-2009, 05:56 PM
To remove a border in an image, in the image tag you need to set border="0":
<img src="yourimage.jpg" style="border-style: none" alt="yourimage" />
GraphiX2004
05-07-2009, 06:07 PM
but that image is stored in the variable $post[usertitle]
what i'm asking is where can i find the source of this usertitle? where is the variable.
there is no way to set a border lynne from inside the adminCP on the actual usertitle
there is no way to set a border to 0
<a href="www.mygamesite.com/listofgroups.php">$post[usertitle]</a></div></if>
so do you see my problem the $post[usetitle] is the image putting border=0 at the side
of the $post[usertitle] just adds the words border=0
i need to be-able to find where its' setting $post[usertitle] in the config.
for example
usertitle = <img src="yourimage.jpg" style="border-style: none" alt="yourimage" />
That is what i'm looking for ... the file that contains the setting up of usertitle
Here, I wrote a quick product for you (attached) to make your life far easier. This will also allow it to easily move across forum upgrades without relying on template edits. Install it as you would any normal plugin. Once you have it installed go to your Admin CP then click on Plugins & Products then Plugin Manager.
If the "Title Group" plugin is not active, make it active. Open it for editing...
// Admin Usergroup
case 6:
$tg_imageURL = "http://urltoimage.com/image.gif";
$tg_linkURL = "http://linktopage.com/page.php";
break;
Copy and paste that for every usergroup you want to have a custom image. Replace the "6" with the ID of the usergroup and the image/link URLs with your information.
If you have any questions post here... I wrote this quick and tested it and it worked, but I may have missed something. ;p
GraphiX2004
05-07-2009, 09:31 PM
Amazing thank you so much Cyro i will test it tonight just got back in from the new trek movie,
if it works and everything are you going to release it as a mod in the mods section
it would sure help alot of people out who's maybe been struggling with this same issue.
something vbulletin in my views should have built in as standard.
I could possibly release it, but it would need to be polished up a bit. It was literally a 2 minute job I did quick at work. Hope it works, did on my test board. If it doesn't let me know and I'll try to figure it out. :)
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.