コード例 #1
0
<ul class="latest-release-list">
	<?php 
$releases = get_sListLatest($numofposts, false, true);
if ($releases) {
    $icons = wpmanga_get('wpmanga_widget_icons', 0);
    foreach ($releases as $release) {
        $project = get_sProject($release, false);
        echo '<li>';
        if ($icons) {
            echo "<a href='" . get_sPermalink($project) . "' title='{$project->title}'><img src='" . get_sThumbnail('60x60', empty($project->image_thumbnail) ? $project->image : $project->image_thumbnail) . "' width='60' height='60' style='float: left; margin-right: 5px;' class='project-icon-thumbnail'></a>";
        }
        echo "<p><a href='" . get_sPermalink($project) . "#release-{$release->id}' title='{$release->title}'>{$project->title} - " . get_sFormatRelease($project, $release, false) . "</a><br><span class='latest-release-date'>";
        if ($release->revision > 1) {
            echo get_sDuration($release->unixtime_mod);
        } else {
            echo get_sDuration($release->unixtime);
        }
        if ($icons) {
            echo '</span></p><span class="wpmanga-clear"></span></li>';
        } else {
            echo '</span></p></li>';
        }
    }
} else {
    echo '<li>No Releases</li>';
}
?>
</ul>
コード例 #2
0
function wpmanga_settings()
{
    global $wpdb;
    if (isset($_POST['settings_nonce'])) {
        if (!wp_verify_nonce($_POST['settings_nonce'], plugin_basename(plugin_sDIR() . '/wpmanga.php'))) {
            echo '<div class="error"><p>Error: Security Verification Failed.</p></div>';
        } else {
            $_POST = array_map('trim', $_POST);
            // Check Boxes Suck (Search for Alternative Method)
            if (!$_POST['wpmanga_releasebar_style']) {
                $_POST['wpmanga_releasebar_style'] = 0;
            }
            if (!$_POST['wpmanga_page_details_title']) {
                $_POST['wpmanga_page_details_title'] = 0;
            }
            if (!$_POST['wpmanga_page_details_header']) {
                $_POST['wpmanga_page_details_header'] = 0;
            }
            if (!$_POST['wpmanga_foolreader']) {
                $_POST['wpmanga_foolreader'] = 0;
            }
            if (!$_POST['wpmanga_widget_icons']) {
                $_POST['wpmanga_widget_icons'] = 0;
            }
            if (!$_POST['wpmanga_delay_megaupload']) {
                $_POST['wpmanga_delay_megaupload'] = 0;
            }
            if (!$_POST['wpmanga_delay_mediafire']) {
                $_POST['wpmanga_delay_mediafire'] = 0;
            }
            if (!$_POST['wpmanga_delay_depositfiles']) {
                $_POST['wpmanga_delay_depositfiles'] = 0;
            }
            if (!$_POST['wpmanga_delay_fileserve']) {
                $_POST['wpmanga_delay_fileserve'] = 0;
            }
            if (!$_POST['wpmanga_delay_filesonic']) {
                $_POST['wpmanga_delay_filesonic'] = 0;
            }
            if (!$_POST['wpmanga_delay_pdf']) {
                $_POST['wpmanga_delay_pdf'] = 0;
            }
            if (!$_POST['wpmanga_disable_megaupload']) {
                $_POST['wpmanga_disable_megaupload'] = 0;
            }
            if (!$_POST['wpmanga_disable_mediafire']) {
                $_POST['wpmanga_disable_mediafire'] = 0;
            }
            if (!$_POST['wpmanga_disable_depositfiles']) {
                $_POST['wpmanga_disable_depositfiles'] = 0;
            }
            if (!$_POST['wpmanga_disable_fileserve']) {
                $_POST['wpmanga_disable_fileserve'] = 0;
            }
            if (!$_POST['wpmanga_disable_filesonic']) {
                $_POST['wpmanga_disable_filesonic'] = 0;
            }
            if (!$_POST['wpmanga_disable_pdf']) {
                $_POST['wpmanga_disable_pdf'] = 0;
            }
            //Url and Title not empty
            if (!$_POST['wpmanga_projectslist_url']) {
                $_POST['wpmanga_projectslist_url'] = 'projects';
            } else {
                $_POST['wpmanga_projectslist_url'] = get_sSanitizedSlug($_POST['wpmanga_projectslist_url']);
            }
            if (!$_POST['wpmanga_projectslist_title']) {
                $_POST['wpmanga_projectslist_title'] = 'Projects';
            }
            // Filter $_POST and Update Setting
            $_DATA = array();
            foreach ($_POST as $key => $value) {
                if (preg_match("/wpmanga_(.*?)/i", $key)) {
                    $status = wpmanga_set($key, $value);
                    $_DATA[$key] = $status;
                }
            }
            // Update Thumbnails
            if ($_DATA['wpmanga_thumbnail_list_width'] || $_DATA['wpmanga_thumbnail_list_height']) {
                set_time_limit(0);
                $thumbnail = new WP_Http();
                foreach (get_sListProject() as $project) {
                    $thumbnail->request(plugin_sURL() . 'includes/generate_thumbnail.php?src=' . $project->image . '&w=' . wpmanga_get('wpmanga_thumbnail_list_width', 145) . '&h=' . wpmanga_get('wpmanga_thumbnail_list_height', 300));
                }
            }
            echo '<div class="updated"><p>Updated Settings.</p></div>';
        }
    }
    if (isset($_GET['generate'])) {
        if ($_GET['generate'] == 'thumbnails') {
            set_time_limit(0);
            $thumbnail = new WP_Http();
            foreach (get_sListProject() as $project) {
                $thumbnail->request(plugin_sURL() . 'includes/generate_thumbnail.php?src=' . $project->image . '&w=' . wpmanga_get('wpmanga_thumbnail_list_width', 145) . '&h=' . wpmanga_get('wpmanga_thumbnail_list_height', 300));
            }
            echo '<div class="updated"><p>Finished Generating Thumbnails.</p></div>';
        }
    }
    ?>
	<div class="wrap">
		<?php 
    screen_icon('options-general');
    ?>
		<h2>WP Manga Settings</h2>

		<p>WP Manga Project Manager has several options which affect the plugin behavior in different areas. The Frontend Options influence the output and features available in the pages, posts, or text-widgets. The Backend Options control the plugin's administrative area.</p>

		<div id="dashboard-widgets-wrap">
			<div id="dashboard-widgets" class="metabox-holder">
				<form method="post" action="admin.php?page=manga/settings">
					<div class="postbox">
						<h3 class='hndle'><span>Frontend Options</span></h3>
						<div class="inside">
							<table class="form-table fixed">
								<tr class="form-field">
									<td width="250px"><label for="wpmanga_thumbnail_list_width">Thumbnail Dimensions</label></td>
									<td>
										Width <input name="wpmanga_thumbnail_list_width" id="wpmanga_thumbnail_list_width" type="number" value="<?php 
    echo wpmanga_get('wpmanga_thumbnail_list_width', 145);
    ?>
" style="width: 10%;"> &nbsp;
										Height <input name="wpmanga_thumbnail_list_height" id="wpmanga_thumbnail_list_height" type="number" value="<?php 
    echo wpmanga_get('wpmanga_thumbnail_list_height', 300);
    ?>
" style="width: 10%;"> &nbsp; <a class="button-secondary" href="admin.php?page=manga/settings&generate=thumbnails">Force Generate Thumbnails</a>
									</td>
								</tr>

								<tr class="form">
									<td valign="top" width="250px"><label>Individual Project Page</label></td>
									<td>
										<input type="checkbox" name="wpmanga_page_details_title" id="wpmanga_page_details_title" value="1" <?php 
    if (wpmanga_get('wpmanga_page_details_title', 0)) {
        echo 'checked="checked"';
    }
    ?>
 style="width: 20px;"> <label for="wpmanga_page_details_title">Disable Title Filter <span class="description">(For Specific Themes)</span></label> <br>
										<input type="checkbox" name="wpmanga_page_details_header" id="wpmanga_page_details_header" value="1" <?php 
    if (wpmanga_get('wpmanga_page_details_header', 0)) {
        echo 'checked="checked"';
    }
    ?>
 style="width: 20px;"> <label for="wpmanga_page_details_header">Display Header <span class="description">(For Specific Themes)</span></label>
									</td>
								</tr>

								<tr class="form">
									<td valign="top" width="250px"><label>Online Reader Link Generator</label></td>
									<td>
										<input name="wpmanga_reader" id="reader_foolreader" type="radio" value="1"<?php 
    if (wpmanga_get('wpmanga_reader', 1) == 1) {
        echo ' checked="checked"';
    }
    ?>
> <label for="reader_foolreader">FoOlSlide</label> &nbsp;
										<input name="wpmanga_reader" id="reader_none" type="radio" value="0"<?php 
    if (!wpmanga_get('wpmanga_reader', 1) == 0) {
        echo ' checked="checked"';
    }
    ?>
> <label for="reader_none">None</label>
									</td>
								</tr>

								<tr class="form">
									<td valign="top" width="250px"><label for="wpmanga_releasebar_style">Release Bar Display Style</label></td>
									<td>
										<select name="wpmanga_releasebar_style" id="wpmanga_releasebar_style" style="width: 100%">
											<option value="1"<?php 
    if (wpmanga_get('wpmanga_releasebar_style', 1) == '1') {
        echo ' selected="selected"';
    }
    ?>
>Default Release Bar</option>
											<option value="2"<?php 
    if (wpmanga_get('wpmanga_releasebar_style', 1) == '2') {
        echo ' selected="selected"';
    }
    ?>
>Plain Release Bar</option>
										</select>
									</td>
								</tr>

								<tr class="form">
									<td width="250px"><label for="wpmanga_widget_icons">Latest Widget List</label></td>
									<td>
										<input type="checkbox" name="wpmanga_widget_icons" id="wpmanga_widget_icons" value="1" <?php 
    if (wpmanga_get('wpmanga_widget_icons', 0)) {
        echo 'checked="checked"';
    }
    ?>
 style="width: 20px;"> <label for="wpmanga_widget_icons">Show Release Icons</label>
									</td>
								</tr>

								<tr class="form">
									<td width="250px"><label for="wpmanga_channel">IRC Channel</label></td>
									<td>
										<input name="wpmanga_channel" id="wpmanga_channel" type="text" placeholder="irc://irc.irchighway.net/beta" value="<?php 
    echo wpmanga_get('wpmanga_channel', '');
    ?>
" style="width: 100%;">
									</td>
								</tr>

								<tr class="form">
									<td width="250px"><label for="wpmanga_projectslist_url">Projects List Url</label></td>
									<td>
										<input name="wpmanga_projectslist_url" id="wpmanga_projectslist_url" type="text" value="<?php 
    echo wpmanga_get('wpmanga_projectslist_url', 'projects');
    ?>
" style="width: 100%;">
									</td>
								</tr>

								<tr class="form">
									<td width="250px"><label for="wpmanga_projectslist_title">Projects List Title</label></td>
									<td>
										<input name="wpmanga_projectslist_title" id="wpmanga_projectslist_title" type="text" value="<?php 
    echo wpmanga_get('wpmanga_projectslist_title', 'Projects');
    ?>
" style="width: 100%;">
									</td>
								</tr>

								<tr class="form-field">
									<td valign="top" style="padding-top: 10px;" width="250px"><label for="wpmanga_delay">Delay Download Link</label></td>
									<td>
										<input name="wpmanga_delay" id="wpmanga_delay" type="number" value="<?php 
    echo wpmanga_get('wpmanga_delay', 0);
    ?>
" style="width: 10%;"> Hours <br>
										<input type="checkbox" name="wpmanga_delay_depositfiles" id="wpmanga_delay_depositfiles" value="1" <?php 
    if (wpmanga_get('wpmanga_delay_depositfiles', 0)) {
        echo 'checked="checked"';
    }
    ?>
 style="width: 20px;"> <label for="wpmanga_delay_depositfiles">Deposit Files</label> <br>
										<input type="checkbox" name="wpmanga_delay_fileserve" id="wpmanga_delay_fileserve" value="1" <?php 
    if (wpmanga_get('wpmanga_delay_fileserve', 0)) {
        echo 'checked="checked"';
    }
    ?>
 style="width: 20px;"> <label for="wpmanga_delay_fileserve">FileServe</label> <br>
										<input type="checkbox" name="wpmanga_delay_filesonic" id="wpmanga_delay_filesonic" value="1" <?php 
    if (wpmanga_get('wpmanga_delay_filesonic', 0)) {
        echo 'checked="checked"';
    }
    ?>
 style="width: 20px;"> <label for="wpmanga_delay_filesonic">FileSonic</label> <br>
										<input type="checkbox" name="wpmanga_delay_mediafire" id="wpmanga_delay_mediafire" value="1" <?php 
    if (wpmanga_get('wpmanga_delay_mediafire', 0)) {
        echo 'checked="checked"';
    }
    ?>
 style="width: 20px;"> <label for="wpmanga_delay_mediafire">MediaFire</label> <br>
										<input type="checkbox" name="wpmanga_delay_megaupload" id="wpmanga_delay_megaupload" value="1" <?php 
    if (wpmanga_get('wpmanga_delay_megaupload', 0)) {
        echo 'checked="checked"';
    }
    ?>
 style="width: 20px;"> <label for="wpmanga_delay_megaupload">MEGAUPLOAD</label> <br>
										<input type="checkbox" name="wpmanga_delay_pdf" id="wpmanga_delay_pdf" value="1" <?php 
    if (wpmanga_get('wpmanga_delay_pdf', 0)) {
        echo 'checked="checked"';
    }
    ?>
 style="width: 20px;"> <label for="wpmanga_delay_pdf">PDF</label>
									</td>
								</tr>
							</table>

							&nbsp; <input type="submit" class="button-primary" name="save" value="Save Settings"><br><br>
							<input type="hidden" name="settings_nonce" value="<?php 
    echo wp_create_nonce(plugin_basename(plugin_sDIR() . '/wpmanga.php'));
    ?>
">
						</div>
					</div>

					<div class="postbox" >
						<h3 class='hndle'><span>Backend Options</span></h3>
						<div class="inside">
							<table class="form-table fixed">
								<tr class="form-field">
									<td valign="top" style="padding-top: 10px;" width="250px"><label>Disable Download Links</label></td>
									<td>
										<input type="checkbox" name="wpmanga_disable_depositfiles" id="wpmanga_disable_depositfiles" value="1" <?php 
    if (wpmanga_get('wpmanga_disable_depositfiles', 0)) {
        echo 'checked="checked"';
    }
    ?>
 style="width: 20px;"> <label for="wpmanga_disable_depositfiles">Deposit Files</label> <br>
										<input type="checkbox" name="wpmanga_disable_fileserve" id="wpmanga_disable_fileserve" value="1" <?php 
    if (wpmanga_get('wpmanga_disable_fileserve', 0)) {
        echo 'checked="checked"';
    }
    ?>
 style="width: 20px;"> <label for="wpmanga_disable_fileserve">FileServe</label> <br>
										<input type="checkbox" name="wpmanga_disable_filesonic" id="wpmanga_disable_filesonic" value="1" <?php 
    if (wpmanga_get('wpmanga_disable_filesonic', 0)) {
        echo 'checked="checked"';
    }
    ?>
 style="width: 20px;"> <label for="wpmanga_disable_filesonic">FileSonic</label> <br>
										<input type="checkbox" name="wpmanga_disable_mediafire" id="wpmanga_disable_mediafire" value="1" <?php 
    if (wpmanga_get('wpmanga_disable_mediafire', 0)) {
        echo 'checked="checked"';
    }
    ?>
 style="width: 20px;"> <label for="wpmanga_disable_mediafire">MediaFire</label> <br>
										<input type="checkbox" name="wpmanga_disable_megaupload" id="wpmanga_disable_megaupload" value="1" <?php 
    if (wpmanga_get('wpmanga_disable_megaupload', 0)) {
        echo 'checked="checked"';
    }
    ?>
 style="width: 20px;"> <label for="wpmanga_disable_megaupload">MEGAUPLOAD</label> <br>
										<input type="checkbox" name="wpmanga_disable_pdf" id="wpmanga_disable_pdf" value="1" <?php 
    if (wpmanga_get('wpmanga_disable_pdf', 0)) {
        echo 'checked="checked"';
    }
    ?>
 style="width: 20px;"> <label for="wpmanga_disable_pdf">PDF</label>
									</td>
								</tr>

								<tr class="form">
									<td width="250px"><label for="wpmanga_release_statuspublished">Release publication status (0 for auto publish)</label></td>
									<td>
										<input name="wpmanga_release_statuspublished" id="wpmanga_release_statuspublished" type="text" value="<?php 
    echo wpmanga_get('wpmanga_release_statuspublished', '');
    ?>
" style="width: 100%;">
									</td>
								</tr>
							</table>

							&nbsp; <input type="submit" class="button-primary" name="save" value="Save Settings"><br><br>
							<input type="hidden" name="settings_nonce" value="<?php 
    echo wp_create_nonce(plugin_basename(plugin_sDIR() . '/wpmanga.php'));
    ?>
">
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
<?php 
}
コード例 #3
0
/**
 * Display Administrative Menu for Releases.
 * @return menu
 */
function wpmanga_dataRelease()
{
    global $wpdb;
    // Action Variable
    if (isset($_GET['action'])) {
        $action = strtolower($_GET['action']);
    } else {
        $action = 'add';
    }
    // Sanity Check on EDIT and DEL
    if (!isset($_GET['id']) && $action != 'add') {
        $action = 'add';
    }
    if (isset($_POST['wpmanga_nonce'])) {
        if (!wp_verify_nonce($_POST['wpmanga_nonce'], plugin_basename(plugin_sDIR() . '/wpmanga.php'))) {
            echo '<div class="error"><p>Error: Security Verification Failed.</p></div>';
        } else {
            $_POST = array_map('trim', $_POST);
            $_POST = array_map('stripslashes', $_POST);
            if ($_POST['project_id']) {
                // UNIXTIME Fix
                if ($_POST['unixtime'] != 0) {
                    if ($_POST['revision'] == 0) {
                        $_POST['unixtime_mod'] = $_POST['unixtime'];
                        $_POST['revision'] = 1;
                    } else {
                        $edit = get_sRelease($_GET['id']);
                        $_POST['unixtime_mod'] = $_POST['unixtime'];
                        $_POST['unixtime'] = $edit->unixtime;
                    }
                } else {
                    $_POST['unixtime'] = time();
                    $_POST['unixtime_mod'] = $_POST['unixtime'];
                }
                if (preg_match("/(edit)/i", $action)) {
                    $edit = get_sRelease($_GET['id']);
                    if ($_POST['revision'] > $edit->revision) {
                        $_POST['unixtime_mod'] = time();
                    }
                }
                $data = array('project_id' => $_POST['project_id'], 'unixtime' => $_POST['unixtime'], 'unixtime_mod' => $_POST['unixtime_mod'], 'volume' => $_POST['volume'], 'chapter' => $_POST['chapter'], 'subchapter' => $_POST['subchapter'], 'revision' => $_POST['revision'], 'type' => $_POST['type'], 'title' => $_POST['title'], 'download_megaupload' => $_POST['download_megaupload'], 'download_mediafire' => $_POST['download_mediafire'], 'download_depositfiles' => $_POST['download_depositfiles'], 'download_fileserve' => $_POST['download_fileserve'], 'download_filesonic' => $_POST['download_filesonic'], 'download_pdf' => $_POST['download_pdf'], 'download_irc' => $_POST['download_irc'], 'link_reader' => $_POST['link_reader'], 'language' => $_POST['language'], 'status' => $_POST['status']);
                switch ($action) {
                    case 'edit':
                        $status = $wpdb->update($wpdb->prefix . 'projects_releases', $data, array('id' => $_GET['id']));
                        if ($status) {
                            echo '<div class="updated"><p>Updated Release Information.</p></div>';
                        } else {
                            echo '<div class="error"><p>Error: Failed to update information.</p></div>';
                        }
                        break;
                    case 'delete':
                        $status = $wpdb->query($wpdb->prepare("DELETE FROM `{$wpdb->prefix}projects_releases` WHERE `id` = '%d'", $_GET['id']));
                        if ($status) {
                            echo '<div class="updated"><p>Deleted Release Information.</p></div>';
                        } else {
                            echo '<div class="error"><p>Error: Failed to delete information.</p></div>';
                        }
                        break;
                    default:
                        $wpdb->insert($wpdb->prefix . 'projects_releases', $data);
                        if ($wpdb->insert_id) {
                            echo '<div class="updated"><p>Added Release for Projects. <a href="admin.php?page=manga/release&action=edit&id=' . $wpdb->insert_id . '">Edit Release</a></p></div>';
                        } else {
                            echo '<div class="error"><p>Error: Failed to add new release.</p></div>';
                        }
                }
            } else {
                echo '<div class="error"><p>Error: Please fill in the required fields.</p></div>';
            }
        }
    }
    $projects = $wpdb->get_results("SELECT `id`, `title` FROM `" . $wpdb->prefix . "projects` ORDER BY `title` ASC");
    if ($projects) {
        if (preg_match("/(edit|delete)/i", $action)) {
            $release = $wpdb->get_row($wpdb->prepare("SELECT * FROM `{$wpdb->prefix}projects_releases` WHERE `id` = '%d' LIMIT 1", $_GET['id']));
        }
        ?>
		<div class="wrap">
			<?php 
        screen_icon('edit');
        ?>
			<h2><?php 
        echo ucfirst($action);
        ?>
 Release</h2>

			<p>Add a new release for a project.</p>
<?php 
        switch ($action) {
            case 'edit':
                echo '<form method="post" action="admin.php?page=manga/release&action=edit&id=' . $_GET['id'] . '">';
                break;
            case 'delete':
                echo '<form method="post" action="admin.php?page=manga/release&action=delete&id=' . $_GET['id'] . '">';
                break;
            default:
                echo '<form method="post" action="admin.php?page=manga/release">';
        }
        ?>
				<table class="form-table">
					<tr class="form-field">
						<th scope="row"><label for="project_id">Project</label></th>
						<td>
							<select name="project_id" id="project_id" style="width: 460px">
								<?php 
        foreach ($projects as $project) {
            if (preg_match("/(edit|delete)/i", $action)) {
                if ($project->id == $release->project_id) {
                    echo "<option value='{$project->id}' selected='selected'>{$project->title}</option>";
                } else {
                    echo "<option value='{$project->id}'>{$project->title}</option>";
                }
            } else {
                echo "<option value='{$project->id}'>{$project->title}</option>";
            }
        }
        ?>
							</select>
						</td>
					</tr>

					<tr class="form-field">
						<th scope="row"><label for="volume">Volume</label></th>
						<td><input name="volume" id="volume" type="number" value="<?php 
        if (isset($release)) {
            echo $release->volume;
        } else {
            echo '0';
        }
        ?>
"<?php 
        if ($action == 'delete') {
            echo ' readonly="readonly"';
        }
        ?>
 autofocus></td>
					</tr>

					<tr class="form-field">
						<th scope="row"><label for="chapter">Chapter</label></th>
						<td><input name="chapter" id="chapter" type="number" value="<?php 
        if (isset($release)) {
            echo $release->chapter;
        } else {
            echo '0';
        }
        ?>
"<?php 
        if ($action == 'delete') {
            echo ' readonly="readonly"';
        }
        ?>
></td>
					</tr>

					<tr class="form-field">
						<th scope="row"><label for="subchapter">Sub-Chapter</label></th>
						<td><input name="subchapter" id="subchapter" type="number" value="<?php 
        if (isset($release)) {
            echo $release->subchapter;
        } else {
            echo '0';
        }
        ?>
"<?php 
        if ($action == 'delete') {
            echo ' readonly="readonly"';
        }
        ?>
></td>
					</tr>

					<?php 
        if (preg_match("/(edit|delete)/i", $action)) {
            ?>
					<tr class="form-field">
						<th scope="row"><label for="revision">Revision</label></th>
						<td><input name="revision" id="revision" type="number" value="<?php 
            if (isset($release)) {
                echo $release->revision;
            }
            ?>
"<?php 
            if ($action == 'delete') {
                echo ' readonly="readonly"';
            }
            ?>
></td>
					</tr>
					<?php 
        } else {
            ?>
					<input type="hidden" name="revision" id="revision" value="0">
					<?php 
        }
        ?>

					<tr class="form">
						<th scope="row"><label>Release Type</label></th>
						<td>
							<input name="type" id="normal" type="radio" value="0"<?php 
        if (!preg_match("/(edit|delete)/i", $action)) {
            echo ' checked="checked"';
        }
        if (isset($release) && $release->type == 0) {
            echo ' checked="checked"';
        }
        if ($action == 'delete') {
            echo ' disabled="disabled"';
        }
        ?>
> <label for="normal">Chapter</label> &nbsp;
							<input name="type" id="volumet" type="radio" value="5"<?php 
        if (isset($release) && $release->type == 5) {
            echo ' checked="checked"';
        }
        if ($action == 'delete') {
            echo ' disabled="disabled"';
        }
        ?>
> <label for="volumet">Volume (Batch)</label> &nbsp;
							<input name="type" id="special" type="radio" value="10"<?php 
        if (isset($release) && $release->type == 10) {
            echo ' checked="checked"';
        }
        if ($action == 'delete') {
            echo ' disabled="disabled"';
        }
        ?>
> <label for="special">Special</label> &nbsp;
							<input name="type" id="oneshot" type="radio" value="20"<?php 
        if (isset($release) && $release->type == 20) {
            echo ' checked="checked"';
        }
        if ($action == 'delete') {
            echo ' disabled="disabled"';
        }
        ?>
> <label for="oneshot">Oneshot</label> &nbsp;
						</td>
					</tr>

					<tr class="form-field">
						<th scope="row"><label for="title">Title</label></th>
						<td><input name="title" id="title" type="text" value="<?php 
        if (isset($release)) {
            echo $release->title;
        }
        ?>
"<?php 
        if ($action == 'delete') {
            echo ' readonly="readonly"';
        }
        ?>
></td>
					</tr>

					<tr class="form-field">
						<th scope="row"><label for="download_depositfiles">Downloads Links</label></th>
						<td>
							<input name="download_depositfiles" id="download_depositfiles" type="<?php 
        if (wpmanga_get('wpmanga_disable_depositfiles', 0)) {
            echo 'hidden';
        } else {
            'url';
        }
        ?>
" placeholder="Enter download link for Deposit Files here." style="width:90%;" value="<?php 
        if (isset($release)) {
            echo $release->download_depositfiles;
        }
        ?>
"<?php 
        if ($action == 'delete') {
            echo ' readonly="readonly"';
        }
        ?>
>
							<label for="download_depositfiles"><?php 
        if (!wpmanga_get('wpmanga_disable_depositfiles', 0)) {
            echo '<img src="' . plugin_sURL() . 'images/download-icon-depositfiles-24.png" width="24px" style="vertical-align: middle; padding-bottom: 2px"><br>';
        }
        ?>
</label>

							<input name="download_fileserve" id="download_fileserve" type="<?php 
        if (wpmanga_get('wpmanga_disable_fileserve', 0)) {
            echo 'hidden';
        } else {
            'url';
        }
        ?>
" placeholder="Enter download link for FileServe here." style="width:90%;" value="<?php 
        if (isset($release)) {
            echo $release->download_fileserve;
        }
        ?>
"<?php 
        if ($action == 'delete') {
            echo ' readonly="readonly"';
        }
        ?>
>
							<label for="download_fileserve"><?php 
        if (!wpmanga_get('wpmanga_disable_fileserve', 0)) {
            echo '<img src="' . plugin_sURL() . 'images/download-icon-fileserve-24.png" width="24px" style="vertical-align: middle; padding-bottom: 2px"><br>';
        }
        ?>
</label>

							<input name="download_filesonic" id="download_filesonic" type="<?php 
        if (wpmanga_get('wpmanga_disable_filesonic', 0)) {
            echo 'hidden';
        } else {
            'url';
        }
        ?>
" placeholder="Enter download link for FileSonic here." style="width:90%;" value="<?php 
        if (isset($release)) {
            echo $release->download_filesonic;
        }
        ?>
"<?php 
        if ($action == 'delete') {
            echo ' readonly="readonly"';
        }
        ?>
>
							<label for="download_filesonic"><?php 
        if (!wpmanga_get('wpmanga_disable_filesonic', 0)) {
            echo '<img src="' . plugin_sURL() . 'images/download-icon-filesonic-24.png" width="24px" style="vertical-align: middle; padding-bottom: 2px"><br>';
        }
        ?>
</label>

							<input name="download_mediafire" id="download_mediafire" type="<?php 
        if (wpmanga_get('wpmanga_disable_mediafire', 0)) {
            echo 'hidden';
        } else {
            'url';
        }
        ?>
" placeholder="Enter download link for MediaFire here." style="width:90%;" value="<?php 
        if (isset($release)) {
            echo $release->download_mediafire;
        }
        ?>
"<?php 
        if ($action == 'delete') {
            echo ' readonly="readonly"';
        }
        ?>
>
							<label for="download_mediafire"><?php 
        if (!wpmanga_get('wpmanga_disable_mediafire', 0)) {
            echo '<img src="' . plugin_sURL() . 'images/download-icon-mediafire-24.png" width="24px" style="vertical-align: middle; padding-bottom: 2px"><br>';
        }
        ?>
</label>

							<input name="download_megaupload" id="download_megaupload" type="<?php 
        if (wpmanga_get('wpmanga_disable_megaupload', 0)) {
            echo 'hidden';
        } else {
            'url';
        }
        ?>
" placeholder="Enter download link for MEGAUPLOAD here." style="width:90%;" value="<?php 
        if (isset($release)) {
            echo $release->download_megaupload;
        }
        ?>
"<?php 
        if ($action == 'delete') {
            echo ' readonly="readonly"';
        }
        ?>
>
							<label for="download_megaupload"><?php 
        if (!wpmanga_get('wpmanga_disable_megaupload', 0)) {
            echo '<img src="' . plugin_sURL() . 'images/download-icon-megaupload-24.png" width="24px" style="vertical-align: middle; padding-bottom: 2px"><br>';
        }
        ?>
</label>

							<input name="download_pdf" id="download_pdf" type="<?php 
        if (wpmanga_get('wpmanga_disable_pdf', 0)) {
            echo 'hidden';
        } else {
            'url';
        }
        ?>
" placeholder="Enter download link for PDF here." style="width:90%;" value="<?php 
        if (isset($release)) {
            echo $release->download_pdf;
        }
        ?>
"<?php 
        if ($action == 'delete') {
            echo ' readonly="readonly"';
        }
        ?>
>
							<label for="download_pdf"><?php 
        if (!wpmanga_get('wpmanga_disable_pdf', 0)) {
            echo '<img src="' . plugin_sURL() . 'images/download-icon-pdf-24.png" width="24px" style="vertical-align: middle; padding-bottom: 2px"><br>';
        }
        ?>
</label>
						</td>
					</tr>

					<?php 
        if (!wpmanga_get('wpmanga_reader', 1) == 1) {
            ?>
					<tr class="form-field">
						<th scope="row"><label for="link_reader">Chapter Links</label></th>
						<td>
							<input name="link_reader" id="link_reader" type="url" placeholder="Enter chapter link here." style="width:90%;" value="<?php 
            if (isset($release)) {
                echo $release->link_reader;
            }
            ?>
"<?php 
            if ($action == 'delete') {
                echo ' readonly="readonly"';
            }
            ?>
>
							<label for="link_reader"><img src=" <?php 
            echo plugin_sURL();
            ?>
images/download-icon-onlinereader-24.png" width="24px" style="vertical-align: middle; padding-bottom: 2px"><br></label>
						</td>
					</tr>
					<?php 
        }
        ?>
					<tr class="form-field">
						<th scope="row"><label for="language">Language</label></th>
						<td>
							<select name="language" id="language" style="width:460px" <?php 
        if ($action == 'delete') {
            echo ' readonly="readonly"';
        }
        ?>
>
								<?php 
        foreach (wpmanga_listLanguages() as $language => $description) {
            if (preg_match("/(edit|delete)/i", $action)) {
                if ($release->language == $language) {
                    echo "<option value='{$language}' selected='selected'>{$description}</option>";
                } else {
                    echo "<option value='{$language}'>{$description}</option>";
                }
            } else {
                if ('en' == $language) {
                    echo "<option value='{$language}' selected='selected'>{$description}</option>";
                } else {
                    echo "<option value='{$language}'>{$description}</option>";
                }
            }
        }
        ?>
							</select>
						</td>
					</tr>

<?php 
        // end add by busaway
        ?>

					<tr class="form-field">
						<th scope="row"><label for="download_irc">IRC Download Command</label></th>
						<td>
							<input name="download_irc" id="download_irc" type="text" placeholder="/MSG BOTNAME XDCC SEND #1  or  !TRIGGER1" style="width:91%;" value="<?php 
        if (isset($release)) {
            echo $release->download_irc;
        }
        ?>
"<?php 
        if ($action == 'delete') {
            echo ' readonly="readonly"';
        }
        ?>
>
							<label for="download_irc"><img src="<?php 
        echo plugin_sURL();
        ?>
images/download-icon-irc.png" width="24px" style="vertical-align: middle; padding-bottom: 2px"></label>
						</td>
					</tr>

					<tr class="form-field">
						<th scope="row"><label for="unixtime">Release Date/Time</label></th>
						<td>
							<input name="unixtime_datetime" id="unixtime_datetime" type="text">
							<input name="unixtime" id="unixtime" type="hidden" value="0">
							<script type="text/javascript">
								jQuery('#unixtime_datetime').datetimepicker();
								<?php 
        if (!preg_match("/(edit|delete)/i", $action)) {
            ?>
								jQuery('#unixtime_datetime').datetimepicker('setDate', (new Date()));
								<?php 
        } else {
            ?>
								jQuery('#unixtime_datetime').datetimepicker('setDate', (new Date(<?php 
            echo $release->unixtime;
            ?>
 * 1000)));
								<?php 
        }
        ?>

								datetime = Date.parse(jQuery('#unixtime_datetime').val()) / 1000;
								jQuery('#unixtime').val(datetime);

								jQuery(document).click(function() {
									datetime = Date.parse(jQuery('#unixtime_datetime').val()) / 1000;
									jQuery('#unixtime').val(datetime);
								});
							</script>
						</td>
					</tr>
					<?php 
        if (wpmanga_get('wpmanga_release_statuspublished', 0) != 0) {
            ?>
					<tr class="form-field">
						<th scope="row"><label for="status">Status</label></th>
						<td><input name="status" id="status" type="number" value="<?php 
            if (isset($release)) {
                echo $release->status;
            } else {
                echo '0';
            }
            ?>
"<?php 
            if ($action == 'delete') {
                echo ' readonly="readonly"';
            }
            ?>
></td>
					</tr>
					<?php 
        }
        ?>

				</table>

				<p class="submit">
					<input type="submit" class="button-primary" name="save" value="<?php 
        echo ucfirst($action);
        ?>
 Release">
					<input type="hidden" name="wpmanga_nonce" value="<?php 
        echo wp_create_nonce(plugin_basename(plugin_sDIR() . '/wpmanga.php'));
        ?>
">
				</p>
			</form>
		</div>
<?php 
    } else {
        ?>
		<script type="text/javascript">
			location.replace("admin.php?page=manga/project")
		</script>
<?php 
    }
}
コード例 #4
0
    }
    $wppb_output .= " style=\"width: {$width}; background: {$color};\"";
    $wppb_output .= "><span></span></span>";
    $wppb_output .= "</div>";
    $wppb_output .= "</div>";
    /**
     * now return the progress bar
     */
    return $wppb_output;
}
?>

<div class="chapters-progress-list">
	<?php 
global $wpdb;
$publishedstatus = wpmanga_get('wpmanga_release_statuspublished', 0);
if ($publishedstatus != 0) {
    if ($projectCategory) {
        $projects = get_sListCategory($projectCategory);
    }
    $sql = "\t\n\t\tSELECT rel.*, p.title AS project_title\n\t\tFROM `{$wpdb->prefix}projects_releases` AS rel\n\t\tINNER JOIN `{$wpdb->prefix}projects` AS p ON rel.project_id = p.id\n\t\tINNER JOIN (\n\t\t\tSELECT project_id, MIN(`chapter`) AS chapter\n\t\t\tFROM `{$wpdb->prefix}projects_releases`\n\t\t\tWHERE `status` <> {$publishedstatus}\n\t\t\tAND `type` = 0";
    if ($projects) {
        $ids = "";
        $first = true;
        foreach ($projects as $project) {
            if (!$first) {
                $ids .= ",";
            }
            $ids .= $project->id;
            $first = false;
        }
コード例 #5
0
/**
 * Display Administrative Menu for Projects.
 * @return menu
 */
function wpmanga_dataProject()
{
    global $wpdb;
    // Action Variable
    if (isset($_GET['action'])) {
        $action = strtolower($_GET['action']);
    } else {
        $action = 'add';
    }
    // Sanity Check on EDIT and DEL
    if (!isset($_GET['id']) && $action != 'add') {
        $action = 'add';
    }
    if (isset($_POST['wpmanga_nonce'])) {
        if (!wp_verify_nonce($_POST['wpmanga_nonce'], plugin_basename(plugin_sDIR() . '/wpmanga.php'))) {
            echo '<div class="error"><p>Error: Security Verification Failed.</p></div>';
        } else {
            $_POST = array_map('trim', $_POST);
            $_POST = array_map('stripslashes', $_POST);
            if (!$_POST['mature']) {
                $_POST['mature'] = 0;
            }
            if ($_POST['title']) {
                if ($_POST['image']) {
                    $thumbnail = new WP_Http();
                    $thumbnail->request(plugin_sURL() . '/includes/generate_thumbnail.php?src=' . $_POST['image'] . '&w=' . wpmanga_get('wpmanga_thumbnail_list_width', 145) . '&h=' . wpmanga_get('wpmanga_thumbnail_list_height', 300));
                    $thumbnail->request(plugin_sURL() . '/includes/generate_thumbnail.php?src=' . $_POST['image'] . '&w=60&h=60');
                }
                if ($_POST['image_thumbnail']) {
                    $thumbnail = new WP_Http();
                    $thumbnail->request(plugin_sURL() . '/includes/generate_thumbnail.php?src=' . $_POST['image_thumbnail'] . '&w=' . wpmanga_get('wpmanga_thumbnail_list_width', 145) . '&h=' . wpmanga_get('wpmanga_thumbnail_list_height', 300));
                    $thumbnail->request(plugin_sURL() . '/includes/generate_thumbnail.php?src=' . $_POST['image_thumbnail'] . '&w=60&h=60');
                }
                $custom_settings = json_encode(array('chapter' => $_POST['custom_chapter'], 'subchapter' => $_POST['custom_subchapter']));
                $data = array('category' => $_POST['category'], 'slug' => wpmanga_getUrl($_POST['slug'], $_POST['title']), 'title' => $_POST['title'], 'title_alt' => $_POST['title_alt'], 'description' => $_POST['description'], 'description_short' => $_POST['description_short'], 'author' => $_POST['author'], 'genre' => $_POST['genre'], 'status' => $_POST['status'], 'image' => $_POST['image'], 'image_thumbnail' => $_POST['image_thumbnail'], 'team_origin' => $_POST['team_origin'], 'reader' => $_POST['reader'], 'url' => $_POST['url'], 'mature' => $_POST['mature'], 'custom' => $custom_settings);
                switch ($action) {
                    case 'edit':
                        $check = $wpdb->query($wpdb->prepare("SELECT `slug` FROM `" . $wpdb->prefix . "projects` WHERE `id` <>" . $_GET['id'] . " and `slug` = '%s'", wpmanga_getUrl($_POST['slug'], $_POST['title'])));
                        if (!$check) {
                            $status = $wpdb->update($wpdb->prefix . 'projects', $data, array('id' => $_GET['id']));
                            if ($status) {
                                echo '<div class="updated"><p>Updated Project Information for <i>' . $_POST['title'] . '</i>.</p></div>';
                            } else {
                                echo '<div class="error"><p>Error: Failed to update information.</p></div>';
                            }
                        } else {
                            echo '<div class="error"><p>Error: Failed to edit project. (Duplicate Url)</p></div>';
                        }
                        break;
                    case 'delete':
                        $status = $wpdb->query($wpdb->prepare("DELETE FROM `{$wpdb->prefix}projects` WHERE `id` = '%d'", $_GET['id']));
                        $wpdb->query($wpdb->prepare("DELETE FROM `{$wpdb->prefix}projects_releases` WHERE `project_id` = '%d'", $_GET['id']));
                        if ($status) {
                            echo '<div class="updated"><p>Deleted Project Information for <i>' . $_POST['title'] . '</i>.</p></div>';
                        } else {
                            echo '<div class="error"><p>Error: Failed to delete information.</p></div>';
                        }
                        break;
                    default:
                        $check = $wpdb->query($wpdb->prepare("SELECT `slug` FROM `" . $wpdb->prefix . "projects` WHERE `slug` = '%s'", wpmanga_getUrl($_POST['slug'], $_POST['title'])));
                        if (!$check) {
                            $wpdb->insert($wpdb->prefix . 'projects', $data);
                            if ($wpdb->insert_id) {
                                echo '<div class="updated"><p>Added <i>' . $_POST['title'] . '</i> to Projects. <a href="admin.php?page=manga/project&action=edit&id=' . $wpdb->insert_id . '">Edit Information</a></p></div>';
                            } else {
                                echo '<div class="error"><p>Error: Failed to add new project.</p></div>';
                            }
                        } else {
                            echo '<div class="error"><p>Error: Failed to add new project. (Duplicate Url)</p></div>';
                        }
                }
            } else {
                echo '<div class="error"><p>Error: Please fill in the required fields.</p></div>';
            }
        }
    }
    if (preg_match("/(edit|delete)/i", $action)) {
        $project = $wpdb->get_row($wpdb->prepare("SELECT * FROM `{$wpdb->prefix}projects` WHERE `id` = '%d' LIMIT 1", $_GET['id']));
    }
    ?>
	<div class="wrap">
		<?php 
    screen_icon('edit');
    ?>
		<h2><?php 
    echo ucfirst($action);
    ?>
 Project Information</h2>
		
		<p>Create a new project and add it to this site.</p>
<?php 
    switch ($action) {
        case 'edit':
            echo '<form method="post" action="admin.php?page=manga/project&action=edit&id=' . $_GET['id'] . '">';
            break;
        case 'delete':
            echo '<form method="post" action="admin.php?page=manga/project&action=delete&id=' . $_GET['id'] . '">';
            break;
        default:
            echo '<form method="post" action="admin.php?page=manga/project">';
    }
    ?>
			<table class="form-table">
				<tr class="form-field">
					<th scope="row"><label for="category">Category</label></th>
					<td>
						<select name="category" id="category" style="width: 460px">
							<?php 
    $categories = get_sListCategories();
    foreach ($categories as $category) {
        if (preg_match("/(edit|delete)/i", $action)) {
            if ($project->category == $category->id) {
                echo "<option value='{$category->id}' selected='selected'>{$category->name}</option>";
            } else {
                echo "<option value='{$category->id}'>{$category->name}</option>";
            }
        } else {
            echo "<option value='{$category->id}'>{$category->name}</option>";
        }
    }
    ?>
						</select>
					</td>
				</tr>
				
				<tr class="form-field">
					<th scope="row"><label for="title">Title <span class="description">(required)</span></label></th>
					<td><input name="title" id="title" type="text" value="<?php 
    if (isset($project)) {
        echo $project->title;
    }
    ?>
"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly" ';
    }
    ?>
autofocus required></td>
				</tr>
				
				<tr class="form-field">
					<th scope="row"><label for="title_alt">Alternative Title</label></th>
					<td><input name="title_alt" id="title_alt" type="text" value="<?php 
    if (isset($project)) {
        echo $project->title_alt;
    }
    ?>
"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
></td>
				</tr>

				<tr class="form-field">
					<th scope="row"><label for="title_alt">Url Fragment <br /><span class="description">(optional, blank for auto-generated url)</span></label></th>
					<td><input name="slug" id="slug" type="text" value="<?php 
    if (isset($project)) {
        echo $project->slug;
    }
    ?>
"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
></td>
				</tr>

				<tr class="form-field">
					<th scope="row"><label for="author">Author & Artist</label></th>
					<td><input name="author" id="author" type="text" value="<?php 
    if (isset($project)) {
        echo esc_textarea($project->author);
    }
    ?>
"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
></td>
				</tr>
				
				<tr class="form-field">
					<th scope="row"><label for="description">Description</label></th>
					<td><textarea name="description" id="description"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
><?php 
    if (isset($project)) {
        echo esc_textarea($project->description);
    }
    ?>
</textarea></td>
				</tr>
				
				<tr class="form-field">
					<th scope="row"><label for="short_description">Short Description <span class="description">(optional)</span></label></th>
					<td><textarea name="description_short" id="description_short"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
><?php 
    if (isset($project)) {
        echo esc_textarea($project->description_short);
    }
    ?>
</textarea></td>
				</tr>

				<tr class="form-field">
					<th scope="row"><label for="genre">Genre(s)</label></th>
					<td><textarea name="genre" id="genre"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
><?php 
    if (isset($project)) {
        echo esc_textarea($project->genre);
    }
    ?>
</textarea></td>
				</tr>
				
				<tr class="form-field">
					<th scope="row"><label for="status">Status in Country of Origin</label></th>
					<td><textarea name="status" id="status"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
><?php 
    if (isset($project)) {
        echo esc_textarea($project->status);
    }
    ?>
</textarea></td>
				</tr>
				
				<tr class="form">
					<th scope="row"><label for="image">Image</label></th>
					<td><input id="image" type="url" name="image" class="upload" size="66" placeholder="Enter an URL or upload an image for this project." value="<?php 
    if (isset($project)) {
        echo $project->image;
    }
    ?>
"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
><input class="<?php 
    if ($action != 'delete') {
        echo 'upload_image_button';
    }
    ?>
" type="button" value="Upload Image"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
></td>
				</tr>

				<tr class="form">
					<th scope="row"><label for="image_thumbnail">Image Thumbnail <span class="description">(optional)</span></label></th>
					<td><input id="image_thumbnail" type="url" name="image_thumbnail" class="upload" size="66" placeholder="Enter an URL or upload an image thumbnail for this project." value="<?php 
    if (isset($project)) {
        echo $project->image_thumbnail;
    }
    ?>
"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
><input class="<?php 
    if ($action != 'delete') {
        echo 'upload_image_button';
    }
    ?>
" type="button" value="Upload Image Thumbnail"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
></td>
				</tr>

				<tr class="form-field">
					<th scope="row"><label for="team_origin">Original Team</label></th>
					<td><input name="team_origin" id="team_origin" type="text" value="<?php 
    if (isset($project)) {
        echo esc_textarea($project->team_origin);
    }
    ?>
"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
></td>
				</tr>

				<tr class="form-field">
					<th scope="row"><label for="reader">Online Reader Link</label></th>
					<td><input name="reader" id="reader" type="url" placeholder="http://reader.<?php 
    echo $_SERVER['HTTP_HOST'];
    ?>
/serie/..." value="<?php 
    if (isset($project)) {
        echo $project->reader;
    }
    ?>
"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
></td>
				</tr>
				
				<tr class="form-field">
					<th scope="row"><label for="url">Reference Link</label></th>
					<td><input name="url" id="url" type="url" placeholder="http://mangaupdates.com/series.html?id=..." value="<?php 
    if (isset($project)) {
        echo $project->url;
    }
    ?>
"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
></td>
				</tr>
				
				<tr class="form">
					<th scope="row"><label for="custom_subchapter">Mature Content</label></th>
					<td><input name="mature" id="mature" type="checkbox" value="1"<?php 
    if ($project->mature) {
        echo ' checked="checked"';
    }
    ?>
> Yes</td>
				</tr>
				
				<tr class="form-field">
					<th scope="row"><label for="custom_chapter">Custom Chapter <span class="description">(optional)</span></label></th>
					<td><input name="custom_chapter" id="custom_chapter" type="text" placeholder="Episode %num%" value="<?php 
    if (isset($project)) {
        echo get_sJSON($project->custom, 'chapter');
    }
    ?>
"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
></td>
				</tr>
				
				<tr class="form-field">
					<th scope="row"><label for="custom_subchapter">Custom Sub-Chapter <span class="description">(optional)</span></label></th>
					<td><input name="custom_subchapter" id="custom_subchapter" type="text" placeholder="Act %num%" value="<?php 
    if (isset($project)) {
        echo get_sJSON($project->custom, 'subchapter');
    }
    ?>
"<?php 
    if ($action == 'delete') {
        echo ' readonly="readonly"';
    }
    ?>
></td>
				</tr>
			</table>
			
			<p class="submit">
				<input type="submit" class="button-primary" name="save" value="<?php 
    echo ucfirst($action);
    ?>
 Project">
				<input type="hidden" name="wpmanga_nonce" value="<?php 
    echo wp_create_nonce(plugin_basename(plugin_sDIR() . '/wpmanga.php'));
    ?>
">
			</p>
		</form>
	</div>
<?php 
}
コード例 #6
0
function footer_sProjects()
{
    $channel = wpmanga_get('wpmanga_channel', '#');
    $content = '<div class="download-overlay" id="download-overlay">';
    $content .= "TO DOWNLOAD, COPY AND PASTE THE FOLLOWING LINE INTO YOUR <a href='{$channel}' title='{$channel}'>IRC CLIENT</a>:<br><br><input class='xdcc' type='text' size='48'><br><br>(CLICK ANYWHERE OUTSIDE THIS BOX TO CLOSE THE OVERLAY)";
    $content .= '</div>';
    echo $content;
}
コード例 #7
0
                echo '&nbsp; <a href="' . $chapterUrl . '" target="_blank">LEL</a>';
            }
            echo '</span>';
            echo '<br class="clear">';
        }
    }
    ?>
					<div class="footer"><span></span></div>
				</div>
				
		</div>
		
<?php 
} else {
    ?>

		<p><b>Error : 404 Page Not Found!</b><br><br>The page you attempted to access could not be found. It has either been moved, renamed, deleted, or never existed.</p>
		<script type="text/javascript">
			//window.location = "<?php 
    $projectDirUrl = wpmanga_get('wpmanga_projectslist_url', 'projects');
    echo get_bloginfo('siteurl') . '/' . $projectDirUrl . '/';
    ?>
";
		</script>
<?php 
}
?>

	<!-- #END WP Manga Project Details Layout -->

<!-- #END WP Manga Project Output -->
コード例 #8
0
			if (project[id][0].image !="") {	output = output + '<br /><img src="' + project[id][0].image + '" />'; }
			if (project[id][0].last_release != "") { output = output + '<br />Latest Release: ' + project[id][0].last_release; }
			if (project[id][0].last_release_title != "") { output = output + '<br /><i>' + project[id][0].last_release_title + '</i>'; }
			if (project[id][0].last_release_time != "") { output = output + '<br /><font size="1">(' + project[id][0].last_release_time + ')</font>'; }
			
			jQuery("#projects-tooltip").html(output).show();
		} else {
			jQuery("#projects-tooltip").html('').hide();
		}
	}
</script>

<?php 
$categories = get_sListCategories();
$thumbnail_width = wpmanga_get('wpmanga_thumbnail_list_width', 145);
$thumbnail_height = wpmanga_get('wpmanga_thumbnail_list_height', 300);
foreach ($categories as $category) {
    $projects = get_sListCategory($category->id);
    if ($projects) {
        echo "<h2>{$category->description}</h2>";
        echo '<div id="projects-wrapper">';
        foreach ($projects as $project) {
            echo "<div class='item'><a href='" . get_sPermalink($project) . "'><img src='" . get_sThumbnail($thumbnail_width . "x" . $thumbnail_height, empty($project->image_thumbnail) ? $project->image : $project->image_thumbnail) . "' width='{$thumbnail_width}' height='{$thumbnail_height}' id='{$project->id}' title='{$project->name}' alt='{$project->name}'>";
            if ($project->mature) {
                echo "<div class='mature'>R-18</div>";
            }
            echo "</a></div>";
        }
        echo '</div><br class="wpmanga-clear"><br>';
    }
}
コード例 #9
0
/**
 * Returns the Permalink for the project specified.
 * @param integer $id Query the ID to obtain the permalink.
 * @return string
 */
function get_sPermalink($project = NULL)
{
    global $wp, $wpdb;
    if (!$project) {
        $id = get_sProjectId($wp->query_vars["pid"]);
        $project = $wpdb->get_row($wpdb->prepare("SELECT `id`, `slug` FROM `{$wpdb->prefix}projects` WHERE `id` = '%d' ORDER BY `title` ASC", $id));
    } elseif (is_int($project)) {
        $id = (int) $project;
        $project = $wpdb->get_row($wpdb->prepare("SELECT `id`, `slug` FROM `{$wpdb->prefix}projects` WHERE `id` = '%d' ORDER BY `title` ASC", $id));
    }
    if ($project) {
        $projectDirUrl = wpmanga_get('wpmanga_projectslist_url', 'projects');
        if ($project->slug != NULL) {
            return (string) get_bloginfo('siteurl') . "/{$projectDirUrl}/" . $project->slug . '/';
        } else {
            return (string) get_bloginfo('siteurl') . "/{$projectDirUrl}/" . $project->id . '/';
        }
    }
    //else
    return NULL;
}
コード例 #10
0
/**
 * Display Administrative Menu for Releases.
 * @return menu
 */
function wpmanga_listReleases()
{
    global $wpdb;
    $projects = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}projects` ORDER BY `title` ASC");
    $publishedstatus = wpmanga_get('wpmanga_release_statuspublished', 0);
    if ($projects) {
        ?>
		<div class="wrap">
			<?php 
        screen_icon('edit-pages');
        ?>
			<h2>Releases <a href="?page=manga/release" class="add-new-h2">Add a New Release</a></h2>
			

		<script type="text/javascript">
			function toggleFinishedRelease(cb) {
			  if (cb.checked)
				jQuery('.finished').css( "display", "table-row" );
			  else
				jQuery('.finished').css( "display", "none" );
			}

			function catFilter(cbo) {
			  var category = cbo.options[cbo.selectedIndex].value;
			  if (category != '')
			  {
				jQuery('.project').css( "display", "none" );
				jQuery('.cat'+category).css( "display", "block" );
			  }
			  else
			  {
				jQuery('.project').css( "display", "block" );
			  }
			}

			function projectFilter(cbo) {
			  var project = cbo.options[cbo.selectedIndex].value;
			  if (project != '')
			  {
				jQuery('.project').css( "display", "none" );
				jQuery('#proj'+project).css( "display", "block" );
			  }
			  else
			  {
				jQuery('.project').css( "display", "block" );
			  }
				document.getElementById("categoryCombo").selectedIndex=0;
			}

			jQuery(function($){ // DOM is now read and ready to be manipulated
				jQuery('.finished').css( "display", "none" );
				document.getElementById("categoryCombo").selectedIndex=1;
				catFilter(document.getElementById("categoryCombo"));
			});
		</script>

<?php 
        if ($publishedstatus != 0) {
            ?>
		<label><input type="checkbox" onclick="toggleFinishedRelease(this);">Show finished releases</label><br />
<?php 
        }
        ?>
		<span>Show only projects from this category </span>
		<select name="category" id="categoryCombo" onchange="catFilter(this)" >
				<?php 
        $categories = get_sListCategories();
        echo "<option value='' selected=\"selected\">All</option>";
        foreach ($categories as $category) {
            echo "<option value='{$category->id}'>{$category->name}</option>";
        }
        ?>
		</select>
		<span> Or only this project</span>
		<select name="projects" id="projectsCombo" onchange="projectFilter(this)" >
				<?php 
        echo "<option value='' selected=\"selected\">All</option>";
        foreach ($projects as $project) {
            echo "<option value='{$project->id}'>{$project->title}</option>";
        }
        ?>
		</select>

<?php 
        foreach ($projects as $project) {
            $releases = $wpdb->get_results($wpdb->prepare("SELECT * FROM `{$wpdb->prefix}projects_releases` WHERE `project_id` = '%d' ORDER BY `volume` ASC, `chapter` ASC, `subchapter` ASC, `type` ASC", $project->id));
            if ($releases) {
                ?>
					<div class="project cat<?php 
                echo $project->category;
                ?>
" id="proj<?php 
                echo $project->id;
                ?>
">
					<br> &nbsp; <a href="admin.php?page=manga/project&action=edit&id=<?php 
                echo $project->id;
                ?>
" style="text-decoration: none; font-weight: bold"><?php 
                echo $project->title;
                ?>
</a> &nbsp; <?php 
                if ($project->title_alt) {
                    echo "&#12302;{$project->title_alt}&#12303;";
                }
                ?>
					<table class="wp-list-table widefat fixed">
						<thead>
							<th scope="col" width="100px">Date</th>
							<th scope="col">Release</th>
							<th scope="col" width="150px">Action</th>
						</thead>
						
						<tbody id="the-list">
							<?php 
                $row = 1;
                ?>
							<?php 
                foreach ($releases as $release) {
                    $class = "";
                    if ($publishedstatus != 0 && $release->status == $publishedstatus) {
                        $class = "finished";
                    }
                    ?>
							<tr<?php 
                    if ($row % 2) {
                        $class .= " alternate";
                    }
                    echo " class=\"{$class}\"";
                    $row++;
                    ?>
>
								<td><?php 
                    echo date('Y.m.d', $release->unixtime);
                    ?>
</td>
								<td><?php 
                    echo get_sFormatRelease($project, $release);
                    if ($release->title) {
                        echo ' - <i>' . $release->title . '</i>';
                    }
                    ?>
</td>
								<td>
									<a href="admin.php?page=manga/release&action=edit&id=<?php 
                    echo $release->id;
                    ?>
" title="Edit Release Information">Edit</a> | 
									<a href="admin.php?page=manga/release&action=delete&id=<?php 
                    echo $release->id;
                    ?>
" title="Delete Release Information">Delete</a> | 
									<a href="<?php 
                    echo get_sPermalink($release->project_id);
                    ?>
#release-<?php 
                    echo $release->id;
                    ?>
" title="View Release Information">View</a>
								</td>
							</tr>
							<?php 
                }
                ?>
						</tbody>
					</table>
					</div>
<?php 
            }
        }
        ?>
		</div>
<?php 
    } else {
        ?>
		<script type="text/javascript">
			location.replace("admin.php?page=manga/project")
		</script>
<?php 
    }
}
コード例 #11
0
<?php

$downloads = get_sReleaseDownloads($release);
if (get_object_vars($downloads) || $project->reader) {
    switch (wpmanga_get('wpmanga_releasebar_style', 1)) {
        case 2:
            $output .= '<div id="release-download-wrapper-style2">';
            $output .= '<span class="release-download-style2-title">';
            $output .= "{$project->title} - " . get_sFormatRelease($project, $release);
            if ($release->title != NULL) {
                $output .= "<br>{$release->title}";
            }
            $output .= '</span>';
            $output .= '<span class="release-download-style2-icons">';
            foreach ($downloads as $download => $value) {
                $title = str_replace(array('download_depositfiles', 'download_fileserve', 'download_filesonic', 'download_mediafire', 'download_megaupload', 'download_pdf', 'download_irc'), array('Deposit Files', 'FileServe', 'FileSonic', 'MediaFire', 'MEGAUPLOAD', 'PDF', 'IRC'), $download);
                $download = str_replace('download_', 'download-icon-', $download);
                if ($value) {
                    if ($download == 'download-icon-irc') {
                        $output .= "&nbsp; <span rel='#download-overlay' title='{$value}'><a><img src='" . plugin_sURL() . "images/{$download}-32.png' title='{$title}'></a></span>";
                    } else {
                        $output .= "&nbsp; <a href='{$value}' target='_blank'><img src='" . plugin_sURL() . "images/{$download}-32.png' title='{$title}'></a>";
                    }
                }
            }
            $output .= '</span>';
            $output .= '</div>';
            $output .= '<br/><br class="wpmanga-clear"/>';
            break;
        default:
            $output .= "{$project->title} - " . get_sFormatRelease($project, $release);