Jump to content

bms231

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

bms231's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. negative, that didnt really do it. i tried this, not working either. $pos = strrpos($this->_mediaInfo['url'], "/"); //$temp = explode("/",$this->_mediaInfo['url']); //$last = $temp[count($temp)-1]; $streetfirekey = substr($this->_mediaInfo['url'], $pos + 1, -4); //Remove the .htm if (preg_match($streetfirekey, $this->_mediaInfo['url'], $match)) {
  2. I am a C# guy and wondering what LastIndexOf would be in php. Here is what I have and want to do...... Here are the two possible URLs. There is nothing really common. I need that id at the end w/o the htm. http://videos.xxxxxxxxxx.com/video/bceb6963-b1b7-4ced-9075-423ce6135921.htm http://videos.xxxxxxxxxx.com/search/tibn/0/9fdd173c-0b67-4236-815d-9933007664e0.htm here is what I had, if (preg_match('/\/video\/(.*)\.htm/', $this->_mediaInfo['url'], $match)) { well, that obviously only works for the /video/ and after. i need basically to get last index of / and then go from one plus / to . any ideas?
  3. ok so i have to be missing a character or something b/c it breaks. i am doing this in wordpad. i am not a php programmer. i am C# and this stuff just looks like greek to me but I am trying. function streetfire(& $mediaArray) { global $db; if (preg_match('/video\/(.*)\.htm', $this->_mediaInfo['url'], $match) { if ($this->vbulletin->options['vbmediaplayerproxy']) { $content = $this->fetchContent('http://www.freeproxysite.com/perl/nph-proxy.pl/101110A/http/videos.streetfire.net/vidiac.swf?video=' . $match[1]); } else { $content = $this->fetchContent('http://videos.streetfire.net/vidiac.swf?video=' . $match[1]); } if (preg_match('|<title>(.+)</title>|Ui',$content,$out)) { $title = $out[1]; if (preg_match('|^Video - |Ui',trim($out[1]))) { $title = preg_replace('|^Video - |Ui','',trim($out[1])); } } else { $title = ''; } $this->_mediaInfo['title'] = $title; if (preg_match('|<span id="_ctl0_Description" class="v7-text">(.+)</span>|is',$content,$out)) { $description = trim(strip_tags($out[1])); } else { $description = ''; } $this->_mediaInfo['description'] = $description; if($this->vbulletin->options['vbmediaplayerproxy']) { $this->_mediaInfo['url'] = 'http://www.freeproxysite.com/perl/nph-proxy.pl/111110A/http/videos.streetfire.net/vidiac.swf?video=' . $match[1]; } else { $this->_mediaInfo['url'] = 'http://videos.streetfire.net/vidiac.swf?video=' . $match[1]; } $this->streetfire_player($mediaArray); $db->query_write("INSERT INTO `" . TABLE_PREFIX . "vbmediaplayerinfo` ( `id` , `type`, `media_code`, `media_url`, `media_info` , `title` , `description` , `date_added` ) VALUES (NULL , '".addslashes($this->_mediaInfo['type'])."', '".addslashes($this->_mediaInfo['text'])."', '".addslashes($this->_mediaInfo['url'])."', '".addslashes(var_export($this->_mediaInfo,true))."', '".addslashes($title)."', '".addslashes($description)."', UNIX_TIMESTAMP( ));"); } else { $this->_mediaInfo['type'] = 'error'; } }
  4. i am looking to do it though w/o declairing the var... like the example i posted. which i think does not work b/c it breaks.
  5. so basically it would look like this? if (preg_match('/video\/(.*)\.htm', $this->_mediaInfo['url'], $match) {
  6. o darn one thing i forgot to add is it has to be able to detect the '-' as well i am doing detection on multiple strings and streetfire is the only url w/ - in it so i figure that is what i will use to determine if it is streetfire or not. this would be a wish, i think i may be able to use ur solution already unless u wanna try and verify the -
  7. ok so i don't know php but a friend told me this is the place to ask.... so this is what i am doing.... i need to grab the string after /video/ and before .htm http://videos.streetfire.net/video/bceb6963-b1b7-4ced-9075-423ce6135921.htm so i can make a string like this http://videos.streetfire.net/vidiac.swf?video=bceb6963-b1b7-4ced-9075-423ce6135921 here is where i am trying to do it: if (preg_match('/video/(.*)$/', $this->_mediaInfo['url'], $match)) ^^^ i know this is not right. what should it be? i need to use preg_match.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.