예제 #1
0
파일: edit.php 프로젝트: proudchild/sdmblog
<?php

/**
 * @package Featured articles Lite - Wordpress plugin
 * @author CodeFlavors ( codeflavors[at]codeflavors.com )
 * @version 2.4
 */
// get the options
$options = FA_slider_options($slider_id);
// get the themes
$themes = FA_themes();
/* if editing and the slider id isn't valid, display error message */
if ($slider_id) {
    $slider = get_post($slider_id);
    if (!$slider) {
        $error_message = __("Sorry, there's no slider with that ID in here.", 'falite');
    } else {
        $current_page .= "&action=edit&id=" . $slider_id;
    }
} else {
    $current_page .= '&action=new';
}
/* Save the data */
if (isset($_POST['FA-save_wpnonce'])) {
    if (!wp_verify_nonce($_POST['FA-save_wpnonce'], 'FA_saveOptions')) {
        die(__('Sorry, it looks like your request is not valid. Please try again.', 'falite'));
    }
    // if it's a new slider, save it first
    if (!$slider_id) {
        global $user_ID;
        $post_data = array('post_type' => 'fa_slider', 'post_title' => $_POST['section_title'], 'post_author' => $user_ID, 'post_status' => 'publish', 'comment_status' => 'closed', 'ping_status' => 'closed');
예제 #2
0
파일: main.php 프로젝트: proudchild/sdmblog
/**
 * Starting with version 2.4, slideshow themes can have their own functions.php file.
 * Using this file in a custom created theme allows to create new optional fields for 
 * the theme that are unique to it. Also, by using this functionality, messages can be displayed to user
 * when selecting your theme from themes drop-down in slideshow editing administration area.
 * 
 * Function for loading themes extra functionality. These files are called only in administration are. 
 */
function FA_run_themes_functions()
{
    global $plugin_page;
    if (!strstr($plugin_page, 'featured-articles')) {
        return;
    }
    // include themes function files to allow them to run filters and hooks on admin display
    $themes = FA_themes();
    foreach ($themes as $theme => $configs) {
        if ($configs['funcs']) {
            include_once $configs['funcs'];
        }
    }
}
예제 #3
0
파일: common.php 프로젝트: rajankz/webspace
/**
 * Sets the option that stores the themes folder path. Function first checks that the folder already exists. After doing that, it 
 * verifies that the themes are copied inside it. Only after all that is done it will actually set it.
 * 
 * @param string $new_rel_path - new relative path to themes folder
 * @return bool - true on success, false on failure
 * 
 * @since 2.4.1
 */
function FA_set_themes_folder($new_rel_path = false)
{
    if (!$new_rel_path || empty($new_rel_path)) {
        return false;
    }
    // new path should be only folder path within Wordpress content dir so let's create the full path
    $full_path = WP_CONTENT_DIR . '/' . $new_rel_path;
    // if new path isn't an existing folder, bail out
    if (!is_dir($full_path)) {
        return false;
    }
    // let's read this new folder and see if themes are copied in it
    $themes = FA_themes($new_rel_path);
    if (!$themes) {
        return false;
    }
    // by now all should be OK. Let's set the new option
    $plugin_options = get_option('fa_plugin_details', array());
    $new_path = array('themes_folder' => $new_rel_path);
    $new_params = wp_parse_args($new_path, $plugin_options);
    update_option('fa_plugin_details', $new_params);
    return true;
}