diff options
| author | Tyler Bello <tylerbello@users.sourceforge.net> | 2009-08-25 19:14:44 +0000 |
|---|---|---|
| committer | Tyler Bello <tylerbello@users.sourceforge.net> | 2009-08-25 19:14:44 +0000 |
| commit | 304878f137e77f82a822fe82196a79d29ef6fb76 (patch) | |
| tree | a238f7d75944d11e2796574db3343ed77648d8d9 /admin | |
| download | feed-304878f137e77f82a822fe82196a79d29ef6fb76.tar.gz feed-304878f137e77f82a822fe82196a79d29ef6fb76.tar.bz2 feed-304878f137e77f82a822fe82196a79d29ef6fb76.zip | |
Import feed package, makes use of liberty_action_log to implement a Facebook style feed display
Diffstat (limited to 'admin')
| -rw-r--r-- | admin/admin_feed_inc.php | 31 | ||||
| -rw-r--r-- | admin/schema_inc.php | 32 |
2 files changed, 63 insertions, 0 deletions
diff --git a/admin/admin_feed_inc.php b/admin/admin_feed_inc.php new file mode 100644 index 0000000..530671f --- /dev/null +++ b/admin/admin_feed_inc.php @@ -0,0 +1,31 @@ +<?php + +global $gBitSmarty; + + +$contentTypes = get_content_types(); + +$deleteSql = "DELETE FROM feed_conjugation"; +$gBitDb->query($deleteSql); + +foreach ( $contentTypes as $type ){ + $insertSql = "INSERT INTO feed_conjugation (content_type_guid, conjugation_phrase, is_target_linked) VALUES ( ?, ?, ?)"; + $gBitDb->query($insertSql, array( $type['content_type_guid'], $_REQUEST[$type['content_type_guid']], empty($_REQUEST[$type['content_type_guid'].'_target'])?'t':'f' ) ); + } + +$contentTypes = get_content_types(); +$gBitSmarty->assign_by_ref('contentTypes',$contentTypes); + + + + + +function get_content_types(){ + global $gBitDb; + $selectSql = "SELECT lct.content_type_guid,conjugation_phrase, is_target_linked FROM liberty_content_types lct LEFT JOIN feed_conjugation fc ON (fc.content_type_guid = lct.content_type_guid)"; + $contentTypes = $gBitDb->getAll($selectSql); + return $contentTypes; + +} + +?> diff --git a/admin/schema_inc.php b/admin/schema_inc.php new file mode 100644 index 0000000..128a2b4 --- /dev/null +++ b/admin/schema_inc.php @@ -0,0 +1,32 @@ +<?php +$tables = array( + 'feed_conjugation' => " + content_type_guid C(16) NOTNULL, + conjugation_phrase C(255) NOTNULL, + is_target_linked C(1) + CONSTRAINT ', CONSTRAINT `feed_conj_content_type_ref` FOREIGN KEY (`content_type_guid`) REFERENCES `".BIT_DB_PREFIX."liberty_content_types` ( `content_type_guid` )' + " +); + +global $gBitInstaller; + +foreach( array_keys( $tables ) AS $tableName ) { + $gBitInstaller->registerSchemaTable( FEED_PKG_NAME, $tableName, $tables[$tableName] ); +} + +$gBitInstaller->registerSchemaDefault( FEED_PKG_NAME, array( + + "INSERT INTO `".BIT_DB_PREFIX."feed_conjugation` (`content_type_guid`, `conjugation_phrase`, `is_target_linked`) VALUES ('bituser', 'updated their profile', 'y')", +)); + +$gBitInstaller->registerPackageInfo( FEED_PKG_NAME, array( + 'description' => "User feed package that makes use of Liberty action log", + 'license' => '<a href="http://www.gnu.org/licenses/licenses.html#LGPL">LGPL</a>', +) ); + +// ### Default UserPermissions +$gBitInstaller->registerUserPermissions( TAGS_PKG_NAME, array( + array( 'p_feed_admin', 'Can admin feeds', 'admin', FEED_PKG_NAME ), + array( 'p_feed_view', 'Can view feed', 'basic', FEED_PKG_NAME ), +) ); +?> |
