miniBB ® 

miniBB

®
Support Forums
  
 | Start | Register | Search | Statistics | File Bank | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /  
 

Disable hyperlink on "Administrator" or "Moderator" or "Forum Member" titles, and add it to Username

 
Author JeremyM
Guest
#1 | Posted: 8 Jan 2009 11:20 
I want to make it so the "Administrator" or "Moderator" or "Forum Member" titles are there, but in text and not links. I want to be able to have it so I click on a user's name and instead of that pasting into the reply box, it goes to that user's profile.

I've searched and tried my own testing. I just can't find where the $viewReg variable is set (which file?). Once I have that, I can do the rest on my own.

So, which file is it?

Thanks!

Author Paul
Lead Developer 
#2 | Posted: 9 Jan 2009 03:30 
Here is how to find where to edit this and that.

But anyway, if you edit a core file, it's bad for further updates, because you will need to roll back your own modifications each time.

What you would like to achieve, could be done also with non-destructive methods. For example, we may use parseMessage() function of bb_plugins.php file. Such function may be used by other add-ons, in that case you need to paste the block of code provided below, before the return; statement. If function is not available, just paste the code as shown below. Do not duplicate that function, else it will stop the forums.

function parseMessage(){

/* Member link on the nickname */

if ($GLOBALS['cols'][0]!=0) {
$GLOBALS['viewRegURL1']="<a href=\"{$GLOBALS['main_url']}/{$GLOBALS['indexphp']}action=userinfo&amp;user={$GLOBALS['cc']}\">";
$GLOBALS['viewRegURL2']='</a>';
}
else{
$GLOBALS['viewRegURL1']='';
$GLOBALS['viewRegURL2']='';
}

$GLOBALS['viewRegClear']=strip_tags($GLOBALS['viewReg']
);

/* --Member link on the nickname */

return;
}
Then modify templates/main_posts_cell.html and replace default code which looks like this:

<span class="username"><a href="JavaScript:paste_strinL('{$posterNameJs}',2)">{$posterName}</a><br /></span><span class="txtSm">{$viewReg}</span>
to this:

<span class="username">{$viewRegURL1}{$posterName}{$viewRegURL2}<br /></span><span class="txtSm">{$viewRegClear}</span>
That 100% works as I already have tested it. Enjoy!

Author kuopassa
Partaker
#3 | Posted: 14 Mar 2009 08:39 
This code works for those regular posts, but it would be great if also private message addon's single messages would have link to sender's profile page. (Name of the user who sent PM would be link to his/hers profile page.) I believe that this would be possible to create, so how much money would it take to do that?

Author Paul
Lead Developer 
#4 | Posted: 16 Mar 2009 03:37 
For Private Messages add-on, you could achieve that modifying templates/addon_pmail_viewmsg.html and putting the following code:

<a href="https://www.minibb.com/forums/{$indexphp}action=userinfo&amp;user={$cc}"{$nof} target="_blank">{$userfromnick}</a>
I suppose in that case you would need to remove the code containing {$viewReg} and {$userfromnick} in the same template for not duplicating them.

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 Disable hyperlink on "Administrator" or "Moderator" or "Forum Member" titles, and add it to Username
 Share Topic's Link

Your Reply Click this icon to move up to the quoted message


  ?
Post as a Guest, leaving the Password field blank. You could also enter a Guest name, if it's not taken by a member yet. Sign-in and post at once, or just sign-in, bypassing the message's text.


Before posting, make sure your message is compliant with forum rules; otherwise it could be locked or removed with no explanation.

 

 
miniBB Support Forums Powered by Forum Software miniBB ® Home  Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contact Us
Try the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑