John3d
01-17-2008, 11:09 AM
Hello and thank for the script
I have a question about bbcode:
I have installed this forum news scrip in my web. I have in my forum IPB 2.1.7 a bbcode for youtube video, but this videos not are published in the news (only see the code)
Thanks
Patrick
01-18-2008, 12:49 PM
The class file for Invision Power Board 2.1+ does not pull bbcode from the forum's database.
Editing the class to do this may be beyond your PHP experience (you did not indicate if you knew anything about PHP). However, it is relatively easy to add bbcode manually to the class file.
If you post your bbcode (give an example of what bbcode you put in and what comes out in the forum post) I can show you the small modification to a file that you must make.
John3d
01-19-2008, 07:17 AM
Thanks
I know a few about php
The bbcode is :
<object width="425" height="350"><embed src="http://www.youtube.com/v/{content}" type="application/x-shockwave-flash" width="425" height="350"></embed></object>
and when i post, i write:
hu3oV1WUEQY
Patrick
01-19-2008, 11:57 AM
Open classes/sources/Forum/Invision_Power_Board_2.1.php
Find:
$search_array = array(
"/\[left\]/i",
"/\[\/left\]/i",
"/\[center\]/i",
"/\[\/center\]/i",
"/\[right\]/i",
"/\[\/right\]/i",
"/\[s\](.*?)\[\/s\]/is",
"/\[topic=([^\]]*)\](.*?)\[\/topic\]/i",
"/\[codebox\](.*?)\[\/codebox\]/is"
);
And replace it with:
$search_array = array(
"/\[left\]/i",
"/\[\/left\]/i",
"/\[center\]/i",
"/\[\/center\]/i",
"/\[right\]/i",
"/\[\/right\]/i",
"/\[s\](.*?)\[\/s\]/is",
"/\[topic=([^\]]*)\](.*?)\[\/topic\]/i",
"/\[codebox\](.*?)\[\/codebox\]/is",
"/\[youtube\](.*?)\[\/youtube\]/is"
);
Find:
$replace_array = array(
"<div align=\"left\">",
"</div>",
"<div align=\"center\">",
"</div>",
"<div align=\"right\">",
"</div>",
"<s>\$1</s>",
"<a href=\"" . $this->LINKS['thread'] . "\$1\">\$2</a>",
"<div class='codemain' style='height:200px;white-space:pre;overflow:auto'>\$1</div>"
);
And replace it with:
$replace_array = array(
"<div align=\"left\">",
"</div>",
"<div align=\"center\">",
"</div>",
"<div align=\"right\">",
"</div>",
"<s>\$1</s>",
"<a href=\"" . $this->LINKS['thread'] . "\$1\">\$2</a>",
"<div class='codemain' style='height:200px;white-space:pre;overflow:auto'>\$1</div>",
"<object width=\"425\" height=\"350\"><embed src=\"http://www.youtube.com/v/\$1\" type=\"application/x-shockwave-flash\" width=\"425\" height=\"350\"></embed></object>"
);
Save & re-upload.
Notice that we have simply added in the bbcode tags & replacement text into their respective search and replace arrays.
Powered by vBulletin™ Version 4.0.0 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.