Welcome, Guest. Please Login or Register.
May 06, 2024, 10:15:19 PM
Home Help Search Log in Register
News: If you are still using YaBB SE, please consider upgrading to SMF as soon as possible.

YaBB SE Community  |  Development  |  Completed mods  |  [Code] Background image in post « previous next »
Pages: [1] Reply Ignore Print
Author Topic: [Code] Background image in post  (Read 5329 times)
vorapoap (vory)
Sr. Member
****
Posts: 424


Not considered either a living or death

WWW
[Code] Background image in post
« on: May 05, 2002, 01:06:44 AM »
Reply with quote

Very easy to do...  Now my post can have a background :D

$codefromcache = array(
..
..
..
..,
'/\[bg=(.+?)\](.+?)\[\/bg\]/is'

and

$codetocache = array(
..
..
..
..,
"<table cellspacing=0 cellpadding=10 background=\"\\1\"><td>\\2</td></table>"

Another junk for you I think :D

To use it
[bg=http://www.somewhere.com/image.gif]

balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah... balh blah balh blah...

[/bg]

Easy as that
« Last Edit: May 05, 2002, 01:08:15 AM by vorapoap » Logged

On the route to hell...
tazthedev
Full Member
***
Posts: 161


I'm a llama!

Re:[Code] Background image in post
« Reply #1 on: May 05, 2002, 01:16:45 AM »
Reply with quote

just a simple question for you...

why are u allways using the thumb down ? ;D
Logged
Chris Cromer
The Strange One
Mod Team
YaBB God
*****
Posts: 3152


I am just a figment of your imagination.

WWW
Re:[Code] Background image in post
« Reply #2 on: May 05, 2002, 01:19:30 AM »
Reply with quote

Probably because has an upside down monitor! ;)
Logged

Chris Cromer

I am not suffering from insanity, I am enjoying every minute of it.
Lonestar
Jr. Member
**
Posts: 87


SchwartzMaster

ICQ - 57595208 WWW
Re:[Code] Background image in post
« Reply #3 on: May 05, 2002, 01:50:00 AM »
Reply with quote

Where do u put this code?
Logged

vorapoap (vory)
Sr. Member
****
Posts: 424


Not considered either a living or death

WWW
Re:[Code] Background image in post
« Reply #4 on: May 05, 2002, 02:28:18 AM »
Reply with quote

QuoteWhere do u put this code?

Oh sorry.. in Subs.php search for codetocache and codefromcache you will see the list..put them there.. becareful about the " , ".

Quotejust a simple question for you...
why are u allways using the thumb down ?  

The pessimism drives me to live. :( Without it, I would go and die.
Logged

On the route to hell...
Lonestar
Jr. Member
**
Posts: 87


SchwartzMaster

ICQ - 57595208 WWW
Re:[Code] Background image in post
« Reply #5 on: May 05, 2002, 05:29:17 AM »
Reply with quote

Its amazing how a negative equals a positive  :)

Thanks BTW  ;)
Logged

Jalapeno
Full Member
***
Posts: 158


Peno, Jala Peno...

WWW
Re:[Code] Background image in post
« Reply #6 on: May 05, 2002, 10:17:08 AM »
Reply with quote

It's a great idea, but it doesn't work for me. All it does is show the URL of the BG image I specified. It doesn'T show the image and it doesn't show the text between the bg-tags. Here's my subs.php after I made the changes you suggested. I was a little confused because you didn't post the whole code but just ..., so I think I didn't get it right. Where have I gone wrong?

$codefromcache = array(
         '/([a-z_-][a-z0-9\._-]*@[a-z0-9_-]+(\.[a-z0-9_-]+)+)/is',
         '/\[url\](.+?)\[\/url\]/is',
         '/\[url=http://(.+?)\](.+?)\[\/url\]/is',
         '/\[iurl\](.+?)\[\/iurl\]/is',
         '/\[iurl=(.+?)\](.+?)\[\/iurl\]/is',
         '/\[b\](.+?)\[\/b\]/is',
         '/\[i\](.+?)\[\/i\]/is',
         '/\[u\](.+?)\[\/u\]/is',
         '/\[s\](.+?)\[\/s\]/is',
         '/\[move\](.+?)\[\/move\]/is',
         '/\n?\[quote author=(.+?) link=(.+?) date=(.+?)\]\n*/ei',
         '/\[\/quote\]/i',
         '/\n?\[quote\]\n*/i',
         '/\[me=([^\]]+)\](.+?)\[\/me\]/is',
         '/\[img\](.+?)\[\/img\]/i',
         '/\[img width=([0-9]+) height=([0-9]+)\s*\](.+?)\[\/img\]/i',
         '/\[img height=([0-9]+) width=([0-9]+)\s*\](.+?)\[\/img\]/i',
         '/\[color=([\w#]+)\](.*?)\[\/color\]/is',
         '/\[black\](.+?)\[\/black\]/is',
         '/\[white\](.+?)\[\/white\]/is',
         '/\[red\](.+?)\[\/red\]/is',
         '/\[green\](.+?)\[\/green\]/is',
         '/\[blue\](.+?)\[\/blue\]/is',
         '/\[font=(.+?)\](.+?)\[\/font\]/is',
         '/\[size=(.+?)\](.+?)\[\/size\]/is',
         '/\[pre\](.+?)\[\/pre\]/is',
         '/\[left\](.+?)\[\/left\]/is',
         '/\[right\](.+?)\[\/right\]/is',
         '/\[center\](.+?)\[\/center\]/is',
         '/\[sub\](.+?)\[\/sub\]/is',
         '/\[sup\](.+?)\[\/sup\]/is',
         '/\[tt\](.+?)\[\/tt\]/is',
         '/\[table\](.+?)\[\/table\]/is',
         '/\[tr\](.*?)\[\/tr\]/is',
         '/\[td\](.*?)\[\/td\]/is',
         '/\[ftp\](.+?)\[\/ftp\]/is',
         '/\[ftp=(.+?)\](.+?)\[\/ftp\]/is',
         '/\[glow=(.+?),(.+?),(.+?)\](.+?)\[\/glow\]/eis',
         '/\[shadow=(.+?),(.+?),(.+?)\](.+?)\[\/shadow\]/is',
         '/\[email\](.+?)\[\/email\]/is',
         '/\[hr\]/i',
         '/\[flash=(\S+?),(\S+?)\](\S+?)\[\/flash\]/is',
         '/\[list\]/',
         '/\[\/list\]/',
         '/(<\/?table>|<\/?tr>|<\/td>)<br>/',
         '/\[bg=(.+?)\](.+?)\[\/bg\]/is'
      );

      $codetocache = array(
         '[url=mailto:\1]\1[/url]',
         "<a href=\"\\1\" target=_blank>\\1</a>",
         "<a href=\"\\1\" target=_blank>\\2</a>",
         "<a href=\"\\1\">\\1</a>",
         "<a href=\"\\1\">\\2</a>",
         "<b>\\1</b>",
         "<i>\\1</i>",
         "<u>\\1</u>",
         "<s>\\1</s>",
         "<marquee>\\1</marquee>",
         "'<br><font size=1><b><a href=\"$scripturl?action=display;\\2\">Quote from: \\1 on '.timeformat('\\3').'</a>   </b></font><table border=0 cellspacing=1 cellpadding=2 width=\"100%\"><tr><td class=quote>'",
         "</td></tr></table>",
         "<br><font size=1><b>Quote:</b></font><table border=0 cellspacing=1 cellpadding=2 width=\"100%\"><tr><td class=quote>",
         "<font class=meaction>* \\1 \\2</font>",
         "<img src=\"\\1\" alt=\"\" border=\"0\">",
         "<img src=\"\\3\" alt=\"\" border=\"0\" width=\"\\1\" height=\"\\2\">",
         "<img src=\"\\3\" alt=\"\" border=\"0\" width=\"\\2\" height=\"\\1\">",
         "<font color=\"\\1\">\\2</font>",
         "<font color=\"#000000\">\\1</font>",
         "<font color=\"#FFFFFF\">\\1</font>",
         "<font color=\"#FF0000\">\\1</font>",
         "<font color=\"#00FF00\">\\1</font>",
         "<font color=\"#0000FF\">\\1</font>",
         "<font face=\"\\1\">\\2</font>",
         "<font size=\\1>\\2</font>",
         "<pre>\\1</pre>",
         "<div align=\"left\">\\1</div>",
         "<div align=\"right\">\\1</div>",
         "<div align=\"center\">\\1</div>",
         "<sub>\\1</sub>",
         "<sup>\\1</sup>",
         "<tt>\\1</tt>",
         "<table>\\1</table>",
         "<tr>\\1</tr>",
         "<td>\\1</td>",
         "<a href=\"\\1\" target=_blank>\\1</a>",
         "<a href=\"\\1\" target=_blank>\\2</a>",
         "'<table style=\"Filter: Glow(Color=\\1, Strength='.(('\\2'<400)?'\\2':400).')\" width='.(('\\3'<400)?'\\3':400).'\>\\4</table>'",
         "<span style=\"Filter: Shadow(Color=\\1, Direction=\\2); width: \\3 px; \">\\4</span>",
         "\\1",
         "<hr>",
         "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\\1 height=\\2><param name=movie value=\\3><param name=play value=true><param name=loop value=true><param name=quality value=high><embed src=\\3 width=\\1 height=\\2 play=true loop=true quality=high></embed></object>",
         "<ul>",
         "</ul>",
         "<table cellspacing=0 cellpadding=10 background=\"\\1\"><td>\\2</td></table>",
         "\\1"
      );
[/quote]
Logged

Too lazy. Way too lazy.
vorapoap (vory)
Sr. Member
****
Posts: 424


Not considered either a living or death

WWW
Re:[Code] Background image in post
« Reply #7 on: May 05, 2002, 10:21:19 AM »
Reply with quote

Your last 3 lines in $codetocache is not in correct order.  you should switch the new table line with the line that says '\\1'.

Please come back if you still have problems
Logged

On the route to hell...
Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284


WWW
Re:[Code] Background image in post
« Reply #8 on: May 05, 2002, 10:30:27 AM »
Reply with quote

This is pretty cool, my only problem with it is that it doesn't size the image, it only shows the bit of the image thats covered with something. For example:

If I put this in my message:

[bg=]
testes
[/bg]


Only the top left side to however many pixels high and long "testes" is will be shown.
Logged
vorapoap (vory)
Sr. Member
****
Posts: 424


Not considered either a living or death

WWW
Re:[Code] Background image in post
« Reply #9 on: May 05, 2002, 10:40:29 AM »
Reply with quote

Quote from: Anonymous Jedi on May 05, 2002, 10:30:27 AMOnly the top left side to however many pixels high and long "testes" is will be shown.

This is normal to background in HTML table code. if you want the whole background to appear. you need to add more text. or put the big image that contains nothing...(e.g. blank.gif) and set the width of this image to the size of background image or larger.
Logged

On the route to hell...
Jedi~
Eric
Beta Tester
YaBB God
*****
Posts: 1284


WWW
Re:[Code] Background image in post
« Reply #10 on: May 05, 2002, 10:43:13 AM »
Reply with quote

Theres a thought... now if there was a way to make that automatic.
Logged
Jalapeno
Full Member
***
Posts: 158


Peno, Jala Peno...

WWW
Re:[Code] Background image in post
« Reply #11 on: May 05, 2002, 10:51:00 AM »
Reply with quote

Working now. Thanks. My bad.  ::)
Logged

Too lazy. Way too lazy.
vorapoap (vory)
Sr. Member
****
Posts: 424


Not considered either a living or death

WWW
Re:[Code] Background image in post
« Reply #12 on: May 05, 2002, 12:00:02 PM »
Reply with quote

Quote from: Anonymous Jedi on May 05, 2002, 10:43:13 AMTheres a thought... now if there was a way to make that automatic.

yes.. First way, make it as a whole cell of post.. not creating new table like this.. and that requires more than just add two lines. Sorry..I won't do this.

Second way.. I don't sure it will work or not
Replace the $codetocache line with

"<table cellspacing=0 cellpadding=10 background=\"\\1\"><td><img src="blank.gif" width="100%" height ="1">\\2</td></table>"

But you still need some lines if the image is big.
or insert more cell into the table control with blank.gif
but as I say.. it will not changable for other bakckground

Third way, use that code with width=xxx height=xxx.. and create the table in that size.... but you really need it????
Logged

On the route to hell...
KenTeamBG
Jr. Member
**
Posts: 74


TeamBG rules!!!

WWW
Re:[Code] Background image in post
« Reply #13 on: June 28, 2002, 11:36:01 PM »
Reply with quote

Actually.  Couldn't this mod simply check the dimensions of the image being used for the bg and specify the TD or TABLE height and width with these values?  I know you can determine an image size in PHP, not sure if it is only with a local file or remote aswell (remote is more and more like local these days in PHP anyway, so...).

Logged

Pages: [1] Reply Ignore Print 
YaBB SE Community  |  Development  |  Completed mods  |  [Code] Background image in post « previous - next »
 


Powered by MySQL Powered by PHP YaBB SE Community | Powered by YaBB SE
© 2001-2003, YaBB SE Dev Team. All Rights Reserved.
SMF 2.1.4 © 2023, Simple Machines
Valid XHTML 1.0! Valid CSS

Page created in 0.068 seconds with 19 queries.