From: Steve Sutton Date: Wed, 12 Oct 2016 12:44:11 +0000 (-0400) Subject: Updates for Mackinac Bridge site. X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=d905301e58e9e411add0e29568168c495df95f56;p=prog%2FPressReleaseExportForWordPress.git Updates for Mackinac Bridge site. This database was really old. Made changes for field names and the one and only table used. --- diff --git a/index.php b/index.php index 8a6730e..b58c73f 100644 --- a/index.php +++ b/index.php @@ -20,30 +20,18 @@ if ( class_exists( Toolkit_Database ) ) { $sql = " SELECT * FROM news - WHERE catid = 2 -ORDER BY pr_date"; - +ORDER BY nldate"; $stmt = $dbh->query($sql); -$getBlocksSql = " - SELECT * - FROM news_block - WHERE news_id = :news_id -ORDER BY pos"; -$getBlocks = $dbh->prepare($getBlocksSql); $data = array(); while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) { - $prDate = strtotime($row['pr_date']); - $row['pubDate'] = date('r', $prDate); - $row['pr_date'] = date('Y-m-d H:i:s', $prDate); - $data[$row['id']] = $row; - $getBlocks->bindParam(':news_id', $row['id'], PDO::PARAM_INT); - $getBlocks->execute(); - $data[$row['id']]['blocks'] = $getBlocks->fetchAll(PDO::FETCH_ASSOC); + $nldate = $row['nldate']; + $row['pubDate'] = date('r', $nldate); + $row['nldate'] = date('Y-m-d H:i:s', $nldate); + $data[$row['artid']] = $row; } -//echo '
'.print_r($data, true).'
'; -$smarty->assign('resized', 'http://www.gaylordgolfmecca.com/images/resized/'); -$smarty->assign('exportTitle', 'Gaylord Golf Mecca'); -$smarty->assign('siteUrl', 'blog.gaylordgolfmecca.com'); +$smarty->assign('resized', 'http://www.mackinacbridge.org/images/resized/'); +$smarty->assign('exportTitle', 'Mackinac Bridge News'); +$smarty->assign('siteUrl', 'www.mackinacbridge.org'); $smarty->assign('data', $data); $smarty->display('wordPress.tpl'); diff --git a/tmp/wordPress.tpl b/tmp/wordPress.tpl index c9b5be7..d7670b9 100644 --- a/tmp/wordPress.tpl +++ b/tmp/wordPress.tpl @@ -45,13 +45,13 @@ http://{$siteUrl}/{$row.ping_name}/ {$row.pubDate} - http://{$siteUrl}/?p={$row.id} + http://{$siteUrl}/?p={$row.artid} - {$row.header}{/if}

{if $row.image}{/if}{$row.description}

{foreach $row.blocks as $block}{if $block.header}

{$block.header}

{/if}

{if $row.image}{/if}{$block.description}

{/foreach}]]>
+ {$row.title}{/if}

{if $row.image}{/if}{$row.body}

]]>
{$row.id} - {$row.pr_date} - {$row.pr_date} + {$row.nldate} + {$row.nldate} closed open {$row.ping_name}