/[drupal]/contributions/sandbox/alaa/snippets/manalaa_aggregator2_block.php
ViewVC logotype

Contents of /contributions/sandbox/alaa/snippets/manalaa_aggregator2_block.php

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Tue Mar 21 23:19:50 2006 UTC (3 years, 8 months ago) by alaa
Branch: MAIN
CVS Tags: HEAD
File MIME type: text/x-php
some page and block snippets
1 <?php
2 $html = "";
3 $tid = 226;
4 $cid = "egblogs:arabic_block";
5 $cached = cache_get($cid);
6
7 if ($cached){
8 $html = $cached->data;
9 } else {
10 $query = "select i.link,n.title from term_node as t, aggregator2_item as i, node as n where t.tid=$tid and t.nid=i.nid and t.nid=n.nid ORDER BY n.sticky DESC, n.created DESC limit 30";
11
12 $result = db_query($query);
13
14 $rows=array();
15
16
17 while ($row=db_fetch_object($result)) {
18 $rows[] = theme('aggregator_block_item',$row);
19 }
20
21 $html = theme('item_list',$rows);
22 cache_set($cid, $html, time()+(60*60));
23 }
24 print $html;
25 ?>
26 <div class="more-link flop"><?php print l("more","taxonomy/term/$tid"); ?></div>

  ViewVC Help
Powered by ViewVC 1.1.2