[geeklog-cvs] geeklog: Syndication editor now uses topic information from topi...
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Mon Dec 5 11:46:59 EST 2011
changeset 8451:da4108b6e32e
url: http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/da4108b6e32e
user: Tom <websitemaster at cogeco.net>
date: Mon Dec 05 11:32:32 2011 -0500
description:
Syndication editor now uses topic information from topic array.
diffstat:
public_html/admin/syndication.php | 77 ++++++++++++++------------------------
1 files changed, 29 insertions(+), 48 deletions(-)
diffs (120 lines):
diff -r 8703014a4baa -r da4108b6e32e public_html/admin/syndication.php
--- a/public_html/admin/syndication.php Mon Dec 05 11:30:31 2011 -0500
+++ b/public_html/admin/syndication.php Mon Dec 05 11:32:32 2011 -0500
@@ -147,40 +147,6 @@
}
/**
-* Return list of types available for article feeds
-*
-* @return array an array with id/name pairs for every feed
-*
-*/
-function get_articleFeeds()
-{
- global $_CONF, $_TABLES, $LANG33;
-
- $options = array ();
-
- $sql = "SELECT tid,topic FROM {$_TABLES['topics']} WHERE perm_anon >= 2 ORDER BY ";
- if ($_CONF['sortmethod'] == 'alpha') {
- $sql .= 'topic ASC';
- } else {
- $sql .= 'sortnum';
- }
- $result = DB_query ($sql);
- $num = DB_numRows ($result);
-
- if ($num > 0) {
- $options[] = array ('id' => '::all', 'name' => $LANG33[23]);
- $options[] = array ('id' => '::frontpage', 'name' => $LANG33[53]);
- }
-
- for ($i = 0; $i < $num; $i++) {
- $A = DB_fetchArray ($result);
- $options[] = array ('id' => $A['tid'], 'name' => '-- ' . $A['topic']);
- }
-
- return $options;
-}
-
-/**
* List all feeds
*
* @return string HTML with the list of all feeds
@@ -322,21 +288,23 @@
$feed_template->set_var ('lang_language', $LANG33[32]);
$feed_template->set_var ('lang_topic', $LANG33[33]);
+ /*
if ($A['header_tid'] == 'all') {
$feed_template->set_var('all_selected', 'selected="selected"');
} elseif ($A['header_tid'] == 'none') {
$feed_template->set_var('none_selected', 'selected="selected"');
}
-
+ */
+
$feed_template->set_var('lang_header_all', $LANG33[43]);
$feed_template->set_var('lang_header_none', $LANG33[44]);
$feed_template->set_var('lang_header_topic', $LANG33[45]);
- $feed_template->set_var('header_topic_options',
- COM_topicList('tid,topic', $A['header_tid'], 1, true));
- // $feed_template->set_var('header_topic_options', TOPIC_getTopicListSelect($A['header_tid'], 2, true));
+ //$feed_template->set_var('header_topic_options',
+ // COM_topicList('tid,topic', $A['header_tid'], 1, true));
+ $feed_template->set_var('header_topic_options', TOPIC_getTopicListSelect($A['header_tid'], 6, true));
$feed_template->set_var('lang_save', $LANG_ADMIN['save']);
@@ -410,7 +378,19 @@
$feed_template->set_var ('feed_limits_what', $selection);
if ($A['type'] == 'article') {
- $options = get_articleFeeds();
+ $options[] = array ('id' => '::all', 'name' => $LANG33[23]);
+ $options[] = array ('id' => '::frontpage', 'name' => $LANG33[53]);
+
+ $selection = '<select name="topic">' . LB;
+ foreach ($options as $o) {
+ $selection .= '<option value="' . $o['id'] . '"';
+ if ($A['topic'] == $o['id']) {
+ $selection .= ' selected="selected"';
+ }
+ $selection .= '>' . $o['name'] . '</option>' . LB;
+ }
+ $selection .= TOPIC_getTopicListSelect($A['topic'], 0, false, '', false, 1);
+ $selection .= '</select>' . LB;
} else {
$result = DB_query("SELECT pi_enabled FROM {$_TABLES['plugins']} WHERE pi_name='{$A['type']}'");
if($result)
@@ -423,16 +403,17 @@
}
}
$options = PLG_getFeedNames ($A['type']);
+
+ $selection = '<select name="topic">' . LB;
+ foreach ($options as $o) {
+ $selection .= '<option value="' . $o['id'] . '"';
+ if ($A['topic'] == $o['id']) {
+ $selection .= ' selected="selected"';
+ }
+ $selection .= '>' . $o['name'] . '</option>' . LB;
+ }
+ $selection .= '</select>' . LB;
}
- $selection = '<select name="topic">' . LB;
- foreach ($options as $o) {
- $selection .= '<option value="' . $o['id'] . '"';
- if ($A['topic'] == $o['id']) {
- $selection .= ' selected="selected"';
- }
- $selection .= '>' . $o['name'] . '</option>' . LB;
- }
- $selection .= '</select>' . LB;
$feed_template->set_var ('feed_topic', $selection);
if ($A['is_enabled'] == 1) {
More information about the geeklog-cvs
mailing list