Ejemplo n.º 1
0
if ($query->numRows() == 1) {
    $sets = $query->fetchRow();
    foreach ($sets as $key => $value) {
        if (is_numeric($key)) {
            continue;
        }
        if ($key == 'section_id' or $key == 'page_id' or $key == 'section_title') {
            continue;
        }
        if ($value == '') {
            continue;
        }
        $addstring .= ', ' . $key . "='" . addslashes($value) . "'";
    }
    $theq = "INSERT INTO " . TABLE_PREFIX . "mod_" . $mod_dir . "_settings SET ";
    $theq .= "section_id='" . $section_id . "', page_id='" . $page_id . "', section_title='" . $section_title . "' " . $addstring;
} else {
    $theq = "INSERT INTO " . TABLE_PREFIX . "mod_" . $tablename . "_settings (section_id,page_id,section_title,section_description,sort_topics,use_timebased_publishing,picture_dir,header,topics_loop,footer,topics_per_page,topic_header,topic_footer,topic_block2,pnsa_string,pnsa_max,comments_header,comments_loop,comments_footer,commenting,default_link,use_captcha,sort_comments) VALUES ('{$section_id}','{$page_id}','{$section_title}','{$section_description}','{$sort_topics}','{$use_timebased_publishing}','{$picture_dir}','{$header}','{$topics_loop}','{$footer}','{$topics_per_page}','{$topic_header}','{$topic_footer}','{$topic_block2}','{$pnsa_string}','{$pnsa_max}','{$comments_header}','{$comments_loop}','{$comments_footer}','{$commenting}','{$default_link}','{$use_captcha}','{$sort_comments}')";
    include 'defaults/first-topics.php';
}
$database->query($theq);
//Add a frirst topic_
//include('defaults/first-topics.php');
if (isset($firsttopic)) {
    $database->query($firsttopic);
    // Get the id
    $topic_id = $database->get_one("SELECT LAST_INSERT_ID()");
    $filename = WB_PATH . $topics_directory . 'welcome' . PAGE_EXTENSION;
    define('TOPICS_DIRECTORY_DEPTH', $topics_directory_depth);
    topics_archive_file($filename, $topic_id, $section_id, $page_id, $create_topics_accessfiles);
}
     }
     if ($autoarchive_action == 2) {
         //after stopTime
         if ($t > $thetu and $thetu != 0) {
             $doarchive = true;
         }
     }
     if ($autoarchive_action == 3) {
         //after max entries
         if ($counter > $autoarchive_entry) {
             $doarchive = true;
         }
     }
     if ($doarchive == true) {
         $filename = WB_PATH . $topics_directory . $topic['link'] . PAGE_EXTENSION;
         topics_archive_file($filename, $t_id, $autoarchive_section, $autoarchive_page_id);
         $theq = "UPDATE " . TABLE_PREFIX . "mod_" . $tablename . " SET page_id = '" . $autoarchive_page_id . "', section_id = '" . $autoarchive_section . "' WHERE topic_id = '" . $t_id . "'";
         $database->query($theq);
         $title = 'Archived: ' . $title;
         //continue;
     }
 }
 //----------------------------------------------------------------------------------
 $hascontent = $topic['hascontent'];
 if ($hascontent < 1) {
     $titleplus = $title;
     $readmorelink = '';
     $topic_link = '#';
 } else {
     $titleplus = '<a href="' . $topic_link . '">' . $title . '</a>';
     $readmorelink = '<div class="tp_readmore"><a href="' . $topic_link . '">' . $TEXT['READ_MORE'] . '</a></div>';