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)

sweede 02-01-2008 10:00 PM

WoW Character BBCode
 
This is a continuation of the project, https://vborg.vbsupport.ru/showthread.php?t=160418 . I have made several modifications to the original authors code and several have asked for my modifications.

Because of this and the original authors lack of updating the original modification, I have decided to upload this package for all to use.

All credit goes to the original author(s) of the utility as i have only cleaned up the code and packaged it for easy usage.

WARNING!
This is very beta at this time. I have added the product now to force myself to update and maintain the plugin and to share it with the rest of my fellow World of Warcraft webmasters

Installation
  1. Uninstall your existing WoW Char Code installation. I have changed the product ID itself and it may not update everything correctly.
  2. Remove the clientscript/ajax_tooltip and clientscript/phparmory folders if they exist
  3. Upload the contents of the "Upload" Folder to the ROOT directory of your forums (for example, if you have your forums installed in /home/mydir/public_html/forums , you would unzip into that folder.)
  4. Import the product/product-WoWCharBBCode-?.??.xml file

Changelog
  • 0.4.9b
    • Added basic Death Knight support
    • Fixed problem with characters with no professions (common with Death Knights)
  • 0.4.9a
    • Fixed a minor issue with realms in spaces in the name
  • 0.4.9
    • Added wysiwyg support
  • 0.4.8a
    • Fixed a php parse error in functions_wowcharcode.php. you do not need to download the entire zip file, just replace your existing functions_wowcharcode.php file with the attached .php file
  • 0.4.8
  • 0.4.7a
    • Removed some left over debugging statements and info in the product and php file.
  • 0.4.7
    • Changed the backend armory code.
    • Updated caching to not cache Armory results that end up as errors
    • Added character class, race and professions as vbphrases.
    • Added KR and TW Armory locales. (, etc)
    • Some minor fixes.
  • 0.4.4
    • Added Icon caching to help with slow armory. Images are cached by default in the armory folder. chmod this folder to 777 and icons will be automaticly cached to this folder.
    • You can now use the variable $wowchar_code in the postbit (or postbit_legacy) to display the character tooltip in a post.
  • 0.4.3 Fixed issue with rebuilding post cache.
  • 0.4.2 Added option to show/hide realm if a default realm is set.
  • 0.4.1 Fixed an issue if the character doesnt have armory data, Only change is in functions_wowcharcode.php file.
  • 0.4
    • All Character stat text are now phrases. you will find a new Phrase Type in the Phrase Manager ( WoW BBCode Phrases )
    • Added default realm option so one does not need to use the [char=server] option when specifying characters on own realm.
    • Customized the stat display per class and on some specs (such as feral v.s. resto druids). see an example at http://www.dramaloot.com/forums/showthread.php?p=19271
  • 0.3
    • Armory Caching works for both US and EU armorys.
    • Removed un-used files.
    • Put the majority of the codes HTML creation as templates and use vbulletins ajax.php and hooks.
    • Added options for default locale (armory) to use (currently EU and US armories).
    • Added option to disable caching of the Armory (i use it to test armory retrieval)
    • Added ability to specify what armory the character / realm you would like, see usage notes below.
  • 0.2
    • Armory Caching never actually worked properly, this should now be fixed.
    • Remove the includes/functions_wow3bbcode.php file. This has been replaced by a plugin.
    • Remove the clientscript/phparmory/config.php file. This isnt needed.
    • Major updates to phparmory.php
    • Minor Plugin changes + code cleanup.
ToDo
  • New tooltip javascript
  • New character sheet.
  • Create easy to modify interface for character stats to be displayed in tooltip.


Usage
Using the character code is easy enough,
[char]CHARACTER[/char] if default realm option is set and character links is on same realm.
For characters not on the same realm as the default,
[char=SERVER]CHARACTER[/char]
For example,
[char=Vek'nilash]Azaril[/char]
Or, if you want to link a character profile from another locale (i.e. EU realms) , you simply add EU- before the server name.
[char=EU-Vek'nilash]Azaril[/char]

The same thing applies to linking US realm characters from a EU default forum.

See a working example at http://www.dramaloot.com/index.php?id=officer_cl (This is a vbadvanced custom page using the BBCode page type).

Added German translation for what i currently have localized. Provided by jluerken http://www.wow-relaxed.de

Jrain157 02-02-2008 12:26 AM

Great job cleaning up the install. I wasn't getting the ajax mouse-over with the original. I get it now but it doesn't contain any data.

sweede 02-02-2008 02:24 AM

Ya, what i did was called "Not testing before releasing" , partially due to my wife wanting me to come out to the living room and watch Monk with her :)

But I'll have it fixed here shortly.

Jrain157 02-02-2008 03:37 AM

Awesome :)

sweede 02-02-2008 05:30 AM

This should be considerably better to use.

One thing to note though, is that if your forums are not in your web document root and you are using vbadvanced (i.e. you have example.com/index.php which is your VBAdvanced Portal and example.com/forums/ is your vb forum itself), you will have to upload the clientscript folder twice (once in the web root and once in the forum root).

I will fix this later.

Jrain157 02-02-2008 12:13 PM

Is there a specific web service that needs to be running other than cURL? Attached is what the mouse-over looks like for me. The link takes me to the correct armory site. This is with the same with the .1 version and the .2 version.

sweede 02-02-2008 12:21 PM

You just need cURL. I'll be adding in nicer ways to handle mis-information in case armory is down or something else goes wrong today.

Oh, i see what your problem could be, your host doesnt have short_open_tags on (ASP style,
Code:

<?=$var;?>
instead of
Code:

<?php echo $var ?>
I will have a new char.php file uploaded here in a few minutes

Jrain157 02-02-2008 12:35 PM

Pulls character info, spec, and trade skills now! I'll have my host turn on short_open_tags. Your response time on this is amazing btw. I appreciate your help.

Edit: Uploaded the old char.php after turning on short_open_tags and it works like a charm. Looking forward to the improvements you have listed on your to-do list.

Caerydd 02-03-2008 12:24 AM

I'm also on 3.6.8 RL2, so I'll be able to confirm if this version works on 3.6.8 tomorrow. We're an EU guild though ;)

sweede 02-03-2008 01:57 AM

Quote:

Originally Posted by Caerydd (Post 1434976)
I'm also on 3.6.8 RL2, so I'll be able to confirm if this version works on 3.6.8 tomorrow. We're an EU guild though ;)

I'll be updating for EU support tomorrow. The solution is two part, one is the default locale, the other is a user option. For example, you could do [char=US-Vek'nilash], [char=Vek'nilash] and if your default locale is the US, it will use the US armory. If for the server option you use EU-Vek'nilash, it will use the Europe armory.

Caerydd 02-05-2008 04:58 AM

vur nice :) again, thanks for all you hard work

CremeEgg 02-06-2008 04:44 PM

The tooltips say "Heath" ;)

EDIT: Fixed it to Health for you.

sweede 02-06-2008 06:57 PM

Thanks :) , with my next release of this i'm going to change all of the hard-coded text to phrases along with options to select what stats to show in the mouseover.

CremeEgg 02-07-2008 01:23 PM

Quote:

Originally Posted by sweede (Post 1437601)
Thanks :) , with my next release of this i'm going to change all of the hard-coded text to phrases along with options to select what stats to show in the mouseover.

That would be ace, as a Ret Paladin I can't see any Dmg stats on mine atm.

Caerydd 02-07-2008 05:46 PM

Confirmed as working on 3.6.8 RL2 in Firefox for Mac :)

sweede 02-07-2008 06:58 PM

Right now im working on making the stats display customizable through the options interface.

For some of the classes that have different types of stats (i.e. paladins , druids and to some extent warriors) , you will be able to choose whats shown based on spec. for example, feral druids dont really care about +healing stats, spirit, etc and resto are vise-versa.

You will have defaults, such as str, agi, stam, int and spirit. Whats actually displayed is based on class. Some classes such as a mage, you wont see str, agi or armor. Other classes like a rogue, you wont see int, spirit. Classes such as a druid, you will see all of the stats.

The other customizable options will be similar to the stat dropdown in the character frame.
Spell, Defenses, Ranged, and Melee

Caerydd 02-07-2008 08:00 PM

Sounds fantastic :)

Caerydd 02-10-2008 08:01 PM

Updates working great!


Is it possible to add in the various critical strike ratings and things?

Also, suggest chaning 'mana regen while casting' to 'MP5' as most casters should know the difference :)

EDIT:

Okay, for non 'default' server character, am getting this error after upgrading to 4

Code:

Warning: Invalid argument supplied foreach() in includes/functions_wowcharbbcode.php on line 180
It pulls the character level, race, spec and class, but nothing else. The character is an inactive, lowish level character - so obviously there is no data to pull, and for most characters this won't be an issue ;)

[char=Steamwheedle Cartel]Qialynna[/char]

sweede 02-10-2008 08:29 PM

Quote:

Originally Posted by Caerydd (Post 1440340)
Updates working great!


Is it possible to add in the various critical strike ratings and things?

Also, suggest chaning 'mana regen while casting' to 'MP5' as most casters should know the difference :)

EDIT:

Okay, for non 'default' server character, am getting this error after upgrading to 4

Code:

Warning: Invalid argument supplied foreach() in includes/functions_wowcharbbcode.php on line 180
It pulls the character level, race, spec and class, but nothing else. The character is an inactive, lowish level character - so obviously there is no data to pull, and for most characters this won't be an issue ;)

[char=Steamwheedle Cartel]Qialynna[/char]

you shouldnt have a file named functions_wowcharbbcode.php. Remove that file and use the file in the zip file instead.

There could also be a "Stale" plugin thats causing the problem.

In the admin CP, go to maintenance -> Execute SQL query ( you must be listed as the superadmin in the config.php file), and enter the following in the manual query

select title from PREFIXplugin WHERE phpcode like "%wowcharbbcode%"

Change Prefix to whatever your table prefix in the config.php file is set to (if it's vbb_ , the sql query would look like select title from vbb_plugin WHERE phpcode like "%wowcharbbcode%")

Note any plugins that are listed (if any), and go back to the Plugin & Products -> Plugin manager and look for the title of that plugin and delete it.


The only plugins you should have listed are:
WoW Char BBCode
WoW Char BBCode Help
WoW Char Code Ajax code
WoW Char Code Language Phrase Cache
WoW Char Code Startup
WoW Char Code Template Cache
WoW Char Code Template Group


Also, make sure that you do not have an old product name (i think it was wowchartest ?)

sweede 02-10-2008 08:51 PM

Quote:

Originally Posted by Caerydd (Post 1440340)
Is it possible to add in the various critical strike ratings and things?

I had this huge thing typed out on how to add custom data from the armory site ready to go and i was almost done with it and then i realized that i can do it in a much better way.

I'll have to re-write some things first.

I can use any data from an armory page (view source and its all XML)
as an example
HTML Code:

<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="/layout/character-sheet.xsl"?><page globalSearch="1" lang="en_us" requestUrl="/character-sheet.xml">
  <characterInfo>
    <character battleGroup="Nightfall" charUrl="r=Alterac+Mountains&amp;n=Azrael" class="Rogue" classId="4" faction="Horde" factionId="1" gender="Male" genderId="0" guildName="Syndicate of Shadows" guildUrl="r=Alterac+Mountains&amp;n=Syndicate+of+Shadows&amp;p=1" lastModified="February 5, 2008" level="65" name="Azrael" prefix="" race="Undead" raceId="5" realm="Alterac Mountains" suffix=""/>
    <characterTab>
      <talentSpec treeOne="15" treeThree="0" treeTwo="41"/>
      <buffs/>
      <debuffs/>
      <pvp>
        <lifetimehonorablekills value="1554"/>
        <arenacurrency value="0"/>
      </pvp>
      <professions>
        <skill key="engineering" max="300" name="Engineering" value="244"/>
        <skill key="mining" max="300" name="Mining" value="226"/>
      </professions>
      <title value=""/>
      <knownTitles/>
      <characterBars>
        <health effective="5939"/>
        <secondBar casting="-1" effective="100" notCasting="-1" type="e"/>
      </characterBars>
      <baseStats>
        <strength attack="103" base="86" block="-1" effective="113"/>
        <agility armor="676" attack="328" base="141" critHitPercent="9.37" effective="338"/>
        <stamina base="83" effective="363" health="3450" petBonus="-1"/>
        <intellect base="35" critHitPercent="-1.00" effective="35" mana="-1" petBonus="-1"/>
        <spirit base="59" effective="68" healthRegen="23" manaRegen="-1"/>
        <armor base="2018" effective="2018" percent="19.71" petBonus="-1"/>
      </baseStats>
      <resistances>
        <arcane petBonus="-1" value="0"/>
        <fire petBonus="-1" value="0"/>
        <frost petBonus="-1" value="0"/>
        <holy petBonus="-1" value="0"/>
        <nature petBonus="-1" value="0"/>
        <shadow petBonus="-1" value="10"/>
      </resistances>
      <melee>
        <mainHandDamage dps="117.2" max="347" min="263" percent="0" speed="2.60"/>
        <offHandDamage dps="91.8" max="137" min="102" percent="0" speed="1.30"/>
        <mainHandSpeed hastePercent="0.00" hasteRating="0" value="2.60"/>
        <offHandSpeed hastePercent="0.00" hasteRating="0" value="1.30"/>
        <power base="561" effective="901" increasedDps="64.0"/>
        <hitRating increasedHitPercent="2.78" value="34"/>
        <critChance percent="18.73" plusPercent="4.44" rating="76"/>
        <expertise additional="0" percent="2.50" rating="0" value="10"/>
      </melee>
      <ranged>
        <weaponSkill rating="0" value="281"/>
        <damage dps="100.6" max="197" min="146" percent="0" speed="1.70"/>
        <speed hastePercent="0.00" hasteRating="0" value="1.70"/>
        <power base="393" effective="733" increasedDps="52.0" petAttack="-1.00" petSpell="-1.00"/>
        <hitRating increasedHitPercent="2.78" value="34"/>
        <critChance percent="17.05" plusPercent="4.44" rating="76"/>
      </ranged>
      <spell>
        <bonusDamage>
          <arcane value="0"/>
          <fire value="0"/>
          <frost value="0"/>
          <holy value="0"/>
          <nature value="0"/>
          <shadow value="0"/>
          <petBonus attack="-1" damage="-1" fromType=""/>
        </bonusDamage>
        <bonusHealing value="0"/>
        <hitRating increasedHitPercent="0.00" value="0"/>
        <critChance rating="0">
          <arcane percent="0.00"/>
          <fire percent="0.00"/>
          <frost percent="0.00"/>
          <holy percent="0.00"/>
          <nature percent="0.00"/>
          <shadow percent="0.00"/>
        </critChance>
        <penetration value="0"/>
        <manaRegen casting="0.00" notCasting="0.00"/>
      </spell>
      <defenses>
        <armor base="2018" effective="2018" percent="19.71" petBonus="-1"/>
        <defense decreasePercent="0.00" increasePercent="0.00" plusDefense="0" rating="0" value="320.00"/>
        <dodge increasePercent="1.36" percent="19.91" rating="20"/>
        <parry increasePercent="0.00" percent="9.80" rating="0"/>
        <block increasePercent="0.00" percent="0.00" rating="0"/>
        <resilience damagePercent="0.00" hitPercent="0.00" value="0.00"/>
      </defenses>
      <items>
        <item durability="31" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_helmet_31" id="31784" maxDurability="50" permanentenchant="0" randomPropertiesId="0" seed="1442833829" slot="0"/>
        <item durability="0" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_jewelry_necklace_03" id="25914" maxDurability="0" permanentenchant="0" randomPropertiesId="0" seed="270680656" slot="1"/>
        <item durability="37" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_shoulder_07" id="31148" maxDurability="60" permanentenchant="0" randomPropertiesId="0" seed="892721840" slot="2"/>
        <item durability="0" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_shirt_black_01" id="3427" maxDurability="0" permanentenchant="0" randomPropertiesId="0" seed="0" slot="3"/>
        <item durability="64" gem0Id="28459" gem1Id="28467" gem2Id="28463" icon="inv_chest_leather_03" id="24396" maxDurability="100" permanentenchant="0" randomPropertiesId="0" seed="1878719127" slot="4"/>
        <item durability="24" gem0Id="28459" gem1Id="28459" gem2Id="0" icon="inv_belt_29" id="24063" maxDurability="35" permanentenchant="0" randomPropertiesId="0" seed="2043929102" slot="5"/>
        <item durability="42" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_pants_leather_08" id="29939" maxDurability="65" permanentenchant="0" randomPropertiesId="0" seed="911117875" slot="6"/>
        <item durability="31" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_boots_cloth_05" id="25717" maxDurability="50" permanentenchant="0" randomPropertiesId="0" seed="816862488" slot="7"/>
        <item durability="20" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_bracer_08" id="25960" maxDurability="30" permanentenchant="0" randomPropertiesId="0" seed="1030569422" slot="8"/>
        <item durability="18" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_gauntlets_14" id="24712" maxDurability="30" permanentenchant="0" randomPropertiesId="-5" seed="1306001438" slot="9"/>
        <item durability="0" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_jewelry_ring_04" id="25499" maxDurability="0" permanentenchant="0" randomPropertiesId="0" seed="1418445178" slot="10"/>
        <item durability="0" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_jewelry_ring_04" id="25926" maxDurability="0" permanentenchant="0" randomPropertiesId="0" seed="1104314345" slot="11"/>
        <item durability="0" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_datacrystal06" id="28041" maxDurability="0" permanentenchant="0" randomPropertiesId="0" seed="811388986" slot="12"/>
        <item durability="0" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_jewelry_trinketpvp_02" id="18849" maxDurability="0" permanentenchant="0" randomPropertiesId="0" seed="0" slot="13"/>
        <item durability="0" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_misc_cape_20" id="25712" maxDurability="0" permanentenchant="0" randomPropertiesId="0" seed="208396522" slot="14"/>
        <item durability="59" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_sword_63" id="24020" maxDurability="90" permanentenchant="0" randomPropertiesId="0" seed="0" slot="15"/>
        <item durability="41" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_weapon_shortblade_14" id="31193" maxDurability="65" permanentenchant="0" randomPropertiesId="0" seed="1111220604" slot="16"/>
        <item durability="196" gem0Id="0" gem1Id="0" gem2Id="0" icon="ability_upgrademoonglaive" id="28538" maxDurability="200" permanentenchant="0" randomPropertiesId="-13" seed="309526543" slot="17"/>
        <item durability="0" gem0Id="0" gem1Id="0" gem2Id="0" icon="inv_shirt_guildtabard_01" id="5976" maxDurability="0" permanentenchant="0" randomPropertiesId="0" seed="0" slot="18"/>
      </items>
    </characterTab>
  </characterInfo>
</page>


Caerydd 02-10-2008 09:02 PM

okay, I typed out the functions file name, it doesn't have 'bb' in it and the line number was 801 *facepalm* late night code tweaking for the LOSE. Should have screenied it rather than transcribing it

Tried the sql query and came up with 0 results

Code:

Warning: Invalid argument supplied foreach() in includes/functions_wowcharcode.php on line 801
updated for clarity. Very sorry

Quote:

WoW Head ItemStats 0.4.0 wowhead.com Itemstats tooltip plugin
Current plugin details

One of my guildies was working on making our own/local version of the guild roster, but I think they're a bit overwhelmed by vbulleting atm, so I haven't seen anything of it, or the crafting database we're making.

sweede 02-11-2008 02:24 AM

Quote:

Originally Posted by Caerydd (Post 1440366)
One of my guildies was working on making our own/local version of the guild roster, but I think they're a bit overwhelmed by vbulleting atm, so I haven't seen anything of it, or the crafting database we're making.

If the armory was better it would be very easy to pull it from the armory.

Other things i have planned to do include some type of guild roster, a raid calander (update/rewrite the one listed on this site) and a built in loot tracking system using either EPGP, NRT or something else (non point DKP though).

sweede 02-11-2008 02:36 AM

The character you're linking doesnt have any professions listed?

I guess thats my fault for not checking first

There'll be an update in 30 minutes or so.

-- Updated functions_wowcharcode.php

Caerydd 02-11-2008 05:28 AM

works perfectly now. Thanks for the quick update! And just noticed my request about mp5 was silly, as it's all phrased. *is blind*


Sounds like you're headed for a complete WoW Package there, pretty awesome :)


I currently use farcaster's event attendance & event forums for raid sign ups, as it lets us do RP events and things as well, and my server means fopen_url has made the WoW version unusable >>


I think loot tracking is more important to us than dkp itself - we use suicide kings, so people just use the mod to find out where they are, but 'latest loot' would be a nice addition to the raid section of our site (small area that has upcoming events, screenshots, latest threads and latest raid news all in one spot.) Anyways, this is getting off topic now, so I'll stop rambling.


:D

CoryHawk 02-12-2008 12:28 AM

Installed!

Question..

Is there a way to not display the server? So it just says the Name of the character. Our forums are for our guild only so the default server is always the same.. would just like to display the Character name.

This looks awesome btw.

Zath 02-12-2008 10:02 AM

Quote:

Originally Posted by CoryHawk (Post 1441107)
Is there a way to not display the server? So it just says the Name of the character. Our forums are for our guild only so the default server is always the same.


Same here. Thanks!

sweede 02-12-2008 11:19 AM

Quote:

Originally Posted by CoryHawk (Post 1441107)
Installed!

Question..

Is there a way to not display the server? So it just says the Name of the character. Our forums are for our guild only so the default server is always the same.. would just like to display the Character name.


This looks awesome btw.

Added

Zath 02-12-2008 11:51 AM

Thanks for the fix! Great mod!

sweede 02-12-2008 09:13 PM

Fixed the issue where if you rebuilt your post cache you'll lose your the [char] tag links.

MrShides 02-14-2008 04:10 PM

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?

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 08:02 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.01575 seconds
  • Memory Usage 1,958KB
  • 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
  • (8)bbcode_code_printable
  • (1)bbcode_html_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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