function generateScript($adLinkData) { $pl = new publink(""); $this->id = $pl->generateScript($adLinkData); $this->link = $adLinkData['videoCode']; if ($this->id != 0) { $this->script = "<EMBED SRC='http://www.sam-rad.com/YouTubePlayer.swf' FlashVars='id=" . $this->id . "&link=" . $this->link . "?version=3' WIDTH='960' HEIGHT='540' allowfullscreen='true' scale='noscale'/>"; $rnd = substr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", rand(1, 52) - 1, 1); $this->script_link = "http://www.sam-rad.com/watch?" . $this->id . "{$rnd}" . $this->link; } else { $this->script = "You must be logged in<br /><br /><br />*In order to enable us to track your earnings by sharing this video, you need to be logged in*"; } }