Here are the pages I modded for my store/point system, beware of security flaws, inefficiencies, etc.
In viewtopic.php:
find:
$result = $db->query('SELECT u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
replace with:
$result = $db->query('SELECT u.points, u.email, u.title, u.url, u.location, u.use_avatar, u.signature, u.email_setting, u.num_posts, u.registered, u.admin_note, p.id, p.poster AS username, p.poster_id, p.poster_ip, p.poster_email, p.message, p.hide_smilies, p.posted, p.edited, p.edited_by, g.g_id, g.g_user_title, o.user_id AS is_online FROM '.$db->prefix.'posts AS p INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id INNER JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id LEFT JOIN '.$db->prefix.'online AS o ON (o.user_id=u.id AND o.user_id!=1 AND o.idle=0) WHERE p.topic_id='.$id.' ORDER BY p.id LIMIT '.$start_from.','.$pun_user['disp_posts'], true) or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());
(basically add u.points to the query)
find:
// Now let's deal with the contact links (E-mail and URL)
add before:
$user_info[] = '<dd>Points: '.$cur_post['points'].' (<a href="store.php?user='.$cur_post['username'].'">$</a>)';
In post.php
add
//Points for posting
$post_reward = 5;
right after the includes - at this moment its 5 points for both topics and posts, you could modify it fairly easily probably to get more points for topics.
find:
// If the posting user is logged in, increment his/her post count
if (!$pun_user['is_guest'])
{
$low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
$db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
}
replace with:
// If the posting user is logged in, increment his/her post count
if (!$pun_user['is_guest'])
{
$low_prio = ($db_type == 'mysql') ? 'LOW_PRIORITY ' : '';
$db->query('UPDATE '.$low_prio.$db->prefix.'users SET num_posts=num_posts+1, last_post='.$now.', points=points+'.$post_reward.' WHERE id='.$pun_user['id']) or error('Unable to update user', __FILE__, __LINE__, $db->error());
}
save the following as store.php and save to your main forum directory
http://www.geocities.com/eddof13/store.txt
and if you want your profile to reflect your points, here is my modded profile.php (copy/paste the contents of the text file):
http://www.geocities.com/eddof13/profile.txt
You'll need to add another row to punbb_users:
"points" as an int(10) with a default of 0
here's the mysql:
ALTER TABLE `punbb_users` ADD `points` INT( 10 ) DEFAULT '0' NOT NULL ;
And that's it. I may of missed something, so if I did, let me know. It should work, and if anyone wants to expand on it and make it an official mod or whatever, feel free. I'll add the post icons code possibly later this week.