Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
BB Code Functions Details »»
BB Code Functions
Version: 1.00, by Velocd Velocd is offline
Developer Last Online: Nov 2023 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 03-28-2004 Last Update: Never Installs: 14
 
No support by the author.




As requested by mudpyr8:
https://vborg.vbsupport.ru/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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 03-29-2004, 08:21 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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.

Quote:
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.

Quote:
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
  #13  
Old 03-29-2004, 10:38 PM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
  #14  
Old 03-29-2004, 10:44 PM
Link14716's Avatar
Link14716 Link14716 is offline
 
Join Date: Jun 2002
Location: Georgia, USA
Posts: 2,519
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.

[high]* Link14716 clicks install anyways. [/high]
Reply With Quote
  #15  
Old 03-30-2004, 12:01 AM
Velocd's Avatar
Velocd Velocd is offline
 
Join Date: Mar 2002
Location: CA University
Posts: 1,696
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The following is a useful function I made that evaluates a mathematical expression.
https://vborg.vbsupport.ru/showpost....02&postcount=2
Reply With Quote
  #16  
Old 03-30-2004, 12:08 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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
  #17  
Old 03-30-2004, 10:26 AM
AlexanderT's Avatar
AlexanderT AlexanderT is offline
 
Join Date: Mar 2003
Posts: 294
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Dean C
Btw love that image at the top
It's from Frankfurt Airport/Germany - I knew I've seen that sign before
Reply With Quote
  #18  
Old 03-31-2004, 01:05 AM
mudpyr8's Avatar
mudpyr8 mudpyr8 is offline
 
Join Date: Mar 2004
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Big kudos to VeloCD for doing this hack. He was willing to write the code after an initial request I made for my dice roller. I like to have the ability for members to roll dice in my forums, but I didn't want to have to hack up the bbcode parser to do it. I thought it would be great to have an adminCP that would allow for php functions to be called by bbcodes, but had NO idea how to do it.

Luckily VeloCD saw my post and said he knew how to do it and here it is.

BIG BIG THANKS.

I will be posting my dice roller soon. If you'd like to see it in action, here you go:
http://www.tekhed.com/dice/

Feel free to email me with game system support requests.
Reply With Quote
  #19  
Old 03-31-2004, 09:39 AM
wcbryant wcbryant is offline
 
Join Date: Dec 2003
Location: Florida
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm going to have to add a line of credit to my site just to cover you Velocd. I don't go looking for your hacks specifically, but it seems you're often behind the ones I end up on when I have a focused need. Great work, again.

Now that I've blown a little sunshine, I have a "clueless" question to ask. I need to figure out some method of allowing users to make text in their post 'secure'. 'Secure' in the sense that other users can't just highlight, right click, copy, and then paste elsewhere. I know nothing is entirely safe (they could simply just View Source), but the primary goal is to prevent someone from absentmindedly cutting and pasting something sensitive into an email to someone else. I could just do it for all my pages, but in many cases the content my site covers needs to be able to be copied and pasted into other posts, so that's no good. Needs to be only there when people want it so.

I've found JavaScript that can accomplish this (I'll quote below in case this is a bad way to do it (it did come from someone named Bart with an AOL account after all), and someone can recommend better -- or in case I haven't expressed my desire well enough), but no PHP. PHP *seems* to be what your hack speaks to though. So my question, and it's coming from a layman to be sure, is can I accomplish what I want with your hack?

HTML Code:
<SCRIPT language=JavaScript>
<!--
/*
No rightclick script v.2.5
(c) 1998 barts1000
[email]barts1000@aol.com[/email]
Don't delete this header!
*/

var message="Oops, that function is disabled."; 

// Don't edit below!

function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// --> 

</SCRIPT>
Reply With Quote
  #20  
Old 03-31-2004, 11:41 AM
mudpyr8's Avatar
mudpyr8 mudpyr8 is offline
 
Join Date: Mar 2004
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

One control that might be necessary is the ability to prohibit the use of a particular code in a signature. BBCodes are normally allowed in signatures, but someone who puts [power] into their sig, or [roll]50d1000[/roll] could generate a lot of server activity. If this isn't possible, the admin will just have to watch for such sigs, but it is important to note that. 100 people with factorials in their sigs is gonna be bad.
Reply With Quote
  #21  
Old 03-31-2004, 11:44 AM
mudpyr8's Avatar
mudpyr8 mudpyr8 is offline
 
Join Date: Mar 2004
Posts: 16
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wcbryant: I think you can. You would just have to write a php function that wraps the bbcode param in the javascript:

[secure]insert message here[/secure] would then wrap "insert message here" in the javascript.
Reply With Quote
Reply


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

Forum Jump


All times are GMT. The time now is 06:54 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06182 seconds
  • Memory Usage 2,316KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_html
  • (5)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete