$fb->publishNewsCloudStory('publishStory', $itemid);
             $contentid = $itemid;
             $storyOption = '<li><a href="?p=read&cid=' . $contentid . '" target="_cts">Read the story</a></li>';
             break;
     }
     if (!$error) {
         $code = '<div id="dialogMessage"><p>Your story has been published successfully.</p><p>What would you like to do next?</p>';
         $code .= '<ul><li><a href="?p=read&cid=' . $contentid . '" onclick="hideDialog(); readStory(' . $contentid . ');return false;">Add a comment</a></li>' . $storyOption . '<li><a href="#" onclick="hideDialog(); return shareStory(this,' . $cid . ');">Share story with friends</a>Share story with friends</a></li><li><a href="?p=invite" onclick="hideDialog(); switchPage(\'invite\',\'\');return false;">Invite friends to ' . SITE_TITLE . '</a></li></ul></div>';
     } else {
         $code = '<div id="dialogMessage">Sorry, there was a problem publishing your story. Error: ' . $errorMsg . '</div>';
     }
     break;
 case 'newswire':
     require_once PATH_FACEBOOK . '/pages/newswire.class.php';
     $nwObj = new newswire($this);
     $code = $nwObj->fetchNewswirePage($userid, $currentPage);
     break;
 case 'refreshComments':
     if (isset($_GET['cid']) and is_numeric($_GET['cid'])) {
         $cid = $_GET['cid'];
     } else {
         $cid = 0;
         $error = true;
         $errorMsg = 'No story id';
     }
     if (!$error) {
         require_once PATH_CORE . '/classes/read.class.php';
         $comObj = new read($db, $session);
         $code = $comObj->fetchComments($cid);
         $comObj->resetStoryCache($cid);
     } else {
             $code = $upObj->fetchUpcomingStories(0, $currentPage);
             break;
     }
     break;
 case 'newswire':
     switch ($cmd) {
         case 'fetchPage':
             if (isset($_GET['currentPage'])) {
                 $currentPage = $_GET['currentPage'];
             } else {
                 $currentPage = 1;
             }
             include_once 'initialize.php';
             require_once PATH_PHP . 'classes/newswire.class.php';
             $nwObj = new newswire($db);
             $code = $nwObj->fetchNewswirePage(0, $currentPage);
             break;
     }
     break;
 case 'readStory':
     define("INIT_SESSION", true);
     include_once 'initialize.php';
     switch ($cmd) {
         case 'addComment':
             if (isset($_GET['siteContentId']) and isset($_GET['comments'])) {
                 $comments = $_GET['comments'];
                 $siteContentId = $_GET['siteContentId'];
                 if ($comments != '') {
                     require_once PATH_CORE . 'classes/comments.class.php';
                     $comObj = new comments($db);
                     $comInfo = $comObj->serialize(0, 0, $siteContentId, 0, $comments, 0, $db->ui->userid, $db->ui->memberName, '', 0);