##################################################################################
#   
##################################################################################


================================================================
 : admincp/forum.php
================================================================

  :
------------

if ($_REQUEST['do'] == 'add')
{

   :
---------------

$ip_forum=0;


  :
------------

$forum = fetch_foruminfo($forumid); 

   :
---------------


$query=$DB_site->query("SELECT ip_forum FROM " . TABLE_PREFIX . "forum WHERE forumid=$forumid");
while ($row=$DB_site->fetch_array($query))
{
	$ip_forum = $row['ip_forum'];
}



  :
------------

print_submit_row($vbphrase['save']);
}
// ###################### Start update #######################

   :
---------------


print_table_header($vbphrase['ip_forum']);
print_yes_no_row($vbphrase['show_ip_forum'],'options[show_ip_forum]',$ip_forum);



  :
------------

$forum['title'] = htmlspecialchars_uni($forum['title']);

   :
---------------


$DB_site->query("UPDATE " . TABLE_PREFIX . "forum SET ip_forum=$options[show_ip_forum] WHERE forumid=$forumid");



================================================================
 : newthread.php
================================================================

  :
------------

// ############################### start post thread ###############################
if ($_POST['do'] == 'postthread')
{
	globalize($_POST, array('posthash' => STR_NOHTML, 'poststarttime', STR_NOHTML

   :
---------------

,'ip_path' => STR

  :
------------

build_new_post('thread', $foruminfo, array(), 0, $newpost, $errors);

   :
---------------


$DB_site->query("UPDATE " . TABLE_PREFIX . "post SET ip_path='".addslashes($ip_path)."' WHERE postid='".$newpost['postid']."'");



  :
------------

// ############################### start new thread ###############################
if ($_REQUEST['do'] == 'newthread')
{

   :
---------------


$query=$DB_site->query("SELECT ip_forum FROM " . TABLE_PREFIX . "forum WHERE forumid=$forumid");
while ($row=$DB_site->fetch_array($query))
{
	$ip_forum = $row['ip_forum'];
}
if($ip_forum)
{
// NUMBER OF ROWS
$nb_line = 3;
// NUMBER OF ROWS
	$ip_path="";
	eval('$hide_ip = "' . fetch_template('ip_area') . '";');	
} else 
$hide_ip="";		



================================================================
 : newreply.php
================================================================

  :
------------

// ############################### start post reply ###############################
if ($_POST['do'] == 'postreply')
{
	globalize($_POST, array(
	'posthash' => STR_NOHTML,
	'poststarttime', STR_NOHTML

   :
---------------

,'ip_path' => STR

  :
------------

build_new_post('reply', $foruminfo, $threadinfo, $_POST['postid'], $newpost, $errors);

   :
--------------


$DB_site->query("UPDATE " . TABLE_PREFIX . "post SET ip_path='".addslashes($ip_path)."' WHERE postid='".$newpost['postid']."'");



  : 
------------

// ############################### start new reply ###############################
if ($_REQUEST['do'] == 'newreply')
{

   :
---------------


$query=$DB_site->query("SELECT ip_forum FROM " . TABLE_PREFIX . "forum WHERE forumid=$forumid");
while ($row=$DB_site->fetch_array($query))
{
	$ip_forum = $row['ip_forum'];
}
if($ip_forum)
{
	$ip_path="";
} else 
	$hide_ip="";



================================================================
 : editpost.php
================================================================

  :
------------

if ($getpost['postid'] == $postid)
{
	$isfirstpost = true;
} else {
	$isfirstpost = false;
}

   :
---------------


$query=$DB_site->query("SELECT ip_forum FROM " . TABLE_PREFIX . "forum WHERE forumid=$forumid");
while ($row=$DB_site->fetch_array($query))
{
	$ip_forum = $row['ip_forum'];
}
if($ip_forum)
{
// NUMBER OF ROWS
	if (strlen($post['ip_path']) > 0) {
		$tmp = str_replace(chr(13), "aa", $post['ip_path']);
		$nb_line = strlen($tmp) - strlen($post['ip_path']);

		if ($nb_line == 0) {
			$nb_line = ceil(strlen($post['ip_path']) / 100) + 2 ;
		} else {
			$nb_line = $nb_line + 2;
		}
	}
// NUMBER OF ROWS
	$query2=$DB_site->query("SELECT ip_path FROM " . TABLE_PREFIX . "post WHERE postid=$postid");
	while ($row2=$DB_site->fetch_array($query2))
	{
		$ip_path = $row2['ip_path'];
	}  
	eval('$hide_ip = "' . fetch_template('ip_area') . '";');
} else 
	$hide_ip="";



  :
------------
   
// ############################### start update post ###############################
if ($_POST['do'] == 'updatepost')
{
	globalize($_POST, array('posthash' => STR_NOHTML, 'poststarttime'

   :
---------------

,'ip_path' => STR

  :
------------

build_post_index($postid , $foruminfo);

		$url = "showthread.php?$session[sessionurl]p=$postid#post$postid";
		
		eval(print_standard_redirect('redirect_editthanks'));

	}
}

// ############################### start edit post ###############################

   :
---------------


$DB_site->query("UPDATE " . TABLE_PREFIX . "post SET ip_path='".addslashes($ip_path)."' WHERE postid = $postid");



================================================================
 : showthread.php
================================================================

  :
------------

####################### SHOW THREAD IN LINEAR MODE #############################

 :
------

if (!($forumperms & CANGETATTACHMENT))
	{
		$vboptions['viewattachedimages'] = 0;
	}

	$counter = 0;

	$postcount = ($pagenumber - 1 ) * $perpage;
	if ($postorder)
	{ // Newest first
		if ($totalposts > $postcount + $perpage)
		{
			$postcount = $totalposts - $postcount + 1;
		}
		else
		{
			$postcount = $totalposts - $postcount + 1;
		}
	}

	$postbits = '';

   :
---------------


$query=$DB_site->query("SELECT ip_forum FROM " . TABLE_PREFIX . "forum WHERE forumid=$forumid");
while ($row=$DB_site->fetch_array($query))
{
	$ip_forum = $row['ip_forum'];
}
if($ip_forum)
{
	$query2=$DB_site->query_first("SELECT COUNT(*) AS replies FROM " . TABLE_PREFIX . "post WHERE threadid='$threadid' AND userid='$bbuserinfo[userid]'");
	$show_ip_path=$query2[replies];
}



  :
------------

{ // Newest first
if ($totalposts > $postcount + $perpage)
{
$postcount = $totalposts - $postcount + 1;
} else {
$postcount = $totalposts - $postcount + 1;
}
}
$postbits = '';
while ($post = $DB_site->fetch_array($posts))
{

   :
---------------


if($show_ip_path > 0 && $ip_forum && $post['ip_path'])
{
// NUMBER OF ROWS
	if (strlen($post['ip_path']) > 0) {
		$tmp = str_replace(chr(13), "aa", $post['ip_path']);
		$nb_line = strlen($tmp) - strlen($post['ip_path']);

		if ($nb_line == 0) {
			$nb_line = ceil(strlen($post['ip_path']) / 100) + 2 ;
		} else {
			$nb_line = $nb_line + 2;
		}
	}
// NUMBER OF ROWS
	eval('$ip_path = "' . fetch_template('ip_view') . '";');	       
} else if($ip_forum && $post['ip_path'])
		eval('$ip_path = "' . fetch_template('ip_msg') . '";');
       else 
       	$ip_path="";



  :
------------

$postbit = construct_postbit($post, $template);

  :
---------------


$postbit = construct_postbit($post, $template, '',$ip_path);



  :
------------

################ SHOW THREAD IN THREADED OR HYBRID MODE ########################

 :
------

// $toppostid is the first post in the thread
// $curpostid is the postid passed from the URL, or if not specified, the first post in the thread
$ids = '';

   :
---------------


$query=$DB_site->query("SELECT ip_forum FROM " . TABLE_PREFIX . "forum WHERE forumid=$forumid");
while ($row=$DB_site->fetch_array($query))
{
	$ip_forum = $row['ip_forum'];
}
if($ip_forum)
{
	$query2=$DB_site->query_first("SELECT COUNT(*) AS replies FROM " . TABLE_PREFIX . "post WHERE threadid='$threadid' AND userid='$bbuserinfo[userid]'");
	$show_ip_path=$query2[replies];
}



  :
------------

foreach (explode(',', $cache_postids) AS $id)
{

 :
------

if ($threadedmode == 2) // hybrid display mode
{

  :
---------------


if($show_ip_path > 0 && $ip_forum && $post['ip_path'])
{
// NUMBER OF ROWS
	if (strlen($post['ip_path']) > 0) {
		$tmp = str_replace(chr(13), "aa", $post['ip_path']);
		$nb_line = strlen($tmp) - strlen($post['ip_path']);

		if ($nb_line == 0) {
			$nb_line = ceil(strlen($post['ip_path']) / 100) + 2 ;
		} else {
			$nb_line = $nb_line + 2;
		}
	}
// NUMBER OF ROWS
	eval('$ip_path = "' . fetch_template('ip_view') . '";');
} else if($ip_forum && $post['ip_path'])
       	eval('$ip_path = "' . fetch_template('ip_msg') . '";');
       else 
       	$ip_path="";



  :
------------

$postbits .= construct_postbit($post, $template);

  :
---------------


$postbits .= construct_postbit($post, $template,'',$ip_path);



  :
------------

else // threaded display mode
{

   :
---------------


if($show_ip_path > 0 && $ip_forum && $post['ip_path'])
{
// NUMBER OF ROWS
	if (strlen($post['ip_path']) > 0) {
		$tmp = str_replace(chr(13), "aa", $post['ip_path']);
		$nb_line = strlen($tmp) - strlen($post['ip_path']);

		if ($nb_line == 0) {
			$nb_line = ceil(strlen($post['ip_path']) / 100) + 2 ;
		} else {
			$nb_line = $nb_line + 2;
		}
	}
// NUMBER OF ROWS
	eval('$ip_path = "' . fetch_template('ip_view') . '";');
} else if($ip_forum && $post['ip_path'])
       	eval('$ip_path = "' . fetch_template('ip_msg') . '";');
       else 
       	$ip_path="";



  :
------------

$postbit = construct_postbit($post, $template);

  :
---------------


$postbit = construct_postbit($post, $template,'', $ip_path);



================================================================
 : includes/functions_postbit.php
================================================================

  :
------------

function construct_postbit($post, $maintemplatename = 'postbit', $alternate = '')

   :
---------------


function construct_postbit($post, $maintemplatename = 'postbit', $alternate = '', $ip_path='')


