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)

Sven 09-30-2004 10:09 AM

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

Sven 11-18-2004 08:08 AM

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

TCM 01-16-2005 09:26 PM

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.

thamyeuvn 02-09-2005 04:24 PM

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.

TCM 02-12-2005 04:48 PM

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

smju 04-01-2005 12:48 PM

Are the instructions for installation still valid with 3.0.7?

TCM 04-01-2005 07:46 PM

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

smju 04-12-2005 02:32 PM

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 **

Marco van Herwaarden 04-12-2005 06:24 PM

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.

smju 04-12-2005 08:51 PM

Whoops.

Consider it removed.

How then do I get help, because I am convinced that I made the hack changes correctly.


All times are GMT. The time now is 01:45 AM.

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.01185 seconds
  • Memory Usage 1,742KB
  • 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_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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