Register Members List Search Today's Posts Mark Forums Read

Reply
 
Mod Options
BB Code Functions Details »
BB Code Functions
Mod Version: 1.00, by Velocd (Member) Velocd is offline
Developer Last Online: Nov 2005 I like it Show Printable Version Email this Page

This modification is in the archives.
vB Version: 3.0.0 Rating: (0 vote - 0 average) Installs: 14
Released: 29 Mar 2004 Last Update: Never Downloads: 11
Not Supported  




As requested by mudpyr8:
http://www.vbulletin.org/forum/showthread.php?t=62933


Features
  • Manage BB Code functions from your AdminCP. These can be internal PHP functions, or custom (derived from a specified PHP file).
  • Apply a BB Code function to a custom BB Code tag, and you can use it (when the correct arguments are provided) in posts, etc.
  • You may choose for a function to be static, or update everytime upon page refresh. If it's static, the first time a function is called the value returned will be replaced with the tag in the post (hard-coded).

Known bugs
  • One must have posted in the WYSIWYG editor in order for function tags that are unchecked for "update upon page refresh" to work correctly. This is an annoying bug I discovered an hour from releasing this hack, and it will prevent functions tags from being replaced with their return values (hard-coded) in the post. It's only significant if you are using a function that returns a random/dynamic value, and wish not for the value to be updated upon page refresh, but stay unique. I will be looking into a solution when I have the time.
  • Know of another? Please PM me of it, or post it in the thread.

Notes
  • This script can only be maliciously taken advantage of if you provide functions that access your server. For example, don't create a custom function that queries your database and returns something. A user could place 100 of these tags into a post, and it would make 100 queries. Even worse, if the "update upon refresh" is enabled, it'll call 100 queries for every view of the page. Especially don't create functions that manipulate data on your server or in your database!

    Everything is at your risk, but I implore you to stick with simple functions.
  • More important notes inside install.html.

Screenshots
See attachments.

Enjoy. Remember to click install if you do use this hack.

Download Now

Only licensed members can download files, Click Here for more information.

Screenshots

Click image for larger version

Name:	acp_1.gif
Views:	922
Size:	78.4 KB
ID:	17687   Click image for larger version

Name:	acp_2.gif
Views:	655
Size:	44.2 KB
ID:	17688   Click image for larger version

Name:	acp_3.gif
Views:	705
Size:	58.3 KB
ID:	17689   Click image for larger version

Name:	acp_4.gif
Views:	545
Size:	25.6 KB
ID:	17690  

Click image for larger version

Name:	bad_usage.gif
Views:	971
Size:	33.8 KB
ID:	17691  

Show Your Support

  • To receive notifications regarding updates -> Click to Mark as Installed.
  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Comments
  #2  
Old 29 Mar 2004, 05:35
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Real name: Mike
Have a custom function that is useful?

Just send me a link to a file with the function, or PM me the working code, and I'll display it in this post.


1. Evaluate mathematical expression
Here is a useful function that will take a mathematical expression and return the answer for it. Valid operators include plus + minus - multiply * divide / modulus % carrot/power ^ and parentheses ().

When used in BB Code, have one argument and it should function like so:

[math]5*6%3+((45/5)/4)[/math]

5*6%3 = 0
(45/5)/4 = 2.25
= 2.25

Here is the function:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Careful with parentheses. If you have (5/5)5 it will result in an error, and nothing will be returned.

Last edited by Velocd; 30 Mar 2004 at 01:03.
Reply With Quote
  #3  
Old 29 Mar 2004, 06:27
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Sorry to sound so deft here, but what does this actually do and how would we use it?

Also, I have to know. How did you do that with that screenshot at the top of the post? That is wild.
Reply With Quote
  #4  
Old 29 Mar 2004, 10:02
xware's Avatar
xware xware is offline
 
Join Date: Nov 2001
Sorry to sound so deft here, but what does this actually do and how would we use it?
__________________
"Who? What does it matter? Or...do you need a name to describe me? A definition by words is merely a means to deceive oneself. It's meaningless before the truth. What matters is how you perceive things. The slightest shift, then life and death no longer have any meaning." - Virgil (Xenosaga - Episode I)
Reply With Quote
  #5  
Old 29 Mar 2004, 10:15
lasto lasto is offline
 
Join Date: Jan 2002
Originally Posted by xware
Sorry to sound so deft here, but what does this actually do and how would we use it?

ditto LOL im confused as well
Reply With Quote
  #6  
Old 29 Mar 2004, 10:29
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Originally Posted by xware
Sorry to sound so deft here, but what does this actually do and how would we use it?
Just curious here ... was there a reason you didn't quote the message instead of just repeating it?
Reply With Quote
  #7  
Old 29 Mar 2004, 11:41
Charlie Argueta's Avatar
Charlie Argueta Charlie Argueta is offline
 
Join Date: Oct 2002
Real name: Charlie Argueta
This is amazing, but some of them are too hardcored, may be I will use some of them.

See Ya
Reply With Quote
  #8  
Old 29 Mar 2004, 15:48
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Real name: Mike
I thought the attached screenshots would be enough of an explanation.

This hack allows you to give bb code PHP functions (internal or custom).

For example, if I assigned the PHP function rand() to a tag called [rand], it would generate a random value.

[rand="0"]100[/rand]

Would generate a random value from 0 - 100.
Reply With Quote
  #9  
Old 29 Mar 2004, 16:13
Dean C's Avatar
Dean C Dean C is offline
 
Join Date: Jan 2002
Real name: Dean Clatworthy
This looks great - could be used to resize an image right? And all sorts ....

Btw love that image at the top
__________________
Dean Clatworthy - Web Developer/Designer
Reply With Quote
  #10  
Old 29 Mar 2004, 17:00
Bad Bunny's Avatar
Bad Bunny Bad Bunny is offline
 
Join Date: Apr 2002
Originally Posted by Velocd
I thought the attached screenshots would be enough of an explanation.

This hack allows you to give bb code PHP functions (internal or custom).

For example, if I assigned the PHP function rand() to a tag called [rand], it would generate a random value.

[rand="0"]100[/rand]

Would generate a random value from 0 - 100.
Wow. So it is possibly to simulate dice with this (amongst many other things)?! That's pretty hardcore!
Reply With Quote
  #11  
Old 29 Mar 2004, 21:21
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Real name: Mike
Also, I have to know. How did you do that with that screenshot at the top of the post? That is wild.
Although it wouldn't be too hard to do in photoshop, it's made through a German site called LetterJames, which allows you to add your own captions to signs, etc.

Wow. So it is possibly to simulate dice with this (amongst many other things)?! That's pretty hardcore!
Yes, but at the moment there is a bug requiring you to use the WYSIWYG editor when posting, if you want a random generated value by the function to be hard-coded into that post (replaced with its bbcode tag). Otherwise, you could keep refreshing the page and a new random value would show.

could be used to resize an image right?
I imagine you could do something like that with this, by passing a image URL and using the GD2 library.
Reply With Quote
  #12  
Old 29 Mar 2004, 23:38
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Real name: Mike
So..

If anyone has this installed and working, could you let me know? It's a sort of long (although quick) hack to install, so I just want to confirm everything is in place.
Reply With Quote
  #13  
Old 29 Mar 2004, 23:44
Link14716's Avatar
Link14716 Link14716 is offline
 
Join Date: Jun 2002
Real name: Matthew Gordon
Wow, kickass hack. I won't install it just yet (trying to find a good file comparison program for Linux to upgrade to vB3 Gold - and I'm not digging myself into a bigger hole before I upgrade (31 modified files is enough for RC3, thank you very much) Well definately install it when I finally get vB3 Gold up and running.

/me clicks install anyways.
Reply With Quote
  #14  
Old 30 Mar 2004, 01:01
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Real name: Mike
The following is a useful function I made that evaluates a mathematical expression.
http://www.vbulletin.org/forum/showp...02&postcount=2
Reply With Quote
  #15  
Old 30 Mar 2004, 01:08
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Real name: Rob
Originally Posted by Velocd
Although it wouldn't be too hard to do in photoshop, it's made through a German site called LetterJames, which allows you to add your own captions to signs, etc.
Thank you, sir. Although I can't read ANY German, once you figure things out at that site, It's pretty impressive.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Mod Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


New To Site? Need Help?

All times are GMT. The time now is 06:05.

Layout Options | Width: Wide Color: