Simple News and events in drupal block
hi,
This is the php code for create a simple news and event in page or block in drupal.
<marquee direction="up" width="20%" height="30%" onmouseover="this.setAttribute('scrollamount', 0, 0);" onmouseout="this.setAttribute('scrollamount', 6, 0);"> <?php global $base_path; $res = db_query('SELECT title,nid FROM node WHERE type="image_gallery" ORDER BY nid DESC LIMIT 0 , 6'); $count=0; $img="<img src='http://cdachyd.in/new_icons_10.gif'/>"; while ($row = db_fetch_array($res)) { $count++; if($count>3){ $img="";} echo "<a href='?q=node/".$row['nid']."'>".$row['title'].$img."</a>"."<br>"; } ?> </marquee>
First create a content type name as “News”. Then create a pages in news content type. Now we want to get the news content type title (News event title) from the database,And display as block or page. Enable the “Phpfilter” module, now we can see new input format, in a page or new block past the code and choose the input format as php. Now it will show as,
நன்றி …
சண்முகசுந்தரம்.க
Advertisements
Leave a Comment