IP-address in topic for phpBB3

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Locked
rxu
Extensions Development Team
Posts: 3388
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: IP-address in topic for phpBB3

Post by rxu »

That's weird. You're using prosilver/subsilver2 for sure and have nothing about IP in viewtopic in both of them?
envirolink
Registered User
Posts: 50
Joined: Mon Jun 09, 2003 3:07 am
Contact:

Re: IP-address in topic for phpBB3

Post by envirolink »

Correct.
rxu
Extensions Development Team
Posts: 3388
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: IP-address in topic for phpBB3

Post by rxu »

Could you pastebin (or show me in any other way) your edited viewtopic.php and one of viewtopic_body.html?
envirolink
Registered User
Posts: 50
Joined: Mon Jun 09, 2003 3:07 am
Contact:

Re: IP-address in topic for phpBB3

Post by envirolink »

From viewtopic.php:

Code: Select all

			if ($user->data['is_registered'])
			{
				$sql_ary = array(
					'topic_id'			=> (int) $topic_id,
					'poll_option_id'	=> (int) $option,
					'vote_user_id'		=> (int) $user->data['user_id'],
					'vote_user_ip'		=> (string) $user->ip,
				);

				$sql = 'INSERT INTO ' . POLL_VOTES_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary);
				$db->sql_query($sql);
			}
From viewtopic_body.html in SubSilver2:

Code: Select all

				<span class="postdetails">
					<!-- IF postrow.POSTER_JOINED --><br /><b>{L_JOINED}:</b> {postrow.POSTER_JOINED}<!-- ENDIF -->
					<!-- IF postrow.POSTER_POSTS != '' --><br /><b>{L_POSTS}:</b> {postrow.POSTER_POSTS}<!-- ENDIF -->
					<!-- IF postrow.POSTER_FROM --><br /><b>{L_LOCATION}:</b> {postrow.POSTER_FROM}<!-- ENDIF -->
					<!-- IF postrow.POSTER_IP --><br /><b>{L_IP}:</b> {postrow.POSTER_IP}<!-- ENDIF -->

					<!-- IF postrow.S_PROFILE_FIELD1 -->
						<!-- Use a construct like this to include admin defined profile fields. Replace FIELD1 with the name of your field. -->
						<br /><b>{postrow.PROFILE_FIELD1_NAME}:</b> {postrow.PROFILE_FIELD1_VALUE}
					<!-- ENDIF -->

					<!-- BEGIN custom_fields -->
						<br /><b>{postrow.custom_fields.PROFILE_FIELD_NAME}:</b> {postrow.custom_fields.PROFILE_FIELD_VALUE}
					<!-- END custom_fields -->
				</span>
rxu
Extensions Development Team
Posts: 3388
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: IP-address in topic for phpBB3

Post by rxu »

envirolink
Could you give all the edited (as per the MOD installation instruction) parts of viewtopic.php? I mean the places (and around them) containing the following strings:

Code: Select all

		'poster_ip'			=> $row['poster_ip'],

Code: Select all

		'POSTER_IP'			=> (($auth->acl_get('a_') || $auth->acl_get('m_')) && $user->data['is_registered']) ? $row['poster_ip'] : '',
envirolink
Registered User
Posts: 50
Joined: Mon Jun 09, 2003 3:07 am
Contact:

Re: IP-address in topic for phpBB3

Post by envirolink »

Sorry, I have no idea what the heck I posted in that last one! Here's the correct parts:

Code: Select all

	$rowset[$row['post_id']] = array(
		'hide_post'			=> ($row['foe'] && ($view != 'show' || $post_id != $row['post_id'])) ? true : false,

		'post_id'			=> $row['post_id'],
		'post_time'			=> $row['post_time'],
		'user_id'			=> $row['user_id'],
		'username'			=> $row['username'],
		'user_colour'		=> $row['user_colour'],
		'topic_id'			=> $row['topic_id'],
		'forum_id'			=> $row['forum_id'],
		'post_subject'		=> $row['post_subject'],
		'post_edit_count'	=> $row['post_edit_count'],
		'post_edit_time'	=> $row['post_edit_time'],
		'post_edit_reason'	=> $row['post_edit_reason'],
		'post_edit_user'	=> $row['post_edit_user'],
		'poster_ip'			=> $row['poster_ip'],

		// Make sure the icon actually exists
		'icon_id'			=> (isset($icons[$row['icon_id']]['img'], $icons[$row['icon_id']]['height'], $icons[$row['icon_id']]['width'])) ? $row['icon_id'] : 0,
		'post_attachment'	=> $row['post_attachment'],
		'post_approved'		=> $row['post_approved'],
		'post_reported'		=> $row['post_reported'],
		'post_username'		=> $row['post_username'],
		'post_text'			=> $row['post_text'],
		'bbcode_uid'		=> $row['bbcode_uid'],
		'bbcode_bitfield'	=> $row['bbcode_bitfield'],
		'enable_smilies'	=> $row['enable_smilies'],
		'enable_sig'		=> $row['enable_sig'],
		'friend'			=> $row['friend'],
		'foe'				=> $row['foe'],
	);

Code: Select all

		'U_REPORT'			=> ($auth->acl_get('f_report', $forum_id)) ? append_sid("{$phpbb_root_path}report.$phpEx", 'f=' . $forum_id . '&p=' . $row['post_id']) : '',
		'U_MCP_REPORT'		=> ($auth->acl_get('m_report', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=reports&mode=report_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '',
		'U_MCP_APPROVE'		=> ($auth->acl_get('m_approve', $forum_id)) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=queue&mode=approve_details&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '',
		'U_MINI_POST'		=> append_sid("{$phpbb_root_path}viewtopic.$phpEx", 'p=' . $row['post_id']) . (($topic_data['topic_type'] == POST_GLOBAL) ? '&f=' . $forum_id : '') . '#p' . $row['post_id'],
		'U_NEXT_POST_ID'	=> ($i < $i_total && isset($rowset[$post_list[$i + 1]])) ? $rowset[$post_list[$i + 1]]['post_id'] : '',
		'U_PREV_POST_ID'	=> $prev_post_id,
		'U_NOTES'			=> ($auth->acl_getf_global('m_')) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=notes&mode=user_notes&u=' . $poster_id, true, $user->session_id) : '',
		'U_WARN'			=> ($auth->acl_get('m_warn') && $poster_id != $user->data['user_id'] && $poster_id != ANONYMOUS) ? append_sid("{$phpbb_root_path}mcp.$phpEx", 'i=warn&mode=warn_post&f=' . $forum_id . '&p=' . $row['post_id'], true, $user->session_id) : '',

		'POST_ID'			=> $row['post_id'],
		'POSTER_ID'			=> $poster_id,
		'POSTER_IP'			=> (($auth->acl_get('a_') || $auth->acl_get('m_')) && $user->data['is_registered']) ? $row['poster_ip'] : '',

		'S_HAS_ATTACHMENTS'	=> (!empty($attachments[$row['post_id']])) ? true : false,
		'S_POST_UNAPPROVED'	=> ($row['post_approved']) ? false : true,
		'S_POST_REPORTED'	=> ($row['post_reported'] && $auth->acl_get('m_report', $forum_id)) ? true : false,
		'S_DISPLAY_NOTICE'	=> $display_notice && $row['post_attachment'],
		'S_FRIEND'			=> ($row['friend']) ? true : false,
		'S_UNREAD_POST'		=> $post_unread,
		'S_FIRST_UNREAD'	=> $s_first_unread,
		'S_CUSTOM_FIELDS'	=> (isset($cp_row['row']) && sizeof($cp_row['row'])) ? true : false,
		'S_TOPIC_POSTER'	=> ($topic_data['topic_poster'] == $poster_id) ? true : false,

		'S_IGNORE_POST'		=> ($row['hide_post']) ? true : false,
		'L_IGNORE_POST'		=> ($row['hide_post']) ? sprintf($user->lang['POST_BY_FOE'], get_username_string('full', $poster_id, $row['username'], $row['user_colour'], $row['post_username']), '<a href="' . $viewtopic_url . "&p={$row['post_id']}&view=show#p{$row['post_id']}" . '">', '</a>') : '',
rxu
Extensions Development Team
Posts: 3388
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: IP-address in topic for phpBB3

Post by rxu »

Strange thing. Code looks ok.
Only thoughts are:
1) you don't have administrator or moderator (or both) permissions (sounds stupid, yep? :lol: )
2) you're trying to see IP addresses as a guest (not logged in, similar to point 1 :) ),
3) the last way is to try to delete tpl_prosilver_viewtopic_body.html.php and tpl_subsilver2_viewtopic_body.html.php directly from /cache folder.

If it won't be helpful, I'll have to take a lot of time to think more :P
envirolink
Registered User
Posts: 50
Joined: Mon Jun 09, 2003 3:07 am
Contact:

Re: IP-address in topic for phpBB3

Post by envirolink »

rxu wrote:Strange thing. Code looks ok.
Only thoughts are:
1) you don't have administrator or moderator (or both) permissions (sounds stupid, yep? :lol: )
2) you're trying to see IP addresses as a guest (not logged in, similar to point 1 :) ),
This is a partial screenshot that shows me (in red) logged in as an Administrator:
Image
3) the last way is to try to delete tpl_prosilver_viewtopic_body.html.php and tpl_subsilver2_viewtopic_body.html.php directly from /cache folder.
I did this, double and triple checked at the filesystem level that the cache was in fact completely cleared... same result.
If it won't be helpful, I'll have to take a lot of time to think more :P
I'm sorry to say this, but... :?
rxu
Extensions Development Team
Posts: 3388
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: IP-address in topic for phpBB3

Post by rxu »

Well... Let's check all the possible and impossible versions :|
Any chance poster_ip field is empty in POSTS_TABLE?
envirolink
Registered User
Posts: 50
Joined: Mon Jun 09, 2003 3:07 am
Contact:

Re: IP-address in topic for phpBB3

Post by envirolink »

rxu wrote:Well... Let's check all the possible and impossible versions :|
Any chance poster_ip field is empty in POSTS_TABLE?
There are definitely IP addresses as values in poster_ip
rxu
Extensions Development Team
Posts: 3388
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: IP-address in topic for phpBB3

Post by rxu »

Can you run a test, if you don't mind?
Try to replace

Code: Select all

'POSTER_IP'         => (($auth->acl_get('a_') || $auth->acl_get('m_')) && $user->data['is_registered']) ? $row['poster_ip'] : '',
to

Code: Select all

'POSTER_IP'         => ($user->data['user_id'] == 3) ? $row['poster_ip'] : '',
envirolink
Registered User
Posts: 50
Joined: Mon Jun 09, 2003 3:07 am
Contact:

Re: IP-address in topic for phpBB3

Post by envirolink »

Did that, cleared the cache (made sure that it was by manually checking the filesystem) and then looked and nothing has changed with any of my users' posts. I created a new topic and then looked, still nothing. I also checked and my phpBB3 installation is the most current. I'm more than happy to continue working with you on fixing this, as it is a feature I would really like to see happen. I have no idea what could be different about my board than others... your mod is the first that I have attempted to install, so there can't be conflicts with others.
ever-fresh
Registered User
Posts: 177
Joined: Fri Nov 16, 2007 2:48 pm
Location: Dubai, United Arab Emirates.
Contact:

Re: IP-address in topic for phpBB3

Post by ever-fresh »

rxu wrote:No, but here you are if you need ;)
Just replace the appropriate MOD code (when installed) in according to the the following instruction

Code: Select all

#
#-----[ OPEN ]------------------------------------------
#
viewtopic.php
#
#-----[ FIND ]------------------------------------------
#
				'from'			=> (!empty($row['user_from'])) ? $row['user_from'] : '',
#
#-----[ FIND ]------------------------------------------
#
				'ip'			=> $row['poster_ip'],
#
#-----[ REPLACE WITH ]------------------------------------------


#
				'ip'			=> ($row['user_type'] == USER_FOUNDER) ? '' : $row['poster_ip'],
do i replace the above 2 lines with this code:

Code: Select all

'ip'			=> ($row['user_type'] == USER_FOUNDER) ? '' : $row['poster_ip'],
do you means i replace this code 2 times with about 2 codes ?
thankyou.
rxu
Extensions Development Team
Posts: 3388
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: IP-address in topic for phpBB3

Post by rxu »

ever-fresh wrote:do you means i replace this code 2 times with about 2 codes ?
No, just the last one.
ever-fresh
Registered User
Posts: 177
Joined: Fri Nov 16, 2007 2:48 pm
Location: Dubai, United Arab Emirates.
Contact:

Re: IP-address in topic for phpBB3

Post by ever-fresh »

but thers is not any code like this:

Code: Select all

            'ip'         => $row['poster_ip'],
i only can see this code about IP:

Code: Select all

'poster_ip'			=> $row['poster_ip'],
do u mean i only replace this code with you provided to replace ?

thankyou.
Locked

Return to “[3.0.x] MOD Database Releases”