diff options
author | Hakan Sandell <sandell.hakan@gmail.com> | 2010-11-13 15:29:49 +0100 |
---|---|---|
committer | Hakan Sandell <sandell.hakan@gmail.com> | 2010-11-13 15:29:49 +0100 |
commit | 14928129ac979d50664cff367377db5364f8e663 (patch) | |
tree | c244ebec8400361b7f084503f3ae40b2142647d5 /inc | |
parent | bcb79ff3b3b63c74a93cdf4762fa0cd1bb28d17a (diff) | |
parent | ebb29737d32bc331541f78a1a47f33ba33919938 (diff) | |
download | rpg-14928129ac979d50664cff367377db5364f8e663.tar.gz rpg-14928129ac979d50664cff367377db5364f8e663.tar.bz2 |
Merge branch 'master' of git://github.com/splitbrain/dokuwiki
Diffstat (limited to 'inc')
-rw-r--r-- | inc/SafeFN.class.php | 1 | ||||
-rw-r--r-- | inc/Sitemapper.php | 203 | ||||
-rw-r--r-- | inc/actions.php | 55 | ||||
-rw-r--r-- | inc/common.php | 22 | ||||
-rw-r--r-- | inc/fulltext.php | 8 | ||||
-rw-r--r-- | inc/html.php | 5 | ||||
-rw-r--r-- | inc/init.php | 3 | ||||
-rw-r--r-- | inc/lang/de-informal/draft.txt | 2 | ||||
-rw-r--r-- | inc/lang/de/draft.txt | 2 | ||||
-rw-r--r-- | inc/lang/eu/adminplugins.txt | 1 | ||||
-rw-r--r-- | inc/lang/eu/lang.php | 87 | ||||
-rw-r--r-- | inc/lang/eu/subscr_digest.txt | 20 | ||||
-rw-r--r-- | inc/lang/eu/subscr_form.txt | 3 | ||||
-rw-r--r-- | inc/lang/eu/subscr_list.txt | 17 | ||||
-rw-r--r-- | inc/lang/eu/subscr_single.txt | 23 | ||||
-rw-r--r-- | inc/lang/zh/lang.php | 3 | ||||
-rw-r--r-- | inc/load.php | 1 | ||||
-rw-r--r-- | inc/mail.php | 32 | ||||
-rw-r--r-- | inc/media.php | 7 | ||||
-rw-r--r-- | inc/search.php | 4 | ||||
-rw-r--r-- | inc/template.php | 15 |
21 files changed, 476 insertions, 38 deletions
diff --git a/inc/SafeFN.class.php b/inc/SafeFN.class.php index b6e477fab..ac6698a63 100644 --- a/inc/SafeFN.class.php +++ b/inc/SafeFN.class.php @@ -114,6 +114,7 @@ class SafeFN { $converted = true; } } + if($converted) $safe .= self::$post_indicator; return $safe; } diff --git a/inc/Sitemapper.php b/inc/Sitemapper.php new file mode 100644 index 000000000..47a3fedb5 --- /dev/null +++ b/inc/Sitemapper.php @@ -0,0 +1,203 @@ +<?php +/** + * Sitemap handling functions + * + * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) + * @author Michael Hamann <michael@content-space.de> + */ + +if(!defined('DOKU_INC')) die('meh.'); + +/** + * A class for building sitemaps and pinging search engines with the sitemap URL. + * + * @author Michael Hamann + */ +class Sitemapper { + /** + * Builds a Google Sitemap of all public pages known to the indexer + * + * The map is placed in the cache directory named sitemap.xml.gz - This + * file needs to be writable! + * + * @author Michael Hamann + * @author Andreas Gohr + * @link https://www.google.com/webmasters/sitemaps/docs/en/about.html + * @link http://www.sitemaps.org/ + */ + public function generate(){ + global $conf; + if($conf['sitemap'] < 1 || !is_numeric($conf['sitemap'])) return false; + + $sitemap = Sitemapper::getFilePath(); + + if(@file_exists($sitemap)){ + if(!is_writable($sitemap)) return false; + }else{ + if(!is_writable(dirname($sitemap))) return false; + } + + if(@filesize($sitemap) && + @filemtime($sitemap) > (time()-($conf['sitemap']*86400))){ // 60*60*24=86400 + dbglog('Sitemapper::generate(): Sitemap up to date'); // FIXME: only in debug mode + return false; + } + + dbglog("Sitemapper::generate(): using $sitemap"); // FIXME: Only in debug mode + + $pages = idx_getIndex('page', ''); + dbglog('Sitemapper::generate(): creating sitemap using '.count($pages).' pages'); + $items = array(); + + // build the sitemap items + foreach($pages as $id){ + //skip hidden, non existing and restricted files + if(isHiddenPage($id)) continue; + if(auth_aclcheck($id,'','') < AUTH_READ) continue; + $item = SitemapItem::createFromID($id); + if ($item !== NULL) + $items[] = $item; + } + + $eventData = array('items' => &$items, 'sitemap' => &$sitemap); + $event = new Doku_Event('SITEMAP_GENERATE', $eventData); + if ($event->advise_before(true)) { + //save the new sitemap + $result = io_saveFile($sitemap, Sitemapper::getXML($items)); + } + $event->advise_after(); + + return $result; + } + + /** + * Builds the sitemap XML string from the given array auf SitemapItems. + * + * @param $items array The SitemapItems that shall be included in the sitemap. + * @return string The sitemap XML. + * @author Michael Hamann + */ + private function getXML($items) { + ob_start(); + echo '<?xml version="1.0" encoding="UTF-8"?>'.NL; + echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'.NL; + foreach ($items as $item) { + echo $item->toXML(); + } + echo '</urlset>'.NL; + $result = ob_get_contents(); + ob_end_clean(); + return $result; + } + + /** + * Helper function for getting the path to the sitemap file. + * + * @return The path to the sitemap file. + * @author Michael Hamann + */ + public function getFilePath() { + global $conf; + + $sitemap = $conf['cachedir'].'/sitemap.xml'; + if($conf['compression'] === 'bz2' || $conf['compression'] === 'gz'){ + $sitemap .= '.gz'; + } + + return $sitemap; + } + + /** + * Pings search engines with the sitemap url. Plugins can add or remove + * urls to ping using the SITEMAP_PING event. + * + * @author Michael Hamann + */ + public function pingSearchEngines() { + //ping search engines... + $http = new DokuHTTPClient(); + $http->timeout = 8; + + $encoded_sitemap_url = urlencode(wl('', array('do' => 'sitemap'), true, '&')); + $ping_urls = array( + 'google' => 'http://www.google.com/webmasters/sitemaps/ping?sitemap='.$encoded_sitemap_url, + 'yahoo' => 'http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=dokuwiki&url='.$encoded_sitemap_url, + 'microsoft' => 'http://www.bing.com/webmaster/ping.aspx?siteMap='.$encoded_sitemap_url, + ); + + $data = array('ping_urls' => $ping_urls, + 'encoded_sitemap_url' => $encoded_sitemap_url + ); + $event = new Doku_Event('SITEMAP_PING', $data); + if ($event->advise_before(true)) { + foreach ($data['ping_urls'] as $name => $url) { + dbglog("Sitemapper::PingSearchEngines(): pinging $name"); + $resp = $http->get($url); + if($http->error) dbglog("Sitemapper:pingSearchengines(): $http->error"); + dbglog('Sitemapper:pingSearchengines(): '.preg_replace('/[\n\r]/',' ',strip_tags($resp))); + } + } + $event->advise_after(); + + return true; + } +} + +/** + * An item of a sitemap. + * + * @author Michael Hamann + */ +class SitemapItem { + public $url; + public $lastmod; + public $changefreq; + public $priority; + + /** + * Create a new item. + * + * @param $url string The url of the item + * @param $lastmod int Timestamp of the last modification + * @param $changefreq string How frequently the item is likely to change. Valid values: always, hourly, daily, weekly, monthly, yearly, never. + * @param $priority float|string The priority of the item relative to other URLs on your site. Valid values range from 0.0 to 1.0. + */ + public function __construct($url, $lastmod, $changefreq = null, $priority = null) { + $this->url = $url; + $this->lastmod = $lastmod; + $this->changefreq = $changefreq; + $this->priority = $priority; + } + + /** + * Helper function for creating an item for a wikipage id. + * + * @param $id string A wikipage id. + * @param $changefreq string How frequently the item is likely to change. Valid values: always, hourly, daily, weekly, monthly, yearly, never. + * @param $priority float|string The priority of the item relative to other URLs on your site. Valid values range from 0.0 to 1.0. + * @return The sitemap item. + */ + public static function createFromID($id, $changefreq = null, $priority = null) { + $id = trim($id); + $date = @filemtime(wikiFN($id)); + if(!$date) return NULL; + return new SitemapItem(wl($id, '', true), $date, $changefreq, $priority); + } + + /** + * Get the XML representation of the sitemap item. + * + * @return The XML representation. + */ + public function toXML() { + $result = ' <url>'.NL + .' <loc>'.hsc($this->url).'</loc>'.NL + .' <lastmod>'.date_iso8601($this->lastmod).'</lastmod>'.NL; + if ($this->changefreq !== NULL) + $result .= ' <changefreq>'.hsc($this->changefreq).'</changefreq>'.NL; + if ($this->priority !== NULL) + $result .= ' <priority>'.hsc($this->priority).'</priority>'.NL; + $result .= ' </url>'.NL; + return $result; + } +} diff --git a/inc/actions.php b/inc/actions.php index 0a6e6d8c7..9db7d5f24 100644 --- a/inc/actions.php +++ b/inc/actions.php @@ -53,6 +53,11 @@ function act_dispatch(){ //check permissions $ACT = act_permcheck($ACT); + //sitemap + if ($ACT == 'sitemap'){ + $ACT = act_sitemap($ACT); + } + //register if($ACT == 'register' && $_POST['save'] && register()){ $ACT = 'login'; @@ -205,7 +210,7 @@ function act_clean($act){ 'preview','search','show','check','index','revisions', 'diff','recent','backlink','admin','subscribe','revert', 'unsubscribe','profile','resendpwd','recover', - 'draftdel','subscribens','unsubscribens',)) && substr($act,0,7) != 'export_' ) { + 'draftdel','subscribens','unsubscribens','sitemap')) && substr($act,0,7) != 'export_' ) { msg('Command unknown: '.htmlspecialchars($act),-1); return 'show'; } @@ -233,7 +238,8 @@ function act_permcheck($act){ }else{ $permneed = AUTH_CREATE; } - }elseif(in_array($act,array('login','search','recent','profile','index'))){ + }elseif(in_array($act,array('login','search','recent','profile','index', 'sitemap'))){ + }elseif(in_array($act,array('login','search','recent','profile','sitemap'))){ $permneed = AUTH_NONE; }elseif($act == 'revert'){ $permneed = AUTH_ADMIN; @@ -587,6 +593,51 @@ function act_export($act){ } /** + * Handle sitemap delivery + * + * @author Michael Hamann <michael@content-space.de> + */ +function act_sitemap($act) { + global $conf; + + if ($conf['sitemap'] < 1 || !is_numeric($conf['sitemap'])) { + header("HTTP/1.0 404 Not Found"); + print "Sitemap generation is disabled."; + exit; + } + + $sitemap = Sitemapper::getFilePath(); + if(strrchr($sitemap, '.') === '.gz'){ + $mime = 'application/x-gzip'; + }else{ + $mime = 'application/xml; charset=utf-8'; + } + + // Check if sitemap file exists, otherwise create it + if (!is_readable($sitemap)) { + Sitemapper::generate(); + } + + if (is_readable($sitemap)) { + // Send headers + header('Content-Type: '.$mime); + + http_conditionalRequest(filemtime($sitemap)); + + // Send file + //use x-sendfile header to pass the delivery to compatible webservers + if (http_sendfile($sitemap)) exit; + + readfile($sitemap); + exit; + } + + header("HTTP/1.0 500 Internal Server Error"); + print "Could not read the sitemap file - bad permissions?"; + exit; +} + +/** * Handle page 'subscribe' * * Throws exception on error. diff --git a/inc/common.php b/inc/common.php index 3e760419f..18f782788 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1134,12 +1134,7 @@ function notify($id,$who,$rev='',$summary='',$minor=false,$replace=array()){ $subject = '['.utf8_substr($conf['title'], 0, 20).'...] '.$subject; } - $from = $conf['mailfrom']; - $from = str_replace('@USER@',$_SERVER['REMOTE_USER'],$from); - $from = str_replace('@NAME@',$INFO['userinfo']['name'],$from); - $from = str_replace('@MAIL@',$INFO['userinfo']['mail'],$from); - - mail_send($to,$subject,$text,$from,'',$bcc); + mail_send($to,$subject,$text,$conf['mailfrom'],'',$bcc); } /** @@ -1271,6 +1266,21 @@ function dformat($dt=null,$format=''){ } /** + * Formats a timestamp as ISO 8601 date + * + * @author <ungu at terong dot com> + * @link http://www.php.net/manual/en/function.date.php#54072 + */ +function date_iso8601($int_date) { + //$int_date: current date in UNIX timestamp + $date_mod = date('Y-m-d\TH:i:s', $int_date); + $pre_timezone = date('O', $int_date); + $time_zone = substr($pre_timezone, 0, 3).":".substr($pre_timezone, 3, 2); + $date_mod .= $time_zone; + return $date_mod; +} + +/** * return an obfuscated email address in line with $conf['mailguard'] setting * * @author Harry Fuecks <hfuecks@gmail.com> diff --git a/inc/fulltext.php b/inc/fulltext.php index 943a5d401..7ace3a724 100644 --- a/inc/fulltext.php +++ b/inc/fulltext.php @@ -229,6 +229,7 @@ function ft_pageLookup($id, $in_ns=false, $in_title=false){ } function _ft_pageLookup(&$data){ + global $conf; // split out original parameters $id = $data['id']; if (preg_match('/(?:^| )@(\w+)/', $id, $matches)) { @@ -241,6 +242,11 @@ function _ft_pageLookup(&$data){ $pages = array_map('rtrim', idx_getIndex('page', '')); $titles = array_map('rtrim', idx_getIndex('title', '')); + // check for corrupt title index #FS2076 + if(count($pages) != count($titles)){ + $titles = array_fill(0,count($pages),''); + @unlink($conf['indexdir'].'/title.idx'); // will be rebuilt in inc/init.php + } $pages = array_combine($pages, $titles); $cleaned = cleanID($id); @@ -270,7 +276,7 @@ function _ft_pageLookup(&$data){ } } - uasort($pages,'ft_pagesorter'); + uksort($pages,'ft_pagesorter'); return $pages; } diff --git a/inc/html.php b/inc/html.php index 02afa00e9..7f502afa5 100644 --- a/inc/html.php +++ b/inc/html.php @@ -162,11 +162,12 @@ function html_topbtn(){ * * @author Andreas Gohr <andi@splitbrain.org> */ -function html_btn($name,$id,$akey,$params,$method='get',$tooltip=''){ +function html_btn($name,$id,$akey,$params,$method='get',$tooltip='',$label=false){ global $conf; global $lang; - $label = $lang['btn_'.$name]; + if (!$label) + $label = $lang['btn_'.$name]; $ret = ''; $tip = ''; diff --git a/inc/init.php b/inc/init.php index bf7815178..ed4409729 100644 --- a/inc/init.php +++ b/inc/init.php @@ -220,6 +220,9 @@ if (!defined('NOSESSION')) { auth_setup(); } +// setup mail system +mail_setup(); + /** * Checks paths from config file */ diff --git a/inc/lang/de-informal/draft.txt b/inc/lang/de-informal/draft.txt index 704c6d1da..e56dbe083 100644 --- a/inc/lang/de-informal/draft.txt +++ b/inc/lang/de-informal/draft.txt @@ -2,5 +2,5 @@ Deine letzte Bearbeitungssitzung wurde nicht ordnungsgemäß abgeschlossen. DokuWiki hat während deiner Arbeit automatisch einen Zwischenentwurf gespeichert, den du jetzt nutzen kannst, um deine Arbeit fortzusetzen. Unten siehst du die Daten, die bei deiner letzten Sitzung gespeichert wurden. -Bitte entscheide dich, ob du den Entwurf //wieder herstellen// oder //löschen// willst oder ob du die Bearbeitung abbrechen möchtest. +Bitte entscheide dich, ob du den Entwurf //wiederherstellen// oder //löschen// willst oder ob du die Bearbeitung abbrechen möchtest. diff --git a/inc/lang/de/draft.txt b/inc/lang/de/draft.txt index 14a5e8495..77a55b165 100644 --- a/inc/lang/de/draft.txt +++ b/inc/lang/de/draft.txt @@ -2,5 +2,5 @@ Ihre letzte Bearbeitungssitzung wurde nicht ordnungsgemäß abgeschlossen. DokuWiki hat während Ihrer Arbeit automatisch einen Zwischenentwurf gespeichert, den Sie jetzt nutzen können, um Ihre Arbeit fortzusetzen. Unten sehen Sie die Daten, die bei Ihrer letzten Sitzung gespeichert wurden. -Bitte entscheiden Sie, ob Sie den Entwurf //wieder herstellen// oder //löschen// wollen oder ob Sie die Bearbeitung abbrechen möchten. +Bitte entscheiden Sie, ob Sie den Entwurf //wiederherstellen// oder //löschen// wollen oder ob Sie die Bearbeitung abbrechen möchten. diff --git a/inc/lang/eu/adminplugins.txt b/inc/lang/eu/adminplugins.txt new file mode 100644 index 000000000..20709bfd6 --- /dev/null +++ b/inc/lang/eu/adminplugins.txt @@ -0,0 +1 @@ +===== Plugin Gehigarriak =====
\ No newline at end of file diff --git a/inc/lang/eu/lang.php b/inc/lang/eu/lang.php index a5f786654..2efec00be 100644 --- a/inc/lang/eu/lang.php +++ b/inc/lang/eu/lang.php @@ -38,15 +38,13 @@ $lang['btn_back'] = 'Atzera'; $lang['btn_backlink'] = 'Itzulera estekak'; $lang['btn_backtomedia'] = 'Atzera Multimedia Fitxategiaren Aukeraketara'; $lang['btn_subscribe'] = 'Harpidetu Orri Aldaketetara'; -$lang['btn_unsubscribe'] = 'Utzi Harpidetza Orri Aldaketetara'; -$lang['btn_subscribens'] = 'Harpidetu Izen-espazio Aldaketetara'; -$lang['btn_unsubscribens'] = 'Utzi Harpidetza Izen-espazio Aldaketetara'; $lang['btn_profile'] = 'Eguneratu Profila '; $lang['btn_reset'] = 'Aldaketak Desegin'; $lang['btn_resendpwd'] = 'Pasahitz berria bidali'; $lang['btn_draft'] = 'Editatu zirriborroa'; $lang['btn_recover'] = 'Berreskuratu zirriborroa'; $lang['btn_draftdel'] = 'Ezabatu zirriborroa'; +$lang['btn_revert'] = 'Berrezarri'; $lang['loggedinas'] = 'Erabiltzailea'; $lang['user'] = 'Erabiltzailea'; $lang['pass'] = 'Pasahitza'; @@ -85,13 +83,46 @@ $lang['resendpwdconfirm'] = 'Baieztapen esteka bat e-postaz bidali da.'; $lang['resendpwdsuccess'] = 'Zure pasahitz berria e-postaz bidali da.'; $lang['license'] = 'Besterik esan ezean, wiki hontako edukia ondorengo lizentziapean argitaratzen da:'; $lang['licenseok'] = 'Oharra: Orri hau editatzean, zure edukia ondorengo lizentziapean argitaratzea onartzen duzu: '; +$lang['searchmedia'] = 'Bilatu fitxategi izena:'; +$lang['searchmedia_in'] = 'Bilatu %s-n'; $lang['txt_upload'] = 'Ireki nahi den fitxategia aukeratu'; $lang['txt_filename'] = 'Idatzi wikiname-a (aukerazkoa)'; $lang['txt_overwrt'] = 'Oraingo fitxategiaren gainean idatzi'; $lang['lockedby'] = 'Momentu honetan blokeatzen:'; $lang['lockexpire'] = 'Blokeaketa iraungitzen da:'; $lang['willexpire'] = 'Zure blokeaketa orri hau aldatzeko minutu batean iraungitzen da.\nGatazkak saihesteko, aurreikusi botoia erabili blokeaketa denboragailua berrabiarazteko.'; -$lang['js']['notsavedyet'] = "Gorde gabeko aldaketak galdu egingo dira.\nBenetan jarraitu nahi duzu?"; +$lang['js']['notsavedyet'] = 'Gorde gabeko aldaketak galdu egingo dira. +Benetan jarraitu nahi duzu?'; +$lang['js']['searchmedia'] = 'Bilatu fitxategiak'; +$lang['js']['keepopen'] = 'Mantendu leihoa irekita aukeraketan'; +$lang['js']['hidedetails'] = 'Xehetasunak Ezkutatu'; +$lang['js']['mediatitle'] = 'Esteken ezarpenak'; +$lang['js']['mediadisplay'] = 'Esteka mota'; +$lang['js']['mediaalign'] = 'Lerrokatzea'; +$lang['js']['mediasize'] = 'Irudi tamaina'; +$lang['js']['mediatarget'] = 'Estekaren helburua'; +$lang['js']['mediaclose'] = 'Itxi'; +$lang['js']['mediainsert'] = 'Txertatu'; +$lang['js']['mediadisplayimg'] = 'Irudia erakutsi'; +$lang['js']['mediadisplaylnk'] = 'Esteka bakarrik erakutsi'; +$lang['js']['mediasmall'] = 'Bertsio txikia'; +$lang['js']['mediamedium'] = 'Bertsio ertaina'; +$lang['js']['medialarge'] = 'Bertsio handia'; +$lang['js']['mediaoriginal'] = 'Jatorrizko bertsioa'; +$lang['js']['medialnk'] = 'Esteka xehetasunen orrira'; +$lang['js']['mediadirect'] = 'Jatorrizkora esteka zuzena'; +$lang['js']['medianolnk'] = 'Estekarik ez'; +$lang['js']['medianolink'] = 'Ez estekatu irudia'; +$lang['js']['medialeft'] = 'Irudia ezkerrean lerrokatu'; +$lang['js']['mediaright'] = 'Irudia eskuinean lerrokatu'; +$lang['js']['mediacenter'] = 'Irudia erdian lerrokatu'; +$lang['js']['medianoalign'] = 'Ez erabili lerrokatzerik'; +$lang['js']['nosmblinks'] = 'Window baliabide konpartituetara estekek Microsoft Internet Explorer-en bakarrik balio dute. +Esteka kopiatu eta itsatsi dezakezu dena den.'; +$lang['js']['linkwiz'] = 'Estekatze Laguntzailea'; +$lang['js']['linkto'] = 'Estekatu hona:'; +$lang['js']['del_confirm'] = 'Benetan ezabatu aukeratutako fitxategia(k)?'; +$lang['js']['mu_btn'] = 'Igo hainbat fitxategi aldi berean'; $lang['rssfailed'] = 'Errorea gertatu da feed hau irakurtzean:'; $lang['nothingfound'] = 'Ez da ezer aurkitu.'; $lang['mediaselect'] = 'Aukeratu Multimedia fitxategia'; @@ -109,11 +140,7 @@ $lang['deletefail'] = 'Ezin izan da "%s" ezabatu - egiaztatu baimenak $lang['mediainuse'] = 'Ez da "%s" fitxategia ezabatu - oraindik erabilia izaten ari da.'; $lang['namespaces'] = 'Izen-espazioak'; $lang['mediafiles'] = 'Fitxategiak eskuragarri hemen:'; -$lang['js']['keepopen'] = 'Mantendu leihoa irekita aukeraketan'; -$lang['js']['hidedetails'] = 'Xehetasunak Ezkutatu'; -$lang['js']['nosmblinks'] = 'Window baliabide konpartituetara estekek Microsoft Internet Explorer-en bakarrik balio dute. -Esteka kopiatu eta itsatsi dezakezu dena den.'; -$lang['js']['mu_btn'] = 'Igo hainbat fitxategi aldi berean'; +$lang['accessdenied'] = 'Ez zaude orri hau ikusteko baimendua'; $lang['mediausage'] = 'Erabili ondoko sintaxia fitxategi honi erreferentzia egiteko:'; $lang['mediaview'] = 'Ikusi jatorrizko fitxategia'; $lang['mediaroot'] = 'root'; @@ -129,6 +156,7 @@ $lang['current'] = 'egungoa'; $lang['yours'] = 'Zure Bertsioa'; $lang['diff'] = 'egungo bertsioarekin dituen aldaketak aurkezten ditu'; $lang['diff2'] = 'Erakutsi desberdintasunak aukeratutako bertsioen artean'; +$lang['difflink'] = 'Estekatu konparaketa bista honetara'; $lang['line'] = 'Marra'; $lang['breadcrumb'] = 'Traza'; $lang['youarehere'] = 'Hemen zaude'; @@ -140,8 +168,10 @@ $lang['restored'] = 'bertsio zaharra berrezarria'; $lang['external_edit'] = 'kanpoko aldaketa'; $lang['summary'] = 'Aldatu laburpena'; $lang['noflash'] = '<a href="http://www.adobe.com/products/flashplayer/">Adobe Flash Plugin</a> beharrezkoa da eduki hau bistaratzeko.'; +$lang['download'] = 'Deskarga Snippet-a'; $lang['mail_newpage'] = '[DokuWiki] gehitutako orria:'; $lang['mail_changed'] = '[DokuWiki] aldatutako orria:'; +$lang['mail_subscribe_list'] = 'izen-espazioan aldatutako orriak:'; $lang['mail_new_user'] = 'erabiltzaile berria:'; $lang['mail_upload'] = 'fitxategia igota:'; $lang['qb_bold'] = 'Letra beltzez'; @@ -154,6 +184,11 @@ $lang['qb_h2'] = 'Izenburua 2'; $lang['qb_h3'] = 'Izenburua 3'; $lang['qb_h4'] = 'Izenburua 4'; $lang['qb_h5'] = 'Izenburua 5'; +$lang['qb_h'] = 'Izenburua'; +$lang['qb_hs'] = 'Izenburua Aukeratu'; +$lang['qb_hplus'] = 'Izenburu Handiagoa'; +$lang['qb_hminus'] = 'Izenburu Txikiagoa'; +$lang['qb_hequal'] = 'Maila Berdineko Izenburua'; $lang['qb_link'] = 'Barruko Lotura'; $lang['qb_extlink'] = 'Kanpoko Lotura'; $lang['qb_hr'] = 'Horizontal Marra'; @@ -163,7 +198,7 @@ $lang['qb_media'] = 'Irudiak eta beste fitxategiak gehitu'; $lang['qb_sig'] = 'Gehitu sinadura'; $lang['qb_smileys'] = 'Irrifartxoak'; $lang['qb_chars'] = 'Karaktere Bereziak'; -$lang['js']['del_confirm'] = 'Benetan ezabatu aukeratutako fitxategia(k)?'; +$lang['upperns'] = 'Jauzi izen-espazio gurasora'; $lang['admin_register'] = 'Erabiltzaile berria gehitu'; $lang['metaedit'] = 'Metadatua Aldatu'; $lang['metasaveerr'] = 'Metadatuaren idazketak huts egin du'; @@ -179,11 +214,22 @@ $lang['img_copyr'] = 'Copyright'; $lang['img_format'] = 'Formatua'; $lang['img_camera'] = 'Kamera'; $lang['img_keywords'] = 'Hitz-gakoak'; -$lang['subscribe_success'] = 'Gehitua %s %s harpidetza zerrendara'; -$lang['subscribe_error'] = 'Errorea %s gehitzen %s harpidetza zerrendara'; -$lang['subscribe_noaddress'] = 'Ez dago posta elektroniko helbiderik zure erabiltzaile izenarekin erlazionatuta, ezin zara harpidetza zerrendara gehitua izan'; -$lang['unsubscribe_success'] = 'Ezabatua %s %s harpidetza zerrendatik'; -$lang['unsubscribe_error'] = 'Errorea %s ezabatzen %s harpidetza zerrendatik'; +$lang['subscr_subscribe_success'] = '%s gehitua %s-ren harpidetza zerrendara'; +$lang['subscr_subscribe_error'] = 'Errorea %s gehitzen %s-ren harpidetza zerrendara'; +$lang['subscr_subscribe_noaddress'] = 'Ez dago helbiderik zure login-arekin lotuta, ezin zara harpidetza zerrendara gehitua izan.'; +$lang['subscr_unsubscribe_success'] = '%s ezabatua %s-ren harpidetza zerrendatik'; +$lang['subscr_unsubscribe_error'] = 'Errorea %s ezabatzen %s-ren harpidetza zerrendatik'; +$lang['subscr_already_subscribed'] = '%s lehendik harpidetua dago %s-n'; +$lang['subscr_not_subscribed'] = '%s ez dago %s-n harpidetua'; +$lang['subscr_m_not_subscribed'] = 'Momentu honetan ez zaude orri honetara edo izen-espazio honetara harpidetua.'; +$lang['subscr_m_new_header'] = 'Gehitu harpidetza'; +$lang['subscr_m_current_header'] = 'Uneko harpidetzak'; +$lang['subscr_m_unsubscribe'] = 'Kendu harpidetza'; +$lang['subscr_m_subscribe'] = 'Harpidetu'; +$lang['subscr_m_receive'] = 'Jaso'; +$lang['subscr_style_every'] = 'e-posta aldaketa bakoitzean'; +$lang['subscr_style_digest'] = 'e-posta laburbildua orri bakoitzeko aldaketentzat (%.2f egunero)'; +$lang['subscr_style_list'] = 'aldatutako orrien zerrenda azken e-postatik (%.2f egunero)'; $lang['authmodfailed'] = 'Erabiltzaile kautotzearen konfigurazioa okerra da. Mesedez, eman honen berri Wiki administratzaileari'; $lang['authtempfail'] = 'Erabiltzaile kautotzea denboraldi batez ez dago erabilgarri. Egoerak hala jarraitzen badu, mesedez, eman honen berri Wiki administratzaileari'; $lang['i_chooselang'] = 'Hautatu zure hizkuntza'; @@ -207,6 +253,7 @@ $lang['i_pol0'] = 'Wiki Irekia (irakurri, idatzi, fitxategiak igo $lang['i_pol1'] = 'Wiki Publikoa (irakurri edonorentzat, idatzi eta fitxategiak igo erregistratutako erabiltzaileentzat)'; $lang['i_pol2'] = 'Wiki Itxia (irakurri, idatzi, fitxategiak igo erregistratutako erabiltzaileentzat soilik)'; $lang['i_retry'] = 'Berriz saiatu'; +$lang['i_license'] = 'Mesedez, aukeratu zein lizentzipean ezarri nahi duzun zure edukia:'; $lang['mu_intro'] = 'Hemen hainbat fitxategi aldi berean igo ditzakezu. Egin klik nabigazio botoian hauek ilarara gehitzeko. Sakatu igo botoia prest egotean.'; $lang['mu_gridname'] = 'Fitxategi izena'; $lang['mu_gridsize'] = 'Tamaina'; @@ -220,4 +267,14 @@ $lang['mu_fail'] = 'hutsegitea'; $lang['mu_authfail'] = 'saioa iraungita'; $lang['mu_progress'] = '@PCT@% igota'; $lang['mu_filetypes'] = 'Onartutako Fitxategi Motak'; +$lang['mu_info'] = 'igotako fitxategiak.'; +$lang['mu_lasterr'] = 'Azken errorea;'; $lang['recent_global'] = 'Une honetan <b>%s</b> izen-espazioaren barneko aldaketak ikusten ari zara.<a href="%s"> Wiki osoaren azken aldaketak</a> ere ikusi ditzakezu.'; +$lang['years'] = 'duela %d urte'; +$lang['months'] = 'duela %d hilabete'; +$lang['weeks'] = 'duela %d aste'; +$lang['days'] = 'duela %d egun'; +$lang['hours'] = 'duela %d ordu'; +$lang['minutes'] = 'duela %d minutu'; +$lang['seconds'] = 'duela %d segundu'; +$lang['wordblock'] = 'Zure aldaketa ez da aldatua izan blokeatutako testua (spam) daukalako.'; diff --git a/inc/lang/eu/subscr_digest.txt b/inc/lang/eu/subscr_digest.txt new file mode 100644 index 000000000..e7962ca22 --- /dev/null +++ b/inc/lang/eu/subscr_digest.txt @@ -0,0 +1,20 @@ +Kaixo! + +@TITLE@ wikiko @PAGE@ orria aldatu egin da. +Hemen aldaketak: + +-------------------------------------------------------- +@DIFF@ +-------------------------------------------------------- + +Berrikuste zaharra: @OLDPAGE@ +Berrikuste berria: @NEWPAGE@ + +Orri jakinarazpenak ezeztatzeko, sartu wikian +@DOKUWIKIURL@ helbidean, bisitatu +@SUBSCRIBE@ +eta ezabatu orri eta/edo izen-espazio aldaketen harpidetza. + +-- +E-posta hau DokuWiki-k sortua izan da helbide honetan: +@DOKUWIKIURL@
\ No newline at end of file diff --git a/inc/lang/eu/subscr_form.txt b/inc/lang/eu/subscr_form.txt new file mode 100644 index 000000000..02a117898 --- /dev/null +++ b/inc/lang/eu/subscr_form.txt @@ -0,0 +1,3 @@ +====== Harpidetza Kudeaketa ====== + +Orri honek, oraingo orriko eta izen-espazioko harpidetzak kudeatzeko aukera ematen dizu.
\ No newline at end of file diff --git a/inc/lang/eu/subscr_list.txt b/inc/lang/eu/subscr_list.txt new file mode 100644 index 000000000..950cd352b --- /dev/null +++ b/inc/lang/eu/subscr_list.txt @@ -0,0 +1,17 @@ +Kaixo! + +@TITLE@ wikiko @PAGE@ izen-espazioko orri batzuk aldatu egin dira. +Hemen aldatutako orriak: + +-------------------------------------------------------- +@DIFF@ +-------------------------------------------------------- + +Orri jakinarazpenak ezeztatzeko, sartu wikian +@DOKUWIKIURL@ helbidean, bisitatu +@SUBSCRIBE@ +eta ezabatu orri eta/edo izen-espazio aldaketen harpidetza. + +-- +E-posta hau DokuWiki-k sortua izan da helbide honetan: +@DOKUWIKIURL@
\ No newline at end of file diff --git a/inc/lang/eu/subscr_single.txt b/inc/lang/eu/subscr_single.txt new file mode 100644 index 000000000..490211784 --- /dev/null +++ b/inc/lang/eu/subscr_single.txt @@ -0,0 +1,23 @@ +Kaixo! + +@TITLE@ wikiko @PAGE@ orria aldatu egin da. +Hemen aldaketak: + +-------------------------------------------------------- +@DIFF@ +-------------------------------------------------------- + +Data : @DATE@ +Erabiltzailea : @USER@ +Aldaketaren Laburpena: @SUMMARY@ +Berrikuste Zaharra: @OLDPAGE@ +Berrikuste Berria: @NEWPAGE@ + +Orri jakinarazpenak ezeztatzeko, sartu wikian +@DOKUWIKIURL@ helbidean, bisitatu +@SUBSCRIBE@ +eta ezabatu orri eta/edo izen-espazio aldaketen harpidetza. + +-- +E-posta hau DokuWiki-k sortua izan da helbide honetan: +@DOKUWIKIURL@
\ No newline at end of file diff --git a/inc/lang/zh/lang.php b/inc/lang/zh/lang.php index 9488cffe1..f819aff9a 100644 --- a/inc/lang/zh/lang.php +++ b/inc/lang/zh/lang.php @@ -10,6 +10,7 @@ * @author mr.jinyi@gmail.com * @author ben <ben@livetom.com> * @author lainme <lainme993@gmail.com> + * @author caii <zhoucaiqi@gmail.com> */ $lang['encoding'] = 'utf-8'; $lang['direction'] = 'ltr'; @@ -62,7 +63,7 @@ $lang['email'] = 'E-Mail'; $lang['register'] = '注册'; $lang['profile'] = '用户信息'; $lang['badlogin'] = '对不起,用户名或密码错误。'; -$lang['minoredit'] = '轻微修改'; +$lang['minoredit'] = '细微修改'; $lang['draftdate'] = '草稿自动保存于'; $lang['nosecedit'] = '在您编辑期间本页刚被他人修改过,局部信息已过期,故载入全页。'; $lang['regmissing'] = '对不起,您必须填写所有的区域。'; diff --git a/inc/load.php b/inc/load.php index 2f5be6d63..478ee7c76 100644 --- a/inc/load.php +++ b/inc/load.php @@ -74,6 +74,7 @@ function load_autoload($name){ 'DokuWikiFeedCreator' => DOKU_INC.'inc/feedcreator.class.php', 'Doku_Parser_Mode' => DOKU_INC.'inc/parser/parser.php', 'SafeFN' => DOKU_INC.'inc/SafeFN.class.php', + 'Sitemapper' => DOKU_INC.'inc/Sitemapper.php', 'DokuWiki_Action_Plugin' => DOKU_PLUGIN.'action.php', 'DokuWiki_Admin_Plugin' => DOKU_PLUGIN.'admin.php', diff --git a/inc/mail.php b/inc/mail.php index 38232d110..fb163585a 100644 --- a/inc/mail.php +++ b/inc/mail.php @@ -30,7 +30,39 @@ if(!defined('QUOTEDPRINTABLE_EOL')) define('QUOTEDPRINTABLE_EOL',"\015\012"); if (!defined('RFC2822_ATEXT')) define('RFC2822_ATEXT',"0-9a-zA-Z!#$%&'*+/=?^_`{|}~-"); if (!defined('PREG_PATTERN_VALID_EMAIL')) define('PREG_PATTERN_VALID_EMAIL', '['.RFC2822_ATEXT.']+(?:\.['.RFC2822_ATEXT.']+)*@(?i:[0-9a-z][0-9a-z-]*\.)+(?i:[a-z]{2,4}|museum|travel)'); +/** + * Prepare mailfrom replacement patterns + * + * @author Andreas Gohr <andi@splitbrain.org> + */ +function mail_setup(){ + global $conf; + global $INFO; + + $replace = array(); + + if(!empty($INFO['userinfo']['mail'])){ + $replace['@MAIL@'] = $INFO['userinfo']['mail']; + }else{ + $replace['@MAIL@'] = 'noreply@'.parse_url(DOKU_URL,PHP_URL_HOST); + } + if(!empty($_SERVER['REMOTE_USER'])){ + $replace['@USER@'] = $_SERVER['REMOTE_USER']; + }else{ + $replace['@USER@'] = 'noreply'; + } + + if(!empty($INFO['userinfo']['name'])){ + $replace['@NAME@'] = $INFO['userinfo']['name']; + }else{ + $replace['@NAME@'] = ''; + } + + $conf['mailfrom'] = str_replace(array_keys($replace), + array_values($replace), + $conf['mailfrom']); +} /** * UTF-8 autoencoding replacement for PHPs mail function diff --git a/inc/media.php b/inc/media.php index 3dacd12b7..69441352b 100644 --- a/inc/media.php +++ b/inc/media.php @@ -407,14 +407,9 @@ function media_notify($id,$file,$mime){ $text = str_replace('@MEDIA@',ml($id,'',true,'&',true),$text); $text = str_replace('@SIZE@',filesize_h(filesize($file)),$text); - $from = $conf['mailfrom']; - $from = str_replace('@USER@',$_SERVER['REMOTE_USER'],$from); - $from = str_replace('@NAME@',$INFO['userinfo']['name'],$from); - $from = str_replace('@MAIL@',$INFO['userinfo']['mail'],$from); - $subject = '['.$conf['title'].'] '.$lang['mail_upload'].' '.$id; - mail_send($conf['notify'],$subject,$text,$from); + mail_send($conf['notify'],$subject,$text,$conf['mailfrom']); } /** diff --git a/inc/search.php b/inc/search.php index 8273eef8c..03abec0c0 100644 --- a/inc/search.php +++ b/inc/search.php @@ -119,7 +119,7 @@ function search_index(&$data,$base,$file,$type,$lvl,$opts){ return false; } - $id = pathID($file); + $id = pathID($file,($type == 'd')); if($type=='d' && $conf['sneaky_index'] && auth_quickaclcheck($id.':') < AUTH_READ){ return false; @@ -550,7 +550,7 @@ function search_universal(&$data,$base,$file,$type,$lvl,$opts){ $return = true; // get ID and check if it is a valid one - $item['id'] = pathID($file,$opts['keeptxt']); + $item['id'] = pathID($file,($type == 'd' || $opts['keeptxt'])); if($item['id'] != cleanID($item['id'])){ if($opts['showmsg']) msg(hsc($item['id']).' is not a valid file name for DokuWiki - skipped',-1); diff --git a/inc/template.php b/inc/template.php index c2ce130ff..00bfde723 100644 --- a/inc/template.php +++ b/inc/template.php @@ -796,7 +796,7 @@ function tpl_userinfo(){ global $lang; global $INFO; if(isset($_SERVER['REMOTE_USER'])){ - print $lang['loggedinas'].': '.$INFO['userinfo']['name'].' ('.$_SERVER['REMOTE_USER'].')'; + print $lang['loggedinas'].': '.hsc($INFO['userinfo']['name']).' ('.hsc($_SERVER['REMOTE_USER']).')'; return true; } return false; @@ -1359,5 +1359,18 @@ function tpl_flush(){ } +/** + * Use favicon.ico from data/media root directory if it exists, otherwise use + * the one in the template's image directory. + * + * @author Anika Henke <anika@selfthinker.org> + */ +function tpl_getFavicon() { + if (file_exists(mediaFN('favicon.ico'))) + return ml('favicon.ico'); + return DOKU_TPL.'images/favicon.ico'; +} + + //Setup VIM: ex: et ts=4 enc=utf-8 : |