|
Re: World of Warcraft - ItemStats [message #30809 is a reply to message #30724] |
Wed, 15 March 2006 02:30 |
melink
Messages: 6 Registered: January 2006
Karma: 0
|
Junior Member |
|
|
I also looked this feature last night (server down :[), I have tried "Replacement & Censorship System" and find it is not possible, since the replacement is done before FUDcode replacement, Javacript is not allowed in FUDcode post and I believe using PHP also not possible. Therefore it is not possible to obtain the item stat from server or client side.
The only possible way, as far as I can see, is to make a customed FUDcode but I can't find any fancy interface to do this. I may do a hack on this later, but don't expect fast, feel free to discuss with me.
[Updated on: Wed, 15 March 2006 02:31] Report message to a moderator
|
|
|
|
|
|
|
Re: World of Warcraft - ItemStats [message #36727 is a reply to message #31504] |
Mon, 02 April 2007 22:13 |
angryowl
Messages: 7 Registered: October 2006
Karma: 0
|
Junior Member |
|
|
Ok, so I just recently worked out an ItemStats hack for FUDForum after pining for one for years.
It does require modifying some source files in your FUDforum/src/... directory, so if you want to do this, make sure you back everything up first.
First:
Install the itemstats directory at the root of your forums directory (the one inside your www root, not the FUDforum directory located elsewhere.)
Then, make some modifications to the FUDforum source code, and to a few of its templates:
Here's the modification list:
/fudforum/src:
+++ root_index.php.t
Include the generic_itemstats.php header so it's available when the page is generated.
/*{POST_HTML_PHP}*/
>>> include_once('./itemstats/generic_itemstats.php');
fud_use('err.inc');
+++ post_proc.inc.t
Catch the [item] and [itemico] tags and allow them to pass-through unchanged.
switch ($tag) {
case 'quote title':
$tag = 'quote';
break;
case 'list type':
$tag = 'list';
break;
case 'hr':
$str{$pos} = '<';
$str{$pos+1} = 'h';
$str{$pos+2} = 'r';
$str{$epos} = '>';
continue 2;
>>> case 'item':
>>> case 'itemico':
>>> $pos = strpos($str, "]", $epos+1) + 1;
>>> $epos = $pos;
>>> continue;
+++ fileio.inc.t
Add a new function that allows itemstats to parse the message body before returning it to the draw code.
>>> function itemstats_read_msg_body($off, $len, $id)
>>> {
>>> $msg = read_msg_body($off, $len, $id);
>>>
>>> $msg = itemstats_parse($msg);
>>>
>>> return $msg;
>>> }
Now, using the Admin Control Panel, go to the Template Management section and enter the Template editor.
First, edit:
'header.tmpl' choose the "header" message from the list.
Insert the following into the header.tmpl template at the bottom of the <head> section (right before the </head>:
<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>
This will make sure that itemstats has access to its css info and javascript functions.
Now edit:
'drawmsg.tmpl' choose the dmsg_normal_msg_body message from the list (towards the bottom)
Where it says:
{FUNC: read_msg_body($obj->foff, $obj->length, $obj->file_id)}
Change it to call the new itemstats-enabled version:
{FUNC: itemstats_read_msg_body($obj->foff, $obj->length, $obj->file_id)}
And you're done. Make sure to rebuild your theme using the Theme
Manager first.
|
|
|
|