Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.4
Author Message
TheosEleos
Life Cycles Becoming CPU Cycles



Joined: Sep 18, 2003
Posts: 960
Location: Missouri

PostPosted: Mon Aug 16, 2004 5:03 pm Reply with quote

Code:
This hack will add a new flash bbcode to your forums. 

The bbcode will look like this [swf width=# height=#]url[/swf]
The bbcode will not work if width or height is left out.
This also adds buttons to your posting page so users can add flash easily.
These instructions are based on a fresh install of phpBB 2.0.1 with no other bbcode hacks installed.
If you have other bbcode hacks installed follow the directions very carefully.
Make sure you backup your files before installing this hack.
This hack was created by Curtis Sanderson. ( sanderson_250@yahoo.com )
Support for this and other hacks can be found at http://phpbbhacks.com/forums/

---- Open /includes/bbcode.php -----

----- Find: -----

$bbcode_tpl['email'] = str_replace('{EMAIL}', '\\1', $bbcode_tpl['email']);

----- After add: -----

$bbcode_tpl['swf'] = str_replace('{WIDTH}', '\\1', $bbcode_tpl['swf']);
$bbcode_tpl['swf'] = str_replace('{HEIGHT}', '\\2', $bbcode_tpl['swf']);
$bbcode_tpl['swf'] = str_replace('{URL}', '\\3', $bbcode_tpl['swf']);

----- Find: -----


// [email]user@domain.tld[/email] code..
$patterns[5] = "#\[email\]([a-z0-9\-_.]+?@[\w\-]+\.([\w\-\.]+\.)?[\w]+)\[/email\]#si";
$replacements[5] = $bbcode_tpl['email'];

----- After add: ----- Careful if you've installed other bbcode hacks. The [7] may need to be changed.

// [swf width=# height=#]filename[/swf]
$patterns[7] = "#\[swf width=([0-9]?[0-9]?[0-9]) height=([0-9]?[0-9]?[0-9]):$uid\](.*?)\[/swf:$uid\]#si";
$replacements[7] = $bbcode_tpl[swf];

----- Find: -----

// [img]image_url_here[/img] code..
$text = preg_replace("#\[img\](([a-z]+?)://([^ \n\r]+?))\[/img\]#si", "[img:$uid]\\1[/img:$uid]", $text);

----- After add: -----

// [swf width=# height=#]url[/swf]
$text = preg_replace("#\[swf width=([0-9]?[0-9]?[0-9]) height=([0-9]?[0-9]?[0-9])\](([a-z]+?)://([^, \n\r]+))\[\/swf\]#si","[swf width=\\1 height=\\2:$uid\]\\3[/swf:$uid]", $text);

----- Save, close, and upload -----

----- Open /posting.php -----

----- Find: -----

'L_BBCODE_F_HELP' => $lang['bbcode_f_help'],

----- After add: ----- If you've installed other bbcode hacks you may already have a 'L_BBCODE_R_HELP' defined. In that case pick a letter that hasn't been used and use it instead of r in this hack. If you changed the letter in this step make sure you change it in all steps.

'L_BBCODE_R_HELP' => $lang['bbcode_r_help'],

----- Save, close, and upload -----

----- Open /language/lang_english/lang_main.php -----

----- Find: -----

$lang['bbcode_f_help'] = 'Font size: [size=x-small]small text[/size]';

----- After add: -----

$lang['bbcode_r_help'] = 'Flash: [swf width=# height=#]http://swf_url[/swf]';
----- Save, close, and upload -----

----- Open /templates/subSilver/bbcode.tpl -----

----- Find: -----

<!-- BEGIN email --><a href="mailto:{EMAIL}">{EMAIL}</A><!-- END email -->

----- After add: -----

<!-- BEGIN swf -->
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width={WIDTH} height={HEIGHT}>
<param name=movie value={URL}>
<param name=quality value="best">
<param name=menu value=false>
<param name=wmode value=transparent>
<embed src="{URL}" quality=best wmode=transparent width={WIDTH} height={HEIGHT} type="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</embed>
</object>
<!-- END swf -->

----- Save, close, and upload -----

----- Open /templates/subSilver/posting_body.tpl -----

----- Find: -----

f_help = "{L_BBCODE_F_HELP}";

----- After add: -----

r_help = "{L_BBCODE_R_HELP}";

----- Find: ----- In the rest of these steps pay close attention to the numbers if you've installed other bbcode hacks. The numbers should increase by 2 for each bbcode.

<td><span class="genmed">
           <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
           </span></td>

----- After add: -----

<td><span class="genmed">
           <input type="button" class="button" accesskey="r" name="addbbcode18" value="Flash" style="width: 40px" onClick="bbstyle(18)" onMouseOver="helpline('r')" />
           </span></td>

----- Find: ----- If you have other bbcode hacks installed do not replace but add ,'[swf width= height=]','[/swf] onto the end so it looks like ,'[swf width= height=]','[/swf]');

bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');

----- Replace with: -----

bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[swf width= height=]','[/swf]');

----- Find: -----

<select name="addbbcode18" onChange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">

----- Replace with: -----

<select name="addbbcode20" onChange="bbfontstyle('[color=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/color]')" onMouseOver="helpline('s')">

----- Find: -----

</select> &nbsp;{L_FONT_SIZE}:<select name="addbbcode20" onChange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">

----- Replace with: -----

</select> &nbsp;{L_FONT_SIZE}:<select name="addbbcode22" onChange="bbfontstyle('[size=' + this.form.addbbcode22.options[this.form.addbbcode22.selectedIndex].value + ']', '[/size]')" onMouseOver="helpline('f')">

----- Save, close and upload. -----

That's it. You should now have a working flash bbcode.


I ask cuz I can't seem to get it to work right.

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website AIM Address ICQ Number
GanjaUK
Life Cycles Becoming CPU Cycles



Joined: Feb 14, 2004
Posts: 633
Location: England

PostPosted: Tue Aug 17, 2004 7:27 am Reply with quote

I added flash to my forum, but left out all the parts for adding new buttons, I didnt really want to publicise the fact to everyone that you could post flash now, it was more for me and a few members to use.
Flash can be real nasty, as you may have noticed with PC Killer. Smile

So if you want to do the same thing, try just editing includes/bbcode and bbcode.tpl for the theme you are using. Then make a post with the code:
Code:


[swf width=# height=#]flash url[/swf]

_________________
Only registered users can see links on this board! Get registered or login! 
View user's profile Send private message Visit poster's website
TheosEleos







PostPosted: Tue Aug 17, 2004 8:25 am Reply with quote

The instructions didn't mention anything about editing theme files. Thanks for the tip. Things are working now.
 
Display posts from previous:       
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Ravens PHP Scripts And Web Hosting Forum Index -> phpnuke 7.4

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©