miniBB ® 

miniBB

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

Thread icons instead of Forum icons on 'latest discussions'

 
Author Marius
Partaker
#1 | Posted: 10 Feb 2007 09:41 
Because on my forum I use only default.gif forum icon, the thread icons would be more informative for the forum on the latest discussion section. Is this possible?

Replacing inside main_last_discuss_cell.html:

<img src="https://www.minibb.com/forums/img/forum_icons/rose.gif" style="width:16px; height:16px" alt="" />


with:

<img src="https://www.minibb.com/forums/img/topic_{$tpcIcon}.gif" style="width:21px;height:21px"
alt="" />


...did not work. My guess is that $tpcIcon needs to be called inside bb_func_ldisc.php. I'm not sure howto or if that's even correct reasoning. Any help would be appreciated.


Kind regards,
Marius

Author Paul
Lead Developer 
#2 | Posted: 10 Feb 2007 12:28 
This would be a very custom and core-destructive modification, but still possible.

First modify bb_func_ldisc.php file and add the following fields to the topic selection request:

if($cols=db_simpleSelect(0, $Tt, 'topic_id, topic_title, topic_poster, topic_poster_name, topic_time, forum_id, posts_count, topic_last_post_id, topic_views, topic_last_post_time, topic_last_poster, topic_status, sticky','','','',$orderBy,$viewlastdiscussions)){

also as modify the array below:

$colls[]=array($cols[0], $cols[1], $cols[2], $cols[3], $cols[4], $cols[5], $cols[6], $cols[7], $cols[8], $cols[9], $cols[10], $cols[11], $cols[12]);

Into bb_plugins.php, paste the function below (or merge with the existing function's code):

function parseTopic(){

/* Displaying topic icons in Latest Discussions */

if($GLOBALS['action']==''){
if ($GLOBALS['cols'][11]==1 and $GLOBALS['cols'][12]==1) $tpcIcon='stlock';
elseif ($GLOBALS['cols'][12]==1) $tpcIcon='sticky';
elseif ($GLOBALS['cols'][11]==1) $tpcIcon='locked';
elseif ($GLOBALS['numReplies']<=0) $tpcIcon='empty';
elseif ($GLOBALS['numReplies']>=$GLOBALS['viewmaxreplys']) $tpcIcon='hot';
else $tpcIcon='default';

$GLOBALS['tpcIcon']='topic_'.$tpcIcon.'.gif';

}

/* --Displaying topic icons in Latest Discussions */

}


So in templates/main_lastdiscuss_cell.html you will have:

<img src="https://www.minibb.com/forums/img/{$tpcIcon}" style=......

Author Marius
Partaker
#3 | Posted: 10 Feb 2007 13:24 
Wonderful!!! I'm sorry this is core destructive solution, the more grateful I am for this code offer.

I know I have many request, still have one more suggestion, which I'll post under the appropriate forum.

Kind regards and thanks for being generous,

Marius

Author hubba
Guest
#4 | Posted: 7 Sep 2007 13:35 
done like mentioned above, bb_func_ldisc.php gives the following error:

Parse error: parse error, unexpected T_VARIABLE in ...\bb_func_ldisc.php on line 20 ($lPosts=array();)

tested on minibb 2.0.5b, Apache/2.2.3 (Win32), PHP/5.1.6

any ideas?

Author Paul
Lead Developer 
#5 | Posted: 8 Sep 2007 10:45 
No ideas... it's your own mistake somewhere in the code. It's not related to the hack.

Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /
 Thread icons instead of Forum icons on 'latest discussions'
 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
Install the Captcha add-on: protect your miniBB-forums from the automated spam and flood.


  ⇑