MOD Author: King Rhyono
MOD Description: Allows the use of custom profile fields anywhere.
Format:
CUSTOM_(field identification)_VALUE
CUSTOM_(field name)_NAME
If there are spaces in your identification/name, remove them.
In: includes/functions.php
Find
- Code: Select all
'A_COOKIE_SETTINGS' => addslashes('; path=' . $config['cookie_path'] . ((!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain']) . ((!$config['cookie_secure']) ? '' : '; secure')),
));
After, add
- Code: Select all
// Begin CPFs Anywhere MOD - King Rhyono
$user_id = $user->data['user_id'];
$sql = 'SELECT *
FROM phpbb_profile_fields_data
WHERE user_id ='.$user_id;
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
if (!empty($row)) {
foreach($row as $key => $field) {
$template->assign_vars(array("CUSTOM".str_replace(" ", "", ltrim(strtoupper($key), "PF"))."_VALUE" => $row[$key]));
}
}
$db->sql_freeresult($result);
$sql = 'SELECT lang_name FROM phpbb_profile_lang';
$result = $db->sql_query($sql);
while($row = $db->sql_fetchrow($result)){
$template->assign_vars(array("CUSTOM_".str_replace(" ", "", strtoupper($row['lang_name']))."_NAME" => $row['lang_name']));
}
$db->sql_freeresult($result);
// End CPFs Anywhere MOD
MOD Version: 1.0.00
MOD Status: Released
Tested on phpBB version: 3.0.8
Released: 03 Jan 2011
Installation Level: easy
Installation Time: ~ 2 Minutes
This is an automated message posted by STG’s MOD Manager version 0.2.0












