/** * Checks whether a blog category exists. Returns TRUE or FALSE. * * @param string $category The category to check for. * @return string */ function blog_category_exists($category) { if ($files = blog_get_categories()) { foreach ($files as $file) { if ($file['seoname'] == $category) { return true; } } unset($file); } return false; }
function blog_info() { global $lang; return array('name' => $lang['blog']['title'], 'intro' => $lang['blog']['descr'], 'version' => '0.2', 'author' => $lang['general']['pluck_dev_team'], 'website' => 'http://www.pluck-cms.org', 'icon' => 'images/blog.png', 'compatibility' => '4.7', 'categories' => blog_get_categories(TRUE)); }
function blog_page_admin_newpost() { global $lang, $var1, $cont1, $cont2, $cont3; //If form is posted... if (isset($_POST['save']) || isset($_POST['save_exit'])) { if (seo_url($cont1)) { //Save blogpost. $seoname = blog_save_post($cont1, $cont2, $cont3); //Redirect user. if (isset($_POST['save'])) { redirect('?module=blog&page=editpost&var1=' . $seoname, 0); } else { redirect('?module=blog', 0); } } else { $error = show_error($lang['page']['no_title'], 1, true); } } if (isset($error)) { echo $error; } ?> <div class="rightmenu"> <p><?php echo $lang['page']['items']; ?> </p> <?php show_link_insert_box(); show_image_insert_box('images'); ?> </div> <form method="post" action=""> <p> <label class="kop2" for="cont1"><?php echo $lang['general']['title']; ?> </label> <input name="cont1" id="cont1" type="text" /> </p> <p> <label class="kop2" for="cont2"><?php echo $lang['blog']['category']; ?> </label> <select name="cont2" id="cont2"> <option value=""><?php echo $lang['blog']['choose_cat']; ?> </option> <?php //If there are categories. if ($categories = blog_get_categories()) { foreach ($categories as $category) { echo '<option value="' . $category['seoname'] . '">' . $category['title'] . '</option>'; } unset($key); } ?> </select> </p> <p> <label class="kop2" for="cont3"><?php echo $lang['general']['contents']; ?> </label> <textarea class="<?php if (defined('WYSIWYG_TEXTAREA_CLASS')) { echo WYSIWYG_TEXTAREA_CLASS; } ?> " name="cont3" id="cont3" cols="70" rows="20"></textarea> </p> <?php show_common_submits('?module=blog', true); ?> </form> <?php }