miniBB ® miniBB®
miniBB Support Forums
 | Forums | Register | Reply | Search | Statistics | Manual |
Custom Tutorials and Modifications miniBB Support Forums / Custom Tutorials and Modifications /   

Thread icons instead of Forum icons on 'latest discussions'

Author Marius
Registered
#1 | Posted: 10 Feb 2007 09:41 | Edited by: Marius 
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="{$main_url}/img/forum_icons/{$forumIcon}" style="width:16px; height:16px" alt="" />


with:

<img src="{$main_url}/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 | Edited by: Paul 
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="{$main_url}/img/{$tpcIcon}" style=......

Author Marius
Registered
#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 | Edited by: Paul 
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' Top

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

 Short link for this topic:

 ?
Only registered users are allowed to post here. Please, enter your username/password details upon posting a message, or register first.


Before posting, make sure your message is compliant with our forum posting rules. If not, it may be locked or deleted with no explanation.
 
miniBB Support Forums Powered by Forum Software miniBB ® Features  Requirements  Demo  Download  Showcase  Gallery of Arts
Compiler  Premium Extensions  Premium Support  License  Contacts
Check out the Captcha add-on: protect your miniBB-forums from the automated spam and flood.
Captcha Addon for miniBB