I haven't looked at any of the database construction for this MOD, but what you want to do could be pretty easily achieved by running an SQL query that SETs the point amount to the same amount as members' post counts. Someone familiar with this mod could probably help point you to the right spot...tucsondrivers wrote:(also, off hand, I don't want you to do any complex coding just for me because I don't want to be a pest but -- since I'm implementing this mod late into the forum, is there a way i could make the beginning score count a users # of posts? i.e. if I have 1533 posts, my starting points number is 1533 and we just run it from there (topic 10, reply 5)...I doubt this is easily doable but hey -- was worth a shot!
I actually meant to say that I was unable to anything at that time.Jackanape wrote:I haven't looked at any of the database construction for this MOD, but what you want to do could be pretty easily achieved by running an SQL query that SETs the point amount to the same amount as members' post counts. Someone familiar with this mod could probably help point you to the right spot...tucsondrivers wrote:(also, off hand, I don't want you to do any complex coding just for me because I don't want to be a pest but -- since I'm implementing this mod late into the forum, is there a way i could make the beginning score count a users # of posts? i.e. if I have 1533 posts, my starting points number is 1533 and we just run it from there (topic 10, reply 5)...I doubt this is easily doable but hey -- was worth a shot!
Code: Select all
<?php
/**
*
* @package points
* @version $Id: user_points_update.php,v 1.0 2007/05/31 15:12:00 Ganon_Master Exp $
* @copyright (c) 2007 Ganon_Master
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
define('IN_PHPBB', true);
$phpbb_root_path = './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
$sql = "SELECT * FROM " . USERS_TABLE . ' WHERE user_posts != 0';
$result = $db->sql_query($sql);
$users = $db->sql_fetchrowset($result);
$db->sql_freeresult($result);
for($i = 0, $size = sizeof($users); $i < $size; $i++)
{
$points = $users[$i]['user_posts'] * $config['points_post'];
$sql = "UPDATE " . USERS_TABLE . "
SET user_points = $points
WHERE user_id = '".$users[$i]['user_id']."'";
$db->sql_query($sql);
unset($points);
}
trigger_error('Query executed.');
?>
Code: Select all
<?php
/**
*
* posting [English]
*
* @package language
* @version $Id: posting.php,v 1.64 2007/05/17 14:58:40 acydburn Exp $
* @copyright (c) 2005 phpBB Group
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*
*/
/**
* DO NOT CHANGE
*/
if (empty($lang) || !is_array($lang))
{
$lang = array();
}
// DEVELOPERS PLEASE NOTE
//
// All language files should use UTF-8 as their encoding and the files must not contain a BOM.
//
// Placeholders can now contain order information, e.g. instead of
// 'Page %s of %s' you can (and should) write 'Page %1$s of %2$s', this allows
// translators to re-order the output of data while ensuring it remains correct
//
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
$lang = array_merge($lang, array(
'ADD_ATTACHMENT' => 'Upload attachment',
'ADD_ATTACHMENT_EXPLAIN' => 'If you wish to attach one or more files enter the details below.',
'ADD_FILE' => 'Add the file',
'ADD_POLL' => 'Poll creation',
'ADD_POLL_EXPLAIN' => 'If you do not want to add a poll to your topic leave the fields blank.',
'ALREADY_DELETED' => 'Sorry but this message is already deleted.',
'ATTACH_QUOTA_REACHED' => 'Sorry, the board attachment quota has been reached.',
'ATTACH_SIG' => 'Attach a signature (signatures can be altered via the UCP)',
'BBCODE_A_HELP' => 'Inline uploaded attachment: [attachment=]filename.ext[/attachment]',
'BBCODE_B_HELP' => 'Bold text: [b]text[/b]',
'BBCODE_C_HELP' => 'Code display: [code]code
I already posted about your problem. Read the quote below. It came from the previous page.Zheverling wrote:ok looked at the posting.php file got nothing there.
.....
there is nothing before the <?php or after the ?> so where would the problem be?
As I stated there, I don't know what the problem could be. Are you using wordpad to edit? If so, try using Notepad or some other program to save the file. UTF-8 format would be the best.Ganon_master wrote:You are misunderstanding the error. Normally /includes/functions.php uses the header function to start sending the page to the user. However, this results in an error if a character has already been sent. That is the error you are getting. Take a look at the bolded area in the error below.Zheverling wrote:The errors seem to come from phpBB Debug] PHP Notice: in file /includes/functions.php on line 4312: is there a way to look at that file on that line and see what the problem is
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4312: Cannot modify header information - headers already sent by (output started at /language/en/posting.php:1)
So the problem is probably in your /language/en/posting.php file. I don't know what the problem could be except for outputted characters before the <?php or after the ?>.
I recommend that you put those lines back immediatly. They are very important to all the pages of phpBB.Zheverling wrote:i deleted these lines
header('Content-type: text/html; charset=UTF-8');
header('Cache-Control: private, no-cache="set-cookie"');
header('Expires: 0');
header('Pragma: no-cache');
Since you are having so many problems, I think you should upload you backup files, and re-do the entire Simple Points System installation again. And please, don't use Wordpad, or Word. Use Notepad or a special PHP editor.Zheverling wrote:and that problem went away but the points system is in the ACP and it is on but no points show up?
I had a similar one with posting.php but after setting the includes/mods/ directory structure it went away. But i can't get rid of the above error.[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1431: Undefined index: points_name
[phpBB Debug] PHP Notice: in file /viewtopic.php on line 1433: Undefined index: points_enable
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3718: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3264)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3720: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3264)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3721: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3264)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3722: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3264)