Ejemplo n.º 1
1
function update_tag()
{
    global $xoopsModule, $xoopsSecurity;
    $page = rmc_server_var($_POST, 'page', 1);
    $tags = rmc_server_var($_POST, 'tags', array());
    if (!$xoopsSecurity->check()) {
        redirectMsg('tags.php?page=' . $page, __('Sorry, operation not allowed!', 'mywords'), 1);
        die;
    }
    if (!is_array($tags) || empty($tags)) {
        redirectMsg('tags.php?page=' . $page, __('Please, specify a valid tag id!', 'mywords'), 1);
        die;
    }
    foreach ($tags as $id) {
        $tag = new MWTag($id);
        if ($tag->isNew()) {
            continue;
        }
        $tag->update_posts();
    }
    redirectMsg('tags.php?page=' . $page, __('Tags updated!', 'mywords'), 0);
}
Ejemplo n.º 2
0
         }
         $item['description'] = XoopsLocal::convert_encoding(htmlspecialchars($image . $post->content(true), ENT_QUOTES));
         $item['pubdate'] = formatTimestamp($post->getVar('pubdate'), 'rss');
         $item['guid'] = $post->permalink();
         $rss_items[] = $item;
     }
     break;
 case 'tag':
     include_once XOOPS_ROOT_PATH . '/modules/mywords/class/mwtag.class.php';
     $id = rmc_server_var($_GET, 'tag', 0);
     if ($id <= 0) {
         redirect_header('backend.php', 1, __('Sorry, specified tag was not foud!', 'mywords'));
         die;
     }
     $tag = new MWTag($id);
     if ($tag->isNew()) {
         redirect_header('backend.php', 1, __('Sorry, specified tag was not foud!', 'mywords'));
         die;
     }
     $rss_channel['title'] = sprintf(__('Posts tagged %s in %s', 'mywords'), $tag->tag, $xoopsConfig['sitename']);
     $rss_channel['link'] = $tag->permalink();
     $rss_channel['description'] = sprintf(__('Posts tagged as %s', 'mywords'), $tag->getVar('tag'));
     $rss_channel['lastbuild'] = formatTimestamp(time(), 'rss');
     $rss_channel['webmaster'] = checkEmail($xoopsConfig['adminmail'], true);
     $rss_channel['editor'] = checkEmail($xoopsConfig['adminmail'], true);
     $rss_channel['category'] = "Blog";
     $rss_channel['generator'] = 'Common Utilities';
     $rss_channel['language'] = RMCLANG;
     $posts = MWFunctions::get_posts_by_tag($id, 0, 10);
     $rss_items = array();
     foreach ($posts as $post) {