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
  #32  
Old 09-30-2004, 10:09 AM
Sven Sven is offline
 
Join Date: Oct 2001
Location: Neuss, Germany
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

After the upgrade to 3.03 I had to re-install this hack and, as an outcome, here are the instructions for the countdown:

Install the hack
Add the following code to includes/functions.php:
Code:
// ###################### 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'; 

}
Create a custom bb code function like this:
title: countdown
handle: fetch_countdown_timer
description: whatever you want
include file: [leave blank]
Update upon page refresh?: yes

Then create a custom bb code:
title: countdown
tag: countdown
function: countdown
replacement: [leave blank]
example: [countdown]1088859600[/countdown] (choose any unix timestamp here)
description: [whatever you want]
use parameter: no
button image: [any image you want]

Now, to make this usable to your users:
Add a link to a calculation script like this one (I did this on the editor toolbars):
http://www.php4scripte.de/umrechner/
it converts a real time into a unix timestamp which can then be used within the BB Code.

I'd really appreciate if one could help me to avoid the conversion between realtime and unix timestamp... so the function can work with realtime formats
Reply With Quote
  #33  
Old 11-18-2004, 08:08 AM
Sven Sven is offline
 
Join Date: Oct 2001
Location: Neuss, Germany
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I just tried to add a new cutom bbcode to our forums - well, that worked - but the new created code won't show up in the bbcode manager.

I edited all the files, according to the install.html, once again - with no effect at all.

Any help on what's wrong here?
Can anyone, who has this hack properly installed, send me this three files:
bbcode.php
adminfunctions.php
functions_bbcodeparse.php
??

Send them to sven@cncforen.de
Reply With Quote
  #34  
Old 01-16-2005, 09:26 PM
TCM TCM is offline
 
Join Date: Dec 2004
Location: 3.6.8
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anyone yet know if this hack is compatiable with .5? It looks like a great hack, but I don't want to install it if it won't work yet, or will cause errors.
Reply With Quote
  #35  
Old 02-09-2005, 04:24 PM
thamyeuvn thamyeuvn is offline
 
Join Date: Oct 2002
Posts: 58
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I need Flash BB code, can anyone here help me?
I need to import flash in to my forum but I dont know how to do that.
Thanks.
Reply With Quote
  #36  
Old 02-12-2005, 04:48 PM
TCM TCM is offline
 
Join Date: Dec 2004
Location: 3.6.8
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey. I'm trying to get this hack installed, but I don't understand how to run the queries from PHPMyAdmin. I go to my database, select Querey, but I don't know where to enter it. Entering it in the box labeled "SQL-query on database tcmutt_Source" just gives me the error "You have to choose at least one Column to display". =/ Can anyone tell me what I'm doing wrong?

EDIT: Whoops. My mistake. I think I found out where to do it.

EDIT2: Alright, it's installed correctly now. Thanks for making this, it should prove very useful.
Reply With Quote
  #37  
Old 04-01-2005, 12:48 PM
smju smju is offline
 
Join Date: Nov 2004
Location: Kent, U.K.
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Are the instructions for installation still valid with 3.0.7?
Reply With Quote
  #38  
Old 04-01-2005, 07:46 PM
TCM TCM is offline
 
Join Date: Dec 2004
Location: 3.6.8
Posts: 75
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by smju
Are the instructions for installation still valid with 3.0.7?
Yup. I've got vB 3.0.7 and this works great on mine.
Reply With Quote
  #39  
Old 04-12-2005, 02:32 PM
smju smju is offline
 
Join Date: Nov 2004
Location: Kent, U.K.
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, I did everything the instructions said and I got an error, so backed it all out.

The error was in the functions_bbcodeparse file. The error message was "unexpected $ at line 1767" (which is the line with the ?>).

I have checked all the hacks and they seem correct.

Here is the final code you can find all the changes and the step numbers by finding "SMJU001"

I tried pasting the code in here BUT it made the message too big. Thus you can find it [Removed by moderator]** Here **
Reply With Quote
  #40  
Old 04-12-2005, 06:24 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by smju
Well, I did everything the instructions said and I got an error, so backed it all out.

The error was in the functions_bbcodeparse file. The error message was "unexpected $ at line 1767" (which is the line with the ?>).

I have checked all the hacks and they seem correct.

Here is the final code you can find all the changes and the step numbers by finding "SMJU001"

I tried pasting the code in here BUT it made the message too big. Thus you can find it ** Here **
You should immediate remove that file. It is against your license agreement and our Forum Rules to paste significant parts of vB files, or vB files in whole.
Reply With Quote
  #41  
Old 04-12-2005, 08:51 PM
smju smju is offline
 
Join Date: Nov 2004
Location: Kent, U.K.
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Whoops.

Consider it removed.

How then do I get help, because I am convinced that I made the hack changes correctly.
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 12:07 AM.


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.07724 seconds
  • Memory Usage 2,308KB
  • 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_code
  • (2)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