| 1 | <?xml version="1.0" encoding="utf-8"?>
|
|---|
| 2 |
|
|---|
| 3 | <extension engine="1.0">
|
|---|
| 4 | <id>download</id>
|
|---|
| 5 | <title>Download</title>
|
|---|
| 6 | <version>1.1</version>
|
|---|
| 7 | <description>Download system.</description>
|
|---|
| 8 | <author>Daris</author>
|
|---|
| 9 | <minversion>1.3</minversion>
|
|---|
| 10 | <maxtestedon>1.3.2</maxtestedon>
|
|---|
| 11 | <install><![CDATA[
|
|---|
| 12 | require_once FORUM_ROOT.'extensions/download/install.php';
|
|---|
| 13 | install();
|
|---|
| 14 |
|
|---|
| 15 | ]]></install>
|
|---|
| 16 | <uninstall><![CDATA[
|
|---|
| 17 | require_once FORUM_ROOT.'extensions/download/install.php';
|
|---|
| 18 | uninstall();
|
|---|
| 19 |
|
|---|
| 20 | ]]></uninstall>
|
|---|
| 21 | <hooks>
|
|---|
| 22 |
|
|---|
| 23 | <hook id="re_rewrite_rules"><![CDATA[
|
|---|
| 24 | // Setup the URL rewriting scheme
|
|---|
| 25 | if (file_exists($ext_info['path'].'/include/url/'.$forum_config['o_sef'].'/rewrite_rules.php'))
|
|---|
| 26 | require $ext_info['path'].'/include/url/'.$forum_config['o_sef'].'/rewrite_rules.php';
|
|---|
| 27 | else
|
|---|
| 28 | require $ext_info['path'].'/include/url/Default/rewrite_rules.php';
|
|---|
| 29 | ]]></hook>
|
|---|
| 30 |
|
|---|
| 31 | <hook id="co_modify_url_scheme"><![CDATA[
|
|---|
| 32 | if (file_exists($ext_info['path'].'/include/url/'.$forum_config['o_sef'].'/forum_urls.php'))
|
|---|
| 33 | require $ext_info['path'].'/include/url/'.$forum_config['o_sef'].'/forum_urls.php';
|
|---|
| 34 | else
|
|---|
| 35 | require $ext_info['path'].'/include/url/Default/forum_urls.php';
|
|---|
| 36 | ]]></hook>
|
|---|
| 37 |
|
|---|
| 38 | <hook id="hd_head"><![CDATA[
|
|---|
| 39 | if (FORUM_PAGE == 'download')
|
|---|
| 40 | $forum_head['style_download'] = '<link rel="stylesheet" type="text/css" media="screen" href="'. $ext_info['url'].'/style/style.css" />';
|
|---|
| 41 | ]]></hook>
|
|---|
| 42 |
|
|---|
| 43 | <hook id="hd_alert"><![CDATA[
|
|---|
| 44 |
|
|---|
| 45 | // Fetch list of downloads
|
|---|
| 46 | $query_down = array(
|
|---|
| 47 | 'SELECT' => 'count(d.id)',
|
|---|
| 48 | 'FROM' => 'downloads AS d',
|
|---|
| 49 | 'WHERE' => 'd.approved=0',
|
|---|
| 50 | );
|
|---|
| 51 |
|
|---|
| 52 | ($hook = get_hook('xn_portal_by_daris_nw_qr_get_news')) ? eval($hook) : null;
|
|---|
| 53 | $result_down = $forum_db->query_build($query_down) or error(__FILE__, __LINE__);
|
|---|
| 54 |
|
|---|
| 55 | $new_files = $forum_db->result($result_down);
|
|---|
| 56 | if ($new_files > 0)
|
|---|
| 57 | {
|
|---|
| 58 | // Load portal.php language file
|
|---|
| 59 | if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'/download.php'))
|
|---|
| 60 | require_once $ext_info['path'].'/lang/'.$forum_user['language'].'/download.php';
|
|---|
| 61 | else
|
|---|
| 62 | require_once $ext_info['path'].'/lang/English/download.php';
|
|---|
| 63 |
|
|---|
| 64 | $admod_links['new_downloads'] = '<span id="new-downloads"><a href="'.$ext_info['url'].'/admin/download.php'.'"><strong>'.sprintf($lang_download['New downloads'], $new_files).'</strong></a></span>';
|
|---|
| 65 | }
|
|---|
| 66 | ]]></hook>
|
|---|
| 67 |
|
|---|
| 68 | <hook id="in_start"><![CDATA[
|
|---|
| 69 | if (isset($_GET['download']) )
|
|---|
| 70 | require $ext_info['path'].'/download.php';
|
|---|
| 71 | ]]></hook>
|
|---|
| 72 |
|
|---|
| 73 | <!--zmieniona nazwa hooka-->
|
|---|
| 74 | <hook id="fn_generate_navlinks_end_"><![CDATA[
|
|---|
| 75 | global $lang_download;
|
|---|
| 76 |
|
|---|
| 77 | // Load portal.php language file
|
|---|
| 78 | if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'/download.php'))
|
|---|
| 79 | require_once $ext_info['path'].'/lang/'.$forum_user['language'].'/download.php';
|
|---|
| 80 | else
|
|---|
| 81 | require_once $ext_info['path'].'/lang/English/download.php';
|
|---|
| 82 |
|
|---|
| 83 | array_insert($links, 2, '<li id="navdownload"'.((FORUM_PAGE == 'download') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['download']).'"><span>'.$lang_download['Downloads'].'</span></a></li>', 'download');
|
|---|
| 84 |
|
|---|
| 85 | ]]></hook>
|
|---|
| 86 |
|
|---|
| 87 | <hook id="ca_fn_generate_admin_menu_new_sublink"><![CDATA[
|
|---|
| 88 |
|
|---|
| 89 | if (FORUM_PAGE_SECTION == 'start')
|
|---|
| 90 | {
|
|---|
| 91 | global $lang_admin_download;
|
|---|
| 92 |
|
|---|
| 93 | if (file_exists($ext_info['path'].'/lang/'.$forum_user['language'].'/admin_download.php'))
|
|---|
| 94 | require_once $ext_info['path'].'/lang/'.$forum_user['language'].'/admin_download.php';
|
|---|
| 95 | else
|
|---|
| 96 | require_once $ext_info['path'].'/lang/English/admin_download.php';
|
|---|
| 97 |
|
|---|
| 98 | $forum_page['admin_submenu']['download'] = '<li'.((FORUM_PAGE == 'admin-download') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['admin_download']).'">'.$lang_admin_download['Downloads'].'</a></li>';
|
|---|
| 99 | $forum_page['admin_submenu']['download_cats'] = '<li'.((FORUM_PAGE == 'admin-download-cats') ? ' class="isactive"' : '').'><a href="'.forum_link($forum_url['admin_download_cats']).'">'.$lang_admin_download['Download cats'].'</a></li>';
|
|---|
| 100 | }
|
|---|
| 101 | ]]></hook>
|
|---|
| 102 | </hooks>
|
|---|
| 103 | </extension>
|
|---|