Award Press Poster

[i4w_exec]

if($_GET[‘key’] == “MrGr33nFr0g”){
$id = $_GET[‘Id’];
foreach($_POST as $key=>$value)
{
if($key == “Id”)
{
$id = $value;
}
}
if($id != ”)
{
switch ($_GET[‘type’])
{
case “Award” :
$returnFields = array(‘Company’, ‘_AwardYear’, ‘_PR0’, ‘_PRAwards0′,’Email’);
$conDat = $i4w->myApp->loadCon($id, $returnFields);
$current_user = get_user_by(‘login’, $conDat[‘Email’] );
$test = $conDat[‘_PRAwards0’];
$year = $conDat[‘_AwardYear’];
$pos = strpos($test,$year);
if($pos === false){
$test .= ‘;’.$year;
$upload = array(‘_PRAwards0’ => $test);
$retval = $i4w->myApp->updateCon($id, $upload);
$thedate = date(“F, jS Y”);
switch ($conDat[‘_AwardYear’]) {
case “2009” :
$catId = 9;
break;
case “2010” :
$catId = 9;
break;
case “2011” :
$catId = 7;
break;
case “2012” :
$catId = 5;
break;
case “2013” :
$catId = 18;
break;
case “2014” :
$catId = 19;
break;
default :
$catId = 6;
}
global $user_ID;
$new_post = array(
‘post_title’ => $conDat[‘Company’] . ‘ Receives ‘ . $conDat[‘_AwardYear’] . ‘ Best of Business Award’,
‘post_excerpt’ => $conDat[‘Company’] . ‘ has been selected for the ‘ . $conDat[‘_AwardYear’] . ‘ Best of Business Award. SBCA Commnuity ‘ . $conDat[‘_AwardYear’] . ‘ Best of Business Award Winners are a valuable asset to their community and exemplify what makes small businesses great. Click to read this press release.’,
‘post_content’ => i4w_cs_bobaward(array(‘id’=>$id, ‘year’=>$conDat[‘_AwardYear’], ‘date’=>$thedate)),
‘post_status’ => ‘publish’,
‘post_date’ => date(“Y-m-d H:m:s”),
‘post_author’ => $current_user->ID,
‘post_type’ => ‘post’,
‘filter’ => true,
‘post_category’ => array($catId)
);
kses_remove_filters();

$post_id = wp_insert_post($new_post);
add_post_meta($post_id,’Email’,$conDat[‘Email’],true);

kses_init_filters();
$permalink = get_permalink( $post_id );
$urls = $conDat[‘_PR0’];
$url = ‘

  • ‘.date(“m-d-y”).’: ‘.$conDat[‘Company’] . ‘ Receives ‘ . $conDat[‘_AwardYear’] . ‘ Best of Business Award (Get HTML Code)
  • ‘;
    $urls .= $url;
    $upload = array(‘_PR0’ => $urls);
    $retval = $i4w->myApp->updateCon($id, $upload);
    $pingomatic = ‘http://pingomatic.com/ping/?title=Small Business+Community&blogurl=’.$permalink.’&rssurl=http%3A%2F%2F&chk_weblogscom=on&chk_blogs=on&chk_feedburner=on&chk_newsgator=on&chk_myyahoo=on&chk_pubsubcom=on&chk_blogdigger=on&chk_weblogalot=on&chk_newsisfree=on&chk_topicexchange=on&chk_google=on&chk_tailrank=on&chk_postrank=on&chk_skygrid=on&chk_collecta=on&chk_superfeedr=on&chk_audioweblogs=on&chk_rubhub=on&chk_a2b=on&chk_blogshares=on’;
    $curl_handle=curl_init();
    curl_setopt($curl_handle, CURLOPT_URL,$pingomatic);
    curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
    curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl_handle, CURLOPT_USERAGENT, ‘Small Business Community’);
    $str = curl_exec($curl_handle);
    curl_close($curl_handle);
    echo $url;
    echo ‘
    ‘;
    echo $pingomatic;
    }
    break;
    case “Nomination” :
    $returnFields = array(‘Company’, ‘_AwardYear’, ‘_PR0’, ‘_PRNoms0′,’Email’);
    $conDat = $i4w->myApp->loadCon($id, $returnFields);
    $current_user = get_user_by(‘login’, $conDat[‘Email’] );
    $test = $conDat[‘_PRNoms0’];
    $year = $conDat[‘_AwardYear’];
    $pos = strpos($test,$year);
    if($pos === false){
    $test .= ‘;’.$year;
    $upload = array(‘_PRNoms0’ => $test);
    $retval = $i4w->myApp->updateCon($id, $upload);
    $thedate = date(“F, jS Y”);
    switch ($conDat[‘_AwardYear’]) {
    case “2009” :
    $catId = 9;
    break;
    case “2010” :
    $catId = 9;
    break;
    case “2011” :
    $catId = 7;
    break;
    case “2012” :
    $catId = 5;
    break;
    case “2013” :
    $catId = 18;
    break;
    case “2014” :
    $catId = 19;
    break;
    default :
    $catId = 6;
    }

    global $user_ID;
    $new_post = array(
    ‘post_title’ => $conDat[‘Company’] . ‘ Receives ‘ . $conDat[‘_AwardYear’] . ‘ Best of Business Nomination’,
    ‘post_excerpt’ => $conDat[‘Company’] . ‘ has been nominated for the ‘ . $conDat[‘_AwardYear’] . ‘ Best of Business Award. Small Business Commnuity ‘ . $conDat[‘_AwardYear’] . ‘ Best of Business Award Nominees are a valuable asset to their community and exemplify what makes small businesses great. Click to read this press release.’,
    ‘post_content’ => i4w_cs_bobnomination(array(‘id’=>$id, ‘year’=>$conDat[‘_AwardYear’], ‘date’=>$thedate)),
    ‘post_status’ => ‘publish’,
    ‘post_date’ => date(“Y-m-d H:m:s”),
    ‘post_author’ => $current_user->ID,
    ‘post_type’ => ‘post’,
    ‘filter’ => true,
    ‘post_category’ => array($catId)
    );
    kses_remove_filters();
    $post_id = wp_insert_post($new_post);
    add_post_meta($post_id,’Email’,$conDat[‘Email’],true);
    kses_init_filters();
    $permalink = get_permalink( $post_id );
    $urls = $conDat[‘_PR0’];
    $url = ‘

  • ‘.date(“m-d-y”).’: ‘.$conDat[‘Company’] . ‘ Nominated ‘ . $conDat[‘_AwardYear’] . ‘ Best of Business Award (Get HTML Code)
  • ‘;
    $urls .= $url;
    $upload = array(‘_PR0’ => $urls);
    $retval = $i4w->myApp->updateCon($id, $upload);
    $pingomatic = ‘http://pingomatic.com/ping/?title=Small Business+Community&blogurl=’.$permalink.’&rssurl=http%3A%2F%2F&chk_weblogscom=on&chk_blogs=on&chk_feedburner=on&chk_newsgator=on&chk_myyahoo=on&chk_pubsubcom=on&chk_blogdigger=on&chk_weblogalot=on&chk_newsisfree=on&chk_topicexchange=on&chk_google=on&chk_tailrank=on&chk_postrank=on&chk_skygrid=on&chk_collecta=on&chk_superfeedr=on&chk_audioweblogs=on&chk_rubhub=on&chk_a2b=on&chk_blogshares=on’;
    $curl_handle=curl_init();
    curl_setopt($curl_handle, CURLOPT_URL,$pingomatic);
    curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
    curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl_handle, CURLOPT_USERAGENT, ‘Small Business Community’);
    $str = curl_exec($curl_handle);
    curl_close($curl_handle);
    echo $url;
    echo ‘
    ‘;
    echo $pingomatic;
    }
    break;
    case “Membership” :
    $returnFields = array(‘Company’, ‘_AwardYear’, ‘_PR0’, ‘_PRMember’,’Email’);
    $conDat = $i4w->myApp->loadCon($id, $returnFields);
    $current_user = get_user_by(‘login’, $conDat[‘Email’] );
    $test = $conDat[‘_PRMember’];
    $year = $conDat[‘_AwardYear’];
    $pos = strpos($test,$year);
    if($pos === false){
    $test .= ‘;’.$year;
    $upload = array(‘_PRAwards0’ => $test);
    $retval = $i4w->myApp->updateCon($id, $upload);
    $thedate = date(“F, jS Y”);

    $catId = 235;
    global $user_ID;
    $new_post = array(
    ‘post_title’ => $conDat[‘Company’] . ‘ selected as ‘.$year.’ member in the Small Business Community Association’,
    ‘post_excerpt’ => $conDat[‘Company’] . ‘ has been selected for membership in the Small Business Community Association. SBCA members are a valuable asset to their community and exemplify what makes small businesses great. Click to read this press release.’,
    ‘post_content’ => i4w_cs_sbcamembership(array(‘id’=>$id, ‘year’=>$conDat[‘_AwardYear’], ‘date’=>$thedate)),
    ‘post_status’ => ‘publish’,
    ‘post_date’ => date(“Y-m-d H:m:s”),
    ‘post_author’ => $current_user->ID,
    ‘post_type’ => ‘post’,
    ‘filter’ => true,
    ‘post_category’ => array($catId)
    );
    kses_remove_filters();

    $post_id = wp_insert_post($new_post);
    add_post_meta($post_id,’Email’,$conDat[‘Email’],true);

    kses_init_filters();
    $permalink = get_permalink( $post_id );
    $urls = $conDat[‘_PR0’];
    $url = ‘

  • ‘.date(“m-d-y”).’: ‘.$conDat[‘Company’] . ‘ selected a member in the Small Business Community Association (Get HTML Code)
  • ‘;
    $urls .= $url;
    $upload = array(‘_PR0’ => $urls);
    $retval = $i4w->myApp->updateCon($id, $upload);
    $pingomatic = ‘http://pingomatic.com/ping/?title=Small Business+Community&blogurl=’.$permalink.’&rssurl=http%3A%2F%2F&chk_weblogscom=on&chk_blogs=on&chk_feedburner=on&chk_newsgator=on&chk_myyahoo=on&chk_pubsubcom=on&chk_blogdigger=on&chk_weblogalot=on&chk_newsisfree=on&chk_topicexchange=on&chk_google=on&chk_tailrank=on&chk_postrank=on&chk_skygrid=on&chk_collecta=on&chk_superfeedr=on&chk_audioweblogs=on&chk_rubhub=on&chk_a2b=on&chk_blogshares=on’;
    $curl_handle=curl_init();
    curl_setopt($curl_handle, CURLOPT_URL,$pingomatic);
    curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);
    curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl_handle, CURLOPT_USERAGENT, ‘Small Business Community’);
    $str = curl_exec($curl_handle);
    curl_close($curl_handle);
    echo $url;
    echo ‘
    ‘;
    echo $pingomatic;
    }
    break;
    }
    }
    }
    [/i4w_exec]

    >