<%@ page import="java.io.File" %> <%@ page import="java.text.SimpleDateFormat" %> <%@ page import="java.sql.Connection" %> <%@ page import="java.util.List" %> <%@ page import="org.crosswire.data.DataObject" %> <%! public static class CrossNews extends DataObject { public CrossNews() {} @Override public synchronized Connection getDBConnection() { return DataObject.getDefaultDBConnection("crossNews"); } } %> The SWORD Project: Free Bible software from the CrossWire Bible Society <% String spsection="news"; %> <%@ include file="include/sword_header.jsp" %> <% SimpleDateFormat dateout = new SimpleDateFormat("h:mmaa 'on' EEEE, MMMM d, yyyy "); try { CrossNews query = new CrossNews(); int i = 0; List newsItems = query.getDataSet("SELECT NEWSID, CATNAME, IMAGEURL, NEWSDATE, AUTHOR, SUBJECT, DETAILS FROM NEWSITEM, CATEGORY WHERE CATEGORY.CATID = NEWSITEM.CATID ORDER BY NEWSDATE DESC"); for (CrossNews newsItem : newsItems) { if (++i >=10) break; boolean hasImage = false; String imgURL = newsItem.getStringValue("IMAGEURL"); if (imgURL != null) { imgURL = imgURL.trim(); if (imgURL.length() > 2) hasImage = true; } %> <% } } catch (Exception e) { e.printStackTrace(); } // at least show rest of page %>
The SWORD Project The SWORD Project is the CrossWire Bible Society's free Bible software project. Its purpose is to create cross-platform open-source tools-- covered by the GNU General Public License-- that allow programmers and Bible societies to write new Bible software more quickly and easily. We also create Bible study software for all readers, students, scholars, and translators of the Bible, and have a growing collection of many hundred texts in around 100 languages.

Current News

<%= (hasImage) ? (" ") : "" %> Posted <%= dateout.format(newsItem.getTSValue("NEWSDATE")) %> by <%= newsItem.getStringValue("AUTHOR") %>
    <%= newsItem.getStringValue("DETAILS") %>
<%@ include file="include/sword_footer.jsp" %>