[REQ] I want MOD don't post count

This forum is now closed as part of retiring phpBB2
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

This forum is now closed due to phpBB2.0 being retired.
Post Reply
i-evil
Registered User
Posts: 8
Joined: Fri Sep 29, 2006 6:04 am

[REQ] I want MOD don't post count

Post by i-evil »

don't post count

eg. define 100 char.

if unless 100 don't post count
the user's post count should only be increased if the post has 100 character



sorry , .. weak English
Last edited by i-evil on Tue Oct 03, 2006 5:09 pm, edited 2 times in total.
mama_soap
Registered User
Posts: 71
Joined: Thu Jun 02, 2005 9:35 pm

Post by mama_soap »

Do you mean that you want a mod that will not increment the post count of an user unless his post is longer than x characters, where you can set x=100 or some value?
i-evil
Registered User
Posts: 8
Joined: Fri Sep 29, 2006 6:04 am

Post by i-evil »

mama_soap wrote: Do you mean that you want a mod that will not increment the post count of an user unless his post is longer than x characters, where you can set x=100 or some value?


errm....

can post all char.

but

don't post count
if post unless x


eg. define 100 char.

my post is 50 char.
do not post count

if my post more than 100
post count point = 1


u understand me
sorry .. weak English
kylemj
Registered User
Posts: 17
Joined: Tue Apr 25, 2006 12:17 pm

Post by kylemj »

Posts: 4


i think he means like this

(next to post by profile/user)

mine currently 16
i-evil
Registered User
Posts: 8
Joined: Fri Sep 29, 2006 6:04 am

Post by i-evil »

yaa
User avatar
Ramon Fincken
Registered User
Posts: 4835
Joined: Thu Oct 14, 2004 1:04 am
Location: NL, The Netherlands Amsterdam area @GMT +1
Contact:

Post by Ramon Fincken »

like this?

if user has les then 100 posts, show 'Hidden' postcount in viewtopic:

OPEN

Code: Select all

viewtopic.php
FIND

Code: Select all

	$template->assign_block_vars('postrow', array(
		'ROW_COLOR' => '#' . $row_color,
		'ROW_CLASS' => $row_class,
BEFORE, ADD

Code: Select all

if(intval($poster_posts) < 100) $poster_posts = 'Hidden';
Dutch quality fully managed WordPress hosting - ManagedWPHosting.nl

Before changing a file, some code or installing a MOD >> Make a backup first!

Do you like my mods? paypal me $1 :) forumsoftware[AT}creativepulses[DOT}nl [/size]
PhpBBantispam.com || Instant find your mod here
User avatar
blazes
Registered User
Posts: 579
Joined: Mon Feb 20, 2006 7:20 am

Post by blazes »

I think he's sayin' that he doesn't want the user's post count to go up if the post is less than 100 characters. IE, i'd get no post count for this since if less than 100 characters.
i-evil
Registered User
Posts: 8
Joined: Fri Sep 29, 2006 6:04 am

Post by i-evil »

blazes wrote: I think he's sayin' that he doesn't want the user's post count to go up if the post is less than 100 characters. IE, i'd get no post count for this since if less than 100 characters.


ya

in function_post.php

Code: Select all

$sign = ($mode == 'delete') ? '- 1' : '+ 1' ;
how i do it ?
don't post count
User avatar
Ramon Fincken
Registered User
Posts: 4835
Joined: Thu Oct 14, 2004 1:04 am
Location: NL, The Netherlands Amsterdam area @GMT +1
Contact:

Post by Ramon Fincken »

This code is NOT tested, make a backup first!

Code: Select all

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

	$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';
	}

	$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' && strlen($HTTP_POST_VARS['message']) > 100)
	{
		$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;
}
Dutch quality fully managed WordPress hosting - ManagedWPHosting.nl

Before changing a file, some code or installing a MOD >> Make a backup first!

Do you like my mods? paypal me $1 :) forumsoftware[AT}creativepulses[DOT}nl [/size]
PhpBBantispam.com || Instant find your mod here
i-evil
Registered User
Posts: 8
Joined: Fri Sep 29, 2006 6:04 am

Post by i-evil »

Ramon Fincken wrote: This code is NOT tested, make a backup first!


tQ sir..

but and all don't count

:wink:
User avatar
Ramon Fincken
Registered User
Posts: 4835
Joined: Thu Oct 14, 2004 1:04 am
Location: NL, The Netherlands Amsterdam area @GMT +1
Contact:

Post by Ramon Fincken »

Code: Select all

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

   $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';
   }

   $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 == 'delete')){
      $update_user_posts_ok = false;
      if(strlen($HTTP_POST_VARS['message']) > 50)
      {
         $update_user_posts_ok = true;
      }
   }
   if ($mode != 'poll_delete' && update_user_posts_ok)
   {
      $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;
}
Dutch quality fully managed WordPress hosting - ManagedWPHosting.nl

Before changing a file, some code or installing a MOD >> Make a backup first!

Do you like my mods? paypal me $1 :) forumsoftware[AT}creativepulses[DOT}nl [/size]
PhpBBantispam.com || Instant find your mod here
Post Reply

Return to “[2.0.x] MOD Requests”