Clan Adverts

Sponsors

CT on Facebook

Latest Product

User Box

Anonymous
38.107.179.219
Nickname:

Password:

Security Code
Security Code
Type Security Code


PND Downloads Feed

Phpnuke Downloads
How to Delete or Reset yo...
How to Delete or Reset your PHPNuke Admin Account
Lost your admin password ?  Cant login to your admin account ?This sh...
Back Online & Stuff
Back Online & Stuff
Look at us with our nifty website back up and running… Seriousl...
How to edit the admins in...
How to edit the admins in the forums
Here is a way to make someone admin in your forums on your Evo site. I...
Demo Splash Screen
Demo Splash Screen
Ped @ Clan Themes has released a simple splash screen entrance hack. ...
Free Phpnuke Business The...
Free Phpnuke Business Theme 6
This is the 6th Business theme for Phpnuke that Clan Themes has releas...
Tricked Out Slider
Tricked Out Slider
We have seen some great new things come out of Tricked Out News and th...

Custom Work

PHP Nuke Custom Work

www.clanthemes.com :: View topic - Integrate last post on topic index with simple subforums
Integrate last post on topic index with simple subforums

4 Replies / 2122 Views


Post new topic   Reply to topic  

   www.clanthemes.com Forum Index » Custom Work

View previous topic :: View next topic


blackfox_us
Reputation: 283.7 Add RepSubtract Rep
votes: 1
Local time: 5:22 AM

blank.gif

OMG
OMG

0.08 posts per day
Medals: 1 (View more...)
Site Supporter (Amount: 1)

Joined: Oct 04, 2007
Last Visit: 27 Nov 2008
Posts: 122
Points: 3979 

Post Integrate last post on topic index with simple subforums Posted: Wed May 14, 2008 5:05 am

I wanna use this addon with my forums, but I have a problem with the simple subforums,,, some of the codes had been changed for the simple subforums, and it requires me to change this codes,,,, so i thought maybe you guys can help me with it

thats the last post on topic index code
Code:
##############################################################
## Mod Title:   shows topic of last made post on index
## Mod Version: 1.4.1
## Author:      e-sven <sven@e-sven.net> http://www.e-sven.net
## Description: -adds lasts post topic to each forum on
##               the index page (based on read-access)
##      -word censorship is used
##      -topic title with more then 27 chars are cut off
##      -mouseover info displays the full title
##
## Installation Level:  easy
## Installation Time:   2-5 Minutes
## Files To Edit:       index.php
## Included Files:      index.php (pre-modded)
##############################################################
## History:
##         1.4.1 Updated to phpBB 2.0.22
##         ???
##         0.9 not released beta
##         1.0 first working release
##         1.1 optimized db access
##      1.2 made implementation easier
##          (only two replaces have to be made)
##         1.2a just a minor bug (thanks to Acid)
##         1.3 empty forums where not displayed correctly
##         1.4 optimized db-query
##############################################################
## Before Adding This MOD To Your Forum,
## You Should Back Up All Files Related To This MOD
##############################################################

#
#-----[ OPEN ]------------------------------------------------
#
index.php

#
#-----[ ACTION Find ]-----------------------------------------
#
         $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id
            FROM (( " . FORUMS_TABLE . " f
            LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )
            LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id )
            ORDER BY f.cat_id, f.forum_order";
         break;
   }
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
   }

   $forum_data = array();
   while( $row = $db->sql_fetchrow($result) )
   {
      $forum_data[] = $row;
   }
   $db->sql_freeresult($result);

   if ( !($total_forums = count($forum_data)) )
   {
      message_die(GENERAL_MESSAGE, $lang['No_forums']);
   }


#
#-----[ REPLACE WITH ]----------------------------------------
#
       $sql = "SELECT f.*, p.post_time, p.post_username, u.username, u.user_id, t.topic_title, t.topic_last_post_id " .
         " FROM ((( " . FORUMS_TABLE . " f " .
         " LEFT JOIN " . POSTS_TABLE . " p ON p.post_id = f.forum_last_post_id )" .
         " LEFT JOIN " . USERS_TABLE . " u ON u.user_id = p.poster_id ) " .
         " LEFT JOIN " . TOPICS_TABLE . " t ON t.topic_last_post_id = p.post_id ) " .
         " ORDER BY f.cat_id, f.forum_order";
      break;
   }
   if ( !($result = $db->sql_query($sql)) )
   {
      message_die(GENERAL_ERROR, 'Could not query forums information', '', __LINE__, __FILE__, $sql);
   }

   $forum_data = array();
   $topic_last_ary = array();
   $i=0;
   while( $row = $db->sql_fetchrow($result) )
   {
      if (!in_array($row['topic_last_post_id'], $topic_last_ary) || $row['topic_last_post_id']==0) {
         $topic_last_ary[i]=$row['topic_last_post_id'];
         $i++;
         $forum_data[] = $row;
      }
   }
   unset($topic_last_ary);
   if ( !($total_forums = count($forum_data)) )
   {
      message_die(GENERAL_MESSAGE, $lang['No_forums']);
   }
   
   //
   // Filter topic_title not allowed to read
   //
   if ( !($userdata['user_level'] == ADMIN && $userdata['session_logged_in']) ) {
      $auth_read_all = array();
      $auth_read_all=auth(AUTH_READ, AUTH_LIST_ALL, $userdata, $forum_data);
      $auth_data = '';
      for($i=0; $i<count($forum_data); $i++)
      {
         if (!$auth_read_all[$forum_data[$i]['forum_id']]['auth_read']) {
            $forum_data[$i]['topic_title']='';
         }
      }
   }

   //
   // Define censored word matches
   //
   $orig_word = array();
   $replacement_word = array();
   obtain_word_list($orig_word, $replacement_word);


#
#-----[ ACTION Find ]-----------------------------------------
#
                     if ( $forum_data[$j]['forum_last_post_id'] )
                     {
                        $last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);

                        $last_post = $last_post_time . '<br />';

                        $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&amp;" . POST_USERS_URL . '='  . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
                        
                        $last_post .= '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '" /></a>';
                     }


#
#-----[ ACTION Replace With ]---------------------------------
#
   if ( $forum_data[$j]['forum_last_post_id'] )
   {
      $topic_title = $forum_data[$j]['topic_title'];
      $topic_title2 = $forum_data[$j]['topic_title'];
      
      //
      // Censor topic title
      //
      if ( count($orig_word) )
      {
         $topic_title = preg_replace($orig_word, $replacement_word, $topic_title);
         $topic_title2 = preg_replace($orig_word, $replacement_word, $topic_title2);
      }
                              
      if (strlen($topic_title)>27) {
         $topic_title = substr($topic_title,0,24) . '...';
      }

      $last_post_time = create_date($board_config['default_dateformat'], $forum_data[$j]['post_time'], $board_config['board_timezone']);
      $last_post = '<a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '" title="' . $topic_title2 . '">' . $topic_title . '</a><br>';
      $last_post .= $last_post_time . ' <a href="' . append_sid("viewtopic.$phpEx?"  . POST_POST_URL . '=' . $forum_data[$j]['forum_last_post_id']) . '#' . $forum_data[$j]['forum_last_post_id'] . '"><img src="' . $images['icon_latest_reply'] . '" border="0" alt="' . $lang['View_latest_post'] . '" title="' . $lang['View_latest_post'] . '"></a><br>' . $lang['by'] . ' ';
      $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&amp;" . POST_USERS_URL . '='  . $forum_data[$j]['user_id']) . '">' . $forum_data[$j]['username'] . '</a> ';
   }

#
#-----[ SAVE/CLOSE ALL FILES ]----------------------------------
#


thank you very much
 

 
View user's profileSend private messageSend e-mail Reply with quote

DoC
Reputation: 90.1 Add RepSubtract Rep
votes: 5
Local time: 10:22 AM
Location: UK
uk.gif



0.24 posts per day
Medals: 3 (View more...)
Super Dedicated User (Amount: 1)
Forums Moderator
Forums Moderator
Joined: Feb 07, 2007
Last Visit: 30 Jun 2011
Posts: 430
Points: 4451 

Post Integrate last post on topic index with simple subforums Posted: Wed May 14, 2008 12:10 pm

Shop Purchases:
Clan Roster v1.7 Php Nuke Module · Clan Roster 2.0

Hello mate,

What you need to do is get the changes made by the subforums MOD and copy them to a txt file, then copy the changes in that file you have posted and compare them. You can use a program called Beyond Compare: http://www.scootersoftware.com/moreinfo.php

It will highlight the differences between the code for you.

Then you manually make the changes in the current index.php file.

Hope this helps

DoC
 

 
View user's profileSend private messageSend e-mail Reply with quote

blackfox_us
Reputation: 283.7 Add RepSubtract Rep
votes: 1
Local time: 5:22 AM

blank.gif

OMG
OMG

0.08 posts per day
Medals: 1 (View more...)
Site Supporter (Amount: 1)

Joined: Oct 04, 2007
Last Visit: 27 Nov 2008
Posts: 122
Points: 3979 

Post Re: Integrate last post on topic index with simple subforums Posted: Wed May 14, 2008 4:21 pm

Thanks a lot, it did help
 

 
View user's profileSend private messageSend e-mail Reply with quote


DoC
Reputation: 90.1 Add RepSubtract Rep
votes: 5
Local time: 10:22 AM
Location: UK
uk.gif



0.24 posts per day
Medals: 3 (View more...)
Dedication (Amount: 1)
Forums Moderator
Forums Moderator
Joined: Feb 07, 2007
Last Visit: 30 Jun 2011
Posts: 430
Points: 4451 

Post Re: Integrate last post on topic index with simple subforums Posted: Wed May 14, 2008 5:15 pm

Shop Purchases:
Clan Roster v1.7 Php Nuke Module · Clan Roster 2.0

No worries mate, glad I could be of service Smiley

DoC
 

 
View user's profileSend private messageSend e-mail Reply with quote

blackfox_us
Reputation: 283.7 Add RepSubtract Rep
votes: 1
Local time: 5:22 AM

blank.gif

OMG
OMG

0.08 posts per day
Medals: 1 (View more...)
Site Supporter (Amount: 1)

Joined: Oct 04, 2007
Last Visit: 27 Nov 2008
Posts: 122
Points: 3979 

Post Re: Integrate last post on topic index with simple subforums Posted: Wed May 14, 2008 7:06 pm

here is my result,

http://bhzclan.com/users/Handsome_Devil/result.bmp

----------------------

one last thing I wanna add the word "By" to the left of the poster name, would that be possible ?
 

 
View user's profileSend private messageSend e-mail Reply with quote
Post new topic   Reply to topic  
   www.clanthemes.com Forum Index » Custom Work


 
4 Replies / 2122 Views
Page 1 of 1
All times are GMT
Display posts from previous:   
 
Jump to:  
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 can download files in this forum