Skip to content
Snippets Groups Projects
Commit c3970143 authored by Brett Bieber's avatar Brett Bieber
Browse files

Import project into version control

parents
No related branches found
No related tags found
No related merge requests found
Showing with 449 additions and 0 deletions
/config.inc.php
.project 0 → 100755
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>feeds</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.php.core.PhpIncrementalProjectBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.php.core.PHPNature</nature>
</natures>
</projectDescription>
Feeds.php 0 → 100755
<?php
require_once 'UNL/Templates.php';
/**
* General class for the feeds system
*
* PHP version 5
*
* @category Default
* @package UNL_
* @author Brett Bieber <brett.bieber@gmail.com>
* @copyright 2007 Regents of the University of Nebraska
* @license http://www1.unl.edu/wdn/wiki/Software_License BSD License
* @link http://pear.unl.edu/
*/
class UNL_Feeds
{
public $p;
static public $uri = 'http://www1.unl.edu/feeds/';
static public $ajaxfeedkey = 'ABQIAAAAmOdhottZNGGP3z2FnYTRnBR14WFt4Rg_n9cmW6HdTkUiifXUmRTykKqhrLLFn-vuZncfOG-LBKUVgw';
function __construct()
{
$this->initializeTemplate();
}
static function factory($table)
{
return DB_DataObject::factory($table);
}
function initializeTemplate()
{
$this->p = UNL_Templates::factory('Fixed');
UNL_Templates::$options['version'] = 3;
UNL_Templates::$options['templatedependentspath'] = '/srv/www/htdocs/';
$this->p->maincontentarea = '';
$this->p->doctitle = '<title>UNL | Feeds</title>';
$this->p->loadSharedCodeFiles();
$this->p->leftRandomPromo = '<div class="image_small_short" id="leftRandomPromo"> <a href="#" id="leftRandomPromoAnchor"><img id="leftRandomPromoImage" alt="" src="/ucomm/templatedependents/templatecss/images/transpixel.gif" /></a>
<script type="text/javascript" src="'.UNL_Feeds::$uri.'/sharedcode/leftRandomPromo.js"></script>
</div>';
$this->p->titlegraphic = '<h1>UNL Content Feeds</h1>';
ob_start();
include('sharedcode/navigation.php');
$this->p->navlinks = ob_get_contents();
ob_end_clean();
$this->p->leftcollinks = file_get_contents('sharedcode/relatedLinks.html');
$this->p->contactinfo = file_get_contents('sharedcode/footerContactInfo.html');
$this->p->breadcrumbs = '<ul>
<li><a href="http://www.unl.edu/">UNL</a></li> ';
$this->p->footercontent = file_get_contents('sharedcode/footer.html');
$this->p->maincontentarea = '<div class="two_col left"><!-- @@MC@@ --></div>
<div class="col right">
<div class="image_small_short"><img src="'.UNL_Feeds::$uri.'images/small_short.gif" alt="210x80"/></div>
<p class="caption">
Sites that have content feeds can be easily recognized by this symbol, or the words RSS.</p>
</div>';
}
function setMainContent($c)
{
$this->p->maincontentarea = str_replace('<!-- @@MC@@ -->', $c, $this->p->maincontentarea);
}
function showCategory(UNL_Feeds_Category $c)
{
$this->p->breadcrumbs .= '<li><a href="http://www1.unl.edu/feeds/">Feeds</a></li> ';
$mc = '';
$fc = UNL_Feeds::factory('feed_has_category');
$fc->category_id = $c->id;
if ($fc->find()) {
$this->p->breadcrumbs .= '<li>'.$c->category.'</li>';
$mc .= '<h1>'.$c->category.' UNL Feeds</h1>';
$mc .= '<ul>';
while ($fc->fetch()) {
$f = $fc->getLink('feed_id');
$mc .= feedLine($f);
}
$mc .= '</ul>';
} else {
$mc .= '<p>Sorry, no feeds are in that category yet!</p>';
}
$this->setMainContent($mc);
}
function showMedia(UNL_Feeds_Media $m)
{
$this->p->breadcrumbs .= '<li><a href="http://www1.unl.edu/feeds/">Feeds</a></li> ';
$mc = '';
$fm = UNL_Feeds::factory('feed_has_media');
$fm->media_id = $m->id;
if ($fm->find()) {
$this->p->breadcrumbs .= '<li>'.$m->media.'</li> ';
$mc .= '<h1>UNL '.$m->media.' Feeds</h1>';
$mc .= '<ul>';
while ($fm->fetch()) {
$f = $fm->getLink('feed_id');
$mc .= feedLine($f);
}
$mc .= '</ul>';
} else {
$mc .= '<p>Sorry, no feeds of that media type are available yet!</p>';
}
$this->setMainContent($mc);
}
function showIndex()
{
$mc = '<h1>Content Feeds from UNL</h1>';
$f = UNL_Feeds::factory('feed');
//$f->orderBy('RANDOM(id)');
//$f->limit(10);
if ($f->find()) {
$mc .= '<ul>';
while ($f->fetch()) {
$mc .= feedLine($f);
}
$mc .= '</ul>';
} else {
$mc .= '<p>Sorry, no content feeds could be found!</p>';
}
$p->breadcrumbs .= '<li>Feeds</li>';
$this->setMainContent($mc);
}
function toHtml()
{
$this->p->breadcrumbs .= '</ul>';
return $this->p->toHtml();
}
}
<?php
/**
* Table Definition for category
*/
require_once 'DB/DataObject.php';
class UNL_Feeds_Category extends DB_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
public $__table = 'category'; // table name
public $id; // int(10) not_null primary_key unsigned auto_increment
public $category; // string(100) not_null multiple_key
/* Static get */
function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('UNL_Feeds_Category',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
}
<?php
/**
* Table Definition for feed
*/
require_once 'DB/DataObject.php';
class UNL_Feeds_Feed extends DB_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
public $__table = 'feed'; // table name
public $id; // int(10) not_null primary_key unsigned auto_increment
public $title; // string(255) not_null multiple_key
public $uri; // string(255) not_null
public $manager_uid; // string(50)
/* Static get */
function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('UNL_Feeds_Feed',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
}
<?php
/**
* Table Definition for feed_has_category
*/
require_once 'DB/DataObject.php';
class UNL_Feeds_Feed_has_category extends DB_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
public $__table = 'feed_has_category'; // table name
public $feed_id; // int(10) not_null multiple_key unsigned
public $category_id; // int(10) not_null multiple_key unsigned
/* Static get */
function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('UNL_Feeds_Feed_has_category',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
}
<?php
/**
* Table Definition for feed_has_media
*/
require_once 'DB/DataObject.php';
class UNL_Feeds_Feed_has_media extends DB_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
public $__table = 'feed_has_media'; // table name
public $feed_id; // int(10) not_null multiple_key unsigned
public $media_id; // int(10) not_null multiple_key unsigned
/* Static get */
function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('UNL_Feeds_Feed_has_media',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
}
<?php
/**
* Table Definition for media
*/
require_once 'DB/DataObject.php';
class UNL_Feeds_Media extends DB_DataObject
{
###START_AUTOCODE
/* the code below is auto generated do not remove the above tag */
public $__table = 'media'; // table name
public $id; // int(10) not_null primary_key unsigned auto_increment
public $media; // string(100) not_null
/* Static get */
function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('UNL_Feeds_Media',$k,$v); }
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
}
[category]
id = 129
category = 130
[category__keys]
id = N
[feed]
id = 129
title = 130
uri = 130
manager_uid = 2
[feed__keys]
id = N
[feed_has_category]
feed_id = 129
category_id = 129
[feed_has_category__keys]
[feed_has_media]
feed_id = 129
media_id = 129
[feed_has_media__keys]
[media]
id = 129
media = 130
[media__keys]
id = N
[feed_has_category]
feed_id = feed:id
category_id = category:id
[feed_has_media]
feed_id = feed:id
media_id = media:id
\ No newline at end of file
about.php 0 → 100755
<?php require_once 'config.inc.php'; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><!-- InstanceBegin template="/Templates/php.fixed.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<!--
Membership and regular participation in the UNL Web Developer Network
is required to use the UNL templates. Visit the WDN site at
http://wdn.unl.edu/. Click the WDN Registry link to log in and
register your unl.edu site.
All UNL template code is the property of the UNL Web Developer Network.
The code seen in a source code view is not, and may not be used as, a
template. You may not use this code, a reverse-engineered version of
this code, or its associated visual presentation in whole or in part to
create a derivative work.
This message may not be removed from any pages based on the UNL site template.
$Id: php.fixed.dwt.php 536 2009-07-23 15:47:30Z bbieber2 $
-->
<link rel="stylesheet" type="text/css" media="screen" href="/wdn/templates_3.0/css/all.css" />
<link rel="stylesheet" type="text/css" media="print" href="/wdn/templates_3.0/css/print.css" />
<script type="text/javascript" src="/wdn/templates_3.0/scripts/all.js"></script>
<?php virtual('/wdn/templates_3.0/includes/browserspecifics.html'); ?>
<?php virtual('/wdn/templates_3.0/includes/metanfavico.html'); ?>
<!-- InstanceBeginEditable name="doctitle" -->
<title>UNL | Feeds | About</title>
<!-- InstanceEndEditable --><!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
</head>
<body class="fixed">
<p class="skipnav"> <a class="skipnav" href="#maincontent">Skip Navigation</a> </p>
<div id="wdn_wrapper">
<div id="header"> <a href="http://www.unl.edu/" title="UNL website"><img src="/wdn/templates_3.0/images/logo.png" alt="UNL graphic identifier" id="logo" /></a>
<h1>University of Nebraska&ndash;Lincoln</h1>
<?php virtual('/wdn/templates_3.0/includes/wdnTools.html'); ?>
</div>
<div id="wdn_navigation_bar">
<div id="breadcrumbs">
<!-- WDN: see glossary item 'breadcrumbs' -->
<!-- InstanceBeginEditable name="breadcrumbs" -->
<!-- WDN: see glossary item 'breadcrumbs' -->
<ul>
<li class="first"><a href="http://www.unl.edu/">UNL</a></li>
<li><a href="/feeds/">Feeds</a></li>
<li>About</li>
</ul>
<!-- InstanceEndEditable --></div>
<div id="wdn_navigation_wrapper">
<div id="navigation"><!-- InstanceBeginEditable name="navlinks" -->
<?php include('sharedcode/navigation.php'); ?>
<!-- InstanceEndEditable --></div>
</div>
</div>
<div id="wdn_content_wrapper">
<div id="titlegraphic"><!-- InstanceBeginEditable name="titlegraphic" -->
<h1>UNL Content Feeds</h1>
<h2>Tune In To What's Happening</h2>
<!-- InstanceEndEditable --></div>
<div id="pagetitle"><!-- InstanceBeginEditable name="pagetitle" --> <!-- InstanceEndEditable --></div>
<div id="maincontent">
<!--THIS IS THE MAIN CONTENT AREA; WDN: see glossary item 'main content area' -->
<!-- InstanceBeginEditable name="maincontentarea" -->
<h1>About RSS/Podcasts/XML Feeds</h1>
<h2>What's RSS?</h2>
<p>RSS is an open-standard XML format for publishing news headlines on the Internet, in a process known as syndication. People subscribe to these news feeds by using a news aggregator or news reader, a specialized application for displaying RSS headlines from multiple news feeds. The application connects to the news services at preset intervals, and downloads new items as they are published. By default, headlines are sorted most-recent-first, and usually carry a short summary and a link to the web page where the full story is displayed.</p>
<h2>What does 'RSS' stand for?</h2>
<p>It either stands for Rich Site Summary, or it stands for Really Simple Syndication. People argue about things like this. Really.</p>
<h2>What news readers or news aggregators do you recommend?</h2>
<p>For Windows 98 and above, we recommend <a href="http://www.bradsoft.com/feeddemon/" target="_blank">FeedDemon</a>, available in a trial version. For Mac OSX, we recommend <a href="http://ranchero.com/netnewswire/" target="_blank">NetNewsWire</a>, which comes in a freeware 'lite' version or a more capable full version. There are many, many RSS readers available ... the adventurous may wish to try versiontracker.com and search for 'rss aggregator' or 'rss reader.'</p>
<!-- InstanceEndEditable -->
<div class="clear"></div>
<?php virtual('/wdn/templates_3.0/includes/noscript.html'); ?>
<!--THIS IS THE END OF THE MAIN CONTENT AREA.-->
</div>
<div id="footer">
<div id="footer_floater"></div>
<div class="footer_col">
<?php virtual('/wdn/templates_3.0/includes/feedback.html'); ?>
</div>
<div class="footer_col"><!-- InstanceBeginEditable name="leftcollinks" -->
<?php include('sharedcode/relatedLinks.html'); ?>
<!-- InstanceEndEditable --></div>
<div class="footer_col"><!-- InstanceBeginEditable name="contactinfo" -->
<?php include 'sharedcode/footerContactInfo.html'; ?>
<!-- InstanceEndEditable --></div>
<div class="footer_col">
<?php virtual('/wdn/templates_3.0/includes/socialmediashare.html'); ?>
</div>
<!-- InstanceBeginEditable name="optionalfooter" --> <!-- InstanceEndEditable -->
<div id="wdn_copyright"><!-- InstanceBeginEditable name="footercontent" -->
<?php include('sharedcode/footer.html'); ?>
<!-- InstanceEndEditable -->
<?php virtual('/wdn/templates_3.0/includes/wdn.html'); ?>
| <a href="http://validator.unl.edu/check/referer">W3C</a> | <a href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3">CSS</a> <a href="http://www.unl.edu/" title="UNL Home" id="wdn_unl_wordmark"><img src="/wdn/templates_3.0/css/footer/images/wordmark.png" alt="UNL's wordmark" /></a> </div>
</div>
</div>
<div id="wdn_wrapper_footer"> </div>
</div>
</body><!-- InstanceEnd -->
</html>
RewriteEngine On
RewriteRule ^category/(.*)$ /feeds/directory/index.php?category=$1
RewriteRule ^media/(.*)$ /feeds/directory/index.php?media=$1
<?php
chdir('../');
require_once 'config.inc.php';
require_once 'Feeds.php';
$f = new UNL_Feeds();
if (isset($_GET['category'])) {
$f->showCategory(UNL_Feeds_Category::staticGet('category',$_GET['category']));
} elseif (isset($_GET['media'])) {
$f->showMedia(UNL_Feeds_Media::staticGet('media',$_GET['media']));
} elseif (isset($_GET['format'])) {
$feeds = UNL_Feeds::factory('feed');
if ($feeds->find()) {
echo 'id,title,uri'.PHP_EOL;
while ($feeds->fetch()) {
echo "{$feeds->id},{$feeds->title},{$feeds->uri}".PHP_EOL;
}
}
exit();
} else {
$f->showIndex();
}
echo $f->toHtml();
[DB_DataObject]
database = mysql://feeds:BRL2ZQjcMrhDtZKh@localhost/feeds
schema_location = /Library/WebServer/Documents/feeds/DataObjects
class_location = /Library/WebServer/Documents/feeds/DataObjects
require_prefix = DataObjects/
class_prefix = DataObjects_
feeds.png 0 → 100755
feeds.png

4.12 KiB

images/2008/20080211_clinton.jpg

14.9 KiB

images/2008/20080211_obama.jpg

12.3 KiB

images/2008/20080418_nl.jpg

14.4 KiB

images/2008/20080905_sotu.jpg

29 KiB

images/2008/20080919_mcc.jpg

23 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment