Can you tell me what this code is missing?

Can you tell me what this code says, and if this code makes sense and if it is missing something?

else if ($page == 'category') {
    if (!empty($_GET['id'])) {
        if (in_array($_GET['id'], array_keys($categories))) {
            $pt->page_url_ = $pt->config->site_url.'/videos/'.$page.'/'.$_GET['id'].'?page_id='.$pt->page_number;
            $cateogry = PT_Secure($_GET['id']);
            $title    = $categories[$cateogry];
            $cateogry_id = "data-category='$cateogry'";

           if (!empty($_GET['sub_id'])) {
                 $is_found = $db->where('type',PT_Secure($_GET['id']))->where('lang_key',PT_Secure($_GET['sub_id']))->getValue(T_LANGS,'COUNT(*)');

               if ($is_found > 0) {

                    $pt->page_url_ = $pt->config->site_url.'/videos/'.$page.'/'.$_GET['id'].'/'.$_GET['sub_id'].'?page_id='.$pt->page_number;

                    $db->where('sub_category', PT_Secure($_GET['sub_id']));

if (!empty($_POST['search_value'])) {
	$search_value = PT_Secure($_POST['sub_id']);
		$search_result = $db->rawQuery("SELECT * FROM " . T_VIDEOS . " WHERE title LIKE '%$search_value%' OR tags LIKE '%$search_value%' OR description LIKE '%$search_value%') AND sub_category LIKE '%$sub_id%' ");
	  if (!empty($search_result)) {
		$html = '';
		foreach ($search_result as $key => $search) {
			$search = PT_GetVideoByID($search, 0, 0, 0);
			$html .= "<div class='search-result'><a href='$search->url'>$search->sub_category</a></div>";
		}
		$data = array('status' => 200, 'html' => $html);
	}
	}
    }
    }

I look forward to any assistance

It’s missing an explanation of what you want it to do, and what it’s doing instead. And some formatting, and an initial if block.

2 Likes
Sponsor our Newsletter | Privacy Policy | Terms of Service