FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum Development » Plugins and Code Hacks » World of Warcraft - ItemStats  () 1 Vote
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Re: World of Warcraft - ItemStats [message #36727 is a reply to message #31504] Mon, 02 April 2007 22:13 Go to previous messageGo to next message
angryowl   United States
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.


Re: World of Warcraft - ItemStats [message #36728 is a reply to message #31504] Mon, 02 April 2007 23:42 Go to previous message
angryowl   United States
Messages: 7
Registered: October 2006
Karma: 0
Junior Member
I posted a hack that lets you use itemstats with fudforum, but it got removed. Why?

Update: Weird, it didn't show up for me until I posted THIS message. Bizarre.

[Updated on: Mon, 02 April 2007 23:42]

Report message to a moderator

  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Edit time limit affects "edit" permission [ oops nevermind ]
Next Topic: EXIF from Fileattachements
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Fri Apr 26 04:05:38 GMT 2024

Total time taken to generate the page: 0.02674 seconds