miniBB ® 

miniBB

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

How to show topic starter on topic page?

 
Author qq12
Guest
#1 | Posted: 13 May 2016 16:53 
Hello all!
Is there any way to display topic starter as (OP) near its nick name on its own posts? It can be based on user id but I'd prefer it to be based on IP because I'm trying to build an anonymous forum. Thanks!

Author tom322
Active Member
#2 | Posted: 13 May 2016 18:33 
It would require a custom solution. Even more custom if you want to compare by IP addresses (which would be pretty much unreliable). I have some piece of code from bb_plugins.php ($myTopic needs to be pasted in the main_posts.html template) that shows for logged user if this is the topic he started; you may try to figure out how to do something else with it. Or better contact paid support.

//swhow my topic info
$myTopics='';

if($action=='vthread' and isset($user_num_posts) and ($user_num_posts>0)){

if($user_id==$topicData[2]) $myTopic='My Topic';

}

Author Paul
Lead Developer 
#3 | Posted: 13 May 2016 20:45 
qq12:
Is there any way to display topic starter as (OP) near its nick name on its own posts?
Not sure what do you mean...
Do you mean that when you open some topic, then near each message which has been posted from the topic starter's IP, there should be a mark stating "Topic Starter"?

For example:

username1 - message1

username2 - message2

username3 - message3

username1 (topic starter) - message4

username3 - message5
etc.
?

Author Batu
Partaker
#4 | Posted: 13 May 2016 21:08 
Hey,
It was by brother asking that question. We are still working on private project built on miniBB. Since I don't have enough free time, my bro was working on it. And yes, it was what we were looking for, Paul.
Also, is there any way to contact you via e-mail? I'd like to discuss about some other customizations. Thanks.

Author Paul
Lead Developer 
#5 | Posted: 13 May 2016 23:30 
Batu:
And yes, it was what we were looking for, Paul.
Well... then it appears you will need to make one custom change in the core script, and also provide the plugin-oriented code in some other files.

Here's what to do:

- bb_func_vthread.php - locate the code string like this:

$cols[4]='';
comment or remove it, so it's not executed:

//$cols[4]='';
- Then you will need to edit bb_plugins.php in two parts. At first, sometimes at the very bottom of this script and possibly right after <?php tag put this code:

/* Displaying topic's starter */
if($action=='vthread'){
$topic_starter_ip='';
if($row=db_simpleSelect(0, $Tp, 'poster_ip', 'topic_id', '=', $topic, 'post_id asc', 1)){
$topic_starter_ip=$row[0];
//echo $topic_starter_ip;
}
}
/* --Displaying topic's starter */
Then if you don't have parseMessage function in this script, paste the following:

function parseMessage(){

/* Displaying topic's starter */
if($GLOBALS['anchor2']!=1 and $GLOBALS['cols'][4]==$GLOBALS['topic_starter_ip']) $GLOBALS['topic_starter_mark']='<br />Topic Starter';
else $GLOBALS['topic_starter_mark']='';
/* --Displaying topic's starter */

return;
}
If you already have this function, you will need only the proper part of the plugin's code and paste it before the return statement.

- Finally, modify templates/main_posts_cell.html and paste the following indication var: {$topic_starter_mark} somewhere... may be right following the {$viewReg} var.


Batu:
Also, is there any way to contact you via e-mail? I'd like to discuss about some other customizations. Thanks.
At the very bottom of this page, on the left side you will find the navigation links; choose "Contacts" to drop me a private message.

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 How to show topic starter on topic page?
 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
Proceed with the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑