Log in

View Full Version : bbCode Mod - Itemstats for EQDKP WoW


frodaddy
10-17-2005, 06:31 PM
My vBulletin is used for a hardcore World of Warcraft guild (PC Game). There is currently a mod for phpBB that allows you to link items that are acquired in the game. Here are the directions for installing this mod:

phpBB Installation (Based on phpBB 2.0.17)

==========================================

1. Configuration

Make sure you complete the instructions in 'config.txt' before doing this part.



2. Copying it over

Copy the 'itemstats' folder to the root of your forum installation.



3. PHPBB modifications

Follow the instructions below to modify the phpbb files with data specific to your environment. This can vary from version to version. The goal is to inject a call to 'itemstats_parse()' in the location where the forum bbcodes are handled. In my installation, the main entry point for this is the bencode_second_pass() function, so I added the call at the beginning of this function. For the HTML changes, the goal is to have allakhazam.css and Overlib loaded for forum page that will display itemstats. For simplicity, I put this in the 'overall_healer.tpl' file. The changes listed below are for the default subSilver template. If you are using multiple templates for your forum, you will need to apply it to each one.

These changes do not follow any BBCode mod standards. I tried to do that, but it was too complicated for my taste. I wanted to make the smallest possible change in the phpbb php code, something that would be easy to fix if a phpbb patch somehow overwrote it somehow.

OPEN

{forum_root}/include/bbcode.php

FIND

define("BBCODE_UID_LEN", 10);

ADD-AFTER

include('./itemstats/phpbb_itemstats.php');

FIND

function bbencode_second_pass($text, $uid)

{

global $lang, $bbcode_tpl;

ADD-AFTER

// Parse text for ItemStats mod

$text = itemstats_parse($text);

SAVE AND CLOSE

{forum_root}/include/bbcode.php

OPEN

{forum_root}/templates/subSilver/overall_header.tpl

FIND

<!-- link rel="stylesheet" href="templates/subSilver/{T_HEAD_STYLESHEET}" type="text/css" -->

ADD-AFTER

<link rel="stylesheet" href="itemstats/templates/itemstats.css" type="text/css">

<script type="text/javascript" src="itemstats/overlib/overlib.js"><!-- overLIB (c) Erik Bosrup --></script>

SAVE AND CLOSE

{forum_root}/templates/subSilver/overall_header.tpl



I am assuming I can do the same thing in vBulletin as VB parses the same type of "BB Code" used for phpBB. Is there anywhere or anyfile in VB that includes the code for parsing for BB and if so, is the same exact parsing as phpBB uses or do i need to find a workaround.



n.b. i udnerstand this is a mod and i have asked the people who created this mod how to do it for vbulletin, but thye are very slow to responding. if there is a similarity between the bbcodes of phpBB and vb than i can do a workaround. if no one knows how to do this, its cool, ill just wait for a response from the creators of this mod

fyi:
here is the dev post:
http://forums.eqdkp.com/index.php?showtopic=1768

Darkmeteor
10-20-2005, 06:14 PM
I needed it so I managed to get it to work on my vbulletin 3.5.0

file : class_bbcode.php

add (right at the start)

include('./itemstats/phpbb_itemstats.php');

then log in your admin panel, create a new module called whatever you want

hook : bbcode_parse_complete

php code :
$text = itemstats_parse($text);

open your headerinclude template and add :

<link rel="stylesheet" href="itemstats/templates/itemstats.css" type="text/css">
<script type="text/javascript" src="itemstats/overlib/overlib.js"><!-- overLIB (c) Erik Bosrup --></script>

at the bottom



and it's done :)

Reeve of shinra
10-20-2005, 11:15 PM
You repost this into the hacks forum.

frodaddy
10-21-2005, 01:08 PM
by add module do u mean in vBAnvaced? can u give me a little more detail in making this "module"? THanks!

fyi im using vB 3.0

Darkmeteor
10-21-2005, 01:18 PM
i don't know if modules are already in vb 3.0, what the module does is adding some php code somewhere in a file at some hook without editing the original file.

to do this manually you have to open class_bbcode.php, find function do_parse, find return $text; inside the function, and add $text = itemstats_parse($text); just before the return

frodaddy
10-21-2005, 01:31 PM
ok figured it out:
// ###################### Start bbcodeparse2 #######################
function parse_bbcode2($bbcode, $dohtml, $dobbimagecode, $dosmilies, $dobbcode, $iswysiwyg = 0, $donl2br = 1)

put it right before the return on thsi function

WOOT! its sick

FYI: this is how to do it for v.308

Darkmeteor
10-23-2005, 10:34 PM
so you got it working ?

ChaoticMageDDC
10-23-2005, 10:39 PM
I can't get it to work on VB 3.08 running win2k3 IIS 6.0

It goes to a white page everytime no matter what you do.

Even after hours of creating a test.php file and testing it just on a single line of text.

I'm assuming you got this to work on Apache/Linux setup as all the item stat files are unix paths.

??

higmet
10-28-2005, 11:20 PM
everything works fine for me, but...

if there is no other bbcode in the same post he will not parse the tags.

any ideas?

Sparkz
11-13-2005, 12:59 PM
I'm experiencing some weird problems with this.
The tags will be properly parsed in preview and when I'm redirected back to the post after submitting it. But on subsequent reloads of the page, the link will be not be parsed. I've been out of the vBulletin-game for a long time now, so I haven't had a chance to properly familiarize myself with the code yet.

It seems to be a problem with the postcache or something. Is there a cleaner way to implement this functionality in vB3.5?

Sparkz
11-15-2005, 07:00 AM
I don't usually do this, but
/bump

Sparkz
11-22-2005, 06:21 PM
<a href="https://vborg.vbsupport.ru/showthread.php?t=101350" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=101350</a>