$this->pagination->page_links('?view=' . $view . '?search=' . $search . '&sort=' . $_SESSION['sort'] . '&' ));
$tpl_vars['page_links'] = $page_links;
$tpl_vars['nb_results'] = $count;
- $tpl_vars['search_term'] = $search;
+ $tpl_vars['searchterm'] = $search;
}
break;
case 'view':
if ($this->store->retrieveOneById($next_id, $this->user->getId())) {
$next = TRUE;
}
- $navigate = $arrayName = array('previous' => $previous, 'previousid' => $previous_id, 'next' => $next, 'nextid' => $next_id);
+ $navigate = array('previous' => $previous, 'previousid' => $previous_id, 'next' => $next, 'nextid' => $next_id);
# tags
$tags = $this->store->retrieveTagsByEntry($entry['id']);
$html->load_file($_FILES['file']['tmp_name']);
$data = array();
$read = 0;
- foreach (array('ol','ul') as $list) {
- foreach ($html->find($list) as $ul) {
- foreach ($ul->find('li') as $li) {
- $tmpEntry = array();
- $a = $li->find('a');
- $tmpEntry['url'] = $a[0]->href;
- $tmpEntry['tags'] = $a[0]->tags;
- $tmpEntry['is_read'] = $read;
- if ($tmpEntry['url']) {
- $data[] = $tmpEntry;
+
+ if (Tools::get_doctype($html)->innertext == "<!DOCTYPE NETSCAPE-Bookmark-file-1>") {
+ // Firefox-bookmarks HTML
+ foreach (array('DL','ul') as $list) {
+ foreach ($html->find($list) as $ul) {
+ foreach ($ul->find('DT') as $li) {
+ $tmpEntry = array();
+ $a = $li->find('A');
+ $tmpEntry['url'] = $a[0]->href;
+ $tmpEntry['tags'] = $a[0]->tags;
+ $tmpEntry['is_read'] = $read;
+ if ($tmpEntry['url']) {
+ $data[] = $tmpEntry;
+ }
}
- }
- # the second <ol/ul> is for read links
- $read = ((sizeof($data) && $read)?0:1);
+ # the second <ol/ul> is for read links
+ $read = ((sizeof($data) && $read)?0:1);
+ }
}
- }
- }
+ } else {
+ // regular HTML
+ foreach (array('ol','ul') as $list) {
+ foreach ($html->find($list) as $ul) {
+ foreach ($ul->find('li') as $li) {
+ $tmpEntry = array();
+ $a = $li->find('a');
+ $tmpEntry['url'] = $a[0]->href;
+ $tmpEntry['tags'] = $a[0]->tags;
+ $tmpEntry['is_read'] = $read;
+ if ($tmpEntry['url']) {
+ $data[] = $tmpEntry;
+ }
+ }
+ # the second <ol/ul> is for read links
+ $read = ((sizeof($data) && $read)?0:1);
+ }
+ }
+ }
+ }
// for readability structure