Super Admin
Posts: 64
Joined: 20-10-2011
|
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.024 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.008 seconds, using GeSHi 1.0.8.10
Now continue in /infusions/forum_threads_list_panel/forum_threads_list_panel.php:
Find:
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.010 seconds, using GeSHi 1.0.8.10
And add tt.thread_locked,
Like this:
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.008 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.009 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.010 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.
Warning about ParkingCrew.com! Case: ParkingCrew.com acquires NameDrive.com but earnings are not transferred despite assurances and promises. Inquiries about this are ignored! It's just a con compagny. Don't do business with them!
|