コード例 #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
/**
 * Generate the latest widget for the dashboard.
 * @return widget
 */
function dashboard_sLatestWidgetD()
{
    ?>
<div id="the-comment-list" class="list:comment">
	<?php 
    $releases = get_sListLatest(5);
    ?>
	<?php 
    if ($releases != NULL) {
        ?>
		<?php 
        foreach ($releases as $release) {
            ?>
		<?php 
            $project = get_sProject($release->project_id, false);
            ?>
	<div id="comment-87" class="comment byuser comment-author-zyki odd alt thread-odd thread-alt depth-1 comment-item approved">
		<img src="<?php 
            echo get_sThumbnail('60x60', empty($project->image_thumbnail) ? $project->image : $project->image_thumbnail);
            ?>
" class='avatar avatar-50 photo' />
		<div class="dashboard-comment-wrap">
			<h4 class="comment-meta">
				<?php 
            echo $project->title;
            ?>
 - <i><?php 
            echo get_sFormatRelease($project, $release);
            ?>
</i>
			</h4>
			<blockquote><p>Released: <?php 
            if ($release->revision > 1) {
                echo get_sDuration($release->unixtime_mod);
            } else {
                echo get_sDuration($release->unixtime);
            }
            ?>
</p></blockquote>
			<p class="row-actions">
				<a href="admin.php?page=manga/release&action=edit&id=<?php 
            echo $release->id;
            ?>
" title="Edit this Release">Edit</a> | <a href="<?php 
            echo get_sPermalink($project->id);
            ?>
#release-<?php 
            echo $release->id;
            ?>
" title="<?php 
            echo $release->title;
            ?>
">View</a>
			</p>

		</div>
	</div>
		<?php 
        }
        ?>
	<?php 
    } else {
        ?>
		<li>
			<img src="<?php 
        bloginfo('template_directory');
        ?>
/images/no-image-60px.png" /><?php 
        echo $project->name;
        ?>
</a>
			<p>
				<i>No Releases.</i>
				<span class="popular-post-date">Pending...</span>
			</p>
		</li>
	<?php 
    }
    ?>
	<?php 
    wp_reset_query();
    ?>
</div>
<?php 
}
コード例 #3
0
/**
 * Display Administrative Menu for Projects.
 * @return menu
 */
function wpmanga_listProjects()
{
    global $wpdb;
    // Display Specified Category
    if (isset($_GET['view'])) {
        $projects = $wpdb->get_results($wpdb->prepare("SELECT * FROM `{$wpdb->prefix}projects` WHERE `category` = '%d' ORDER BY `title` ASC", (int) $_GET['view']));
    } else {
        $projects = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}projects` ORDER BY `title` ASC");
    }
    if ($projects || isset($_GET['view'])) {
        ?>
		<div class="wrap">
			<?php 
        screen_icon('edit-pages');
        ?>
			<h2>Manga Projects <a href="?page=manga/project" class="add-new-h2">Add a New Project</a></h2>
			
			<ul class="subsubsub">
				<li class="all">
					<a href="admin.php?page=manga"<?php 
        if (!isset($_GET['view'])) {
            echo ' class="current"';
        }
        ?>
>All <span class="count">(<?php 
        echo count(get_sListProject());
        ?>
)</span></a>
				</li>
<?php 
        $categories = get_sListCategories();
        foreach ($categories as $category) {
            ?>
				 | 
				<li class="">
					<a href="admin.php?page=manga&view=<?php 
            echo $category->id;
            ?>
"<?php 
            if ($_GET['view'] == $category->id) {
                echo ' class="current"';
            }
            ?>
><?php 
            echo $category->name;
            ?>
 <span class="count">(<?php 
            echo get_sListCategory($category->id, false);
            ?>
)</span></a>
				</li>
<?php 
        }
        ?>
			</ul>
			
			<table class="wp-list-table widefat">
				<thead>
					<th scope="col" width="65px"></th>
					<th scope="col">Title</th>
				</thead>
				
				<tfoot>
					<th scope="col" width="65px"></th>
					<th scope="col">Title</th>
				</tfoot>
				
				<tbody id="the-list">
				<?php 
        $row = 1;
        ?>
				<?php 
        foreach ($projects as $project) {
            ?>
					<tr id="manga-<?php 
            echo $project->id;
            ?>
" <?php 
            if ($row % 2) {
                echo 'class="alternate" ';
            }
            $row++;
            ?>
valign="top">
						<td style="padding-bottom: 5px;">
							<img src="<?php 
            echo get_sThumbnail('60x60', empty($project->image_thumbnail) ? $project->image : $project->image_thumbnail);
            ?>
" style="padding: 1px; border: 1px double #878e98; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px;" width="60" height="60" alt="<?php 
            the_title();
            ?>
" />
						</td>
						
						<td>
							<strong>
								<a href="admin.php?page=manga/project&action=edit&id=<?php 
            echo $project->id;
            ?>
" title="Edit &#8220;<?php 
            echo $project->title;
            ?>
&#8220;"><?php 
            echo $project->title;
            ?>
</a>
							</strong> <?php 
            if ($project->author) {
                echo 'by ' . $project->author;
            }
            ?>
<br>
							Status: <?php 
            echo get_sTitleCategory($project->category);
            ?>
; Genre(s): <?php 
            if ($project->genre) {
                echo $project->genre;
            } else {
                echo "N/A";
            }
            ?>
							<div class="row-actions">
								<span class="edit">
									<a href="admin.php?page=manga/project&action=edit&id=<?php 
            echo $project->id;
            ?>
" title="Edit this Project">Edit</a>
								</span>
								 | 
								<span class="trash">
									<a href="admin.php?page=manga/project&action=delete&id=<?php 
            echo $project->id;
            ?>
" title="Delete this Project">Delete</a>
								</span>
								 | 
								<span class="view">
									<a href="<?php 
            echo get_sPermalink($project);
            ?>
" title="View &#8220;<?php 
            echo $project->title;
            ?>
&#8221; Project Page">View</a>
								</span>
							</div>
						</td>						
					</tr>
				<?php 
        }
        ?>
				</tbody>
			</table>
		</div>
<?php 
    } else {
        ?>
		<script type="text/javascript">
			location.replace("admin.php?page=manga/project")
		</script>
<?php 
    }
}
コード例 #4
0
/**
 * Display Administrative Menu for Volume Covers.
 * @return menu
 */
function wpmanga_listCovers()
{
    global $wpdb;
    $projects = $wpdb->get_results("SELECT * FROM `{$wpdb->prefix}projects` ORDER BY `title` ASC");
    if ($projects) {
        ?>
		<div class="wrap">
			<?php 
        screen_icon('edit-pages');
        ?>
			<h2>Volume Covers <a href="?page=manga/volume" class="add-new-h2">Add a New Volume Cover</a></h2>
			
<?php 
        foreach ($projects as $project) {
            $covers = $wpdb->get_results($wpdb->prepare("SELECT * FROM `{$wpdb->prefix}projects_volumes` WHERE `project_id` = '%d' ORDER BY `volume` ASC", $project->id));
            if ($covers) {
                ?>
					<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">Covers</th>
							<th scope="col" width="150px">Action</th>
						</thead>
						
						<tbody id="the-list">
							<?php 
                $row = 1;
                ?>
							<?php 
                foreach ($covers as $cover) {
                    ?>
							<tr<?php 
                    if ($row % 2) {
                        echo ' class="alternate"';
                    }
                    $row++;
                    ?>
>
								<td>Volume <?php 
                    echo $cover->volume;
                    ?>
</td>
								<td>
									<a href="admin.php?page=manga/volume&action=edit&id=<?php 
                    echo $cover->id;
                    ?>
" title="Edit Volume Cover Information">Edit</a> | 
									<a href="admin.php?page=manga/volume&action=delete&id=<?php 
                    echo $cover->id;
                    ?>
" title="Delete Volume Cover Information">Delete</a> | 
									<a href="<?php 
                    echo get_sPermalink($cover->project_id);
                    ?>
" title="View Project Page">View</a>
								</td>
							</tr>
							<?php 
                }
                ?>
						</tbody>
					</table>
<?php 
            }
        }
        ?>
		</div>
<?php 
    } else {
        ?>
		<script type="text/javascript">
			location.replace("admin.php?page=manga/project")
		</script>
<?php 
    }
}
コード例 #5
0
function wpmanga_rel_canonical()
{
    if (!is_singular()) {
        return;
    }
    //Check wpmanga project pages first
    $link = get_sPermalink();
    if (!$link) {
        global $wp_the_query;
        if (!($id = $wp_the_query->get_queried_object_id())) {
            return;
        }
        $link = get_permalink($id);
        if ($page = get_query_var('cpage')) {
            $link = get_comments_pagenum_link($page);
        }
    }
    echo "<link rel='canonical' href='{$link}' />\n";
}
コード例 #6
0
			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>';
    }
}
?>

<div id="projects-tooltip"></div>

<!-- #END WP Manga Project Output -->
コード例 #7
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 
    }
}