From 6783e030029009eec33819a6e6293453dc4a9db2 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 18 Apr 2011 15:16:28 +0000 Subject: [PATCH] --- inc/ws/DAO/class.ws.dao.document.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/inc/ws/DAO/class.ws.dao.document.php b/inc/ws/DAO/class.ws.dao.document.php index b362f816d..81454ee6a 100644 --- a/inc/ws/DAO/class.ws.dao.document.php +++ b/inc/ws/DAO/class.ws.dao.document.php @@ -222,7 +222,7 @@ class wsDAODocument extends commonDAO { } if (isset($lpages[$p])) { $links[$infos['document_id']][$infos['document_page']] = $lpages[$p]; - //fb($lpages[$p]); + // fb($lpages[$p]); } } @@ -256,25 +256,29 @@ class wsDAODocument extends commonDAO { $tlinks = array(); $trulers = array(); - $links=array(); - $rulers=array(); + $links = array(); + $rulers = array(); foreach($documents as $d) { $r = $this->con->select('SELECT * FROM document_links_versions WHERE document_id=' . $d . ' ORDER BY `update` DESC LIMIT 1'); - fb($r->links); - fb($r->rulers); - $tlinks[$d] = json_decode($r->links, true); - $trulers[$d] = json_decode($r->rulers, true); - } - fb($tlinks); - fb($trulers); + if (mb_substr($r->links, 1, 1) == ':') { + $ll = unserialize($r->links); + $rr = unserialize($r->rulers); + } else { + $ll = json_decode($r->links, true); + $rr = json_decode($r->rulers, true); + } + $tlinks[$d] = $ll; + $trulers[$d] = $rr; + } $i = 1; foreach ($pages as $p => $infos) { if (isset($tlinks[$infos['document_id']][$infos['document_page']])) { $l = $tlinks[$infos['document_id']][$infos['document_page']]; foreach($l as $link) { + $link=(array)$link; $link['page'] = $p; $links[] = $link; } -- 2.39.5