The renovation of Machsom Watch

You are here

Contact

Israel Office

+972-52-838-7222

+972-52-430-5252

Europe office

+33-695-805-004

20.12.2010
The renovation of Machsom Watch
submitted by: Raz Konforti
One of our favorite client that we are very proud of, and we accompanied from our early days, is www.MachsomWatch.org. Lately we upgraded it from drupal 5.x to drupal 6.x and dressed it with a new beautiful design by Inbal Mizrach. As long with the design, an extreme UI process was made, what made us actually build, almost the entire site from scratch, over the existing content. One of the interesting challenge was to combine the checkpoints content with the daily reports from checkpoints. *A checkpoint* - is a description of the checkpoint with map, flickr images and videos from the checkpoint. *A daily report from the checkpoints* - is a daily report from one, two, three or more checkpoints, which tagged with those checkpoints tag. The goal was to eliminate the checkpoint page, and under it to display the latest report from that checkpoint, and to make the checkpoint as a context for paging through daily reports from that checkpoint. One more thing is to display the description, map, flickr images and embed video from the checkpoint context. Keeping the original paths of the daily reports was a must, according to the amount and their google rank. We created the check points navigation by going over the checkpoint terms and links them to the latest report from that checkpoint, while adding the tid (checkpoint) as a query to the path. Well, it looks something like that: 0 ORDER BY n.created DESC LIMIT 1 ', 'content_daily_report', $term->tid)); //Build the links with the name the term, href of from the latest report that we found //and passing the link checkpoint as url query. if ($nid) { $items[] = l($term->name, "node/" . $nid, array('query' => 'checkpoint=' . $term->tid)); } }; return theme('item-list', $items); ... ?> Now when we'll chose a checkpoint to observe it, we'll actually go to his latest daily report with the checkpoint as a context (argument in the URL). We also can use this context to grab the resources (description, map, flickr images and embed video) from the checkpoint to display in the report page. We are using this checkpoint context to browse through reports from the same context (checkpoint) by a jump menu or by their created day sorting pager. A pager can look something like this: created; $node_type = $node->type; //Get the checkpoint tid from the url query. $current_tid = $_GET['checkpoint']; //Return the prev result for the same checkpoint. $prev_res = db_result(db_query('SELECT n.nid, n.title FROM {node} n INNER JOIN {term_node} t ON n.vid = t.vid WHERE n.type = “%s” AND t.tid = “%s” AND n.status <> 0 AND n.created < %d ORDER BY n.created DESC LIMIT 1 ', $node_type, $current_tid, $node_created)); //Return the next result for the same checkpoint. $next_res = db_result(db_query('SELECT n.nid, n.title FROM {node} n INNER JOIN {term_node} t ON n.vid = t.vid WHERE n.type = “%s” AND t.tid = “%s” AND n.status <> 0 AND n.created > %d ORDER BY n.created ASC LIMIT 1 ', $node_type, $current_tid, $node_created)); $urlquery = $node_type == 'content_daily_report' ? 'checkpoint=' . $_GET['checkpoint'] : NULL; if ($nid = $prev_res) { //Build the links with the name of the link, href from the prev report that we found //and passing the link checkpoint as url query. $items[] = l(t('prev'), "node/" . $nid, array('query' => $urlquery)); } else { $items[] = t('prev'); } if ($nid =$next_res) { //Build the links with the name of the link, href from the next report that we found //and passing the link checkpoint as url query. $items[] = l(t('next'), "node/" . $nid, array('query' => $urlquery)); } else { $items[] = t('next'); } return theme(checkpoint_daily_report_pager', $items); ... ?> As long as we keep getting the checkpoint query from the URL, and passing it to the next one, we are keeping the context alive.
AttachmentSize
Image icon machsomwatch-org-1.png214.32 KB
Image icon machsomwatch-org-2.png163.57 KB
Image icon machsomwatch-org-3.png96.64 KB

Add new comment

blogs