<?php if ('POST' == $_SERVER['REQUEST_METHOD'] && !empty($_POST['action']) && $_POST['post_type'] == 'site') { $post = array('post_title' => $_POST['title'], 'description' => $_POST['description'], 'siteS-url' => $_POST['site'], 'cat' => $_POST['category'], 'tags' => $_POST['post_tags'], 'post_status' => 'publish', 'post_type' => $_POST['post_type']); wp_insert_post($post); wp_redirect($_POST['redirect_to']); $insert = new siteSubmit(); $insert->wp_insert_post($post); } elseif ('POST' == $_SERVER['REQUEST_METHOD'] && !empty($_POST['action']) && $_POST['post_type'] == 'snip') { $post = array('post_title' => $_POST['title'], 'description' => $_POST['description'], 'syntax' => $_POST['syntax'], 'tags' => $_POST['post_tags'], 'post_status' => 'publish', 'post_type' => $_POST['post_type']); wp_insert_post($post); wp_redirect($_POST['redirect_to']); $insert = new siteSnippet(); $insert->wp_insert_post($post); } elseif ('POST' == $_SERVER['REQUEST_METHOD'] && !empty($_POST['action']) && $_POST['post_type'] == 'status') { $post = array('post_title' => substr($_POST['description'], 20), 'description' => $_POST['description'], 'tags' => $_POST['post_tags'], 'post_status' => 'publish', 'post_type' => $_POST['post_type']); wp_insert_post($post); wp_redirect($_POST['redirect_to']); $insert = new siteStatus(); $insert->wp_insert_post($post); } elseif ('POST' == $_SERVER['REQUEST_METHOD'] && !empty($_POST['action']) && $_POST['post_type'] == 'question') { $post = array('post_title' => $_POST['title'], 'description' => $_POST['description'], 'tags' => $_POST['post_tags'], 'post_status' => 'publish', 'post_type' => $_POST['post_type']); wp_insert_post($post); wp_redirect($_POST['redirect_to']); $insert = new siteQuestion(); $insert->wp_insert_post($post); }
<?php $insert = new siteSubmit(); if ('POST' == $_SERVER['REQUEST_METHOD'] && !empty($_POST['action'])) { $post = array('post_title' => $_POST['title'], 'description' => $_POST['description'], 'siteurl' => $_POST['site'], 'cat' => $_POST['category'], 'labels' => $_POST['lbls'], 'post_status' => 'publish', 'post_type' => $_POST['post_type']); wp_insert_post($post); $insert->template_redirect(); } $insert->wp_insert_post($post); // do_action('wp_insert_post', 'wp_insert_post'); ?> <div id="postbox"> <div id="tabs"> <ul> <li><a href="#tab1">Site</a></li> <li><a href="#tab2">Snippet</a></li> <li><a href="#tab3">Status</a></li> <li><a href="#tab4">Question</a></li> </ul> <div id="tab1" class="default"> <div class="adminaccess"> <form id="new_site" name="new_site" method="post" action=""> <div id="media-buttons" class="hide-if-no-js"><?php echo N2::media_buttons2(); ?> </div> <p><label for="title">Title:</label> <input type="text" name="title" id="title" tabindex="1" size="30" value="" /></p> <p><label for="siteurl">Site:</label>
get_header(); ?> <div class="navigation"><p><?php posts_nav_link(); ?> </p></div> <div class="gallery-thumbs"> <ul> <?php $q = new WP_query(); $q->query("post_type=site&post_status=publish&posts_per_page=9"); if (have_posts()) { /*$previous_user_id = 0; $previous_user_id = */ while ($q->have_posts()) { $q->the_post(); $s = new siteSubmit(); // var_dump($s->mshot('200')); // die; ?> <li id="n2-<?php the_ID(); ?> " class="user_id_<?php the_author_ID(); ?> "> <a href="<?php the_permalink(); ?> " title="<?php
<?php get_header(); ?> <div class="gallery-details" id="post"> <?php if (have_posts()) { while (have_posts()) { the_post(); ?> <article class="description entry"> <?php $s = new siteSubmit(); // print_r($s->meta_options()); // var_dump($s->siteurl); die; ?> <h2><a href="<?php echo $siteurl; ?> " title="<?php the_title(); ?> "><?php the_title(); ?> </a></h2> <?php the_content(); ?>