Log in Register FAQ Memberlist Search Welcome to RCF - WHF Forum Index
alt : test.swf
Welcome to RCF - WHF
4fx3.gif 
calendar_open_closeCalendar 
Last topic Title on index
Post new topic   Reply to topic View previous topic :: View next topic
Welcome to RCF - WHF Forum Index -> Area 51 - phpBB & Easymod Tech Support Add To Bookmarks
Last topic Title on index
PostPosted: 11/12/2006 7:20 PM Reply with quote
Caravan
FTM
Caravan
Posts 282
Word Cnt. 31,380
BDay Apr 14
Sign Aries
Sex Sex:Female
Joined: Nov 01, 2006
Local time: 11:54 PM
Location: Denver, PA
usaCa.gif
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("/&gt;/i", ">", $lttitle);
                        $lttitle = preg_replace("/&lt;/i", "<", $lttitle);
                        $lttitle = preg_replace("/&quot;/i", "\"", $lttitle);
                        $lttitle = preg_replace("/&amp;/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 . '&nbsp;' . '<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'] . '&nbsp;' . ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : $lang['by'] . '&nbsp;' . '<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
View user's profile Find all posts by FTM Send private message   Visit poster's website Yahoo Messenger
Re: Last topic Title on index
PostPosted: 11/13/2006 4:17 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 11:54 PM
Location: St Pete, FL
peace.gif
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("/&gt;/i", ">", $lttitle);
                        $lttitle = preg_replace("/&lt;/i", "<", $lttitle);
                        $lttitle = preg_replace("/&quot;/i", "\"", $lttitle);
                        $lttitle = preg_replace("/&amp;/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 . '&nbsp;' . '<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'] . '&nbsp;' . ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : $lang['by'] . '&nbsp;' . '<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("/&gt;/i", ">", $lttitle);
                        $lttitle = preg_replace("/&lt;/i", "<", $lttitle);
                        $lttitle = preg_replace("/&quot;/i", "\"", $lttitle);
                        $lttitle = preg_replace("/&amp;/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 . '&nbsp;' . '<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'] . '&nbsp;' . ( ($forum_data[$j]['post_username'] != '' ) ? $forum_data[$j]['post_username'] . ' ' : $lang['Guest'] . ' ' ) : $lang['by'] . '&nbsp;' . '<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...

headbang
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: Last topic Title on index
PostPosted: 11/13/2006 5:23 PM Reply with quote
Caravan
FTM
Caravan
Posts 282
Word Cnt. 31,380
BDay Apr 14
Sign Aries
Sex Sex:Female
Joined: Nov 01, 2006
Local time: 11:54 PM
Location: Denver, PA
usaCa.gif
Worked perfectly! Thank you bunches banana
Back to Top
View user's profile Find all posts by FTM Send private message   Visit poster's website Yahoo Messenger
Re: Last topic Title on index
PostPosted: 11/14/2006 12:30 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 11:54 PM
Location: St Pete, FL
peace.gif
Yahoooo.  Another success story...

Applause
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: Last topic Title on index
PostPosted: 11/14/2006 1:09 PM Reply with quote
Caravan
FTM
Caravan
Posts 282
Word Cnt. 31,380
BDay Apr 14
Sign Aries
Sex Sex:Female
Joined: Nov 01, 2006
Local time: 11:54 PM
Location: Denver, PA
usaCa.gif
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
View user's profile Find all posts by FTM Send private message   Visit poster's website Yahoo Messenger
Re: Last topic Title on index
PostPosted: 11/15/2006 12:46 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 11:54 PM
Location: St Pete, FL
peace.gif
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...

dontknow
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
Re: Last topic Title on index
PostPosted: 11/15/2006 6:26 AM Reply with quote
Caravan
FTM
Caravan
Posts 282
Word Cnt. 31,380
BDay Apr 14
Sign Aries
Sex Sex:Female
Joined: Nov 01, 2006
Local time: 11:54 PM
Location: Denver, PA
usaCa.gif
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.  sunny
Back to Top
View user's profile Find all posts by FTM Send private message   Visit poster's website Yahoo Messenger
Re: Last topic Title on index
PostPosted: 11/15/2006 8:13 AM Reply with quote
Site Admin
Nightrider
Site Admin
Posts 30757
Word Cnt. 2,628,690
BDay Jul 28
Sign Leo
Sex Sex:Male
Joined: Sep 25, 2004
Local time: 11:54 PM
Location: St Pete, FL
peace.gif
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...

dontknow
Back to Top
View all pictures posted by this userView user's profile Find all posts by Nightrider Send private message   AIM Address Yahoo Messenger Phoogle Map ICQ Number
 Post new topic  Reply to topic
Information
Welcome to RCF - WHF Forum Index -> Area 51 - phpBB & Easymod Tech Support

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
All times are GMT - 5 Hours

Page 1 of 1


Add To Bookmarks

 
  
  


  Google

Powered by phpBB © 2001, 2005 phpBB Group

Page generation time: 0.1122s (PHP: 71% - SQL: 29%) - SQL queries: 52 - GZIP disabled - Debug on