1
sskhalid
BBCodes/Xoops Codes ?
  • 2006/4/30 16:39

  • sskhalid

  • Just popping in

  • Posts: 24

  • Since: 2006/4/18


Lo All,

I am trying to integrate Itemstats module http://sourceforge.net/project/showfiles.php?group_id=69529&package_id=70632&release_id=381547 with CBB (newbb). This module can display items from wow.allakhazam.com etc.

Itemstats only works with PHPBB by inserting a custom bbcode tag and then rendering the custom tag with a function call. The whole set of instructions is as follows :

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


ADD-AFTER



SAVE AND CLOSE
{forum_root}/templates/subSilver/overall_header.tpl
----------------------------------------------------

So, the question is, is there a place in CBB code (or XOOPS code) where I can

1. Intercept/Retrieve the text of the post (before it is rendered).
2. inject the 'itemstats_parse($text)' function where 'text' is the content I got from 1. above, and modify it before handing it back to the forum renderer.

Since CBB does not support BBCodes, I don't know how to do this. Also I don't know what XOOPS codes are, or if I can add custom XOOPS codes etc

Any help would be appreciated.

Cheers

2
Bender
Re: BBCodes/Xoops Codes ?
  • 2006/4/30 17:20

  • Bender

  • Home away from home

  • Posts: 1899

  • Since: 2003/3/10


You would need to hack that into the XOOPS textsanitizer. There is no plugin interface to add own codes.

Here is an example of how a spoiler tag was implemented:

https://xoops.org/modules/newbb/viewtopic.php?viewmode=flat&topic_id=48232&forum=14
Sorry, this signature is experiencing technical difficulties. We will return you to the sheduled signature as soon as possible ...

3
sskhalid
Re: BBCodes/Xoops Codes ?
  • 2006/4/30 17:36

  • sskhalid

  • Just popping in

  • Posts: 24

  • Since: 2006/4/18


You da man bender - thanks !!!

4
iHackCode
Re: BBCodes/Xoops Codes ?

Lo,

how u doing with the hack. need some help?
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧

5
svaha
Re: BBCodes/Xoops Codes ?
  • 2006/5/1 10:47

  • svaha

  • Just can't stay away

  • Posts: 896

  • Since: 2003/8/2 2


Could it be possible to filter/edit 'linking'

When I insert a link with koivi editor in the forum, clicking on the link does not lead to a blank page.

What I need is a filter that checks if "target=_blank" is present in a link, and if not inserts this "target=_blank".

6
sskhalid
Re: BBCodes/Xoops Codes ?
  • 2006/5/2 11:08

  • sskhalid

  • Just popping in

  • Posts: 24

  • Since: 2006/4/18


I've installed the hack, or rather, the call to the itemstats function like this:

// [/rhl]
$patterns[] = "/\[\quote]/sU";
$replacements[] = _QUOTEC.'
';
//$replacements[] = 'Quote:
';
$patterns[] = "/\[\/quote]/sU";
$replacements[] = '
';

// -- START HACK
$text = itemstats_parse($text);
// -- END HACK

$text = str_replace( "\x00", "", $text );
$c = "[\x01-\x1f]*";
$patterns[] = "/j{$c}a{$c}v{$c}a{$c}s{$c}c{$c}r{$c}i{$c}p{$c}t{$c}:/si";
$replacements[] = "(tammairanslip)";
$patterns[] = "/a{$c}b{$c}o{$c}u{$c}t{$c}:/si";
$replacements[] = "about :";
return preg_replace($patterns, $replacements, $text);

I've got the itemstats directory under C:\Apache\Apache2\htdocs\xoops\modules\newbb\itemstats


Lets say I am using the xmt theme from xoops. I've added the stylesheets as per itemstats instructions (in theme.html)

<{$xoops_sitename}> - <{$xoops_slogan}> - <{$xoops_pagetitle}>








7
mooshoo
Re: BBCodes/Xoops Codes ?
  • 2006/5/7 9:42

  • mooshoo

  • Just popping in

  • Posts: 3

  • Since: 2006/5/7 9


Did you ever get this working as I am in the process of trying to do it myself.

8
sskhalid
Re: BBCodes/Xoops Codes ?
  • 2006/5/7 23:39

  • sskhalid

  • Just popping in

  • Posts: 24

  • Since: 2006/4/18


i did get it to work with the latest version of itemstats - but it prints a space between the icon and the item description. maybe one of the XOOPS themes is causing problems. download the latest version from

http://forums.eqdkp.com/index.php?showtopic=3331

use the base version.

copy itemstats to modules/newbb/

in itemstats/include/sqlhelper.php , there will be an undefined variable called DEBUG.

at top of file do

$DEBUG = 0;


in your theme.html do






in xoops/class/module.textsanitizer.php do the thing I did (check the previous post I made)

in config.php of itemstats update location of your database

when u have done this, check the functionality by making new post and entering someting like

[item]Eye of Divinity[/item]

9
iHackCode
Re: BBCodes/Xoops Codes ?

Resized Image

looks like its working right.

using CBB 1.16a. what version of cbb are you using.?

and svaha i have no clue on koivi, i never edited that editor before. but maybe someone else has
CBB / LatestNews / Publisher / XM-Spotlight

(ノ◕ヮ◕)ノ*:・゚✧

10
mooshoo
Re: BBCodes/Xoops Codes ?
  • 2006/5/8 12:18

  • mooshoo

  • Just popping in

  • Posts: 3

  • Since: 2006/5/7 9


Grrr ... everytime I do a xoops-2.0.13.1-to-2.2.3a-Final upgrade it breaks the sight (following the instructions that come with the patch). Oh well.. thanks for the info anyway, much appreciated.

-Update-
Gah.. I had to do the xoops-2.2.3a-to-2.2.4 and then the site worked perfect again will try mods now and let you know how I go...

-Update-
As soon as I add the ...

// -- START HACK
$text = itemstats_parse($text);
// -- END HACK

into the module.textsanitizer.php file the pages just show up blank. My error log reads...

[Mon May 8 23:42:07 2006] [error] [client 220.253.130.211] File does not exist: /home/clubcat/public_html/404.shtml
[Mon May 8 23:42:07 2006] [error] [client 220.253.130.211] File does not exist: /home/clubcat/public_html/favicon.ico

When I comment out the $text = itemstats_parse($text); line it works like normal. I changed the call to itemsstats_parse($text) to see if it would throw a "undefined function called" error but it said the same as above.

Login

Who's Online

203 user(s) are online (94 user(s) are browsing Support Forums)


Members: 0


Guests: 203


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits