Pagina 1 van 1

Tijd en naam poster achter forum klopt niet

Geplaatst: 03 sep 2006, 12:42
door LDawg
Support Template
  • Wat is het probleem? De tijden en de laatste poster achter de forums zijn ermee gestopt
    Wanneer ontstond het probleem? 31 augustus dacht ik
    Adres van je forum: http://www.pokesea.siteburg.com/forum
    Modifications op je forum: Yellow Card, Quick Reply en nog een aantal
    Huidige stijl: Anubis
    phpBB versie: 2.0.21
    Waar is je forum gehost: siteburg
    Heb je onlangs iets verandert aan je forum? stijl, mods geinstalleerd
Overige opmerkingen:
Het is vrij lastig, omdat je niet makkelijk kan zien waar er het laatst gepost is.

Help please :(

Geplaatst: 03 sep 2006, 12:45
door Astro
er staat toch elke post een data en een tijd achter ? alleen je hebt je gmt te laag staan moet je +1 doen je forum loopt een uur achter

Geplaatst: 03 sep 2006, 12:46
door Raimon
Wat is de laatse MOD die je op u forum heeft geinstalleerd?

Geplaatst: 03 sep 2006, 12:47
door LDawg
Ja maar erna zijn er allang weer posts gemaakt vandaag enzo. Maar er blijft staan 30 aug en 31 aug...

De tijd staat op GMT +1

Geplaatst: 03 sep 2006, 12:48
door Astro
o nee nu snap ik hem

solly

Geplaatst: 04 sep 2006, 11:27
door LDawg
Raimon schreef:Wat is de laatse MOD die je op u forum heeft geinstalleerd?
De laatste was dat de topic titel boven de tijd en de poster achter het forum komt te staan. Maar daar ligt het niet aan, want als ik die naar de standaard index.php overzet maakt het geen verschil.

Daarvoor was de yellow card mod de laatste, en zeg maar jij, ik ben nog maar 16 :P

Geplaatst: 04 sep 2006, 14:27
door Luuk
Staat dit nog in includes/functions_post.php ?

Code: Selecteer alles

		$sql = "UPDATE " . FORUMS_TABLE . " SET 
			$forum_update_sql 
			WHERE forum_id = $forum_id";
		if (!$db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
		}
Om het nu recht te krijgen moet je in het admin paneel bij forum management voor elk forum op sync klikken (rechts), dan zou hij als het goed is alles opnieuw moeten berekenen.

Geplaatst: 04 sep 2006, 16:05
door LDawg
Ja! Bedankt, hij doet het nu helemaal goed! Echt bedankt!
:bier:

EDIT:
Hij doet het niet helemaal ><
Moet ik dat stukje script wat jij gaf ergens plaatsen of verwijderen ofzo?

Geplaatst: 04 sep 2006, 18:49
door Luuk
Post hier eens het stuk uit includes/functions_post.php van

Code: Selecteer alles

//
// Update post stats and details
//
tot

Code: Selecteer alles

//
// Delete a post/poll
//
Dat is de gehele functie update_post_stats(...).

Geplaatst: 04 sep 2006, 19:48
door LDawg
Hier is het:

Code: Selecteer alles

//
// Update post stats and details
//
function update_post_stats(&$mode, &$post_data, &$forum_id, &$topic_id, &$post_id, &$user_id)
{
	global $db;

	$sign = ($mode == 'delete') ? '- 1' : '+ 1';
	$forum_update_sql = "forum_posts = forum_posts $sign";
	$topic_update_sql = '';

	if ($mode == 'delete')
	{
		if ($post_data['last_post'])
		{
			if ($post_data['first_post'])
			{
				$forum_update_sql .= ', forum_topics = forum_topics - 1';
			}
			else
			{

				$topic_update_sql .= 'topic_replies = topic_replies - 1';

				$sql = "SELECT MAX(post_id) AS last_post_id
					FROM " . POSTS_TABLE . " 
					WHERE topic_id = $topic_id";
				if (!($result = $db->sql_query($sql)))
				{
					message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
				}

				if ($row = $db->sql_fetchrow($result))
				{
					$topic_update_sql .= ', topic_last_post_id = ' . $row['last_post_id'];
				}
			}

			if ($post_data['last_topic'])
			{
				$sql = "SELECT MAX(post_id) AS last_post_id
					FROM " . POSTS_TABLE . " 
					WHERE forum_id = $forum_id"; 
				if (!($result = $db->sql_query($sql)))
				{
					message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
				}

				if ($row = $db->sql_fetchrow($result))
				{
					$forum_update_sql .= ($row['last_post_id']) ? ', forum_last_post_id = ' . $row['last_post_id'] : ', forum_last_post_id = 0';
				}
			}
		}
		else if ($post_data['first_post']) 
		{
			$sql = "SELECT MIN(post_id) AS first_post_id
				FROM " . POSTS_TABLE . " 
				WHERE topic_id = $topic_id";
			if (!($result = $db->sql_query($sql)))
			{
				message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
			}

			if ($row = $db->sql_fetchrow($result))
			{
				$topic_update_sql .= 'topic_replies = topic_replies - 1, topic_first_post_id = ' . $row['first_post_id'];
			}
		}
		else
		{
			$topic_update_sql .= 'topic_replies = topic_replies - 1';
		}
	}
	else if ($mode != 'poll_delete')
	{
		$forum_update_sql .= ", forum_last_post_id = $post_id" . (($mode == 'newtopic') ? ", forum_topics = forum_topics $sign" : ""); 
		$topic_update_sql = "topic_last_post_id = $post_id" . (($mode == 'reply') ? ", topic_replies = topic_replies $sign" : ", topic_first_post_id = $post_id");
	}
	else 
	{
		$topic_update_sql .= 'topic_vote = 0';
	}

		if ($mode != 'poll_delete')
	{
		$sql = "SELECT forum_count_posts FROM ". FORUMS_TABLE . " WHERE forum_id = " . $forum_id;
		$result = $db->sql_query($sql);
		if( $row = $db->sql_fetchrow($result) ) 
		{ 
			if( $row['forum_count_posts'] == 1 )
			{

				$sql = "UPDATE " . USERS_TABLE . "
					SET user_posts = user_posts $sign 
					WHERE user_id = $user_id";
				if (!$db->sql_query($sql, END_TRANSACTION))
				{
					message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
				}
			}
		}
	}

	if ($topic_update_sql != '')
	{
		$sql = "UPDATE " . TOPICS_TABLE . " SET 
			$topic_update_sql 
			WHERE topic_id = $topic_id";
		if (!$db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
		}
	}


	return;
}

//
// Delete a post/poll
//

Geplaatst: 04 sep 2006, 19:56
door Luuk
Daar zit inderdaad de fout, je hebt wat verkeerds gewijzigd bij ik denk een mod die ervoor zorgt dat bepaalde forums niet meetellen bij de user postcount.

Vervang dat stuk eens met

Code: Selecteer alles

//
// Update post stats and details
//
function update_post_stats(&$mode, &$post_data, &$forum_id, &$topic_id, &$post_id, &$user_id)
{
	global $db;

	$sign = ($mode == 'delete') ? '- 1' : '+ 1';
	$forum_update_sql = "forum_posts = forum_posts $sign";
	$topic_update_sql = '';

	if ($mode == 'delete')
	{
		if ($post_data['last_post'])
		{
			if ($post_data['first_post'])
			{
				$forum_update_sql .= ', forum_topics = forum_topics - 1';
			}
			else
			{

				$topic_update_sql .= 'topic_replies = topic_replies - 1';

				$sql = "SELECT MAX(post_id) AS last_post_id
					FROM " . POSTS_TABLE . " 
					WHERE topic_id = $topic_id";
				if (!($result = $db->sql_query($sql)))
				{
					message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
				}

				if ($row = $db->sql_fetchrow($result))
				{
					$topic_update_sql .= ', topic_last_post_id = ' . $row['last_post_id'];
				}
			}

			if ($post_data['last_topic'])
			{
				$sql = "SELECT MAX(post_id) AS last_post_id
					FROM " . POSTS_TABLE . " 
					WHERE forum_id = $forum_id"; 
				if (!($result = $db->sql_query($sql)))
				{
					message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
				}

				if ($row = $db->sql_fetchrow($result))
				{
					$forum_update_sql .= ($row['last_post_id']) ? ', forum_last_post_id = ' . $row['last_post_id'] : ', forum_last_post_id = 0';
				}
			}
		}
		else if ($post_data['first_post']) 
		{
			$sql = "SELECT MIN(post_id) AS first_post_id
				FROM " . POSTS_TABLE . " 
				WHERE topic_id = $topic_id";
			if (!($result = $db->sql_query($sql)))
			{
				message_die(GENERAL_ERROR, 'Error in deleting post', '', __LINE__, __FILE__, $sql);
			}

			if ($row = $db->sql_fetchrow($result))
			{
				$topic_update_sql .= 'topic_replies = topic_replies - 1, topic_first_post_id = ' . $row['first_post_id'];
			}
		}
		else
		{
			$topic_update_sql .= 'topic_replies = topic_replies - 1';
		}
	}
	else if ($mode != 'poll_delete')
	{
		$forum_update_sql .= ", forum_last_post_id = $post_id" . (($mode == 'newtopic') ? ", forum_topics = forum_topics $sign" : ""); 
		$topic_update_sql = "topic_last_post_id = $post_id" . (($mode == 'reply') ? ", topic_replies = topic_replies $sign" : ", topic_first_post_id = $post_id");
	}
	else 
	{
		$topic_update_sql .= 'topic_vote = 0';
	}

	if ($mode != 'poll_delete')
	{
		$sql = "UPDATE " . FORUMS_TABLE . " SET 
			$forum_update_sql 
			WHERE forum_id = $forum_id";
		if (!$db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
		}
	}

	if ($topic_update_sql != '')
	{
		$sql = "UPDATE " . TOPICS_TABLE . " SET 
			$topic_update_sql 
			WHERE topic_id = $topic_id";
		if (!$db->sql_query($sql))
		{
			message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
		}
	}

	if ($mode != 'poll_delete')
	{
		$sql = "SELECT forum_count_posts FROM ". FORUMS_TABLE . " WHERE forum_id = " . $forum_id;
 		$result = $db->sql_query($sql);
		if( $row = $db->sql_fetchrow($result) )
		{
			if( $row['forum_count_posts'] == 1 )
			{

				$sql = "UPDATE " . USERS_TABLE . "
					SET user_posts = user_posts $sign
					WHERE user_id = $user_id";
				if (!$db->sql_query($sql, END_TRANSACTION))
				{
					message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql);
				}
			}
		}
	}

	return;
}

//
// Delete a post/poll
//

Geplaatst: 04 sep 2006, 20:06
door LDawg
Ik heb het erin geplaatst, maar het heeft geen verschil gemaakt... :?