Seite 2 von 13

Verfasst: 28.08.2003 22:05
von saddel
noch ne frage: funzt der mod? ich hatte einen anderen heruntergeladen und der spinnt einfach nur...

Verfasst: 28.08.2003 22:06
von Henne
Hast kein phpMyAdmin oder ähnliches?
Wie wartest du denn deine Datenbank?
Tipp: http://www.phpbbhacks.com/viewhack.php?id=1581

Verfasst: 29.08.2003 00:00
von saddel
doch hab ich ..aber wenig gemacht damit bisher..ich konnte mich immer vor der datenbank drücken..meiner erster versuch scheiterte kläglich...

mal ne frage zu dem mod: ist das der hierarchiemod 2.04?

mit dem bin ich kläglichst gescheitert...

Verfasst: 17.09.2003 17:20
von nu_marc
Ausgangslage bei mir:
phpBB 2.0.6 / Aeolus Template

Hab jetzt fast alles eingebaut .... DB erweitert ... nun habe ich das Problem, dass ich im ACP zwar bei den Foren-Einstellungen alles "blau" sehe, wenn ich aber ein neues Forum erstellen will (oben) geht das nicht! Es kommt keine Fehlermeldung! Das Forum erscheint dann einfach nicht.

Auch sonst habe ich nach dem Einbau keine Fehler bemerkt ... :cry: [/code]

Verfasst: 17.09.2003 17:32
von nu_marc
Diesen Bereich hier hab ich in meiner /includes/functions_admin.php nicht gefunden:

Code: Alles auswählen

#-----[ OPEN ]------------------------------------------ 
# 

includes/functions_admin.php

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

			$sql = "SELECT MAX(p.post_id) AS last_post, COUNT(p.post_id) AS total 
				FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE  . " t 
				WHERE p.forum_id = $id 
					AND t.topic_id = p.topic_id 
					AND t.topic_status <> " . TOPIC_MOVED;
Bei mir schaut das da so aus:

Code: Alles auswählen


$sql = "SELECT MAX(post_id) AS last_post, COUNT(post_id) AS total 
				FROM " . POSTS_TABLE . "  
				WHERE forum_id = $id";
			if ( !($result = $db->sql_query($sql)) )
			{
				message_die(GENERAL_ERROR, 'Could not get post ID', '', __LINE__, __FILE__, $sql);
			}

			if ( $row = $db->sql_fetchrow($result) )

usw usw usw usw ............
Liegt das evt. an meiner 2.0.6 Version? :roll:

Verfasst: 17.09.2003 17:47
von Mad-Max95
poste mal bitte ein bisschen mehr
von der install datei...
(halt die nächste funktion)

Verfasst: 17.09.2003 17:59
von nu_marc
Hier mal der ganze Bereich :wink:

Code: Alles auswählen

#-----[ OPEN ]------------------------------------------ 
# 

includes/functions_admin.php

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

			$sql = "SELECT MAX(p.post_id) AS last_post, COUNT(p.post_id) AS total 
				FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE  . " t 
				WHERE p.forum_id = $id 
					AND t.topic_id = p.topic_id 
					AND t.topic_status <> " . TOPIC_MOVED;

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

			// DJ-Begin, 15.4.02
			// count not only the posts/topics of the forum itself but of all forums junior to this
			//
			
			$forum_ids = get_list_inferior('forum', $id, 'forum');
			
			if( empty($forum_ids) )
			{
				$forum_ids = $id;
			}
			
			$sql = "SELECT MAX(p.post_id) AS last_post, COUNT(p.post_id) AS total 
				FROM " . POSTS_TABLE . " p, " . TOPICS_TABLE  . " t 
				WHERE p.forum_id IN ($forum_ids)
					AND t.topic_id = p.topic_id 
					AND t.topic_status <> " . TOPIC_MOVED;
			// DJ-End, 15.4.02

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

			$sql = "SELECT COUNT(topic_id) AS total
				FROM " . TOPICS_TABLE . "
				WHERE forum_id = $id 
					AND topic_status <> " . TOPIC_MOVED;

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

			// DJ-Begin, 15.4.02
			$sql = "SELECT COUNT(topic_id) AS total
				FROM " . TOPICS_TABLE . "
				WHERE forum_id IN ($forum_ids)
					AND topic_status <> " . TOPIC_MOVED;
			// DJ-End, 15.4.02

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

Verfasst: 17.09.2003 18:14
von Mad-Max95
sorry...
ich habe den von neodoomer genommen, da kann ich dir nicht helfen..

Verfasst: 17.09.2003 18:45
von nu_marc
Mad-Max95 hat geschrieben:sorry...
ich habe den von neodoomer genommen, da kann ich dir nicht helfen..
Das ist aber der MOD von Neodoomer :wink:

Verfasst: 17.09.2003 18:54
von Mad-Max95
der hier?

Code: Alles auswählen

################################################################# 
## Mod Title: Hierarchies
## Mod Version: 0.9.48
## Author: Martin Kuhlmann < darkjedi@neodoomer.de > - http://www.neodoomer.de
## Updated to 2.0.2, 2.0.3 and 2.0.4 by David Drane (DoubleDoom) > phpbb@doubledoom.clara.co.uk
## (development from 0.9.4 onwards)
die betreffende zeile sieht bei mir nämlich so aus...

Code: Alles auswählen

includes/functions_admin.php

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

	  	case 'forum':
			
# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

			// 
			// count not only the posts/topics of the forum itself but of all forums junior to this
			//
			
			$forum_ids = get_list_inferior('forum', $id, 'forum');
			
			if( empty($forum_ids) )
			{
				$forum_ids = $id;
			}
			
# 
#-----[ FIND ]------------------------------------------ 
# 
  
			$sql = "SELECT MAX(post_id) AS last_post, COUNT(post_id) AS total 
				FROM " . POSTS_TABLE . "  
				WHERE forum_id = $id";

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
# 

				WHERE forum_id = $id";

# 
#-----[ IN-LINE, REPLACE ]------------------------------------------ 
# 

				WHERE forum_id IN($forum_ids)";

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

			$sql = "SELECT COUNT(topic_id) AS total
				FROM " . TOPICS_TABLE . "
				WHERE forum_id = $id";

# 
#-----[ IN-LINE FIND ]------------------------------------------ 
# 

				WHERE forum_id = $id";

# 
#-----[ IN-LINE, REPLACE ]------------------------------------------ 
# 

				WHERE forum_id IN($forum_ids)";

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

?>

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

// $mode means return inferior categories or inferior forums (== 'category' | 'forum')
// $id means to which category|forum the result have to be inferior
// $mode_of_id says $id is either a cat_id or a forum_id
function get_list_inferior($mode, $id, $mode_of_id = 'category')
{
	global $db;

	if( empty($id) || $id == 0 )
	{
		return;
	}

	switch($mode_of_id)
	{
		case 'forum': // $id is a forum_id

			switch($mode)
			{
				case 'category':
					$sql = "SELECT c.cat_id
						FROM " . CATEGORIES_TABLE . " c
						WHERE c.parent_forum_id = $id
						ORDER BY c.cat_id";
					if( !($result = $db->sql_query($sql)) )
					{
						message_die(GENERAL_ERROR, 'Could not query inferior categories', '', __LINE__, __FILE__, $sql);
					}
					while( $row = $db->sql_fetchrow($result) )
					{
						if( empty($cats_inferior) )
						{
							$cats_inferior .= $row['cat_id'];
						}
						else
						{
							$cats_inferior .= ", " . $row['cat_id'];
						}

						$return = get_list_inferior($mode, $row['cat_id'], 'category');
						if( !empty($return) )
						{
							$cats_inferior .= ", $return";
						}
					}
						
					return($cats_inferior);
					break;

				case 'forum':
					$sql = "SELECT c.cat_id
						FROM " . CATEGORIES_TABLE . " c
						WHERE c.parent_forum_id = $id
						ORDER BY c.cat_id";
					if( !($result = $db->sql_query($sql)) )
					{
						message_die(GENERAL_ERROR, 'Could not query inferior categories', '', __LINE__, __FILE__, $sql);
					}
					while( $row = $db->sql_fetchrow($result) )
					{
						$return = get_list_inferior($mode, $row['cat_id'], 'category');
						if( !empty($return) )
						{
							if( empty($forums_inferior) )
							{
								$forums_inferior = $return;
							}
							else
							{
								$forums_inferior .= ", $return";
							}
						}
					}
						
					return($forums_inferior);
					break;
				
				default:
					message_die(GENERAL_ERROR, "Wrong mode for generating list of inferior", "", __LINE__, __FILE__);
					break;
			}
	
		case 'category': // $id is a cat_id
		
			switch($mode) 
			{
				case 'category':
					// print "<br>get_list_inferior, $mode, got id: $id<br>";
					$cats_inferior = "";
					$sql = "SELECT c.cat_id
						FROM " . CATEGORIES_TABLE . " c, " . CAT_REL_CAT_PARENTS_TABLE . " ccp
						WHERE ccp.cat_id = c.cat_id
						AND ccp.parent_cat_id = $id
						ORDER BY c.cat_hier_level";
		
					if( !($result = $db->sql_query($sql)) )
					{
						message_die(GENERAL_ERROR, 'Could not query inferior categories', '', __LINE__, __FILE__, $sql);
					}
					while( $row = $db->sql_fetchrow($result) )
					{
						if( empty($cats_inferior) )
						{
							$cats_inferior .= $row['cat_id'];
						}
						else
						{
							$cats_inferior .= ", " . $row['cat_id'];
						}
					}
					// print "<br>get_list_inferior, $mode, SQL: $sql<br><br>get_list_inferior, $mode, Result: $cats_inferior<br><br>";
					return $cats_inferior;
					break;
				
				case 'forum':
					// print "<br>get_list_inferior, $mode, got id: $id<br>";
					$forums_inferior = "";
		
					// get inferior forum_ids of inferior cat_id of cat_id
					$sql = "SELECT f.forum_id
						FROM " . CAT_REL_CAT_PARENTS_TABLE . " ccp, " . FORUMS_TABLE . " f
						WHERE ccp.parent_cat_id = $id
						AND f.cat_id = ccp.cat_id
						ORDER BY f.forum_hier_level";
		
					if( !($result = $db->sql_query($sql)) )
					{
						message_die(GENERAL_ERROR, 'Could not query inferior forums', '', __LINE__, __FILE__, $sql);
					}
					while( $row = $db->sql_fetchrow($result) )
					{
						if( empty($forums_inferior) )
						{
							$forums_inferior .= $row['forum_id'];
						}
						else
						{
							$forums_inferior .= ", " . $row['forum_id'];
						}
					}
		
					// get directly inferior forum_ids of cat_id
					$sql = "SELECT forum_id
						FROM " . FORUMS_TABLE . "
						WHERE cat_id = $id";
		
					if( !($result = $db->sql_query($sql)) )
					{
						message_die(GENERAL_ERROR, 'Could not query inferior forums', '', __LINE__, __FILE__, $sql);
					}
					while( $row = $db->sql_fetchrow($result) )
					{
						if( empty($forums_inferior) )
						{
							$forums_inferior .= $row['forum_id'];
						}
						else
						{
							$forums_inferior .= ", " . $row['forum_id'];
						}
					}
		
					// print "<br>get_list_inferior, $mode, SQL: $sql<br><br>get_list_inferior, $mode, Result: $forums_inferior<br><br>";
					return $forums_inferior;
					
					break;
		
				default:
					message_die(GENERAL_ERROR, "Wrong mode for generating list of inferior", "", __LINE__, __FILE__);
					break;
			}
		break;
		
	default:
		message_die(GENERAL_ERROR, "Wrong mode for generating list of inferior", "", __LINE__, __FILE__);
		break;
	}
}