[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.
afterlife_69
I've Been Banned!
Posts: 630
Joined: Tue Nov 30, 2004 10:35 am

Post by afterlife_69 » Mon Feb 14, 2005 7:46 am

DJ04SlimShadyNo1 wrote: i keep getting this error on index.php

Parse error: parse error, unexpected T_ELSE in /home/*****/public_html/index.php on line 543

here's lines 540-545

Code: Select all

	} // for ... categories

}// if ... total_categories
else
{
	message_die(GENERAL_MESSAGE, $lang['No_forums']);


i also have this problem, it lies in this code:

Code: Select all

if ( $is_auth_ary[$forum_id]['auth_view'] ) 

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

if ( $is_auth_ary[$forum_id]['auth_view'] && $attached_id == -1 ) 
                  { 
              
                     $sql = "SELECT forum_name, forum_id FROM " . FORUMS_TABLE . " 
                        WHERE attached_forum_id = " . $forum_id ; 
                     $result = $db->sql_query($sql); 
                     $list_of_attached = ''; 

                     if (!$result) 
                     { 
                        message_die(GENERAL_ERROR, 'Could not get attached forums.', '', __LINE__, __FILE__, $sql); 
                     } 
                     $count_attached = $db->sql_numrows ($result); 
                     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) 
                     { 
                        $row = $db->sql_fetchrow ($result); 
                        do 
                        { 
                           if ($row) 
                           { 
                              $url_row2 = '<a href="' . append_sid ('viewforum.php?f=' . $row['forum_id'] ) . '">' . $row['forum_name'] . '</a>' ; 
                              $list_of_attached = $list_of_attached . $url_row2 ; 
                           } 
                           $row = $db->sql_fetchrow ($result); 
                           if ( $row ) 
                           { 
                              $list_of_attached = $list_of_attached . ', '; 
                           } 
                        } 
                        while ($row); 

                        $list_of_attached = $list_of_attached . '<br />' ; 
                     } 
                     $db->sql_freeresult ($result); 
could somebody please fix this asap

kratzer54847
Registered User
Posts: 143
Joined: Wed Oct 15, 2003 9:46 pm
Location: Wannsee
Contact:

Post by kratzer54847 » Mon Feb 14, 2005 12:24 pm

Code: Select all

# 
#-----[ FIND ]------------------------------------------ 
# 

if ( $is_auth_ary[$forum_id]['auth_view'] ) 
{

# 
#-----[ REPLACE WITH ]------------------------------------------ 
# 

if ( $is_auth_ary[$forum_id]['auth_view'] && $attached_id == -1 ) 
                  { 
              
                     $sql = "SELECT forum_name, forum_id FROM " . FORUMS_TABLE . " 
                        WHERE attached_forum_id = " . $forum_id ; 
                     $result = $db->sql_query($sql); 
                     $list_of_attached = ''; 

                     if (!$result) 
                     { 
                        message_die(GENERAL_ERROR, 'Could not get attached forums.', '', __LINE__, __FILE__, $sql); 
                     } 
                     $count_attached = $db->sql_numrows ($result); 
                     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) 
                     { 
                        $row = $db->sql_fetchrow ($result); 
                        do 
                        { 
                           if ($row) 
                           { 
                              $url_row2 = '<a href="' . append_sid ('viewforum.php?f=' . $row['forum_id'] ) . '">' . $row['forum_name'] . '</a>' ; 
                              $list_of_attached = $list_of_attached . $url_row2 ; 
                           } 
                           $row = $db->sql_fetchrow ($result); 
                           if ( $row ) 
                           { 
                              $list_of_attached = $list_of_attached . ', '; 
                           } 
                        } 
                        while ($row); 

                        $list_of_attached = $list_of_attached . '<br />' ; 
                     } 
                     $db->sql_freeresult ($result); 
try that!

mfg Johny
I do phpBB work for money.
Just contact!

afterlife_69
I've Been Banned!
Posts: 630
Joined: Tue Nov 30, 2004 10:35 am

Post by afterlife_69 » Mon Feb 14, 2005 1:32 pm

that was interesting it hid every one of my forums

DJ04SlimShadyNo1
Registered User
Posts: 34
Joined: Thu Oct 21, 2004 9:23 pm
Location: Glasgow Scotland United Kingdom
Contact:

Post by DJ04SlimShadyNo1 » Mon Feb 14, 2005 5:38 pm

afterlife_69 wrote: that was interesting it hid every one of my forums


happened to me aswell

User avatar
god49
Registered User
Posts: 186
Joined: Fri Nov 08, 2002 2:57 pm

Post by god49 » Tue Feb 15, 2005 10:22 am

Shof515 wrote: WONDERFUL....but one small thing missing:
New Posts/non new posts icons


won't happen as long as you are using merely an attached forum list. it only shows up when the last attached forum is used or all the attached forums have a new post in them

deny
Registered User
Posts: 565
Joined: Wed May 14, 2003 9:14 am
Location: Find-Ip-Address.org
Contact:

Post by deny » Thu Feb 24, 2005 11:21 am

I've uninstall this mods because it is heavy for any board.Depend on number of forums that you have on index page this mod added from 10 -30 extra query on index page even if you not use installed attach subforum ability at all.
It is heavy and if you care about speed of your board then is better to be off of this mod.Actually i did not see any mod that added so much executiobn query to your board as this one.

btw

After unstalling this mod on my board i got a less 25 execution query on index page and i just install mod to play with it.I did not attach any subforum.

DivErTido
Registered User
Posts: 642
Joined: Fri Aug 08, 2003 10:11 pm
Contact:

Post by DivErTido » Thu Feb 24, 2005 11:33 am

Where can I find a link demo? :wink:

Scali
Registered User
Posts: 51
Joined: Wed Dec 01, 2004 8:54 pm
Location: http://www.monloup.net
Contact:

Post by Scali » Sun Feb 27, 2005 9:39 pm

Hi,

Where can i find a demo for this mod ?

Thanks

User avatar
End of a Shadow
Registered User
Posts: 1557
Joined: Sun Apr 27, 2003 6:39 pm
Location: Washington
Name: J G
Contact:

Post by End of a Shadow » Mon Feb 28, 2005 12:35 am

Click the banner in my signature then goto forums in the header

bcs10
Registered User
Posts: 1525
Joined: Mon Jul 14, 2003 4:45 am
Location: Chicago, IL

Post by bcs10 » Mon Feb 28, 2005 3:47 am

i like this mod... but i have an idea for you...

you should make it so that if i attach a forum to another forum it not only attaches it on the index page... but also in the ACP
/DD

User avatar
B€RN@RD
Registered User
Posts: 89
Joined: Mon Dec 30, 2002 10:25 am
Location: maisons laffitte / france

Post by B€RN@RD » Tue Mar 01, 2005 6:52 am

hello,

any release of this mod on the way ?

Scali
Registered User
Posts: 51
Joined: Wed Dec 01, 2004 8:54 pm
Location: http://www.monloup.net
Contact:

Post by Scali » Tue Mar 01, 2005 4:41 pm

End of a Shadow wrote: Click the banner in my signature then goto forums in the header


Sorry but i don't see the sub-forums on your website.

bebe2803
Registered User
Posts: 49
Joined: Tue Jan 25, 2005 7:16 am
Location: Hong Kong

Post by bebe2803 » Wed Mar 02, 2005 8:22 am

kratzer54847 wrote: hi there,

I've updated part 7 of the Power Pack(Forum Moderators)

Fixes:

:arrow: Uses one single array now instead of two
:arrow: , between names
:arrow: better handling of lang-entries


Code: Select all

############################################################## 
## MOD Title: Attached forums Moderators ADDON v2
## MOD Author: kratzer54847 < alternativ3322@web.de > (Johny Jesewski) http://www.plauderclub.de 
## MOD Description: This mod displays all the attached forum moderators like in index.php 
## 
## MOD Version: 2.0.0  
## 
## Installation Level: Easy 
## Installation Time: 3 Minutes 
## Files To Edit:  viewforum.php, viewforum_body.tpl 
## 
## 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: 
## 
## Please report bugs here: http://www.phpbb.com/phpBB/viewtopic.php?t=245756 
## 
############################################################## 
## MOD History: 
## 
##   2004-12-11 - Version 1.0.0 
##      - Alpha release 
## 
############################################################## 
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD 
############################################################## 

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

# 
#-----[ FIND ]------------------------------------------------ 
#
 
$attach_forum_posts = $row2['forum_posts'];
    
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 
		//
		// Forum Moderators
		//

		$sqlm = "SELECT u.user_id, u.username 
			  FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u
			  WHERE aa.forum_id = $attach_forum_id 
				AND aa.auth_mod = " . TRUE . " 
				AND g.group_single_user = 1
				AND ug.group_id = aa.group_id 
				AND g.group_id = aa.group_id 
				AND u.user_id = ug.user_id 
			  GROUP BY u.user_id, u.username  
			  ORDER BY u.user_id";
		if ( !($resultm = $db->sql_query($sqlm)) )
		{
			message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sqlm);
		}

		$moderators = array();
		while( $rowm = $db->sql_fetchrow($resultm) )
		{
			$moderators[] = '<a href="' . append_sid("profile.$phpEx?mode=viewprofile&" . POST_USERS_URL . "=" . $rowm['user_id']) . '">' . $rowm['username'] . '</a>';
		}

		$sqlg = "SELECT g.group_id, g.group_name 
			FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g 
			WHERE aa.forum_id = $attach_forum_id
				AND aa.auth_mod = " . TRUE . " 
				AND g.group_single_user = 0
				AND g.group_type <> ". GROUP_HIDDEN ."
				AND ug.group_id = aa.group_id 
				AND g.group_id = aa.group_id 
			GROUP BY g.group_id, g.group_name  
			ORDER BY g.group_id";
		if ( !($resultg = $db->sql_query($sqlg)) )
		{
			message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sqlg);
		}

		while( $rowg = $db->sql_fetchrow($resultg) )
		{
			$moderators[] = '<a href="' . append_sid("groupcp.$phpEx?" . POST_GROUPS_URL . "=" . $rowg['group_id']) . '">' . $rowg['group_name'] . '</a>';
		}
		
		$l_moderators = ( count($moderators) == 1 ) ? $lang['Moderator'] : $lang['Moderators'];
		$forum_moderators = ( count($moderators) ) ? implode(', ', $moderators) : $lang['None'];
		unset($moderators);
# 
#-----[ FIND ]------------------------------------------------ 
#
 
'POSTS' => $attach_forum_posts

# 
#-----[ REPLACE WITH ]------------------------------------------------ 
#

			'POSTS' => $attach_forum_posts,
			'L_MODERATORS' => $l_moderators,
			'MODERATORS' => $forum_moderators

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

# 
#-----[ FIND ]------------------------------------------------ 
# 
{switch_attached_list.switch_attached_present.FORUM_DESC}

# 
#-----[ AFTER, ADD ]----------------------------------------- 
# 
    
<br>{switch_attached_list.switch_attached_present.L_MODERATORS}: {switch_attached_list.switch_attached_present.MODERATORS}

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



AHHH I have a problem with this mod

i got this error when viewing a forum that have sub forum (other normal foum are ok)

Code: Select all

Could not query forum moderator information

DEBUG MODE

SQL Error : 1064 You have an error in your SQL syntax near 'AND aa.auth_mod = 1 AND g.group_single_user = 1 AND ug' at line 4

SELECT u.user_id, u.username FROM phpbb_auth_access aa, phpbb_user_group ug, phpbb_groups g, phpbb_users u WHERE aa.forum_id = AND aa.auth_mod = 1 AND g.group_single_user = 1 AND ug.group_id = aa.group_id AND g.group_id = aa.group_id AND u.user_id = ug.user_id GROUP BY u.user_id, u.username ORDER BY u.user_id

Line : 493
File : viewforum.php

The error come from here :

Code: Select all

		//
		// Forum Moderators
		//

		$sqlm = "SELECT u.user_id, u.username 
			FROM " . AUTH_ACCESS_TABLE . " aa, " . USER_GROUP_TABLE . " ug, " . GROUPS_TABLE . " g, " . USERS_TABLE . " u
			  WHERE aa.forum_id = $attach_forum_id 
				AND aa.auth_mod = " . TRUE . " 
				AND g.group_single_user = 1
				AND ug.group_id = aa.group_id 
				AND g.group_id = aa.group_id 
				AND u.user_id = ug.user_id 
			  GROUP BY u.user_id, u.username  
			  ORDER BY u.user_id";
		if ( !($resultm = $db->sql_query($sqlm)) )
		{
			message_die(GENERAL_ERROR, 'Could not query forum moderator information', '', __LINE__, __FILE__, $sqlm);
		}
怨念公社 (trad. chinese big5 forum)

Scali
Registered User
Posts: 51
Joined: Wed Dec 01, 2004 8:54 pm
Location: http://www.monloup.net
Contact:

Post by Scali » Sun Mar 06, 2005 6:32 pm

Scali wrote:
End of a Shadow wrote:Click the banner in my signature then goto forums in the header


Sorry but i don't see the sub-forums on your website.


Can you tell me where can i find a board who uses this mod ? Thanks.

kritikas
Registered User
Posts: 10
Joined: Sun Nov 30, 2003 8:31 pm
Location: Vilnius

Post by kritikas » Sun Mar 06, 2005 7:06 pm

Scali wrote:
Scali wrote:
End of a Shadow wrote:Click the banner in my signature then goto forums in the header


Sorry but i don't see the sub-forums on your website.


Can you tell me where can i find a board who uses this mod ? Thanks.


Where are demo?

Post Reply

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