예제 #1
0
/**
 * Get all the topics available
 *
 * @param   array   args    Contains all the data provided by the client
 * @param   string  &output OUTPUT parameter containing the returned text
 * @return  int         Response code as defined in lib-plugins.php
 */
function service_getTopicList_story($args, &$output, &$svc_msg)
{
    $output = COM_topicArray('tid');
    return PLG_RET_OK;
}
예제 #2
0
/**
* Create and return a dropdown-list of available topics
*
* This is a variation of COM_optionList() from lib-common.php. It will add
* only those topics to the option list which are accessible by the current
* user.
*
* @param        string      $selection  Comma delimited string of fields to pull The first field is the value of the option and the second is the label to be displayed.  This is used in a SQL statement and can include DISTINCT to start.
* @param        string      $selected   Value (from $selection) to set to SELECTED or default
* @param        int         $sortcol    Which field to sort option list by 0 (value) or 1 (label)
* @param        boolean     $ignorelang Whether to return all topics (true) or only the ones for the current language (false)
* @see function COM_optionList
* @return   string  Formated HTML of option values
*
*/
function COM_topicList($selection, $selected = '', $sortcol = 1, $ignorelang = false)
{
    global $_TABLES;
    $retval = '';
    $topics = COM_topicArray($selection, $sortcol, $ignorelang);
    foreach ($topics as $tid => $topic) {
        $retval .= '<option value="' . $tid . '"';
        if ($tid == $selected) {
            $retval .= ' selected="selected"';
        }
        $retval .= '>' . $topic . '</option>' . LB;
    }
    return $retval;
}
예제 #3
0
/**
 * Get all the topics available
 *
 * @param   array  $args    Contains all the data provided by the client
 * @param   string &$output OUTPUT parameter containing the returned text
 * @return  int         Response code as defined in lib-plugins.php
 */
function service_getTopicList_staticpages($args, &$output, &$svc_msg)
{
    $output = COM_topicArray('tid');
    $output[] = 'all';
    $output[] = 'none';
    return PLG_RET_OK;
}
예제 #4
0
/**
* Create and return a dropdown-list of available topics
*
* This is a variation of COM_optionList() from lib-common.php. It will add
* only those topics to the option list which are accessible by the current
* user.
*
* @param        string      $selection  Comma delimited string of fields to pull The first field is the value of the option and the second is the label to be displayed.  This is used in a SQL statement and can include DISTINCT to start.
* @param        string      $selected   Value (from $selection) to set to SELECTED or default
* @param        int         $sortcol    Which field to sort option list by 0 (value) or 1 (label)
* @param        boolean     $ignorelang Whether to return all topics (true) or only the ones for the current language (false)
* @see function COM_optionList
* @return   string  Formated HTML of option values
*
*/
function COM_topicList($selection, $selected = '', $sortcol = 1, $ignorelang = false, $access = 2)
{
    global $_TABLES;
    $retval = '';
    $topics = COM_topicArray($selection, $sortcol, $ignorelang, $access);
    if (is_array($topics)) {
        foreach ($topics as $tid => $topic) {
            $retval .= '<option value="' . $tid . '"';
            if ($tid == $selected) {
                $retval .= ' selected="selected"';
            }
            $retval .= '>' . $topic;
            if (isset($tid)) {
                $retval .= ' (' . $tid . ')';
            }
            $retval .= '</option>' . LB;
        }
    }
    return $retval;
}
예제 #5
0
/**
 * Create and return a dropdown-list of available topics
 * This is a variation of COM_optionList() from lib-common.php. It will add
 * only those topics to the option list which are accessible by the current
 * user.
 *
 * @param        string  $selection  Comma delimited string of fields to pull The first field is the value of the
 *                                   option and the second is the label to be displayed.  This is used in a SQL
 *                                   statement and can include DISTINCT to start.
 * @param        string  $selected   Value (from $selection) to set to SELECTED or default
 * @param        int     $sortCol    Which field to sort option list by 0 (value) or 1 (label)
 * @param        boolean $ignoreLang Whether to return all topics (true) or only the ones for the current language
 *                                   (false)
 * @see function COM_optionList
 * @return   string  Formatted HTML of option values
 */
function COM_topicList($selection, $selected = '', $sortCol = 1, $ignoreLang = false)
{
    $retval = '';
    $topics = COM_topicArray($selection, $sortCol, $ignoreLang);
    foreach ($topics as $tid => $topic) {
        $retval .= '<option value="' . $tid . '"';
        if (is_array($selected)) {
            foreach ($selected as $multiSelectTid) {
                if ($tid == $multiSelectTid) {
                    $retval .= ' selected="selected"';
                    break;
                }
            }
        } else {
            if ($tid == $selected) {
                $retval .= ' selected="selected"';
            }
        }
        $retval .= '>' . $topic . '</option>' . LB;
    }
    return $retval;
}
예제 #6
0
        $directory = DIR_displayAll($template, $dir_topic);
        $page_navigation = '';
        $block_title = $LANG_DIR['title'];
        $val_year = 0;
        $val_month = 0;
        if ($conf_list_current_month) {
            $currenttime = time();
            $currentyear = date('Y', $currenttime);
            $currentmonth = date('n', $currenttime);
            $thismonth = COM_startBlock($LANG_MONTH[$currentmonth]) . DIR_displayMonth($template, $dir_topic, $currentyear, $currentmonth) . COM_endBlock();
            $template->set_var('current_month', $thismonth);
        }
    }
}
$topic_list = '<option value="all">' . $LANG21[7] . '</option>';
$topics = COM_topicArray('tid,topic', 1, false, 2);
if (is_array($topics)) {
    foreach ($topics as $tid => $topic) {
        $topic_list .= '<option value="' . $tid . '"';
        if ($tid == $dir_topic) {
            $topic_list .= ' selected="selected"';
        }
        $topic_list .= '>' . $topic;
        if (isset($tid)) {
            $topic_list .= ' (' . $tid . ')';
        }
        $topic_list .= '</option>' . LB;
    }
}
$template->set_var(array('url' => $_CONF['site_url'] . '/directory.php', 'topic_list' => $topic_list, 'blockheader' => COM_startBlock($block_title), 'val_year' => $val_year, 'val_month' => $val_month, 'directory' => $directory, 'page_navigation' => $page_navigation, 'blockfooter' => COM_endBlock()));
$template->parse('output', 't_directory');