Mistři v programování na #hovnokod

function PagerStarter( $object_id, $object_url, $dbt, $maxwidth, $edittime, $level_step, $comments_per_page )
{
	if ( $_GET['from'] ) { $from = $_GET['from']; }
	if ( $_POST['from'] ) { $from = $_POST['from']; }
	if ( $_GET['current_page'] ) { $current_page = $_GET['current_page']; }
	if ( $_POST['current_page'] ) { $current_page = $_POST['current_page']; }
	if ( ( empty( $current_page ) == TRUE ) && ( empty( $from ) == TRUE ) )
		{
		$r = mysql_query( "SELECT * FROM ".$dbt." WHERE parent = '1' AND parent_image = '$object_id'".$e."" );
		$r_count = mysql_num_rows ( $r );
		$total_pages = 0;
		$i = 0;
		while ( $i < $r_count )
			{
			$total_pages = $total_pages + 1;
			$i = $i + $comments_per_page;
			}
		if ( $total_pages == 0 )
			{
			$total_pages = 1;
			}
		for ( $i = 1 ; $i <= $total_pages ; $i++ )
			{
			$from_q = ( $i * $comments_per_page ) - $comments_per_page + 0;
			}
		$_GET['current_page'] = $total_pages;
		$_GET['from'] = $from_q;
		}
}

Anonymous,