• Welcome to Simple Machines Community Forum. Please login or sign up.
December 02, 2021, 02:01:36 AM

News:

Join the Facebook Fan Page.


[SMF Converter] phpBB - 2.0.19+

Started by JayBachatero, January 13, 2007, 02:47:08 AM

Previous topic - Next topic

SleePy

The one at the start of the thread should work fine.
The one later on might of been a change to see if something fixed an issue that a user might of had.

I will update the post with the latest phpbb2 converter file I have in the svn repo :)
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:GitHub
Join us on IRC Libera.chat/#smf

frank_

thank you very much it work perfectly, now im going fot the UTF8 update
tnx cheers

Kvark

Greetings, maybe help me a little, i instaled SMF 1.1.5 create few users, some topiks and then deside to convert all another topics from old phpBB forum, dovnload script (convert.php) and run it... now i dont have accsse to forum as admin (old one was not me and i dont know his paswords) and old forum was in utf-8 new one cp1251 i see only ???? thats look like as older forum topics but dont redable - how i can fix this? How to take admin back and wthat to do corectly?

ThorstenE

you can change the user's group in PHPMyAdmin - SQL-Window:
UPDATE smf_members set ID_GROUP=1 WHERE memberName='User'

replace User to the real user's Name

the collation will be a problem, you should convert again with the same collation of your old phpBB.

allymcbeal

Hi, sorry for the question, I think I want much, but I try, maybe someone can help me. :)

For a question of user fake I have installed in my phpbb2 this mod

##############################################################
## MOD Title: Advanced IP Tools Pack
## MOD Author: pentapenguin < pentapenguin@bluebottle.com > (n/a) http://www.pentapenguin.com
## MOD Description: This MOD will save users' IP and hostname information on signup. Includes additional IP features and extensions.
## MOD Version: 0.3.2
##
## MOD : www.forum-linux-italia.com
##
## Installation Level: Intermediate
## Installation Time: 30 Minutes
## Files To Edit: 15
## admin/admin_db_utilities.php
## common.php
## search.php
## viewonline.php
## viewtopic.php
## language/lang_english/lang_main.php
## includes/constants.php
## includes/functions.php
## includes/page_header.php
## includes/sessions.php
## includes/usercp_register.php
## includes/usercp_viewprofile.php
## templates/subSilver/profile_view_body.tpl
## templates/subSilver/search_body.tpl
## templates/subSilver/viewonline_body.tpl
##
## Included Files: (n/a)
##############################################################
## For Security Purposes, Please Check: http://www.phpbb.com/mods/ for the
## latest version of this MOD. Downloading this MOD from other sites could cause malicious code
## to enter into your phpBB Forum. As such, phpBB will not offer support for MODs not offered
## in our MOD-Database, located at: http://www.phpbb.com/mods/
##############################################################
## Author Notes:
## Thanks go out to CyberAlien and geocator for their tips.
##
## Support for this MOD may be found at http://www.phpbb.com/phpBB/viewtopic.php?t=234613 or at
## http://www.pentapenguin.com/forum/viewtopic.php?t=138
##
## This MOD is EasyMOD friendly! (http://area51.phpbb.com/phpBB/viewtopic.php?sid=&f=17&t=15391)
##
## Optional step: if you have CyberAlien's eXtreme Styles MOD (http://www.phpbb.com/phpBB/viewtopic.php?t=125251),
## you can copy the file in contrib/admin/advanced_ip_tools_pack.cfg to admin/advanced_ip_tools_pack.cfg and you will
## be automatically notified if there's an update available when you use the "check for updates" function.
##
## Additional style support: I've included instructions on how to MOD other templates.
## Just look in the Styles directory under style_yourstylename.txt for directions.
##############################################################
## MOD History:
##   2005-10-18 Version 0.3.2
##      -Security update. Credit for help and discovery goes to AnthraX101
##
##   2005-05-07 Version 0.3.1
##      -Full pagination support for the other users registering under this IP, posts, and logins sections
##      -Miscellaneus PHP code improvements in includes/usercp_viewprofile.php
##      -Added Whois IP address lookup to logins section
##      -Added the time of the registration to the other users registering under this IP section
##
##   2005-05-04 Version 0.3.0
##      -Added browser recording
##      -Added IP and browser information to who's online page
##      -Added logins recording
##      -Added message if the IP wasn't recorded instead of blank space
##      -Added Aphrodite style support
##      -Added error message instead of having a blank profile page for wrong user IDs
##
##   2004-12-31 Version 0.2.0
##      -Added wildcard searching for IPs
##      -Added quick view of IPs
##      -Added Profile Control Panel support
##      -Added Morpheus eXtreme style to the styles directory
##
##   2004-11-23 Version 0.1.1
##      -Updated FIND commands to reflect version 2.0.11 of phpBB.
##      -Put MOD in ZIP file along with MOD directions for Cobalt, Morpheus, ff8, and Appalachia
##
##   2004-10-24 - Version 0.1.0
##      - First Public Beta
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################


#
#-----[ SQL ]------------------------------------------
#
ALTER TABLE phpbb_users
ADD user_registered_ip VARCHAR(8),
ADD user_registered_hostname VARCHAR(255 );

ALTER TABLE phpbb_sessions
ADD session_user_agent VARCHAR( 255 ) NOT NULL AFTER session_ip;

CREATE TABLE phpbb_logins (
login_id mediumint(8) unsigned NOT NULL auto_increment,
login_userid mediumint(8) NOT NULL default '0',
login_ip varchar(8) NOT NULL default '0',
login_user_agent varchar(255) NOT NULL default 'n/a',
login_time int(11) NOT NULL default '0',
PRIMARY KEY (login_id)
);


#
#-----[ OPEN ]------------------------------------------
#
admin/admin_db_utilities.php


#
#-----[ FIND ]------------------------------------------
#
# Note: actual line is much longer and may slightly vary!
#
$tables = array('auth_access', 'banlist', 'categories',


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
$tables[] = 'logins';
// End Advanced IP Tools Pack MOD


#
#-----[ OPEN ]------------------------------------------
#
common.php


#
#-----[ FIND ]------------------------------------------
#
$user_ip = encode_ip($client_ip);


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
$user_agent = ( !empty($HTTP_SERVER_VARS['HTTP_USER_AGENT']) ? $HTTP_SERVER_VARS['HTTP_USER_AGENT'] : ( !empty($HTTP_ENV_VARS['HTTP_USER_AGENT']) ? $HTTP_ENV_VARS['HTTP_USER_AGENT'] : getenv('HTTP_USER_AGENT') ) );
$user_agent = addslashes($user_agent);
// End Advanced IP Tools Pack MOD


#
#-----[ OPEN ]------------------------------------------
#
viewonline.php


#
#-----[ FIND ]------------------------------------------
#
$template->assign_vars(array(
'L_WHOSONLINE' => $lang['Who_is_Online'],


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
'L_WHOIS' => $lang['Whois'],
'L_IP' => $lang['IP'],
'L_BROWSER' => $lang['Browser'],
// End Advanced IP Tools Pack MOD


#
#-----[ FIND ]------------------------------------------
#
$sql = "SELECT u.user_id, u.username, u.user_allow_viewonline,


#
#-----[ IN-LINE FIND ]------------------------------------------
#
s.session_ip


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, s.session_user_agent


#
#-----[ FIND ]------------------------------------------
#
$row_color = ( $$which_counter % 2 ) ? $theme['td_color1'] : $theme['td_color2'];
$row_class = ( $$which_counter % 2 ) ? $theme['td_class1'] : $theme['td_class2'];


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
$mode = htmlspecialchars($HTTP_GET_VARS['mode']);

if ( ( ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == MOD) ) && $mode == 'lookup' && isset($HTTP_GET_VARS['ip']) && (decode_ip($row['session_ip']) == $HTTP_GET_VARS['ip']) )
{
$ip = gethostbyaddr( decode_ip($row['session_ip']) );
}

else
{
$ip = decode_ip($row['session_ip']);
$mode = 'ip';
}
// End Advanced IP Tools Pack MOD


#
#-----[ FIND ]------------------------------------------
#
$template->assign_block_vars("$which_row", array(


#
#-----[ AFTER, ADD ]------------------------------------------
#

         // Start Advanced IP Tools Pack MOD
         'IP' => htmlspecialchars($ip),
         'USER_AGENT' => htmlspecialchars($row['session_user_agent']),
         'U_HOSTNAME_LOOKUP' => ( $mode != 'lookup' ) ? append_sid("viewonline.$phpEx?mode=lookup&amp;ip=" . decode_ip($row['session_ip']) ) : append_sid("viewonline.$phpEx?mode=ip&amp;ip=" . decode_ip($row['session_ip']) ) ,
         'U_WHOIS' => 'http://whois.sc/' . decode_ip($row['session_ip']),
         // End Advanced IP Tools Pack MOD


#
#-----[ FIND ]------------------------------------------
#
'U_FORUM_LOCATION' => append_sid($location_url))
);


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
if ( ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == MOD) )
{
$template->assign_block_vars($which_row . '.switch_user_admin_or_mod', array() );
}
// End Advanced IP Tools Pack MOD


#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php


#
#-----[ FIND ]------------------------------------------
#
$ip_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_ip'] . '" alt="' . $lang['View_IP'] . '" title="' . $lang['View_IP'] . '" border="0" /></a>';


#
#-----[ REPLACE WITH ]------------------------------------------
#
// Start Advanced IP Tools Pack MOD
$ip_img = '<a href="' . $temp_url . '"><img src="' . $images['icon_ip'] . '" alt="' . $lang['View_IP'] . ' (' . decode_ip($postrow[$i]['poster_ip']) . ')" title="' . $lang['View_IP'] . ' (' . decode_ip($postrow[$i]['poster_ip']) . ')" border="0" /></a>';
// End Advanced IP Tools Pack MOD


#
#-----[ OPEN ]------------------------------------------
#
search.php


#
#-----[ FIND ]------------------------------------------
#
$sort_by_types = array($lang['Sort_Time'], $lang['Sort_Post_Subject'], $lang['Sort_Topic_Title'], $lang['Sort_Author'], $lang['Sort_Forum']);


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
$search_ip = '';

// For security reasons, we need to make sure the IP lookup is coming from an admin or mod.
if ( ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == MOD) )
{
if ( !empty($HTTP_POST_VARS['search_ip']) || !empty($HTTP_GET_VARS['search_ip']) )
{
$ip_address = ( !empty($HTTP_POST_VARS['search_ip']) ) ? $HTTP_POST_VARS['search_ip'] : $HTTP_GET_VARS['search_ip'];
$ip_address = htmlspecialchars($ip_address);
$ip_address = str_replace("\'", "''", $ip_address);
$ip_pieces = explode('.', $ip_address);
$ip_pieces_count = count($ip_pieces) - 1;

for ($i = 0; $i <= $ip_pieces_count; $i++)
{
$search_ip .= ( $ip_pieces[$i] == '*' ) ? '%' : sprintf('%02x', $ip_pieces[$i]);
}

}

else
{
$search_ip = '';
}
}
// End Advanced IP Tools Pack MOD


#
#-----[ FIND ]------------------------------------------
#
# Note: full line to find is: else if ( $search_keywords != '' || $search_author != '' || $search_id )
#
$search_keywords != '' || $search_author != '' || $search_id


#
#-----[ IN-LINE FIND ]------------------------------------------
#
$search_id


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
# Important note: there should be a space before the || AND after the != ''
#
|| $search_ip != ''


#
#-----[ FIND ]------------------------------------------
#
#Note: full line to find is: if ( $search_id == 'newposts' || $search_id == 'egosearch' || $search_id == 'unanswered' || $search_keywords != '' || $search_author != '' )
#
$search_id == 'unanswered' || $search_keywords != '' || $search_author != ''


#
#-----[ IN-LINE FIND ]------------------------------------------
#
$search_author != ''


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
# Important note: there should be a space before the || AND after the != ''
#
|| $search_ip != ''


#
#-----[ FIND ]------------------------------------------
#
# Note: full line to find is: if ( $search_id == 'newposts' || $search_id == 'egosearch' || ( $search_author != '' && $search_keywords == '' )  )
#
( $search_author != '' && $search_keywords == '' )


#
#-----[ IN-LINE FIND ]------------------------------------------
#
$search_keywords == '' )


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
# Important note: there should be a space before the || AND after the != ''
#
|| $search_ip != ''


#
#-----[ FIND ]------------------------------------------
#
if ( $search_id == 'newposts' )
{
if ( $userdata['session_logged_in'] )
{
$sql = "SELECT post_id
FROM " . POSTS_TABLE . "
WHERE post_time >= " . $userdata['user_lastvisit'];
}
else
{
redirect(append_sid("login.$phpEx?redirect=search.$phpEx&search_id=newposts", true));
}

$show_results = 'topics';
$sort_by = 0;
$sort_dir = 'DESC';
}


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
else if ($search_ip != '')
{
$sql = "SELECT post_id FROM " . POSTS_TABLE . " WHERE poster_ip LIKE '$search_ip'";
$show_results = 'posts';
$sort_by = 0;
$sort_dir = 'DESC';
}
//End Advanced IP Tools Pack MOD


#
#-----[ FIND ]------------------------------------------
#
'L_SEARCH_AUTHOR_EXPLAIN' => $lang['Search_author_explain'],


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
'L_SEARCH_IP' => $lang['Search_ip'],
'L_SEARCH_IP_EXPLAIN' => $lang['Search_ip_explain'],
// End Advanced IP Tools Pack MOD


#
#-----[ OPEN ]------------------------------------------
#
language/lang_english/lang_main.php


#
#-----[ FIND ]------------------------------------------
#
# Note: the complete line to find is: $lang['Viewing_user_profile'] = 'Viewing profile :: %s'; // %s is username
#
$lang['Viewing_user_profile']


#
#-----[ BEFORE, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
$lang['Moderator_ip_information'] = 'IP address information for moderators only';
$lang['Registered_ip_address'] = 'Registered IP address';
$lang['Registered_hostname'] = 'Registered hostname';
$lang['Other_registered_ips'] = 'Other users registering from %s'; //%s is the IP address
$lang['Other_posted_ips'] = 'IP addresses this user has posted from';
$lang['Search_ip'] = 'Search for posts by IP address';
$lang['Search_ip_explain'] = 'Enter a IP address in the format like <u>127.0.0.1</u> -- you may use * as a wildcard for partial matches like <u>127.*.*.1</u>';
$lang['IP'] = 'IP';
$lang['Whois'] = 'Whois';
$lang['Browser'] = 'Browser';
$lang['No_other_registered_ips'] = 'No other users have registered under this IP address.';
$lang['No_other_posted_ips'] = 'This user has not made any posts.';
$lang['Not_recorded'] = 'Not recorded';
$lang['Logins'] = 'Logins';
$lang['No_logins'] = 'No logins have been recorded for this user.';
// End Advanced IP Tools Pack MOD


#
#-----[ OPEN ]------------------------------------------
#
includes/constants.php


#
#-----[ FIND ]------------------------------------------
#
?>


#
#-----[ BEFORE, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
define('LOGINS_TABLE', $table_prefix . 'logins');
// End Advanced IP Tools Pack MOD


#
#-----[ OPEN ]------------------------------------------
#
includes/functions.php


#
#-----[ FIND ]------------------------------------------
#
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Tried obtaining data for a non-existent user', '', __LINE__, __FILE__, $sql);
}


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
if ( $db->sql_affectedrows() == 0 )
{
message_die(GENERAL_ERROR, 'User does not exist.');
}
// End Advanced IP Tools Pack MOD


#
#-----[ FIND ]------------------------------------------
#
function generate_pagination($base_url, $num_items, $per_page,


#
#-----[ IN-LINE FIND ]------------------------------------------
#
$add_prevnext_text = TRUE


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, $start = 'start'


#
#-----[ FIND ]------------------------------------------
#
$page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>';


#
#-----[ IN-LINE FIND ]------------------------------------------
#
start


#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
$start


#
#-----[ FIND ]------------------------------------------
#
$page_string .= ($i == $on_page) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>';


#
#-----[ IN-LINE FIND ]------------------------------------------
#
start


#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
$start


#
#-----[ FIND ]------------------------------------------
#
$page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>'  : '<a href="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>';


#
#-----[ IN-LINE FIND ]------------------------------------------
#
start


#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
$start


#
#-----[ FIND ]------------------------------------------
#
$page_string .= ( $i == $on_page ) ? '<b>' . $i . '</b>' : '<a href="' . append_sid($base_url . "&amp;start=" . ( ( $i - 1 ) * $per_page ) ) . '">' . $i . '</a>';


#
#-----[ IN-LINE FIND ]------------------------------------------
#
start


#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
$start


#
#-----[ FIND ]------------------------------------------
#
$page_string = ' <a href="' . append_sid($base_url . "&amp;start=" . ( ( $on_page - 2 ) * $per_page ) ) . '">' . $lang['Previous'] . '</a>&nbsp;&nbsp;' . $page_string;


#
#-----[ IN-LINE FIND ]------------------------------------------
#
start


#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
$start


#
#-----[ FIND ]------------------------------------------
#
$page_string .= '&nbsp;&nbsp;<a href="' . append_sid($base_url . "&amp;start=" . ( $on_page * $per_page ) ) . '">' . $lang['Next'] . '</a>';


#
#-----[ IN-LINE FIND ]------------------------------------------
#
start


#
#-----[ IN-LINE REPLACE WITH ]------------------------------------------
#
$start


#
#-----[ OPEN ]------------------------------------------
#
includes/page_header.php


#
#-----[ FIND ]------------------------------------------
#
if ( !empty($userdata['user_popup_pm']) )
{
$template->assign_block_vars('switch_enable_pm_popup', array());
}


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
if ( ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == MOD) )
{
$template->assign_block_vars('switch_user_admin_or_mod',array() );
}
// End Advanced IP Tools Pack MOD


#
#-----[ OPEN ]------------------------------------------
#
includes/sessions.php


#
#-----[ FIND ]------------------------------------------
#
global $HTTP_COOKIE_VARS, $HTTP_GET_VARS, $SID;


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
global $user_agent;
// End Advanced IP Tools Pack MOD


#
#-----[ FIND ]------------------------------------------
#
$sql = "UPDATE " . SESSIONS_TABLE . "
SET session_user_id = $user_id, session_start = $current_time, session_time = $current_time, session_page = $page_id, session_logged_in = $login


#
#-----[ IN-LINE FIND ]------------------------------------------
#
session_logged_in = $login


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
, session_user_agent = '$user_agent'


#
#-----[ FIND ]------------------------------------------
#
$sql = "INSERT INTO " . SESSIONS_TABLE . "
(session_id, session_user_id, session_start, session_time, session_ip, session_page, session_logged_in)
VALUES ('$session_id', $user_id, $current_time, $current_time, '$user_ip', $page_id, $login)";


#
#-----[ IN-LINE FIND ]------------------------------------------
#
session_ip,


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
session_user_agent,


#
#-----[ IN-LINE FIND ]------------------------------------------
#
'$user_ip',


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
'$user_agent',


#
#-----[ FIND ]------------------------------------------
#
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error updating last visit time', '', __LINE__, __FILE__, $sql);
}


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
$sql = "INSERT INTO " . LOGINS_TABLE . "
(login_id, login_userid, login_ip, login_user_agent, login_time)
VALUES (NULL, $user_id, '$user_ip', '$user_agent', $current_time)";
if ( !$db->sql_query($sql) )
{
message_die(CRITICAL_ERROR, 'Error inserting login', '', __LINE__, __FILE__, $sql);
}
// End Advanced IP Tools Pack MOD


#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_register.php


#
#-----[ FIND ]------------------------------------------
#
$user_id = $row['total'] + 1;


#
#-----[ AFTER, ADD ]------------------------------------------
#

         // Start Advanced IP Tools Pack MOD
         $user_registered_ip = ( !empty($HTTP_SERVER_VARS['REMOTE_ADDR']) ) ? $HTTP_SERVER_VARS['REMOTE_ADDR'] : ( ( !empty($HTTP_ENV_VARS['REMOTE_ADDR']) ) ? $HTTP_ENV_VARS['REMOTE_ADDR'] : getenv('REMOTE_ADDR') );
         $user_registered_hostname = ( gethostbyaddr($user_registered_ip) ) ? gethostbyaddr($user_registered_ip) : $user_registered_ip;
         $user_registered_hostname = addslashes($user_registered_hostname);
         $user_registered_ip = encode_ip($user_registered_ip);
         // End Advanced IP Tools Pack MOD


#
#-----[ FIND ]------------------------------------------
#
INSERT INTO " . USERS_TABLE . " (


#
#-----[ IN-LINE FIND ]------------------------------------------
#
INSERT INTO " . USERS_TABLE . " (


#
#-----[ IN-LINE AFTER, ADD ]------------------------------------------
#
user_registered_ip, user_registered_hostname,


#
#-----[ FIND ]------------------------------------------
#
$user_id, '" . str_replace("\'", "''", $username) . "',


#
#-----[ IN-LINE FIND ]------------------------------------------
#
$user_id, '" . str_replace("\'", "''", $username) . "',


#
#-----[ IN-LINE BEFORE, ADD ]------------------------------------------
#
'" . str_replace("\'", "''", $user_registered_ip) . "', '" . str_replace("\'", "''", $user_registered_hostname) . "',


#
#-----[ OPEN ]------------------------------------------
#
includes/usercp_viewprofile.php


#
#-----[ FIND ]------------------------------------------
#
$search = '<a href="' . $temp_url . '">' . $lang['Search_user_posts'] . '</a>';


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
$encoded_ip = ( $profiledata['user_registered_ip'] == '' ) ? '' : $profiledata['user_registered_ip'];
$decoded_ip = ( decode_ip($encoded_ip) == '0.0.0.0' ) ? $lang['Not_recorded'] : decode_ip($encoded_ip);
$hostname = ( $profiledata['user_registered_hostname'] == '' ) ? $lang['Not_recorded'] : htmlspecialchars( $profiledata['user_registered_hostname'] );
// End Advanced IP Tools Pack MOD


#
#-----[ FIND ]------------------------------------------
#
'U_SEARCH_USER' => append_sid("search.$phpEx?search_author=" . $u_search_author),


#
#-----[ AFTER, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
'L_MODERATOR_IP_INFORMATION' => $lang['Moderator_ip_information'],
'L_REGISTERED_IP_ADDRESS' => $lang['Registered_ip_address'],
'L_REGISTERED_HOSTNAME' => $lang['Registered_hostname'],
'L_OTHER_REGISTERED_IPS' => sprintf($lang['Other_registered_ips'], $decoded_ip),
'L_OTHER_IPS' => $lang['Other_posted_ips'],
'USER_EMAIL_ADDRESS' => $profiledata['user_email'],
'U_USER_IP_ADDRESS' => ( $decoded_ip != $lang['Not_recorded'] ) ? "<a href='http://whois.sc/$decoded_ip' target='_blank'>$decoded_ip</a>" : $lang['Not_recorded'],
'USER_IP_ADDRESS' => $decoded_ip,
'USER_REGISTERED_HOSTNAME' => $hostname,
// End Advanced IP Tools Pack MOD


#
#-----[ FIND ]------------------------------------------
#
$template->pparse('body');


#
#-----[ BEFORE, ADD ]------------------------------------------
#

// Start Advanced IP Tools Pack MOD
// Let's see if the user viewing this page is an admin or mod, if not, we can save several database queries! :P
if ( ($userdata['user_level'] == ADMIN) || ($userdata['user_level'] == MOD) )
{
// All users registering under this IP address section
if ( $encoded_ip != '' )
{
$sql = 'SELECT COUNT(user_id) AS total_users FROM ' . USERS_TABLE . ' WHERE user_registered_ip = "' . $encoded_ip . '" AND user_id != "' . $profiledata['user_id'] . '"';

if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error: could not determine total users registering under this IP.', '', __LINE__, __FILE__, $sql);
}

if ( !$row = $db->sql_fetchrow($result) )
{
message_die(GENERAL_ERROR, 'Error: could not get the total users number.', '', __LINE__, __FILE__, $sql);
}

$total_users = $row['total_users'];

if ( $total_users > 0 )
{
$u_start = ( isset($HTTP_GET_VARS['u_start']) ) ? intval($HTTP_GET_VARS['u_start']) : 0;

$sql = "SELECT user_id, username, user_regdate, user_registered_ip, user_registered_hostname FROM " . USERS_TABLE . " WHERE user_registered_ip = '" . $encoded_ip . "' AND user_id != '" . $profiledata['user_id'] . "' ORDER BY user_regdate DESC LIMIT $u_start, " . $board_config['topics_per_page'];

if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error: could not look up other registered IP addresses.', '', __LINE__, __FILE__, $sql);
}

$template->assign_block_vars('switch_user_admin_or_mod.switch_other_user_ips', array() );

while ( $row = $db->sql_fetchrow($result) )
{
$template->assign_block_vars('switch_user_admin_or_mod.switch_other_user_ips.OTHER_REGISTERED_IPS', array(
'USER_NAME' => $row['username'],
'U_PROFILE' => append_sid("profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . '=' . $row['user_id']),
'USER_HOSTNAME' => htmlspecialchars( $row['user_registered_hostname'] ),
'TIME' => create_date($userdata['user_dateformat'], $row['user_regdate'], $userdata['user_timezone']),
));
}

$base_url = "profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . '=' . $profiledata['user_id'];
$pagination = generate_pagination($base_url, $total_users, $board_config['topics_per_page'], $u_start, TRUE, 'u_start');

$template->assign_vars(array(
'USERS_PAGINATION' => $pagination,
'USERS_PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $u_start / $board_config['topics_per_page'] ) + 1 ), ceil( $total_users / $board_config['topics_per_page'] ) ),
));
}

else
{
$template->assign_vars(array(
'L_NO_OTHER_REGISTERED_IPS' => $lang['No_other_registered_ips'],
));
$template->assign_block_vars('switch_user_admin_or_mod.switch_no_other_registered_ips', array() );
}
}

else
{
$template->assign_vars(array(
'L_NO_OTHER_REGISTERED_IPS' => $lang['No_other_registered_ips'],
));
$template->assign_block_vars('switch_user_admin_or_mod.switch_no_other_registered_ips', array() );
}

// All IP addresses this user has posted from section
$total_ips = 0;
$sql = 'SELECT poster_ip, COUNT(*) AS postings FROM ' . POSTS_TABLE . ' WHERE poster_id = "' . $profiledata['user_id'] . '" GROUP BY poster_ip ORDER BY ' . (( SQL_LAYER == 'msaccess' ) ? 'COUNT(*)' : 'postings' ) . ' DESC';

if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error: could not look up all IP addresses this user has posted from.', '', __LINE__, __FILE__, $sql);
}

while ( $row = $db->sql_fetchrow($result) )
{
$total_ips = $total_ips + 1;
}

if ( $total_ips > 0 )
{
$i_start = ( isset($HTTP_GET_VARS['i_start']) ) ? intval($HTTP_GET_VARS['i_start']) : 0;

$sql = 'SELECT poster_ip, COUNT(*) AS postings FROM ' . POSTS_TABLE . ' WHERE poster_id = "' . $profiledata['user_id'] . '" GROUP BY poster_ip ORDER BY ' . (( SQL_LAYER == 'msaccess' ) ? 'COUNT(*)' : 'postings' ) . " DESC LIMIT $i_start, " . $board_config['topics_per_page'];

if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error: could not look up all IP addresses this user has posted from.', '', __LINE__, __FILE__, $sql);
}

$template->assign_block_vars('switch_user_admin_or_mod.switch_other_posted_ips', array() );

while ( $row = $db->sql_fetchrow($result) )
{
$poster_ip = decode_ip($row['poster_ip']);

$template->assign_block_vars('switch_user_admin_or_mod.switch_other_posted_ips.ALL_IPS_POSTED_FROM', array(
'U_POSTER_IP' => "http://whois.sc/$poster_ip",
'POSTER_IP' => $poster_ip,
'POSTS' => $row['postings'] . ' ' . ( ( $row['postings'] == 1 ) ? $lang['Post'] : $lang['Posts'] ),
'U_POSTS_LINK' => append_sid("search.$phpEx?mode=results&amp;search_author=" . urlencode($profiledata['username']) . "&amp;search_ip=$poster_ip"),
));
}

$base_url = "profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . '=' . $profiledata['user_id'];
$pagination = generate_pagination($base_url, $total_ips, $board_config['topics_per_page'], $i_start, TRUE, 'i_start');

$template->assign_vars(array(
'IPS_PAGINATION' => $pagination,
'IPS_PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $i_start / $board_config['topics_per_page'] ) + 1 ), ceil( $total_ips / $board_config['topics_per_page'] ) ),
));
}

else
{
$template->assign_vars(array(
'L_NO_OTHER_POSTED_IPS' => $lang['No_other_posted_ips'],
));
$template->assign_block_vars('switch_user_admin_or_mod.switch_no_other_posted_ips', array() );
}

// All logins section
// Obtain the total logins for this user
$sql = 'SELECT COUNT(login_id) AS total_logins FROM ' . LOGINS_TABLE . ' WHERE login_userid = ' . $profiledata['user_id'];

if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error: could not determine total logins.', '', __LINE__, __FILE__, $sql);
}

if ( !$row = $db->sql_fetchrow($result) )
{
message_die(GENERAL_ERROR, 'Error: could not get the logins number.', '', __LINE__, __FILE__, $sql);
}

$total_logins = $row['total_logins'];

if ( $total_logins > 0 )
{
$l_start = ( isset($HTTP_GET_VARS['l_start']) ) ? intval($HTTP_GET_VARS['l_start']) : 0;

// Now get the results in groups based on how many topics per page parameter set in the admin panel
$sql = 'SELECT * FROM ' . LOGINS_TABLE . ' WHERE login_userid = ' . $profiledata['user_id'] . " ORDER BY login_time DESC LIMIT $l_start, " . $board_config['topics_per_page'];

if ( !$result = $db->sql_query($sql) )
{
message_die(GENERAL_ERROR, 'Error: could not retrieve last login.', '', __LINE__, __FILE__, $sql);
}

while ( $row = $db->sql_fetchrow($result) )
{
$ip = decode_ip($row['login_ip']);

$template->assign_block_vars('switch_user_admin_or_mod.USER_LOGINS', array(
'U_IP' => "http://whois.sc/$ip",
'IP' => $ip,
'USER_AGENT' => htmlspecialchars( $row['login_user_agent'] ),
'LOGIN_TIME' => create_date($userdata['user_dateformat'], $row['login_time'], $userdata['user_timezone']),
));
}

$base_url = "profile.$phpEx?mode=viewprofile&amp;" . POST_USERS_URL . '=' . $profiledata['user_id'];
$pagination = generate_pagination($base_url, $total_logins, $board_config['topics_per_page'], $l_start, TRUE, 'l_start');

$template->assign_vars(array(
'LOGINS_PAGINATION' => $pagination,
'LOGINS_PAGE_NUMBER' => sprintf($lang['Page_of'], ( floor( $l_start / $board_config['topics_per_page'] ) + 1 ), ceil( $total_logins / $board_config['topics_per_page'] ) ),
));
}

else
{
$template->assign_vars(array(
'L_NO_LOGINS' => $lang['No_logins'],
));
$template->assign_block_vars('switch_user_admin_or_mod.switch_no_logins', array() );
}

$template->assign_vars(array(
'L_USERNAME' => $lang['Username'],
'L_LOGINS' => $lang['Logins'],
'L_IP' => $lang['IP'],
'L_BROWSER' => $lang['Browser'],
'L_TIME' => $lang['Time'],
));
}
// End Advanced IP Tools Pack MOD


#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_view_body.tpl


#
#-----[ FIND ]------------------------------------------
#
//--></script><noscript>{ICQ_IMG}</noscript></td>
</tr>
  </table>
</td>
  </tr>

#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- BEGIN switch_user_admin_or_mod -->
<tr>
<th class="thHead" colspan="2" align="center">{L_MODERATOR_IP_INFORMATION}:</th>
</tr>
 
<tr>
<td class="row1" colspan="2"><span class="gen">{L_EMAIL_ADDRESS}: <a href="mailto:{USER_EMAIL_ADDRESS}">{USER_EMAIL_ADDRESS}</a></span></td>
</tr>

<tr>
<td class="row1" colspan="2"><span class="gen">{L_REGISTERED_IP_ADDRESS}: {U_USER_IP_ADDRESS}</span></td>
</tr>

<tr>
<td class="row1" colspan="2"><span class="gen">{L_REGISTERED_HOSTNAME}: {USER_REGISTERED_HOSTNAME}</span></td>
</tr>
<!-- END switch_user_admin_or_mod -->


#
#-----[ FIND ]------------------------------------------
#
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
<td align="right"><span class="nav"><br />{JUMPBOX}</span></td>
  </tr>
</table>


#
#-----[ BEFORE, ADD ]------------------------------------------
#

<!-- BEGIN switch_user_admin_or_mod -->
<br />

<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center">
<tr>
<th class="thHead" colspan="3" align="center">{L_OTHER_REGISTERED_IPS}:</th>
</tr>

<tr>
<td class="cat"><span class="gen"><b>{L_USERNAME}:</b></span></td>
<td class="cat"><span class="gen"><b>{L_REGISTERED_HOSTNAME}:</b></span></td>
<td class="cat"><span class="gen"><b>{L_TIME}:</b></span></td>
</tr>

<!-- BEGIN switch_other_user_ips -->
<!-- BEGIN OTHER_REGISTERED_IPS -->
<tr>
<td class="row1"><span class="gen"><a href="{switch_user_admin_or_mod.switch_other_user_ips.OTHER_REGISTERED_IPS.U_PROFILE}">{switch_user_admin_or_mod.switch_other_user_ips.OTHER_REGISTERED_IPS.USER_NAME}</a></span></td>
<td class="row1"><span class="gen">{switch_user_admin_or_mod.switch_other_user_ips.OTHER_REGISTERED_IPS.USER_HOSTNAME}</span></td>
<td class="row1"><span class="gen">{switch_user_admin_or_mod.switch_other_user_ips.OTHER_REGISTERED_IPS.TIME}</span></td>
</tr>
<!-- END OTHER_REGISTERED_IPS -->
<!-- END switch_other_user_ips -->

<!-- BEGIN switch_no_other_registered_ips -->
<tr>
<td class="row1" colspan="3" valign="middle" align="center"><span class="gen">{L_NO_OTHER_REGISTERED_IPS}</span></td>
</tr>
<!-- END switch_no_other_registered_ips -->

</table>

<table width="100%" cellspacing="2" border="0" align="center" cellpadding="2">
<tr>
<td align="left" valign="top"><span class="nav">{USERS_PAGE_NUMBER}</span></td>
<td align="right" valign="top" nowrap="nowrap"><span class="nav">{USERS_PAGINATION}</span><br /><span class="gensmall">{S_TIMEZONE}</span></td>
</tr>
</table>

<br />

<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center">
<tr>
<th class="thHead" align="center">{L_OTHER_IPS}:</th>
</tr>

<!-- BEGIN switch_other_posted_ips -->
<!-- BEGIN ALL_IPS_POSTED_FROM -->
<tr>
<td class="row1"><span class="gen"><a href="{switch_user_admin_or_mod.switch_other_posted_ips.ALL_IPS_POSTED_FROM.U_POSTER_IP}" target="_blank">{switch_user_admin_or_mod.switch_other_posted_ips.ALL_IPS_POSTED_FROM.POSTER_IP}</a> [ <a href="{switch_user_admin_or_mod.switch_other_posted_ips.ALL_IPS_POSTED_FROM.U_POSTS_LINK}">{switch_user_admin_or_mod.switch_other_posted_ips.ALL_IPS_POSTED_FROM.POSTS}</a> ] </span></td>
</tr>
<!-- END ALL_IPS_POSTED_FROM -->
<!-- END switch_other_posted_ips -->

<!-- BEGIN switch_no_other_posted_ips -->
<tr>
<td class="row1" valign="middle" align="center"><span class="gen">{L_NO_OTHER_POSTED_IPS}</span></td>
</tr>
<!-- END switch_no_other_posted_ips -->

</table>

<table width="100%" cellspacing="2" border="0" align="center" cellpadding="2">
<tr>
<td align="left" valign="top"><span class="nav">{IPS_PAGE_NUMBER}</span></td>
<td align="right" valign="top" nowrap="nowrap"><span class="nav">{IPS_PAGINATION}</span></td>
</tr>
</table>

<br />

<table class="forumline" width="100%" cellspacing="1" cellpadding="3" border="0" align="center">

<tr>
<th class="thHead" colspan="3" height="25" nowrap="nowrap">{L_LOGINS}:</th>
</tr>

<tr>
<td class="cat"><span class="gen"><b>{L_IP}:</b></span></td>
<td class="cat"><span class="gen"><b>{L_BROWSER}:</b></span></td>
<td class="cat"><span class="gen"><b>{L_TIME}:</b></span></td>
</tr>

<!-- BEGIN USER_LOGINS -->
<tr>
<td class="row1"><span class="gen"><a href="{switch_user_admin_or_mod.USER_LOGINS.U_IP}" target="_blank">{switch_user_admin_or_mod.USER_LOGINS.IP}</a></span></td>
<td class="row1"><span class="gen">{switch_user_admin_or_mod.USER_LOGINS.USER_AGENT}</span></td>
<td class="row1"><span class="gen">{switch_user_admin_or_mod.USER_LOGINS.LOGIN_TIME}</span></td>
</tr>
<!-- END USER_LOGINS -->

<!-- BEGIN switch_no_logins -->
<tr>
<td class="row1" colspan="3" valign="middle" align="center"><span class="gen">{L_NO_LOGINS}</span></td>
</tr>
<!-- END switch_no_logins -->

<tr>
<td class="catBottom" colspan="3" height="28" valign="middle">&nbsp;</td>
</tr>

</table>

<table width="100%" cellspacing="2" border="0" align="center" cellpadding="2">
<tr>
<td align="left" valign="top"><span class="nav">{LOGINS_PAGE_NUMBER}</span></td>
<td align="right" valign="top" nowrap="nowrap"><span class="nav">{LOGINS_PAGINATION}</span><br /><span class="gensmall">{S_TIMEZONE}</span></td>
</tr>
</table>
<!-- END switch_user_admin_or_mod -->


#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/search_body.tpl


#
#-----[ FIND ]------------------------------------------
#
<tr>
<td class="row1" colspan="2"><span class="gen">{L_SEARCH_AUTHOR}:</span><br /><span class="gensmall">{L_SEARCH_AUTHOR_EXPLAIN}</span></td>
<td class="row2" colspan="2" valign="middle"><span class="genmed"><input type="text" style="width: 300px" class="post" name="search_author" size="30" /></span></td>
</tr>


#
#-----[ AFTER, ADD ]------------------------------------------
#
<!-- BEGIN switch_user_admin_or_mod -->
<tr>
<td class="row1" colspan="2"><span class="gen">{L_SEARCH_IP}:</span><br /><span class="gensmall">{L_SEARCH_IP_EXPLAIN}</span></td>
<td class="row2" colspan="2" valign="middle"><span class="genmed"><input type="text" style="width: 300px" class="post" name="search_ip" size="30" /></span></td>
</tr>
<!-- END switch_user_admin_or_mod -->


#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/viewonline_body.tpl


#
#-----[ FIND ]------------------------------------------
#
<td width="40%" class="{reg_user_row.ROW_CLASS}">&nbsp;<span class="gen"><a href="{reg_user_row.U_FORUM_LOCATION}" class="gen">{reg_user_row.FORUM_LOCATION}</a></span>&nbsp;</td>
</tr>


#
#-----[ AFTER, ADD ]------------------------------------------
#

<!-- BEGIN switch_user_admin_or_mod -->
<tr>
<td width="100%" class="{reg_user_row.ROW_CLASS}" colspan="3"><span class="gensmall">{L_IP}: <a href="{reg_user_row.U_HOSTNAME_LOOKUP}">{reg_user_row.IP}</a> » <a href="{reg_user_row.U_WHOIS}" target="_blank">{L_WHOIS}</a> || {L_BROWSER}: {reg_user_row.USER_AGENT}</span></td>
</tr>
<!-- END switch_user_admin_or_mod -->



#
#-----[ FIND ]------------------------------------------
#
<td width="40%" class="{guest_user_row.ROW_CLASS}">&nbsp;<span class="gen"><a href="{guest_user_row.U_FORUM_LOCATION}" class="gen">{guest_user_row.FORUM_LOCATION}</a></span>&nbsp;</td>
</tr>


#
#-----[ AFTER, ADD ]------------------------------------------
#

  <!-- BEGIN switch_user_admin_or_mod -->
  <tr>
<td width="100%" class="{guest_user_row.ROW_CLASS}" colspan="3"><span class="gensmall">{L_IP}: <a href="{guest_user_row.U_HOSTNAME_LOOKUP}">{guest_user_row.IP}</a> » <a href="{guest_user_row.U_WHOIS}" target="_blank">{L_WHOIS}</a> || {L_BROWSER}: {guest_user_row.USER_AGENT}</span></td>
  </tr>
  <!-- END switch_user_admin_or_mod -->


#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM


This mode add a a table for the ip, is possible import the ip about users? Not all maybe but the ip they used to register himself.

Thanks.

SleePy

I think I failed to understand the issue?

Are you wanting to import their ip addresses? These are imported as gained from their profile.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:GitHub
Join us on IRC Libera.chat/#smf

allymcbeal

No I can't see it in the profile. :(

SleePy

Does it show under track IP?

Otherwise the only other place the ip is shown is when viewing a topic for those users.
Jeremy D — Site Team / SMF Developer
Support the SMF Support team!
Profiles:GitHub
Join us on IRC Libera.chat/#smf

Het Bosje

Hi All,
I've browsed this topic to see if there is a solution for my question:
Al converter for migrating from PHPbb2.0.20 to SMF (latest)
There are many conversion scripts and even so many problems and difficulties.
My question is, which script or procedure is the best?

brgds Bossie

allymcbeal

Sorry if I insist.
But I need the ip of my members

I think is this the code can help to help me :)
ALTER TABLE phpbb_users ADD user_registered_ip VARCHAR(8),ADD user_registered_hostname VARCHAR(255 );ALTER TABLE phpbb_sessions ADD session_user_agent VARCHAR( 255 ) NOT NULL AFTER session_ip;CREATE TABLE phpbb_logins (login_id mediumint(8) unsigned NOT NULL auto_increment,login_userid mediumint(8) NOT NULL default '0',login_ip varchar(8) NOT NULL default '0',login_user_agent varchar(255) NOT NULL default 'n/a',login_time int(11) NOT NULL default '0',PRIMARY KEY (login_id)
Whit this I can see what ip they use for register.

I need to import it, please...

ThorstenE

Bossie, use the phpbb2_to_smf.sql attached in the first post of this topic..
Quote« Last Edit: 20.07.2008 02:35:16 by SleePy »

ThorstenE

July 28, 2008, 11:27:27 AM #531 Last Edit: July 28, 2008, 12:10:03 PM by ThorstenE
allymcbeal,
can you convert again or is your SMF allready running (then conversion is not possible without loosing all new data)?

if you can convert again you only need to edit the phpbb2_to_smf.sql

find
'' AS memberIP
replace with
u.user_registered_ip AS memberIP,


find
'' AS memberIP2
replace with
u.user_registered_ip AS memberIP2

allymcbeal

Hi ThorstenE,  I can because I'm watching to see very well how it works, so I'm doing some test first, so thank you for your help.  :)

I did what you say me, I have write only one "," after "u.user_registered_ip AS memberIP," because it give me an error, and I write a "," after "u.user_registered_ip AS memberIP2," like you say me (but first there isn't).
But it gives me alredy an error.

Converting...
Converting ranks... Successful.
Converting groups... Successful.
Converting members... Unsuccessful!
This query:
SELECT
u.user_id AS ID_MEMBER, SUBSTRING(u.username, 1, 80) AS memberName,
SUBSTRING(u.username, 1, 255) AS realName,
SUBSTRING(u.user_password, 1, 64) AS passwd, u.user_lastvisit AS lastLogin,
u.user_regdate AS dateRegistered,
SUBSTRING(u.user_from, 1, 255) AS location,
u.user_posts AS posts, IF(u.user_level = 1, 1, mg.ID_GROUP) AS ID_GROUP,
u.user_new_privmsg AS instantMessages,
SUBSTRING(u.user_email, 1, 255) AS emailAddress,
u.user_unread_privmsg AS unreadMessages,
SUBSTRING(u.user_msnm, 1, 255) AS MSN,
SUBSTRING(u.user_aim, 1, 16) AS AIM,
SUBSTRING(u.user_icq, 1, 255) AS ICQ,
SUBSTRING(u.user_yim, 1, 32) AS YIM,
SUBSTRING(u.user_website, 1, 255) AS websiteTitle,
SUBSTRING(u.user_website, 1, 255) AS websiteUrl,
u.user_allow_viewonline AS showOnline, u.user_timezone AS timeOffset,
IF(u.user_viewemail = 1, 0, 1) AS hideEmail, u.user_avatar AS avatar,
REPLACE(u.user_sig, '\n', '<br />') AS signature,
u.user_sig_bbcode_uid AS signature_uid, u.user_avatar_type,
u.user_notify_pm AS pm_email_notify, u.user_active AS is_activated,
'' AS lngfile, '' AS buddy_list, '' AS pm_ignore_list, '' AS messageLabels,
'' AS personalText, '' AS timeFormat, '' AS usertitle, u.user_registered_ip AS memberIP,
'' AS secretQuestion, '' AS secretAnswer, '' AS validation_code,
'' AS additionalGroups, '' AS smileySet, '' AS passwordSalt,
u.user_registered_ip AS memberIP2,
FROM `my0360`.phpbb_users AS u
LEFT JOIN `my0360`.phpbb_ranks AS r ON (r.rank_id = u.user_rank AND r.rank_special = 1)
LEFT JOIN `my0360`.smf_membergroups AS mg ON (BINARY mg.groupName = CONCAT('phpBB ', r.rank_title))
WHERE u.user_id != -1
GROUP BY u.user_id
LIMIT 0, 500;
Caused the error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM `my0360`.phpbb_users AS u
LEFT JOIN `my0360`.phpbb_ranks AS r ON (r.rank_' at line 27

ThorstenE

ups, sorry..my mistake, copy&paste is sometimes not a good solution ;)

fixed it above.

it must be  u.user_registered_ip AS memberIP2 (without the , at the end, because it's the last column converted)

allymcbeal

It works!!! THANKs!!!!

But I can see a ip like this "4f0b61d3" if  I remember well, in phpmyadmin I see the ip so and then in the forum I see they right.
Is a problem fix it?

ThorstenE

untested, but the following should fix it:

find (in phpbb_to_smf.sql)

// Got the board timezone?
add before
if (!empty($row['memberIP'])) {
$ipa= hexdec(substr($row['memberIP'],0,2));
$ipb= hexdec(substr($row['memberIP'],2,2));
$ipc= hexdec(substr($row['memberIP'],4,2));
$ipd= hexdec(substr($row['memberIP'],6,2));
$row['memberIP'] = $ipa.'.'.$ipb.'.'.$ipc.'.'.$ipd;
$row['memberIP2'] = $ipa.'.'.$ipb.'.'.$ipc.'.'.$ipd;
}

allymcbeal

July 30, 2008, 04:52:01 PM #536 Last Edit: July 31, 2008, 03:20:38 AM by allymcbeal
Great, it works!!!
I don't know how thank you!!!

You have been very nice to help me. Thanks again!!!  :)

allymcbeal

Hi, again me.
I have a mod in my forum, it gives me the name of users vote for a poll.

Can you help me to add to my new forum?

I have created this table

ALTER TABLE phpbb_vote_voters ADD vote_cast TINYINT( 4 ) UNSIGNED DEFAULT '0' NOT NULL;


and add this code
-around line 494-
# NOTE: the complete line to find is:
#            $sql = "INSERT INTO " . VOTE_USERS_TABLE . " (vote_id, vote_user_id, vote_user_ip)
#               VALUES ($vote_id, " . $userdata['user_id'] . ", '$user_ip')";
#
            $sql = "INSERT INTO " . VOTE_USERS_TABLE
               VALUES

#
#-----[ IN-LINE FIND ]------------------------------------
#
vote_user_ip

#
#-----[ IN-LINE AFTER, ADD ]------------------------------
#
, vote_cast

#
#-----[ IN-LINE FIND ]------------------------------------
#
'$user_ip'

#
#-----[ IN-LINE AFTER, ADD ]------------------------------
#
, $vote_option_id

#
# NOTE: Many users make a mistake when performing the above edit.  After the above instructions are performed
#      the code should look like this:
#
#            $sql = "INSERT INTO " . VOTE_USERS_TABLE . " (vote_id, vote_user_id, vote_user_ip, vote_cast)
#               VALUES ($vote_id, " . $userdata['user_id'] . ", '$user_ip', $vote_option_id)";



Can you help me please?
I add also some php file:

copy admin_voting.php to /phpbb_root/admin/admin_voting.php
copy admin_voting_body.tpl to /phpbb_root/templates/subSilver/admin/admin_voting_body.tpl
copy lang_admin_voting.php to /phpbb_root/language/lang_english/lang_admin_voting.php
copy admin_voting_icon.gif to /phpbb_root/templates/subSilver/images/admin_voting_icon.gif


Can you help me please?

ThorstenE

what does this phpbb-hack do? is it something like SMF's Karma?

allymcbeal

I don't know how is karma, because in my old forum I don't have it.
This hack register the name of user who vote in a poll, not what they have vote, but only the users name.
Is because some user register itself twice only for vote.

Advertisement: