vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Miscellaneous Hacks - WoW Character BBCode (https://vborg.vbsupport.ru/showthread.php?t=169389)

MrShides 02-14-2008 04:11 PM

Quote:

Originally Posted by MrShides (Post 1443014)
Sorry, i'm definitly a novice here.

I've got everything loaded up where it needs to be, (i think) however when i mouse over my name it says "loading" and eventually just shows that it can't load the picture or any data.

any ideas?

could this be related to needing that cURL thing loaded up? I do not know if i have that.

MrShides 02-14-2008 05:34 PM

I have confirmed I have curl installed, so that can't be it. I had one of my more knowledgable guys look over it, and he contends that i've installed it according to the instructions

One of my admins says that it isn't pulling the xml into the database. It does add a row for my character, but never populates it with any data.

MrShides 02-14-2008 06:58 PM

nvm, it magically started working on its own. I have no idea :D

sweede 02-14-2008 07:56 PM

need more info than that. what character/server are you trying to link, your forum URl, etc.

MrShides 02-14-2008 08:03 PM

we got it all working, its www.free-collective.us.

it just began working on its own, maybe armory lag?

What I'd really like to do is get this added to the postbit using a custom profile field. That would be slick.

sweede 02-14-2008 08:40 PM

Quote:

Originally Posted by MrShides (Post 1443181)
we got it all working, its www.free-collective.us.

it just began working on its own, maybe armory lag?

What I'd really like to do is get this added to the postbit using a custom profile field. That would be slick.

Create a new plugin, make sure that you select the WoW BB Code product
HookLocation: postbit_display_start
title : WoW Char Postbit
PHP code is as follows
Code:

// Change the Field2 to whatever custom profile field your have setup in the admincp.
// If your server field is 7 and your character field is 8, you would use
// $wowchar_server  = $post['field7'];
// $wowchar_charname = $post['field8'];
////////////////////////////////////////////////////////////////////////////////////////

$wowchar_server  = $post['field1'];
$wowchar_charname = $post['field2'];

global $vbulletin;
$wowchar_use_default =  false;
if(!$wowchar_server)
{
        $wowchar_server = $vbulletin->options['wowcharcode_default_realm'];
        $wowchar_use_default =  true;
}

if($wowchar_charname != false or $server != false)
{
        $wowchar_charname = trim($wowchar_charname);
        $wowchar_server = trim($wowchar_server);
       
        //override default armory URL.
        preg_match("/(EU|US)-(.*)/", $wowchar_server, $match);
       
        if($match[1] == true)
        {
                $armory_locale = strtolower($match[1]);
                $armory_server = $match[2];
        } else {
                $armory_locale = strtolower($vbulletin->options['wowcharcode_locale']);
                $armory_server = $wowchar_server;
        }
       
        switch($armory_locale)
        {
                case 'eu':
                        $armoryurl = 'http://eu.wowarmory.com';
                        break;
                case 'us':
                        $armoryurl = 'http://www.wowarmory.com';
                        break;
        }

        //$wowchar_code = "<img src='clientscript/wowbbcode_js/char.gif' border='0' align='middle'>";
        $wowchar_code .= "<a href=\"".$armoryurl."/character-sheet.xml?r=".str_replace(" ","+",$armory_server)."&n=".$wowchar_charname."\"";
        $wowchar_code .= " target=\"new\"";
        $wowchar_code .= " onmouseover='ajax_showTooltip(\"".$vbulletin->options['bburl']."/ajax.php?do=wowcharcode&server={xserver}&char={charname}\",this);";
        $wowchar_code .= " return false' onmouseout='ajax_hideTooltip()'>";
        if($vbulletin->options['wowcharcode_display_realm'] == 0 && $wowchar_use_default == true)
        {
                $wowchar_code .= "<strong>&lt;{charname}&gt;</strong></a>";
        } else {
                $wowchar_code .= "<strong>&lt;{server}: {charname}&gt;</strong></a>";
        }
       
        $wowchar_server = str_replace("'","'",$wowchar_server);
        $wowchar_code = str_replace("{xserver}",str_replace(" ","+",$wowchar_server), $wowchar_code);
        $wowchar_code = str_replace("{server}",$wowchar_server, $wowchar_code);
        $wowchar_code = str_replace("{charname}",$wowchar_charname, $wowchar_code);
}  else {
        $wowchar_code = false;
}

Be sure to read and edit the first few lines of the plugin code.
Save

The variable $wowchar_code is now avialable to use in the postbit (or postbit_legacy). The output is something like "<Vek'nilash: Azaril>"

It where ever you see fit.

The other error, you can fix it by opening up the functions_wowcharcode.php and replacing line 743
Code:

unset($char['characterinfo']['charactertab']['items']);
with

Code:

    if(is_array($char['characterinfo']['charactertab']['items']))
    {
        unset($char['characterinfo']['charactertab']['items']);
    }


MrShides 02-14-2008 08:47 PM

You rock!

MrShides 02-15-2008 12:19 AM

That worked perfectly, i just set it up.

Thanks again!

As an added option, that maybe your users will want to add, I made the char_server option a non-editable user field, eliminating a step for the users.

sweede 02-15-2008 02:02 AM

Quote:

Originally Posted by MrShides (Post 1443356)
That worked perfectly, i just set it up.

Thanks again!

As an added option, that maybe your users will want to add, I made the char_server option a non-editable user field, eliminating a step for the users.

Setting the default realm in the options should have made the user profile field useless.

Zath 02-15-2008 03:26 AM

Anyone else having the trouble of the character picture not loading when the pop up stats show on a character. v4.3. It will pull the character info up but no pics.

you can see what I mean in my signature here.. http://deathdealers.wowtvc.com/member.php?u=1
(if it works from this link please tell me.. Ive tried it from home and at work.. still no pics)

version 4.2 worked fine but for some reason it isnt showing the pics anymore.


All times are GMT. The time now is 03:31 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.01151 seconds
  • Memory Usage 1,751KB
  • 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
  • (3)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (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