コード例 #1
0
ファイル: addnews.php プロジェクト: jasmith152/Salt_Face
     $pack = edit_option($pack, $i, $_REQUEST[$i]);
 }
 // Preview tool
 $preview_hmtl = false;
 if (isset($preview) && $preview == 'preview') {
     $new[NEW_ID] = time();
     $new[NEW_USER] = $member_db[2];
     $new[NEW_TITLE] = $title;
     $new[NEW_SHORT] = $short_story;
     $new[NEW_FULL] = $full_story;
     $new[NEW_AVATAR] = $manual_avatar;
     $new[NEW_CAT] = $nice_category;
     $new[NEW_MF] = $pack;
     $new[NEW_OPT] = $options;
     $preview_hmtl = getpart('addnews_preview', array(lang('Preview active news'), template_replacer_news($new, $template_active)));
     $preview_hmtl .= getpart('addnews_preview', array(lang('Preview full story'), template_replacer_news($new, $template_full)));
     $error_messages = false;
 }
 // ---------------------------------------------------------------------------------------------------- SAVE ---
 if ($error_messages == false && empty($preview_hmtl)) {
     // Make unique time, just for draft/normal: not postponed
     if ($postpone == false) {
         $added_time = time();
         if (file_exists(SERVDIR . '/cdata/newsid.txt')) {
             $added_time = join('', file(SERVDIR . '/cdata/newsid.txt'));
         }
         if (time() <= $added_time) {
             $added_time++;
         } else {
             $added_time = time();
         }
コード例 #2
0
<?php

if (!defined('INIT_INSTANCE')) {
    die('Access restricted');
}
$all_active_news = file($news_file);
foreach ($all_active_news as $active_news) {
    $news_arr = explode("|", $active_news);
    if ($news_arr[NEW_ID] == $id and (empty($category) or $is_in_category)) {
        $found = true;
        $output = template_replacer_news($news_arr, $template_full);
        $output = hook('replace_fullstory', $output);
        $output = UTF8ToEntities($output);
        echo $output;
    }
}
// Article ID was not found, if we have not specified an archive -> try to find the article in some archive.
// Auto-Find ID In archives
//----------------------------------------------------------------------
if (!$found) {
    echo '<a id="com_form"></a>';
    if (!$archive or $archive == '') {
        // Get all archives. (if any) and fit our lost id in the most propper archive.
        $lost_id = $id;
        $all_archives = false;
        $hope_archive = false;
        if (!($handle = opendir(SERVDIR . "/cdata/archives"))) {
            echo "<!-- " . lang('cannot open directory') . " " . SERVDIR . "/cdata/archives --> ";
        }
        while (false !== ($file = readdir($handle))) {
            if ($file != "." and $file != ".." and !is_dir(SERVDIR . "/cdata/archives/{$file}") and substr($file, -9) == 'news.arch') {
コード例 #3
0
         $count_all--;
         continue;
     }
     if (!$is_in_cat and isset($category) and $category) {
         continue;
     }
     if ($start_from) {
         if ($i < $start_from) {
             $i++;
             continue;
         } elseif ($showed == $number) {
             break;
         }
     }
     // Basic replacements
     $output = template_replacer_news($news_arr, $template_active);
     $output = hook('replace_activenews', $output);
     $output = UTF8ToEntities($output);
     echo $output;
     $i++;
     $showed++;
     // allow use fb comments
     if ($config_use_fbcomments == 'yes' && $config_fb_inactive == 'yes') {
         echo '<div class="fb-comments" data-href="' . $config_http_script_dir . '/router.php?subaction=showfull&amp;id=' . $news_arr[0] . '" data-num-posts="' . $config_fb_comments . '" data-width="' . $config_fb_box_width . '"></div>';
     }
     // Includes for bottom of activenews
     echo hook('additional_include_activenews');
     if ($number and $number == $i) {
         break;
     }
 }