Jump to content

class_bbcode.php need help!


adam119

Recommended Posts

Hi,

I have a custom code into class_bbcode.php file in vbulletin forum this code will redirect every url in any thread in that forum to another website. Here is the code

	// --------------------- 123456
		$rightlink='http://www.domainname.com?GO*'.bin2hex($rightlink);
	// --------------------- 123456
	// standard URL hyperlink
	return "<a href=\"$rightlink\" target=\"_blank\">$text</a>";

In php is there any way where I can throw exceptions for some urls. For example every url in any thread will be redirected to www.domainname.com however I don't want this code to redirect this url in specific www.domain.com.

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/129009-class_bbcodephp-need-help/
Share on other sites

You could just check if the has the domain in it.

 

if(preg_match('/^https?://(?:www\.)?domain\.com/', $something)) {

    //it has the url

}

 

 

Or you could just use strpos.

 

Thank you for your replay but how is it going to look like if I added the two codes together?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.