Oh no! Where's the
JavaScript ?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please
enable JavaScript on your Web browser to properly view this Web site,
or
upgrade to a Web browser that does support JavaScript;
Firefox ,
Safari ,
Opera ,
Chrome or a version of
Internet Explorer newer then version 6.
image locked and hot added in forum_threads_list_panel.php
Fusioneer
Posted on 15-02-2012 21:35
Super Admin
Posts: 37
Joined: 20.10.11
The current forum_threads_list_panel.php usually displayed on your front page containing the latest forum entries does not have an image for a locked or a hot thread. It can only display an image for new post/thread or a standard image.
Somewhere in the development of php fusion the hot thread functionality was abandoned. Even though all themes still include this image.
How to fix this:
If you want folder hot as well open up includes/system_images.php
Find "foldernew" => THEME."forum/foldernew.gif",
and add: "folderhot" => THEME."forum/folderhot.gif",
see below.
GeSHi: PHP
//A
"arrow" => IMAGES. "arrow.png" ,
//B
"blank" => THEME. "images/blank.gif" ,
//C
"calendar" => IMAGES. "dl_calendar.png" ,
//D
"down" => THEME. "images/down.gif" ,
"download" => IMAGES. "dl_download.png" ,
"downloads" => IMAGES. "dl_downloads1.png" ,
//E
"edit" => IMAGES. "edit.png" ,
//F
"folder" => THEME. "forum/folder.gif" ,
"folderlock" => THEME. "forum/folderlock.gif" ,
"foldernew" => THEME. "forum/foldernew.gif" ,
"folderhot" => THEME. "forum/folderhot.gif" ,
"forum_edit" => THEME. "forum/edit.gif" ,
//G
"go_first" => IMAGES. "go_first.png" ,
"go_last" => IMAGES. "go_last.png" ,
"go_next" => IMAGES. "go_next.png" ,
"go_previous" => IMAGES. "go_previous.png" ,
//H
"homepage" => IMAGES. "dl_homepage.png" ,
//I
"info" => IMAGES. "dl_info.png" ,
"imagenotfound" => IMAGES. "imagenotfound.jpg" ,
//J
//K
//L
"left" => THEME. "images/left.gif" ,
//M
//N
"newthread" => THEME. "forum/newthread.gif" ,
"no" => IMAGES. "no.png" ,
"noavatar50" => "noavatar50.png" ,
"noavatar100" => "noavatar100.png" ,
"noavatar150" => "noavatar150.png" ,
//O
//P
"panel_on" => THEME. "images/panel_on.gif" ,
"panel_off" => THEME. "images/panel_off.gif" ,
"pm" => THEME. "forum/pm.gif" ,
"pollbar" => THEME. "images/pollbar.gif" ,
"printer" => IMAGES. "printer.png" ,
//Q
"quote" => THEME. "forum/quote.gif" ,
//R
"reply" => THEME. "forum/reply.gif" ,
"right" => THEME. "images/right.gif" ,
//S
"save" => IMAGES. "php-save.png" ,
"screenshot" => IMAGES. "dl_screenshot.png" ,
"star" => IMAGES. "star.png" ,
"statistics" => IMAGES. "dl_stats.png" ,
"stickythread" => THEME. "forum/stickythread.gif" ,
//T
"tick" => IMAGES. "tick.png" ,
//U
"up" => THEME. "images/up.gif" ,
//V
//W
"web" => THEME. "forum/web.gif" ,
//X
//Y
"yes" => IMAGES. "yes.png"
//Z
) ;
Parsed in 0.070 seconds, using GeSHi 1.0.8.10
I want to include the forum locale as well to make use of the alt descriptions I can grab from there.
So open up /infusions/forum_threads_list_panel/forum_threads_list_panel.php and add include LOCALE.LOCALESET."forum/main.php"; like below.
GeSHi: PHP <?php
if ( ! defined ( "IN_FUSION" ) ) { die ( "Access Denied" ) ; } include LOCALE. LOCALESET. "forum/main.php" ;
global $lastvisited ;
Parsed in 0.048 seconds, using GeSHi 1.0.8.10
Now continue in /infusions/forum_threads_list_panel/forum_threads_list_panel.php :
Find:
GeSHi: PHP $result = dbquery(
"SELECT tt.thread_id, tt.thread_subject, tt.thread_views, tt.thread_lastuser, tt.thread_lastpost,
tt.thread_poll, tf.forum_id, tf.forum_name, tf.forum_description, tf.forum_access, tt.thread_lastpostid, tt.thread_postcount, tu.user_id, tu.user_name, tu.user_status
FROM " . DB_THREADS. " tt
INNER JOIN " . DB_FORUMS. " tf ON tt.forum_id=tf.forum_id
INNER JOIN " . DB_USERS. " tu ON tt.thread_lastuser=tu.user_id
WHERE " . groupaccess( 'tf.forum_access' ) . " AND tt.thread_lastpost >= " . $timeframe . " AND tt.thread_hidden='0'
ORDER BY tt.thread_lastpost DESC LIMIT 0," . $settings [ 'numofthreads' ]
) ;
Parsed in 0.050 seconds, using GeSHi 1.0.8.10
And add tt.thread_locked,
Like this:
GeSHi: PHP $result = dbquery(
"SELECT tt.thread_id, tt.thread_subject, tt.thread_views, tt.thread_lastuser, tt.thread_lastpost, tt.thread_locked,
tt.thread_poll, tf.forum_id, tf.forum_name, tf.forum_description, tf.forum_access, tt.thread_lastpostid, tt.thread_postcount, tu.user_id, tu.user_name, tu.user_status
FROM " . DB_THREADS. " tt
INNER JOIN " . DB_FORUMS. " tf ON tt.forum_id=tf.forum_id
INNER JOIN " . DB_USERS. " tu ON tt.thread_lastuser=tu.user_id
WHERE " . groupaccess( 'tf.forum_access' ) . " AND tt.thread_lastpost >= " . $timeframe . " AND tt.thread_hidden='0'
ORDER BY tt.thread_lastpost DESC LIMIT 0," . $settings [ 'numofthreads' ]
) ;
Parsed in 0.052 seconds, using GeSHi 1.0.8.10
Now find:
GeSHi: PHP while ( $data = dbarray( $result ) ) {
$row_color = ( $i % 2 == 0 ? "tbl1" : "tbl2" ) ;
echo "<tr>\n <td class='" . $row_color . "'>" ;
if ( $data [ 'thread_lastpost' ] > $lastvisited ) {
$thread_match = $data [ 'thread_id' ] . "\|" . $data [ 'thread_lastpost' ] . "\|" . $data [ 'forum_id' ] ;
if ( iMEMBER
&& ( $data [ 'thread_lastuser' ] == $userdata [ 'user_id' ] || preg_match ( "(^\.{$thread_match} $|\.{$thread_match} \.|\.{$thread_match} $)" , $userdata [ 'user_threads' ] ) ) ) { echo "<img src='" . get_image( "folder" ) . "' alt='' />" ;
} else {
echo "<img src='" . get_image( "foldernew" ) . "' alt='' />" ;
}
} else {
echo "<img src='" . get_image( "folder" ) . "' alt='' />" ;
}
if ( $data [ 'thread_poll' ] ) {
$thread_poll = "<span class='small' style='font-weight:bold'>[" . $locale [ 'global_051' ] . "]</span> " ;
} else {
$thread_poll = "" ;
}
Parsed in 0.060 seconds, using GeSHi 1.0.8.10
And replace with this code:
GeSHi: PHP while ( $data = dbarray( $result ) ) {
$row_color = ( $i % 2 == 0 ? "tbl1" : "tbl2" ) ;
echo "<tr>\n <td class='" . $row_color . "'>" ;
if ( $data [ 'thread_locked' ] ) {
echo "<img src='" . get_image( "folderlock" ) . "' alt='" . $locale [ '564' ] . "' />" ;
} else {
if ( $data [ 'thread_lastpost' ] > $lastvisited ) {
$thread_match = $data [ 'thread_id' ] . "\|" . $data [ 'thread_lastpost' ] . "\|" . $data [ 'forum_id' ] ;
if ( iMEMBER
&& ( $data [ 'thread_lastuser' ] == $userdata [ 'user_id' ] || preg_match ( "(^\.{$thread_match} $|\.{$thread_match} \.|\.{$thread_match} $)" , $userdata [ 'user_threads' ] ) ) ) { echo "<img src='" . get_image( "folder" ) . "' alt='" . $locale [ '561' ] . "' />" ;
} else {
echo "<img src='" . get_image( "foldernew" ) . "' alt='" . $locale [ '560' ] . "' />" ;
}
} elseif ( $data [ 'thread_postcount' ] > 10 ) {
echo "<img src='" . get_image( "folderhot" ) . "' alt='" . $locale [ '562' ] . "' />" ;
} else {
echo "<img src='" . get_image( "folder" ) . "' alt='" . $locale [ '561' ] . "' />" ;
}
if ( $data [ 'thread_poll' ] ) {
$thread_poll = "<span class='small' style='font-weight:bold'>[" . $locale [ 'global_051' ] . "]</span> " ;
} else {
$thread_poll = "" ;
}
}
Parsed in 0.067 seconds, using GeSHi 1.0.8.10
Notice the alt locales as well! Better for SEO.
If the thread_postcount is greater than 10 the thread is considered hot. But you can alter this value to your liking. (perhaps an administration panel setting?) Or you can take thread_views as a measure point for when to consider a thread as hot.
.
Jump to Forum:
PHP-Fusion installation
PHP-Fusion usage
Modifications to forum_threads_list_panel.php
Modifications to header.php
Modifications to BBcodes
Modifications to messages.php
Panels, share youre code
Panels/infusions (add ons)
Modifications to protect your website
• Guests Online: 1
• Members Online: 0
• Total Members: 20
• Newest Member: Craig
Not a member yet?
Click here to register.
Forgotten your password?
Request a new one
here .
You must login to post a message.
No messages have been posted.
PHP-Fusion, I might try it.
Yes
100% [3 Votes]
No
0% [0 Votes]
Maybe
0% [0 Votes]
Votes: 3
You must login to vote. Started: 20.10.11