[ALPHA] Attached forums or pseudo sub-forums mod 1.0.0

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
Daniel-san
Registered User
Posts: 7
Joined: Wed Oct 27, 2004 8:59 pm

Post by Daniel-san »

I just wanted to thank you, this mod is fabelous ! :mrgreen:

And it's working on phpnuke's forums too :)




Thanks again !

User avatar
ccessex
Registered User
Posts: 399
Joined: Sat May 15, 2004 2:04 pm
Location: Furneux Pelham
Contact:

Post by ccessex »

I installed this mod, but got a strange thing happen?

It all installed ok, no errors.

It has added the last posted in the Last Post column, but has made no difference to the forums?

There is nothing in the ACP, not sure if there should be or not?

Anyone any ideas?

Cliff

Patrick Simmons
Registered User
Posts: 296
Joined: Fri May 13, 2005 12:38 pm
Contact:

Post by Patrick Simmons »

Can anyone help me. I can not get the subforum's post total to show up on the index. Is there a fix for it that I am missing?

Patrick Simmons
Registered User
Posts: 296
Joined: Fri May 13, 2005 12:38 pm
Contact:

Post by Patrick Simmons »

anyone know?

jquindlen
Registered User
Posts: 23
Joined: Sun Aug 13, 2006 9:50 pm

Post by jquindlen »

Patrick Simmons wrote: Can anyone help me. I can not get the subforum's post total to show up on the index. Is there a fix for it that I am missing?


No. I just read the whole topic looking for that one bit of information and couldn't find it. Hopefully we can get that one last bit of support to complete this iteration of the mod.

jquindlen
Registered User
Posts: 23
Joined: Sun Aug 13, 2006 9:50 pm

Post by jquindlen »

Well, screw it. I'm going to write the feature myself, because I prefer this version of the mod over all the derivatives. I'll post the code here when I am done.

User avatar
bigbassfish1
Registered User
Posts: 45
Joined: Tue Jul 18, 2006 7:33 am

pseudosubforum

Post by bigbassfish1 »

Hello there!

My pseudosubforum finally works!
I have a forum and it is called -

check it out here -

http://bigbassfish.tetrahost.net/testforum/

esserdk
Registered User
Posts: 85
Joined: Sat Mar 26, 2005 11:27 am
Location: EU,Denmark,Kokkedal
Contact:

Post by esserdk »

Ok, i set up a total new test site, and a new phpBB 2.0.21 installation, and tried to install the mod with easymod, but there was some errors.

Now i know how to install a mod mannualy and all that, just wanted to tell about it.


this was the error message EM gave me
Critical Error

IN-LINE FIND FAILED: In file [admin/admin_forums.php] could not find:

intval($HTTP_POST_VARS[POST_CAT_URL]) .

MOD script line #122 :: FAQ :: Report

esserdk
Registered User
Posts: 85
Joined: Sat Mar 26, 2005 11:27 am
Location: EU,Denmark,Kokkedal
Contact:

this is a fixed version of the install file...

Post by esserdk »

this is a fixed version so it can install

Code: Select all

############################################################## 
## MOD Title: Attached forums or pseudo sub-forums MOD 
## MOD Author: harishankar < v_harishankar@yahoo.co.in > (Harishankar) http://literaryforums.org 
## MOD Description: This mod allows you to "attach" specific forums to another so that they are not displayed on the main index page but inside another forum. This emulates the sub-forums features but does not really create true sub-forum functionality. 
## 
## MOD Version: 1.0.1 (alpha) 
## 
## Installation Level: (Easy) 
## Installation Time: 10 Minutes 
## Files To Edit:    admin/admin_forums.php 
##                  templates/subSilver/admin/forum_edit_body.tpl 
##                  index.php 
##                  templates/subSilver/index_body.tpl 
##                  viewforum.php 
##                  templates/subSilver/viewforum_body.tpl 
##                  language/lang_english/lang_main.php 
##                  language/lang_english/lang_admin.php 
## 
## Included Files: (n/a) 
############################################################## 
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the 
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code 
## to enter into your phpBB Forum. As such, phpBB will not offer support for MOD's not offered 
## in our MOD-Database, located at: http://www.phpbb.com/mods/ 
############################################################## 
## Author Notes: 
## 
##      Test this MOD in a testing/isolated enviroment. Although 
##      no obvious bugs have been found yet, this MOD *should* 
##      work in a live environment as well. I am well aware of 
##      certain features missing. That is due to two reasons: 
## 
##      1. I don't want to make this MOD too difficult and 
##         cumbersome to install which I wanted to avoid. 
##      2. To add certain features like "last post" on index 
##         to integrate with this MOD a lot of functionality 
##         will have to be duplicated. 
## 
############################################################## 
## MOD History: 
## 
##   2004-12-11 - Version 1.0.1 
##      - Alpha release :) 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

# 
#-----[ SQL ]------------------------------------------------- 
# 
#       If your phpbb table prefix is different, then change it to 
#      reflect the correct one. 
# 
     ALTER TABLE phpbb_forums ADD attached_forum_id MEDIUMINT(8) DEFAULT '-1' NOT NULL; 

# 
#-----[ OPEN ]------------------------------------------------ 
# 
   admin/admin_forums.php 

# 
#-----[ FIND ]------------------------------------------------ 
# 
   $forumstatus = $row['forum_status']; 
    
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
   // Added by Harishankar's Attached Forums MOD 
   $forum_attached_id = $row['attached_forum_id']; 
   // End add 

# 
#-----[ FIND ]------------------------------------------------ 
# 
    
   'S_PRUNE_ENABLED' => $prune_enabled, 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
   // Added by Harishankar's Attached Forums MOD 
   'S_ATTACHED_FORUM_ID' => $forum_attached_id, 
   // End add 
       
# 
#-----[ FIND ]------------------------------------------------ 
# 
   'L_CATEGORY' => $lang['Category'], 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

   // Added by Harishankar's Attached Forums MOD 
   'L_ATTACHED_FORUM' => $lang['Attached_Field_Title'] , 
   'L_ATTACHED_DESC' => $lang['Attached_Description'], 
   // End add 

# 
#-----[ FIND ]------------------------------------------------ 
# 
			$sql = "INSERT INTO " . FORUMS_TABLE . " (forum_id, forum_name, cat_id, forum_desc, forum_order, forum_status, prune_enable" . $field_sql . ")
				VALUES ('" . $next_id . "', '" . str_replace("\'", "''", $HTTP_POST_VARS['forumname']) . "', " . intval($HTTP_POST_VARS[POST_CAT_URL]) . ", '" . str_replace("\'", "''", $HTTP_POST_VARS['forumdesc']) . "', $next_order, " . intval($HTTP_POST_VARS['forumstatus']) . ", " . intval($HTTP_POST_VARS['prune_enable']) . $value_sql . ")";
# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
   cat_id, 

# 
#-----[ IN-LINE AFTER, ADD ]----------------------------------- 
#       
   attached_forum_id, 
    
# 
#-----[ IN-LINE FIND ]----------------------------------------- 
# 
, " . intval($HTTP_POST_VARS[POST_CAT_URL]) . 

# 
#-----[ IN-LINE AFTER, ADD ]----------------------------------- 
# 
   ", " . intval($HTTP_POST_VARS['attached_forum_id']) . 

# 
#-----[ FIND ]------------------------------------------------ 
# 
   $sql = "UPDATE " . FORUMS_TABLE . " 
      SET forum_name = '" . 

# 
#-----[ IN-LINE FIND ]---------------------------------------- 
# 
   cat_id = " . intval($HTTP_POST_VARS[POST_CAT_URL]) . 
    
# 
#-----[ IN-LINE AFTER, ADD ]---------------------------------- 
# 
   ", attached_forum_id = " . intval($HTTP_POST_VARS['attached_forum_id']) . 

# 
#-----[ OPEN ]------------------------------------------------ 
# 
   templates/subSilver/admin/forum_edit_body.tpl 

#-----[ FIND ]------------------------------------------------ 
    
   <tr> 
     <td class="row1">{L_CATEGORY}</td> 
     <td class="row2"><select name="c">{S_CAT_LIST}</select></td> 
   </tr> 

#-----[ AFTER, ADD ]------------------------------------------ 

   <tr> 
     <td class="row1">{L_ATTACHED_FORUM}</td> 
     <td class="row2"><input type="text" name="attached_forum_id" value="{S_ATTACHED_FORUM_ID}" class="post" /><br />{L_ATTACHED_DESC}</td> 
   </tr> 

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

# 
#-----[ FIND ]------------------------------------------------ 
# 
   $forum_id = $forum_data[$j]['forum_id']; 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
   // Added by Harishankar's Attached Forums MOD 
   $attached_id = $forum_data[$j]['attached_forum_id']; 
   // End add 

# 
#-----[ FIND ]------------------------------------------------ 
# 
    
   if ( $is_auth_ary[$forum_id]['auth_view'] ) 

# 
#-----[ REPLACE WITH ]---------------------------------------- 
# 
    
   if ( $is_auth_ary[$forum_id]['auth_view'] && $attached_id == -1 ) 

# 
#-----[ FIND ]------------------------------------------------ 
# 
    
   if ( $forum_data[$j]['forum_status'] == FORUM_LOCKED ) 
   { 
      $folder_image = $images['forum_locked']; 
      $folder_alt = $lang['Forum_locked']; 
   } 
    
# 
#-----[ BEFORE, ADD ]----------------------------------------- 
# 
   // Added by Harishankar's Attached Forums MOD 
   $sql2 = "SELECT forum_name, forum_id FROM " . FORUMS_TABLE . " 
         WHERE attached_forum_id = " . $forum_id ; 
   $result2 = $db->sql_query ($sql2); 
   $list_of_attached = ''; 
    
   if (! $result2 ) 
   { 
      message_die(GENERAL_ERROR, 'Could not get attached forums.', '', __LINE__, __FILE__, $sql); 
   } 
   $count_attached = $db->sql_numrows ($result2); 
   if ($count_attached == 1) 
      $list_of_attached = $lang['Attached_forum'] . ': '; 
   else if ($count_attached > 1) 
      $list_of_attached = $lang['Attached_forums'] . ': '; 
    
   if ($count_attached != 0) 
   { 
      $row2 = $db->sql_fetchrow ($result2); 
      do 
      { 
         if ($row2) 
         { 
            $url_row2 = '<a href="' . append_sid ('viewforum.php?f=' . $row2['forum_id'] ) . '">' . $row2['forum_name'] . '</a>' ; 
             
            $list_of_attached = $list_of_attached . $url_row2 ; 
         } 
         $row2 = $db->sql_fetchrow ($result2); 
         if ( $row2 ) 
            $list_of_attached = $list_of_attached . ', '; 
      } 
      while ($row2); 
       
      $list_of_attached = $list_of_attached . '<br />' ; 
   } 
    
   $db->sql_freeresult ($result2); 
   // End add 

# 
#-----[ FIND ]------------------------------------------------ 
# 
   'LAST_POST' => $last_post, 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
   // Added by Harishankar's Attached Forums MOD 
   'ATTACHED_FORUMS_LIST' => $list_of_attached, 
   // End add 

# 
#-----[ OPEN ]------------------------------------------------ 
# 
   /templates/subSilver/index_body.tpl 

# 
#-----[ FIND ]------------------------------------------------ 
# 
   <span class="gensmall">{catrow.forumrow.L_MODERATOR} {catrow.forumrow.MODERATORS}</span> 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
   <br /><span class="genmed">{catrow.forumrow.ATTACHED_FORUMS_LIST}</span> 

# 
#-----[ OPEN ]------------------------------------------------ 
# 
   viewforum.php 

# 
#-----[ FIND ]------------------------------------------------ 
# 
   // 
   // Okay, lets dump out the page ... 
   // 

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

   // Added by Harishankar's Attached Forums MOD 
   $sql2 = "SELECT * FROM " . FORUMS_TABLE . 
         " WHERE attached_forum_id = " . $forum_id ; 
          
   $result2 = $db->sql_query ($sql2); 
   if (! $result2 ) 
   { 
      message_die ('Could not gather attached forum info', __LINE__, __FILE__, $sql2); 
   } 
   if ($db->sql_numrows ($result2) != 0) 
   { 
      if ($db->sql_numrows ($result2) == 1) 
         $attached_forum_title = $lang['Attached_forum']; 
      else 
         $attached_forum_title = $lang['Attached_forums']; 
       
      $template->assign_block_vars ('switch_attached_list', 
                           array( 'L_ATTACHED_FORUM' => $attached_forum_title, 
                                 'L_ATTACHED_TOPICS' => $lang['Topics'], 
                                 'L_ATTACHED_POSTS' => $lang['Posts'] 
                               ) 
                            ); 
      while ( $row2 = $db->sql_fetchrow ($result2) ) 
      { 
         $attach_forum_name = '<a href="' . append_sid('viewforum.php?f=' . $row2['forum_id']) . '">' . $row2['forum_name'] . '</a>' ; 
         $attach_forum_desc = '<br />' . $row2['forum_desc']; 
          
         $attach_forum_topics = $row2['forum_topics']; 
         $attach_forum_posts = $row2['forum_posts']; 
          
         $last_post_id = $row2['forum_last_post_id']; 
       
         $template->assign_block_vars ('switch_attached_list.switch_attached_present', 
                                 array 
                                 ( 
                                 'FORUM_NAME' => $attach_forum_name, 
                                 'FORUM_DESC' => $attach_forum_desc, 
                                 'TOPICS' => $attach_forum_topics, 
                                 'POSTS' => $attach_forum_posts 
                                 ) 
                              ); 
      }    
   } 
    
   $db->sql_freeresult ($result2); 
   // End add 

# 
#-----[ OPEN ]------------------------------------------------ 
# 
   /templates/subSilver/viewforum_body.tpl 

# 
#-----[ FIND ]------------------------------------------------ 
# 
   <table border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline"> 

# 
#-----[ BEFORE, ADD ]----------------------------------------- 
# 
    
   <!-- BEGIN switch_attached_list --> 
   <br /> 
   <table width="100%" border="0" cellpadding="4" cellspacing="1" width="100%" class="forumline"> 
     <tr> 
      <th colspan="1" class="thCornerL" height="15" nowrap="nowrap">&nbsp;{switch_attached_list.L_ATTACHED_FORUM}&nbsp;</th> 
      <th width="50" class="thTop" nowrap="nowrap">&nbsp;{switch_attached_list.L_ATTACHED_TOPICS}&nbsp;</th> 
      <th width="50" class="thTop" nowrap="nowrap">&nbsp;{switch_attached_list.L_ATTACHED_POSTS}&nbsp;</th> 
     </tr> 
     <!-- BEGIN switch_attached_present --> 
     <tr> 
      <td class="row1" width="75%"><span class="forumlink">{switch_attached_list.switch_attached_present.FORUM_NAME}</span><span class="genmed">{switch_attached_list.switch_attached_present.FORUM_DESC}</span></td> 
      <td class="row2" align="center" valign="middle"><span class="gensmall">{switch_attached_list.switch_attached_present.TOPICS}</span></td> 
      <td class="row2" align="center" valign="middle"><span class="gensmall">{switch_attached_list.switch_attached_present.POSTS}</span></td> 
       </tr> 
     <!-- END switch_attached_present --> 
   </table> 
   <br /> 
   <!-- END switch_attached_list --> 

# 
#-----[ OPEN ]------------------------------------------------ 
# 
     language/lang_english/lang_admin.php 
    
# 
#-----[ FIND ]------------------------------------------------ 
# 
   // 
   // That's all Folks! 

# 
#-----[ BEFORE, ADD ]----------------------------------------- 
# 
   // Added by Harishankar's Attached Forums MOD 
   $lang['Attached_Field_Title'] = 'Attached to forum'; 
   $lang['Attached_Description'] = "This field has been added by Harishankar's attached forums mod. If you wish this forum to be a pseudo sub-forum or attached to another forum, then enter the id of the forum you wish to attach it to. For regular (normal) forums, leave this value as -1"; 
   // End Add 
    
# 
#-----[ OPEN ]------------------------------------------------ 
# 
    language/lang_english/lang_main.php 
    
# 
#-----[ FIND ]------------------------------------------------ 
# 
   // 
   // That's all, Folks! 

# 
#-----[ BEFORE, ADD ]----------------------------------------- 
# 

   // Added by Harishankar's Attached Forums MOD 

   $lang['Attached_forum'] = 'Attached Forum'; 
   $lang['Attached_forums'] = 'Attached Forums'; 
    
   // End Add 

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

User avatar
felguard
Registered User
Posts: 68
Joined: Tue Oct 18, 2005 7:41 am
Contact:

Post by felguard »

I had an error with this, but I found out the problem. I forgot to enter one of the SQL codes as there's one in the readme file and the other in the installation file.

Other than that, it's a great mod because it requires way less time to install than the other mods if you don't have easy mod.

Prizem
Registered User
Posts: 249
Joined: Sun Sep 07, 2003 9:14 am
Contact:

Post by Prizem »

Ok, so this mod was continued by niekas as the Improved pseudo sub-forums MOD but then abandoned.

acoolwelshbloke began to continue from there with the Easy Sub-Forums MOD, but has pretty much abandoned it too (no posts since January).

Anyone going to take it up? This is a good mod, a good alternative to CH and the XS version, but no one seems interested in developing it. (I'm also surprised this topic is still even open! Author hasn't posted since January 27, 2005 when he gave it up.)

Post Reply

Return to “[2.0.x] MODs in Development”