summaryrefslogtreecommitdiff
path: root/admin
diff options
context:
space:
mode:
authorChristian Fowler <spider@viovio.com>2009-09-02 16:42:32 +0000
committerChristian Fowler <spider@viovio.com>2009-09-02 16:42:32 +0000
commitfbca59a4aedbed10a4eb81fd6d2f0e838137be9d (patch)
tree1dedf42bef7a3a4574a23b18ed801efc35ef8c76 /admin
parente907dd7fc0ba3fb72931fc2377b54b78f6b21e63 (diff)
downloadfeed-fbca59a4aedbed10a4eb81fd6d2f0e838137be9d.tar.gz
feed-fbca59a4aedbed10a4eb81fd6d2f0e838137be9d.tar.bz2
feed-fbca59a4aedbed10a4eb81fd6d2f0e838137be9d.zip
fix up editing and add feed icon
Diffstat (limited to 'admin')
-rw-r--r--admin/admin_feed_inc.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/admin/admin_feed_inc.php b/admin/admin_feed_inc.php
index 530671f..8328177 100644
--- a/admin/admin_feed_inc.php
+++ b/admin/admin_feed_inc.php
@@ -5,25 +5,29 @@ global $gBitSmarty;
$contentTypes = get_content_types();
-$deleteSql = "DELETE FROM feed_conjugation";
-$gBitDb->query($deleteSql);
+if( !empty( $_REQUEST['store_feed'] ) ) {
-foreach ( $contentTypes as $type ){
+ $deleteSql = "DELETE FROM feed_conjugation";
+ $gBitDb->query($deleteSql);
+
+ foreach ( array_keys( $contentTypes ) as $type ){
+ if( !empty( $_REQUEST[$type]['conjugation_phrase'] ) || !empty( $_REQUEST[$type]['is_target_linked'] ) ) {
$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' ) );
+ $gBitDb->query($insertSql, array( $type, $_REQUEST[$type]['conjugation_phrase'], empty($_REQUEST[$type]['is_target_linked'])?'y' : NULL ) );
}
+ }
+
+}
$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);
+ $contentTypes = $gBitDb->getAssoc($selectSql);
return $contentTypes;
}