• Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

PHP Can you tell me what this code is missing?

chrisj

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

PHP:
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
 
Top