Example #1
0
								<h3 class="date-header"><span><?php 
        echo get_the_date();
        ?>
</span></h3>
								<h2 class="post-title entry-title"><a href="<?php 
        the_permalink();
        ?>
"><?php 
        the_title();
        ?>
</a></h2>

								<div class="post-lead entry-content">
									<?php 
        echo get_first_paragraph();
        ?>
								</div>
								
								<div class="post-image">
									<a href="<?php 
        the_permalink();
        ?>
">
									<?php 
        if (has_post_thumbnail()) {
            // check if the post has a Post Thumbnail assigned to it.
            the_post_thumbnail('full');
        } else {
            ?>
										<img src="<?php 
Example #2
0
/**
 * Adds story as a drupal node to our site.
 */
function newstory($head, $body, $taxonomy, $date, $data)
{
    global $mniblogpub_props;
    $cfg = $mniblogpub_props["mniblogpub.php"];
    // Check ContentType
    $pdf_file = null;
    if ($data['ContentType'] == "UUSTORY") {
        $pdf_file = move_pdf($body);
    }
    // Load data
    $author = loadAuthor();
    $format = loadFormat();
    $status = $cfg["node.status_published"] == 1;
    $codenums = array();
    $txttbl = 0;
    // Load taxonomy data
    foreach ($taxonomy as $key => $value) {
        $tt = $value;
        if ($cfg["node.taxonomy.load_from"] == "description") {
            $tt = tax_getHumanName_sql($value);
        }
        $theterm = taxonomy_get_term_by_name($tt);
        //if($value = "txttbl")
        //	$txttbl = "Text Table";
        foreach ($theterm as $mkey => $mvalue) {
            $codenums[] = $mvalue->tid;
        }
    }
    // Basic Data
    $node = array('type' => $cfg["node.type"], 'title' => $head, 'uid' => $cfg["user.use"] == 1 ? $author->uid : 3, 'name' => $cfg["user.use"] == 1 ? $author->name : 'mnieditor', 'status' => $status, 'comment' => $cfg["node.comments"] == 1 ? 2 : 0, 'promote' => 1, 'taxonomy' => $codenums, 'revision' => 1, 'format' => 1, 'body' => $data['ContentType'] == "UUSTORY" ? richbody($pdf_file) : $body);
    // Alacarte Specific
    if ($cfg["node.type"] == "alacarte_article") {
        $product_nid = newproduct($node, $data);
        $node['body'] = get_first_paragraph($body);
        $node['field_full_body'] = array(0 => array("value" => $body, "format" => $format));
        $node['field_product_nid'] = array(0 => array("value" => $product_nid));
        //$node['field_txttbl'] = array(0=> array("value" => $txttbl));
    }
    // Embargo specific
    if ($cfg["modules.mnembargo"] && module_exists('mnembargo')) {
        if ($data['mnembargo'] > 0) {
            $node['time_to_pub'] = $data['mnembargo'];
            $node['status'] = 0;
        }
    }
    // Expire Specific
    if ($cfg["modules.mnexpire"] && module_exists('mnexpire')) {
        $node['time_to_exp'] = $data['mnexpire'];
    }
    if ($format) {
        $node['format'] = $format;
    }
    if ($data['ContentType'] == "UUSTORY") {
        if ($cfg["rich.type"]) {
            $node['type'] = $cfg["rich.type"];
        }
        $node['format'] = 3;
    }
    $node = node_submit($node);
    // Final Changes
    if ($cfg["date.adjust"] == 1) {
        $node->created = intval($date);
        $node->changed = intval($date);
        if ($data['ContentType'] == "UUSTORY") {
            $node->files[$pdf_file->fid] = $pdf_file;
        }
    }
    // SAVE!
    node_save($node);
    $article_nid = $node->nid;
    //unset($node);
    // Aftermath
    if ($cfg["node.type"] == "alacarte_article") {
        set_uc_node_access_feature($product_nid, $article_nid);
    }
    return $node;
}