function createStoryContent($userinfo = NULL, $info = NULL, $mode = 'link')
 {
     // post a story from the post story form
     // build source from domain - to do : improve this with source objects table
     $urlParts = parse_url($info->url);
     $info->source = $urlParts['host'];
     // create permalink
     $info->permalink = $this->buildPermalink($info->title);
     //$this->db->log($info->permalink);
     // serialize the content
     // mode = link for third party web site story link and blog for blog posts
     if ($mode == 'link') {
         $isBlogEntry = 0;
     } else {
         $isBlogEntry = 1;
     }
     $story = $this->serialize(0, $info->title, $info->caption, $info->source, $info->url, $info->permalink, $userinfo->ncUid, $userinfo->u->name, $userinfo->userid, '', $userinfo->votePower, 0, 0, $info->imageUrl, 0, $isBlogEntry, $info->isFeatureCandidate);
     // post wire story to content
     $siteContentId = $this->add($story);
     if ($info->videoEmbed != '') {
         // add video if it exists
         require_once PATH_CORE . '/classes/video.class.php';
         $videoURL = videos::getVideoURLFromEmbedCodeOrURL(stripslashes($info->videoEmbed));
         if (videos::validateVideoURL($videoURL)) {
             $vt = new VideoTable($this->db);
             // create new video
             $videoid = $vt->createVideoForContent($userinfo->userid, $videoURL, "Video for story {$siteContentId}");
             if (is_numeric($videoid)) {
                 $this->db->update("Content", "videoid={$videoid}", "siteContentId={$siteContentId}");
             }
             // store video id in content table
         } else {
             // error on video, should have been picked up by validate
         }
     }
     return $siteContentId;
 }