Пример #1
0
function category_list($message = "")
{
    global $use_sections, $use_categories;
    pagetop(gTxt('categories'), $message);
    $out = array('<table cellspacing="20" align="center">', '<tr>', $use_categories ? tdtl(article_list(), ' class="categories"') : '', tdtl(link_list(), ' class="categories"'), tdtl(image_list(), ' class="categories"'), '</tr>', endTable());
    echo join(n, $out);
}
Пример #2
0
function link_edit($message = "")
{
    global $vars, $step;
    extract(gpsa($vars));
    pagetop(gTxt('edit_links', $message));
    $id = gps('id');
    if ($id && $step == 'link_edit') {
        extract(safe_row("*", "txp_link", "id = {$id}"));
    }
    if ($step == 'link_save' or $step == 'link_post') {
        foreach ($vars as $var) {
            ${$var} = '';
        }
    }
    $textarea = '<textarea name="description" cols="40" rows="7" tabindex="4">' . $description . '</textarea>';
    $selects = linkcategory_popup($category);
    $editlink = ' [' . eLink('category', 'list', '', '', gTxt('edit')) . ']';
    $out = startTable('edit') . tr(fLabelCell('title') . fInputCell('linkname', $linkname, 1, 30)) . tr(fLabelCell('sort_value') . fInputCell('linksort', $linksort, 2, 15)) . tr(fLabelCell('url', 'link_url') . fInputCell('url', $url, 3, 30)) . tr(fLabelCell('link_category', 'link_category') . td($selects . $editlink)) . tr(fLabelCell('description', 'link_description') . tda($textarea, ' valign="top"')) . tr(td() . td(fInput("submit", '', gTxt('save'), "publish"))) . endTable() . eInput('link') . sInput($step == 'link_edit' ? 'link_save' : 'link_post') . hInput('id', $id);
    echo form($out);
    echo link_list();
}
Пример #3
0
function link_edit($message = '')
{
    global $vars, $step;
    pagetop(gTxt('edit_links'), $message);
    extract(gpsa($vars));
    $rs = array();
    if ($id && $step == 'link_edit') {
        $id = assert_int($id);
        $rs = safe_row('*', 'txp_link', "id = {$id}");
        extract($rs);
    }
    if ($step == 'link_save' or $step == 'link_post') {
        foreach ($vars as $var) {
            ${$var} = '';
        }
    }
    echo form(startTable('edit') . tr(fLabelCell('title', '', 'link-title') . fInputCell('linkname', $linkname, 1, 30, '', 'link-title')) . tr(fLabelCell('sort_value', '', 'link-sort') . fInputCell('linksort', $linksort, 2, 15, '', 'link-sort')) . tr(fLabelCell('url', 'link_url', 'link-url') . fInputCell('url', $url, 3, 30, '', 'link-url')) . tr(fLabelCell('link_category', 'link_category', 'link-category') . td(linkcategory_popup($category) . ' [' . eLink('category', 'list', '', '', gTxt('edit')) . ']')) . tr(tda('<label for="link-description">' . gTxt('description') . '</label>' . sp . popHelp('link_description'), ' style="text-align: right; vertical-align: top;"') . td('<textarea id="link-description" name="description" cols="40" rows="7" tabindex="4">' . htmlspecialchars($description) . '</textarea>')) . pluggable_ui('link_ui', 'extend_detail_form', '', $rs) . tr(td() . td(fInput('submit', '', gTxt('save'), 'publish'))) . endTable() . eInput('link') . ($id ? sInput('link_save') . hInput('id', $id) : sInput('link_post')) . hInput('search_method', gps('search_method')) . hInput('crit', gps('crit')), 'margin-bottom: 25px;');
    echo link_list();
}
Пример #4
0
function link_multi_edit()
{
    global $txp_user, $all_link_cats, $all_link_authors;
    // Empty entry to permit clearing the category
    $categories = array('');
    foreach ($all_link_cats as $row) {
        $categories[] = $row['name'];
    }
    $selected = ps('selected');
    if (!$selected or !is_array($selected)) {
        link_list();
        return;
    }
    $selected = array_map('assert_int', $selected);
    $method = ps('edit_method');
    $changed = array();
    $key = '';
    switch ($method) {
        case 'delete':
            if (!has_privs('link.delete')) {
                if (has_privs('link.delete.own')) {
                    $selected = safe_column('id', 'txp_link', 'id IN (' . join(',', $selected) . ') AND author=\'' . doSlash($txp_user) . '\'');
                } else {
                    $selected = array();
                }
            }
            foreach ($selected as $id) {
                if (safe_delete('txp_link', 'id = ' . $id)) {
                    $changed[] = $id;
                }
            }
            if ($changed) {
                callback_event('links_deleted', '', 0, $changed);
            }
            $key = '';
            break;
        case 'changecategory':
            $val = ps('category');
            if (in_array($val, $categories)) {
                $key = 'category';
            }
            break;
        case 'changeauthor':
            $val = ps('author');
            if (in_array($val, $all_link_authors)) {
                $key = 'author';
            }
            break;
        default:
            $key = '';
            $val = '';
            break;
    }
    if ($selected and $key) {
        foreach ($selected as $id) {
            if (safe_update('txp_link', "{$key} = '" . doSlash($val) . "'", "id = {$id}")) {
                $changed[] = $id;
            }
        }
    }
    if ($changed) {
        update_lastmod();
        link_list(gTxt($method == 'delete' ? 'links_deleted' : 'link_updated', array($method == 'delete' ? '{list}' : '{name}' => join(', ', $changed))));
        return;
    }
    link_list();
}
Пример #5
0
function link_edit($message = '')
{
    global $vars, $event, $step, $txp_user;
    pagetop(gTxt('edit_links'), $message);
    echo '<div id="' . $event . '_container" class="txp-container">';
    extract(gpsa($vars));
    $rs = array();
    if ($id && $step == 'link_edit') {
        $id = assert_int($id);
        $rs = safe_row('*', 'txp_link', "id = {$id}");
        if ($rs) {
            extract($rs);
            if (!has_privs('link.edit') && !($author == $txp_user && has_privs('link.edit.own'))) {
                link_list(gTxt('restricted_area'));
                return;
            }
        }
    }
    if ($step == 'link_save' or $step == 'link_post') {
        foreach ($vars as $var) {
            ${$var} = '';
        }
    }
    if (has_privs('link.edit') || has_privs('link.edit.own')) {
        echo '<div class="txp-edit">' . form(startTable('edit', '', 'edit-pane') . tr(fLabelCell('title', '', 'link-title') . fInputCell('linkname', $linkname, 1, 30, '', 'link-title'), ' class="name"') . tr(fLabelCell('sort_value', '', 'link-sort') . fInputCell('linksort', $linksort, 2, 15, '', 'link-sort'), ' class="sort"') . tr(fLabelCell('url', 'link_url', 'link-url') . fInputCell('url', $url, 3, 30, '', 'link-url'), ' class="url"') . tr(fLabelCell('link_category', 'link_category', 'link-category') . td(linkcategory_popup($category) . ' [' . eLink('category', 'list', '', '', gTxt('edit')) . ']'), ' class="category"') . tr(tda('<label for="link-description">' . gTxt('description') . '</label>' . sp . popHelp('link_description'), ' style="text-align: right; vertical-align: top;"') . td('<textarea id="link-description" name="description" cols="40" rows="7" tabindex="4">' . htmlspecialchars($description) . '</textarea>'), ' class="description text"') . pluggable_ui('link_ui', 'extend_detail_form', '', $rs) . tr(td() . td(fInput('submit', '', gTxt('save'), 'publish'))) . endTable() . eInput('link') . ($id ? sInput('link_save') . hInput('id', $id) : sInput('link_post')) . hInput('search_method', gps('search_method')) . hInput('crit', gps('crit')), 'margin-bottom: 25px;', '', 'post', 'edit-form', '', 'link_details') . '</div>';
    }
    link_list();
    echo '</div>';
}
Пример #6
0
?>
					
<?php 
if (isset($data_sources->music) && count($data_sources->music) > 0) {
    ?>
					<div id="music" class="module">
						<h2 class="module-header"><span>What I'm Hearing:</span></h2>
						<div class="module-content links">
							<?php 
    $music = array();
    foreach (array_intersect_key($data_sources->sources, array_flip($data_sources->music)) as $source) {
        $music[] = $source[1];
    }
    ?>
							<?php 
    echo link_list(combine_feeds($music, MAX_ITEMS * 2));
    ?>
						</div>
					</div>
<?php 
}
?>

<?php 
if (isset($data_sources->location) && count($data_sources->location) > 0) {
    ?>
					<div id="location" class="module">
						<h2 class="module-header"><span>Where I've Been Checking In:</span></h2>
<?php 
    $location = array();
    foreach (array_intersect_key($data_sources->sources, array_flip($data_sources->location)) as $source) {