예제 #1
0
/**
 * Generate a List of Addon submitted by a member, you will need memberid/userid
 */
function addonList()
{
    global $url_params;
    if (isset($url_params['authorid'])) {
        $addon = new Addon();
        $limit = isset($url_params['limit']) ? checkResultLimit($url_params['limit']) : default_result_limit;
        $data = $addon->getAddonListByMember($url_params['authorid'], $limit);
        printJson(json_encode($data));
    }
}
예제 #2
0
 if (is_int($_GET['id']) || ctype_digit($_GET['id'])) {
     $params = array_filter($params);
     array_shift($params);
     //"addons" from the array as we already know the page name
     $addon_data = $addon->getAddonData($_GET['id']);
     $type_blob = array_key_exists($addon_data['category'], $mb['main_menu']['add-ons']['sub_menu']) ? $mb['main_menu']['add-ons']['sub_menu'][$addon_data['category']]['title'] : $addon_data['category'];
     if ($addon_data == null) {
         header("HTTP/1.0 404 Not Found");
         include $link['404'];
         exit;
     }
     //checks the url parameter and try to match the addon title, if the addon id matches but not the title, then do a 301 redirect
     if (count($params) <= 3 && (urldecode($params[2]) != Format::Slug($addon_data['addon_title']) || urldecode($params[0]) != Format::Slug($type_blob))) {
         header("Location: " . $link['addon']['home'] . Format::Slug($type_blob) . '/' . $addon_data['ID_ADDON'] . "/" . Format::Slug($addon_data['addon_title']) . "/", 301);
     }
     $from_author = $addon->getAddonListByMember($addon_data['ID_AUTHOR'], 5);
     // var_dump($addon_data);
     include_once $link['root'] . 'views/addons.selected.template.php';
     exit;
 } elseif ($_GET['id'] == "s") {
     //remove the ? sign from the string and convert the url paramenter into an array
     parse_str(str_replace("?", "", $params[3]), $url_params);
     //Just to be safe, we will check if the url contains type and order parameter otherwise initialize the default value for them
     $url_params['type'] = isset($url_params['type']) ? Format::htmlSafeOutput($url_params['type']) : "all";
     //get the addon type,result order,if any search query from the get request
     $data['type'] = Format::UnslugTxt(htmlspecialchars($url_params['type'], ENT_QUOTES, "UTF-8"));
     $data['is_overview'] = isset($url_params['overview']) ? true : false;
     if (isset($url_params['q'])) {
         if (!empty($url_params['q'])) {
             $searchinput['query'] = htmlspecialchars(trim($url_params['q']), ENT_QUOTES, "UTF-8");
         } else {