0 ) { ?> Build Thread, Page : 1 ) { printf ( "  <<  " ); } $l_pages = $l_total_pages; if ( $l_pages > ( $l_start_page + 10 ) ) { $l_pages = $l_start_page + 10; } for ( $l_temp = $l_start_page; $l_temp <= $l_pages; $l_temp += 1 ) { $l_offset = ( $l_temp - 1 ) * $l_posts_per_page; $l_marker1 = ' '; $l_marker2 = ' '; if ( $l_offset == $l_recent_start ) { $l_marker1 = '['; $l_marker2 = ']'; } printf ( " %s %d %s ", $l_offset, $l_marker1, $l_temp, $l_marker2 ); } if ( $l_temp < ( $l_result_count / $l_posts_per_page ) ) { printf ( "  >>  ", $l_result_count - $l_posts_per_page ); } ?> ( posts, posts per page, pages in total) 0 ) { $l_temp = $l_recent_start - $l_posts_per_page; if ( $l_temp < 0 ) $l_temp = 0; printf ( "[ < Prev ] ", $l_temp ); } $l_pages = floor ( $l_result_count / $l_posts_per_page ); $l_temp = $l_recent_start + $l_posts_per_page; if ( $l_temp <= ( $l_pages * $l_posts_per_page ) ) { printf ( "[ Next > ] ", $l_temp ); } ?> 0 ) { $l_base_url = $l_base_url . "&p_aircraft_id=$p_aircraft_id"; } if ( $p_user_id > 0 ) { $l_base_url = $l_base_url . "&p_user_id=$p_user_id"; } $l_connection = new mysqli($c_db_hostname, $c_db_username, $c_db_password, $c_db_database); $l_sql = "select \"i\" type, i.id image_id, u.id user_id, u.username, i.comment, " . " DATE_FORMAT(i.date_added, '%d %b %y %H:%i' ) as date_added, i.date_added date_order, a.name, m.name manufacturer_name ". "from user_aircraft_images i, user_aircraft ua, aircraft a, " . " user u, image_category ic, manufacturer m " . "where ua.id = i.user_aircraft_id " . "and a.id = ua.aircraft_id " . "and u.id = ua.user_id " . "and m.id = a.manufacturer_id " . "and ic.id = i.image_category_id " . "and i.status = 1 " . "and u.id = $p_user_id " . "and a.id = $p_aircraft_id " . "union " . "select \"c\" type, ic.user_aircraft_image_id image_id, ic.user_id, u.username, ic.comment, " . " DATE_FORMAT(ic.date_added, '%d %b %y %H:%i' ) as date_added, ic.date_added date_order, a.name, m.name manufacturer_name " . "from user_aircraft ua, aircraft a, user_aircraft_images uai, image_comment ic, manufacturer m, user u " . "where a.id = $p_aircraft_id ". "and ua.user_id = $p_user_id " . "and ua.aircraft_id = a.id ". "and ua.status = 1 " . "and a.status = 1 " . "and ic.status = 1 " . "and uai.user_aircraft_id = ua.id " . "and ic.user_aircraft_image_id = uai.id " . "and m.id = a.manufacturer_id " . "and u.id = ic.user_id " . "order by date_order desc"; $l_result = $l_connection -> query ( $l_sql ) or die ( "Unble to read thread." ); $l_result_count = $l_result -> num_rows; $l_result -> data_seek ($l_recent_start); $l_posts_per_page = 20; $l_image_dir = "/user_aircraft_images"; ?> fetch_array(MYSQLI_ASSOC) ) ) { //$l_aircraft_id = $l_row [ 'aircraft_id' ]; $l_aircraft_model = $l_row [ 'name' ]; $l_manufacturer_name = $l_row [ 'manufacturer_name' ]; $l_user_id = $l_row [ 'user_id' ]; $l_username = $l_row [ 'username' ]; $l_date_added = $l_row [ 'date_added' ]; $l_image_id = $l_row [ 'image_id' ]; $l_image_comment = $l_row [ 'comment' ]; $l_type = $l_row [ 'type' ]; $l_image_comment = clickable_link ( $l_image_comment ); if ( $l_type == "i" ) { echo ( "" ); echo ( "" ); echo ( "" ); } else { echo ( "" ); echo ( "" ); echo ( "" ); } echo ( "\n" ); $l_counter = $l_counter + 1; } display_browse_bar (); ?>
Add Comment

$l_username, Image # $l_image_id$l_date_added
" . "
$l_image_comment
$l_username, Comment for image # $l_image_id$l_date_added
$l_image_comment