News:

Wondering if this will always be free?  See why free is better.

Main Menu

[urgent] question about karma feature

Started by SMUserGT, September 21, 2004, 04:30:52 AM

Previous topic - Next topic

SMUserGT

hi

a question about karma, i have my forum setup so people who make less than 30 posts are a newbe but i was wondering people who post more then 31 posts on my forum can i automatically reward them with lets say 10 karma?

regards

[Unknown]


SMUserGT


Parham

Quote from: SMUserGT on September 21, 2004, 04:30:52 AM
hi

a question about karma, i have my forum setup so people who make less than 30 posts are a newbe but i was wondering people who post more then 31 posts on my forum can i automatically reward them with lets say 10 karma?

regards

yes it's possible, but then you'd need a whole new table to track members with 30 or more posts who have already been given the 10 karma points.  It's just a hassle that's all and probably not a worthwhile feature request since you'd start seeing at on of spam on your board which i don't think you particularly want.  let them earn their karma points, don't hand it out as incentive for people to post more (more nonsense that is).

Grudge

This is a fair idea of how you could do it.
In Post2, in Post.php after sorting out all the post inserts do something simple like

if ($user_info['posts'] == 30)
db_query("
UPDATE {$db_prefix}members
SET karamGood = karmaGood + 10
WHERE ID_MEMBER = $user_info[id]", __FILE__, __LINE__);


Obviously that's not all you need but it's a good start!
I'm only a half geek really...

Oldiesmann

Try this...

In Sources/Post.php

Find
if (!$user_info['is_guest'] && !isset($_REQUEST['msg']))
{
// Check if posts count on this board, and if so increase the post count.
$request = db_query("
SELECT countPosts
FROM {$db_prefix}boards
WHERE ID_BOARD = $board
LIMIT 1", __FILE__, __LINE__);
list ($pcounter) = mysql_fetch_row($request);
mysql_free_result($request);

if (empty($pcounter))
{
++$user_info['posts'];
updateMemberData($ID_MEMBER, array('posts' => 'posts + 1'));
}
}


Replace
if (!$user_info['is_guest'] && !isset($_REQUEST['msg']))
{
// Check if posts count on this board, and if so increase the post count.
$request = db_query("
SELECT countPosts
FROM {$db_prefix}boards
WHERE ID_BOARD = $board
LIMIT 1", __FILE__, __LINE__);
list ($pcounter) = mysql_fetch_row($request);
mysql_free_result($request);

if (empty($pcounter))
{
++$user_info['posts'];
updateMemberData($ID_MEMBER, array('posts' => 'posts + 1'));
if($user_info['posts'] == 30)
{
db_query("
UPDATE {$db_prefix}members
SET karmaGood = karmaGood + 10
WHERE ID_MEMBER = $user_info[id]", __FILE__, __LINE__);
}
}
}
Michael Eshom
Christian Metal Fans

[Unknown]

Quote from: Oldiesmann on September 23, 2004, 09:30:47 AM
Replace
if (!$user_info['is_guest'] && !isset($_REQUEST['msg']))
{
// Check if posts count on this board, and if so increase the post count.
$request = db_query("
SELECT countPosts
FROM {$db_prefix}boards
WHERE ID_BOARD = $board
LIMIT 1", __FILE__, __LINE__);
list ($pcounter) = mysql_fetch_row($request);
mysql_free_result($request);

if (empty($pcounter))
{
++$user_info['posts'];
updateMemberData($ID_MEMBER, array('posts' => 'posts + 1'));
if($user_info['posts'] == 30)
{
db_query("
UPDATE {$db_prefix}members
SET karmaGood = karmaGood + 10
WHERE ID_MEMBER = $user_info[id]", __FILE__, __LINE__);
}
}
}


if (!$user_info['is_guest'] && !isset($_REQUEST['msg']))
{
// Check if posts count on this board, and if so increase the post count.
$request = db_query("
SELECT countPosts
FROM {$db_prefix}boards
WHERE ID_BOARD = $board
LIMIT 1", __FILE__, __LINE__);
list ($pcounter) = mysql_fetch_row($request);
mysql_free_result($request);

if (empty($pcounter))
{
++$user_info['posts'];
updateMemberData($ID_MEMBER, array('posts' => 'posts + 1'));

if ($user_info['posts'] == 30)
updateMemberData($ID_MEMBER, array('karmaGood' => 'karmaGood + 10'));
}
}


-[Unknown]

Advertisement: