vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   BB Code Functions (https://vborg.vbsupport.ru/showthread.php?t=63113)

Velocd 04-01-2004 04:35 AM

wcbryant, I understand what you're trying to do, but I don't think this hack serves the purpose. (unless my interpretation is wrong, and mudpyr8 is closer to your question)

Quote:

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.
In the case you have a server-extensive function, it would. If you have the feature for not calling a function every time upon page refresh (although there is a bug right now where you must post in the WYSIWYG editor for this to apply) then it wouldn't be that big of a deal.

I will look into disabling it for signatures, as well fixing that bug, over the weekend. ;)

wcbryant 04-01-2004 09:18 AM

Quote:

Originally Posted by Velocd
wcbryant, I understand what you're trying to do, but I don't think this hack serves the purpose. (unless my interpretation is wrong, and mudpyr8 is closer to your question)

My explanation was convoluted at best, but despite that I think you both understood. I've looked at the hack some more, and while I think it walks a line very near to what I want to do -- may even be able to function loosely in that capacity in the manner mudpyr8 suggested -- it's probably not the 'right' approach. Which might be somehow just adding a 'no text copy' flag to the Additional Options field when posting.

You can turn off 'email to a friend' or 'printer friendly format' in threads, all I want to be able to do is turn off user's ability to copy and paste. Disable text highlighting (not that I think the JS I found does that), and disable right clicking. Again, I understand people can always just view source, but my goal is the prevention of accidental leaks, rather than intentional/malicious ones.

Anyway, thanks to you both for the responses.

mudpyr8 04-13-2004 03:08 PM

VeloCD, thanks. I got it working and it is superb. A couple of things:

1. In your install notes, steps 49 & 50 refer to 'allowsmilie". It should be 'allowsmilies'.

2. It reevaluates on edit of the message. It would be nice if this could be disabled. For my dice roller, I only want it to roll once. Not a big deal since when rolling dice it is a faux pas to edit your post anyway.

3. It only accepts one instance of the code (the last one). If I put two [roll] tags in one message, it only evaluates the last one.

Again, thanks a lot. This rocks.

Velocd 04-13-2004 04:15 PM

1. Thanks, will correct. ;)

2. If you are using the WYSIWYG editor and have the update option disabled, it shouldn't do so, since the return value of the function is hard-coded into the post. But, I haven't had time to look into making the update work for non-WYSIWYG.

3. That's odd. I'll check this out, although it should evaluate all tags. If you place two custom BB Code function tags that aren't your roll function, say maybe [random], does this generate two random values?

Sven 06-21-2004 12:38 PM

I have installed this hack so far since I was looking for something that enables me to use php functions in bbcodes...
But I'm fiddling around and it's not working....
Here's the function to include:
PHP Code:

<?php
// ###################### Start fetch_countdown_timer ###################### 
// returns the time left untill $dateline 
function fetch_countdown_timer($dateline) { 

    global 
$vboptions

    
$diff $dateline - (time() - $vboptions['hourdiff']); 

    
$days = ($diff - ($diff 86400)) / 86400
    
$diff $diff - ($days 86400); 
    
$hours = ($diff - ($diff 3600)) / 3600
    
$diff $diff - ($hours 3600); 
    
$minutes = ($diff - ($diff 60)) / 60
    
$diff $diff - ($minutes 60); 
    
$seconds = ($diff - ($diff 1)) / 1

    return 
iif($days 0$days.'d ''').iif("$hours > 0 && $days != 0"$hours.'h ''').$minutes.'m'


?>

Now I added a function like this:
Title: countdown
Handle: fetch_countdown_timer
Include File: countdown.php (containing above code)

Also I added a bbcode 'countdown' and have choosen the function in there....
It's just not working, what am I doing wrong?
As an example I used
[countdown]03, July 2004[/countdown] and the function returns something like -13h -40m instead of 11d and something....

How do I pass the date of interest to the function?

Sven 06-22-2004 08:40 AM

sorry for double posting but I didn't want to edit in case someone read my previous posting and wouldn't recognize this posting then.

I think I found out what's going wrong, it's because If I'm trying to pass a date it will be passed as Unix Timestamp.

Is there any way to pass the variable to the function as formatted date?

Sven 06-25-2004 08:24 AM

^bump^

Wasser 07-15-2004 03:36 AM

it would be perfect to have a countdown timer intergrated with the calendar. =)

KW802 08-03-2004 08:29 PM

OK, I'm those of those guys that hated math classes in school.... besides the mathematical functions, what are some other uses that you guys have come up with?

Borisch 09-12-2004 07:40 PM

From the description...this hack is the King!
Installing and testing tomorrow.


All times are GMT. The time now is 10:01 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01128 seconds
  • Memory Usage 1,751KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete