 | Last topic Title on index |  |
Posted: 11/12/2006 7:20 PM |
|
|
|
|
|
| Caravan |
| Posts |
282 |
| Word Cnt. |
31,380 |
| BDay |
Apr 14 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Nov 01, 2006
Local time: 11:54 PM
Location: Denver, PA
|

|
|
|
|
 |
Mod I am trying to install
| Code:
|
##############################################################
## MOD Title: Last Topic Title on Index
## MOD Author: Dicky <rfoote@tellink.net> (Richard Foote) http://dicky.askmaggymae.com
## MOD Description: Displays the title of and adds a link to the last topic replied to in a particular forum.
## MOD Version: 1.0.1
##
## Installation Level: Easy
## Installation Time: 10 Minutes
## Files To Edit: (3)
## index.php
## language/lang_english/lang_main.php
## templates/subSilver/index_body.tpl
## Included Files: N/A
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes: Dicky
##
## This MOD has been verified to work with phpBB 2.0.19
## This MOD can be installed by EasyMOD
##############################################################
## MOD History:
##
## 2005-12-31 - Version 1.0.1
## - Optimize the code - No functional changes
## - No longer need a separate MOD if you have Today/Yesterday installed
## 2005-12-18 - Version 1.0.0
## - Add filtering for html characters in title
## - Redo queries to reduce number of queries
## 2005-08-21 - Version 0.0.3
## - Add word censoring
## - Add Display topic title only if user allowed to read forum
## 2005-05-17 - Version 0.0.2
## - Replaced sql query for faster times - query by y.m
## - Added By: before poster name
## - Added In: before topic title
## - Added alternate text to topic title
## 2004-05-31 - Version 0.0.1
## - initial version of the Last Topic Mod
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ OPEN ]------------------------------------------
#
index.php
#
#-----[ FIND ]-----------------------------------------
#
<?php
#
#-----[ AFTER, ADD ]----------------------------------------
#
//-- MOD : Last Topic Title on Index -------------------
#
#-----[ FIND ]-----------------------------------------
#
default:
#
#-----[ AFTER, ADD ]-----------------------------------------
#
//-- MOD BEGIN: Last Topic Title on Index -------------------
#
#-----[ FIND ]-----------------------------------------
#
$sql
#
#-----[ IN-LINE FIND ]-----------------------------------------
#
u.user_id
#
#-----[ IN-LINE AFTER, ADD ]-----------------------------------------
#
, t.topic_id, t.topic_title, t.topic_last_post_id
#
#-----[ FIND ]-----------------------------------------
#
FROM
#
#-----[ IN-LINE FIND ]-----------------------------------------
#
(
#
#-----[ IN-LINE AFTER, ADD ]-----------------------------------------
#
(
#
#-----[ FIND ]-----------------------------------------
#
LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
#
#-----[ AFTER, ADD ]-----------------------------------------
#
LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_last_post_id = p.post_id )
#
#-----[ FIND ]-----------------------------------------
#
ORDER BY f.cat_id, f.forum_order";
#
#-----[ AFTER, ADD ]-----------------------------------------
#
//-- MOD END: Last Topic Title on Index -------------------
#
#-----[ FIND ]-----------------------------------------
#
//
// Obtain a list of topic ids which contain
// posts made since user last visited
//
#
#-----[ BEFORE, ADD ]----------------------------------------
#
//-- MOD BEGIN: Last Topic Title on Index -------------------
//
// Define censored word matches
//
$orig_word = array();
$replacement_word = array();
obtain_word_list($orig_word, $replacement_word);
//-- MOD END: Last Topic Title on Index -------------------
#
#-----[ FIND ]-----------------------------------------
#
$is_auth_ary = auth(AUTH_VIEW, AUTH_LIST_ALL, $userdata, $forum_data);
#
#-----[ AFTER, ADD ]----------------------------------------
#
//-- MOD BEGIN: Last Topic Title on Index -------------------
//
// Find which forums are readable for this user
//
$auth_read_ary = array();
$auth_read_ary = auth(AUTH_READ, AUTH_LIST_ALL, $userdata, $forum_data);
//-- MOD END: Last Topic Title on Index -------------------
#
#-----[ FIND ]------------------------------------------
#
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
#
#-----[ REPLACE WITH ]------------------------------------------
#
//-- MOD BEGIN: Last Topic Title on Index -------------------
$ltid = $forum_data[$j]['topic_id'];
$lttitle = $forum_data[$j]['topic_title'];
//
// Censor topic title
//
if ( count($orig_word) )
{
$lttitle = preg_replace($orig_word, $replacement_word, $lttitle);
}
$altlttitle = $lttitle;
$lang_in = $lang['in'];
// undo_htmlspecialchars();
$lttitle = preg_replace("/>/i", ">", $lttitle);
$lttitle = preg_replace("/</i", "<", $lttitle);
$lttitle = preg_replace("/"/i", "\"", $lttitle);
$lttitle = preg_replace("/&/i", "&", $lttitle);
//
// Filter topic_title if not allowed to read
//
if (!$auth_read_ary[$forum_data[$j]['forum_id']]['auth_read'])
{
$lttitle = '';
$lang_in = '';
}
// append first 25 characters of topic title to last topic data
$lttitle = (strlen($lttitle) > 25) ? substr($lttitle,0,25) . '...' : $lttitle;
$last_post .= $lang_in . ' ' . '<a title="' . $altlttitle . '" alt="' . $altlttitle . '" href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$ltid") . '">' . $lttitle . '</a><br />';
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? $lang['by'] . ' ' . ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : $lang['by'] . ' ' . '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
//-- MOD END: Last Topic Title on Index -------------------
#
#-----[ OPEN ]------------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ FIND ]-----------------------------------------
#
$lang['Forums_marked_read']
#
#-----[ AFTER, ADD ]----------------------------------------
#
// Last Topic on Index BEGIN
$lang['by'] = 'By:';
$lang['in'] = 'In:';
// Last Topic on Index END
#
#-----[ OPEN ]------------------------------------------------
#
templates/subSilver/index_body.tpl
#
#-----[ FIND ]-----------------------------------------
#
catrow.forumrow.LAST_POST
#
#-----[ IN-LINE FIND ]-----------------------------------------
#
center
#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
left
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM
|
Error
| Code:
|
Critical Error
FIND FAILED: In file [index.php] could not find:
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> '
|
This is what my line looks like.
| Code:
|
|
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a ' . $last_post_color . ' href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
|
|
|
|
 |
 |
| Back to Top |
|
|
 | Re: Last topic Title on index |  |
Posted: 11/13/2006 4:17 AM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 11:54 PM
Location: St Pete, FL
|

|
|
|
|
 |
Ok, try this:
OPEN
Last Topic Title on Index.txt
FIND
| Code:
|
#
#-----[ FIND ]------------------------------------------
#
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
#
#-----[ REPLACE WITH ]------------------------------------------
#
//-- MOD BEGIN: Last Topic Title on Index -------------------
$ltid = $forum_data[$j]['topic_id'];
$lttitle = $forum_data[$j]['topic_title'];
//
// Censor topic title
//
if ( count($orig_word) )
{
$lttitle = preg_replace($orig_word, $replacement_word, $lttitle);
}
$altlttitle = $lttitle;
$lang_in = $lang['in'];
// undo_htmlspecialchars();
$lttitle = preg_replace("/>/i", ">", $lttitle);
$lttitle = preg_replace("/</i", "<", $lttitle);
$lttitle = preg_replace("/"/i", "\"", $lttitle);
$lttitle = preg_replace("/&/i", "&", $lttitle);
//
// Filter topic_title if not allowed to read
//
if (!$auth_read_ary[$forum_data[$j]['forum_id']]['auth_read'])
{
$lttitle = '';
$lang_in = '';
}
// append first 25 characters of topic title to last topic data
$lttitle = (strlen($lttitle) > 25) ? substr($lttitle,0,25) . '...' : $lttitle;
$last_post .= $lang_in . ' ' . '<a title="' . $altlttitle . '" alt="' . $altlttitle . '" href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$ltid") . '">' . $lttitle . '</a><br />';
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? $lang['by'] . ' ' . ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : $lang['by'] . ' ' . '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
//-- MOD END: Last Topic Title on Index -------------------
|
REPLACE WITH
| Code:
|
#
#-----[ FIND ]------------------------------------------
#
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS
#
#-----[ REPLACE WITH ]------------------------------------------
#
//-- MOD BEGIN: Last Topic Title on Index -------------------
$ltid = $forum_data[$j]['topic_id'];
$lttitle = $forum_data[$j]['topic_title'];
//
// Censor topic title
//
if ( count($orig_word) )
{
$lttitle = preg_replace($orig_word, $replacement_word, $lttitle);
}
$altlttitle = $lttitle;
$lang_in = $lang['in'];
// undo_htmlspecialchars();
$lttitle = preg_replace("/>/i", ">", $lttitle);
$lttitle = preg_replace("/</i", "<", $lttitle);
$lttitle = preg_replace("/"/i", "\"", $lttitle);
$lttitle = preg_replace("/&/i", "&", $lttitle);
//
// Filter topic_title if not allowed to read
//
if (!$auth_read_ary[$forum_data[$j]['forum_id']]['auth_read'])
{
$lttitle = '';
$lang_in = '';
}
// append first 25 characters of topic title to last topic data
$lttitle = (strlen($lttitle) > 25) ? substr($lttitle,0,25) . '...' : $lttitle;
$last_post .= $lang_in . ' ' . '<a ' . $last_post_color . ' title="' . $altlttitle . '" alt="' . $altlttitle . '" href="' . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$ltid") . '">' . $lttitle . '</a><br />';
$last_post .= ( $forum_data[$j]['user_id'] == ANONYMOUS ) ? $lang['by'] . ' ' . ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : $lang['by'] . ' ' . '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . '=' . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
//-- MOD END: Last Topic Title on Index -------------------
|
Save, upload, and try again using EM...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Last topic Title on index |  |
Posted: 11/13/2006 5:23 PM |
|
|
|
|
|
| Caravan |
| Posts |
282 |
| Word Cnt. |
31,380 |
| BDay |
Apr 14 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Nov 01, 2006
Local time: 11:54 PM
Location: Denver, PA
|

|
|
|
|
 |
Worked perfectly! Thank you bunches  |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Last topic Title on index |  |
Posted: 11/14/2006 12:30 AM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 11:54 PM
Location: St Pete, FL
|

|
|
|
|
 |
Yahoooo. Another success story...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Last topic Title on index |  |
Posted: 11/14/2006 1:09 PM |
|
|
|
|
|
| Caravan |
| Posts |
282 |
| Word Cnt. |
31,380 |
| BDay |
Apr 14 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Nov 01, 2006
Local time: 11:54 PM
Location: Denver, PA
|

|
|
|
|
 |
I just noticed a small bug in the coloring on the post name and the user that posted it.
Here is a screen shot. The top one is correct. It was posted by a regular user, so the coloring is correct. The next two were posted by admin's, and the admin color is green, while the post name should be blue. The last one was posted by a global mod, and their color is pink, and the post color should be blue.
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Last topic Title on index |  |
Posted: 11/15/2006 12:46 AM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 11:54 PM
Location: St Pete, FL
|

|
|
|
|
 |
I'm really having a difficult time comprehending the problem. There was code that colorized specific things, so if the colors aren't what you are expecting, it is probably a simple fix to move the code to where it belongs. It looks like you have removed the MOD because I couldn't find what you posted above on either your Test or Live board...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Last topic Title on index |  |
Posted: 11/15/2006 6:26 AM |
|
|
|
|
|
| Caravan |
| Posts |
282 |
| Word Cnt. |
31,380 |
| BDay |
Apr 14 |
| Sign |
Aries |
| Sex |
 |
|
|
|
Joined: Nov 01, 2006
Local time: 11:54 PM
Location: Denver, PA
|

|
|
|
|
 |
I took the mod off of the live board, but it is still on the test board. What's happening is the color for the username is showing up for the link to the post instead of the link to the user's profile.
I will change the admin color at the test board so that you can hopefully see what I am talking about. I think the reason why I missed it before I put it on the live board is because the colors are so similiar on my test board.
Okay, here is another screen shot. See how the admin color is blue, and the forum name's (links) are purple. And then if you look at the section where it shows the last post and who posted it. The admin color is showing for the post, and the post color is showing for the user. In this example the "dimples" should be blue and "drop down menu for smilies" and "Wahh" should be purple. I hope this helps.
I am sure it's probably a simple code fix. I just didn't want to mess anything up. I will look into it a little later today when I get home. Sprry for the confusion, Nightrider.  |
|
|
 |
 |
| Back to Top |
|
|
 | Re: Last topic Title on index |  |
Posted: 11/15/2006 8:13 AM |
|
|
|
|
|
| Site Admin |
| Posts |
30757 |
| Word Cnt. |
2,628,690 |
| BDay |
Jul 28 |
| Sign |
Leo |
| Sex |
 |
|
|
|
Joined: Sep 25, 2004
Local time: 11:54 PM
Location: St Pete, FL
|

|
|
|
|
 |
This MOD sets all Topics to dark blue and all members to Purple regardless of whether they are an admin or regular member. It doesn't differentiate. It's strange that the MOD author chose to change the orignal settings since they should have been correct...
The code is working as the MOD author specified, so to get it to work differently would take a customization of the MOD...
 |
|
|
 |
 |
| Back to Top |
|
|
 | Information |  |
|