*/
//only add tags,
//do not remove tags from CMS when there is no tag-post association
//
//trim spaces
if (!empty($tagstring)) {
    $tagstring = str_replace(' ', '', $tagstring);
    //echo $tagstring ;
    $tags = explode(',', $tagstring);
    sort($tags);
    echo '<h2>identified tags from the form field</h2>';
    pretty($tags);
}
add_cms_tags($tags);
//now that we know which tags are sent from the form
//attach them to the post
//delete current tag_post association
//
remove_tag_post_association($id);
add_tag_post_association($tags, $id);
echo '<h2>======= END  TAG SECTION ============</h2>';
//END OF METADATA PROCESSING
//update the RSS Feed
build_rss();
//update the sitemap
build_sitemap();
echo "<meta http-equiv='refresh' content='" . $redir_delay . "; url={$tld2}/manage/write.php?id={$id}'>";
$db->close();
?>

Exemple #2
0
         die('No meta info.');
     }
     // protect us from evil urls
     die_on_evil_url($data['entries']);
     // make filename for new revision
     $time = time();
     $meta['time'] = $time;
     $meta['file'] = 'data/' . md5(json_encode($meta)) . $time . '.js';
     // get all the revisions data, add new revision and save it again
     $revisions = get_revisions_data();
     array_push($revisions['revisions'], $meta);
     save_revisions_data($revisions);
     // save the new revision
     save_new_revision($meta['file'], $data);
     // rebuid the rss
     build_rss($revisions);
     // die with the id of the new revision
     die('' . (count($revisions['revisions']) - 1));
     break;
 case 'set_current_revision':
     // take input as a number
     $revision = $postdata;
     if (!is_numeric($revision)) {
         die('Non numeric input.');
     }
     // get revisions data and check if the request makes sense
     $revisions = get_revisions_data();
     if ($revision > count($revisions['revisions']) || $revision < 0) {
         die('Selected revision does not exist.');
     }
     // update current revision
Exemple #3
0
    exit;
} else {
    if (!$_course['visibility'] && !claro_is_course_allowed()) {
        if (!isset($_SERVER['PHP_AUTH_USER'])) {
            header('WWW-Authenticate: Basic realm="' . get_lang('Rss feed for %course', array('%course' => $_course['name'])) . '"');
            header('HTTP/1.0 401 Unauthorized');
            echo '<h2>' . get_lang('You need to be authenticated with your %sitename account', array('%sitename' => $siteName)) . '</h2>' . '<a href="index.php?cidReq=' . claro_get_current_course_id() . '">' . get_lang('Retry') . '</a>';
            exit;
        } else {
            if (get_magic_quotes_gpc()) {
                $_REQUEST['login'] = stripslashes($_SERVER['PHP_AUTH_USER']);
                $_REQUEST['password'] = stripslashes($_SERVER['PHP_AUTH_PW']);
            } else {
                $_REQUEST['login'] = $_SERVER['PHP_AUTH_USER'];
                $_REQUEST['password'] = $_SERVER['PHP_AUTH_PW'];
            }
            require '../inc/claro_init_local.inc.php';
            if (!$_course['visibility'] && !claro_is_course_allowed()) {
                header('WWW-Authenticate: Basic realm="' . get_lang('Rss feed for %course', array('%course' => $_course['name'])) . '"');
                header('HTTP/1.0 401 Unauthorized');
                echo '<h2>' . get_lang('You need to be authenticated with your %sitename account', array('%sitename' => $siteName)) . '</h2>' . '<a href="index.php?cidReq=' . claro_get_current_course_id() . '">' . get_lang('Retry') . '</a>';
                exit;
            }
        }
    }
    // end session to avoid lock
    session_write_close();
    // OK TO SEND FEED
    require_once get_path('incRepositorySys') . '/lib/rss.write.lib.php';
    echo build_rss(array('course' => claro_get_current_course_id()));
}