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-15-2008 04:18 AM

The images are pulled from wowarmory.com, which is 90% of the time pretty slow.

I guess that's an idea though. to cache the images from wowarmory to your local webspace. it would require that you have a directory writable by the webserver though.

Zath 02-15-2008 10:46 AM

You are awsome! Thank you so much!!

Caerydd 02-15-2008 11:13 AM

I might see if I can mash this together with the WoWChar drop down addon (I think gryphon made it?) as a tidier way to add characters, although gryphon's one supports alts.

MrShides 02-15-2008 02:12 PM

Quote:

Originally Posted by Caerydd (Post 1443592)
I might see if I can mash this together with the WoWChar drop down addon (I think gryphon made it?) as a tidier way to add characters, although gryphon's one supports alts.

This would be sofaking cool

Caerydd 02-16-2008 02:15 PM

Mebbe, but I'm not going to do it now. His 'version' pulls armory data for his new WoW Event Calendar, so I wouldn't want to mess it up :) However Sweede's bbcode would be a nicer way of displaying characters in the postbit ^^ So...we'll see.

I love love love that we have two great developers maintaining these mods now :D

sweede 02-16-2008 04:26 PM

Quote:

Originally Posted by Caerydd (Post 1444448)
Mebbe, but I'm not going to do it now. His 'version' pulls armory data for his new WoW Event Calendar, so I wouldn't want to mess it up :) However Sweede's bbcode would be a nicer way of displaying characters in the postbit ^^ So...we'll see.

I love love love that we have two great developers maintaining these mods now :D

My mod retrieves the armory XML data and stores the entire thing into the database. the cached data expires after 6 hours (at least thats what i think it did).

Anything that that uses armory data can easily be re-written to use the cache storage container that i have

For example, the elricstorm calander read the XML file from the armory then copied the parts of the XML to the database. You would simply change the code that retrieves the the armory from the URL with what i wrote.

MrShides 02-17-2008 04:35 AM

My Fury Warriors and Ehancement Shaman where commenting on how they really like the addon, however they would really like it to display their Attackpower and Crit Chance.

sweede 02-17-2008 07:13 AM

Quote:

Originally Posted by MrShides (Post 1444942)
My Fury Warriors and Ehancement Shaman where commenting on how they really like the addon, however they would really like it to display their Attackpower and Crit Chance.



It appears that melee crit wasnt part of the original or i accidently deleted it..

Go to admincp -> Phrase Manager -> Add New Phrase

Phrase Type: WoW BBCode Phrases
Product: WoW BB Code
Varname: wowcharcode_melee_crit
Text: Melee Crit

Save.

Open includes/functions_wowcharcode.php file and find
Code:

$value["melee main dps"]                = $melee['mainhanddamage']['dps'];
Add
Code:

  $value["melee crit"]            = $melee['critchance']['percent'] . "%";
after it.

Find
Code:

"melee main dps" => 3,
Add
Code:

"melee crit" => 3,
after it

Now, you can add the melee crit ID in the make_extra_data method.
Change all lines that read
Code:

$default = array_merge($default, array("melee main damage", "melee main dps"));
to

Code:

$default = array_merge($default, array("melee main damage", "melee main dps","melee crit"));
There should be 4 places to change (you don't need to change the hunter section that starts with // Hunter 2 melee stats).

I'll incorporate this into a more complete package at a later time. I want to finish up a couple other things first.

CremeEgg 02-17-2008 12:53 PM

With the caching enabled I can't see any of the images. They are being cached, I've checked the folder on the server.

I have this issue alot with the theme I'm using when I have images that are outside of the themes folder root.

There are no replacement variables set in the theme though. Should I add one for the armory/images folder or is there a way I can move that folder?

sweede 02-17-2008 02:48 PM

odd, if you go to http://www.destinyawaitsguild.co.uk/...w-70/1-1-2.gif

The image is there, but you get a permission error when trying to view it. Using an FTP client (or if you have a shell to the server which is the best!), try to browse to the /forum/armory/images folder and note the permissions.

Note the attached image, in CuteFTP that is the info i'll be looking for.

CremeEgg 02-17-2008 04:02 PM

Thats totally odd. As far as I can see the permissions are correct.

sweede 02-17-2008 04:43 PM

What about the armory directory itself?

Also, do you have access to the error_log file for your domain? that may tell you a bit more.

if you delete (rename, whatever) the armory folder, it won't try to cache images and use images from wowarmory.com instead.

sweede 02-17-2008 04:47 PM

Oh, and i want to change a couple thing so that instead of caching images to the filesystem, it caches them to the MySQL database so you don't have to add new directories and run into issues such as this. I'm not quite that far long with it though.

CremeEgg 02-17-2008 04:56 PM

Quote:

Originally Posted by sweede (Post 1445293)
What about the armory directory itself?

Also, do you have access to the error_log file for your domain? that may tell you a bit more.

if you delete (rename, whatever) the armory folder, it won't try to cache images and use images from wowarmory.com instead.

Armory is 777, subdirs are 764.

I will have to see about an error log not looked for one before.

sweede 02-17-2008 05:13 PM

Quote:

Originally Posted by CremeEgg (Post 1445312)
Armory is 777, subdirs are 764.

I will have to see about an error log not looked for one before.

don't worry about the error log, 764 means that the owner has RWX (Read, Write, Execute), Group has Read,Write, and world (Everyone) has read permissions.

apache needs execute access in any directory it serves images from, so the permissions on folders should be 755 (or 751, but we wont get into unix permissions here).

sweede 02-17-2008 05:33 PM

CremeEgg, try this.

delete your armory/images folder (don't delete the armory folder), hopefully you do not need to get your host involved due to permission issues.

open up functions_wowcharcode.php and find the line

Code:

mkdir($full_image_path ,0777,true);
Replace that line with all of the following

Code:

$dirs  = explode("/",dirname($image_loc));
$path = DIR . "/" . $localpath;
foreach ($dirs AS $element)
{
  $path .= $element . "/";
  @mkdir($path ,0777,true);
  if(!chmod($path,0755))
 {
    echo "error chmod'ing $path";
 }
}


CremeEgg 02-17-2008 05:33 PM

Quote:

Originally Posted by sweede (Post 1445326)
don't worry about the error log, 764 means that the owner has RWX (Read, Write, Execute), Group has Read,Write, and world (Everyone) has read permissions.

apache needs execute access in any directory it serves images from, so the permissions on folders should be 755 (or 751, but we wont get into unix permissions here).

Works fine now thanks. My *nix skills are weak, don't really have much to do with it anymore.

sweede 02-22-2008 08:30 AM

Just as a notice, I plan on updating this in a few days.

Changes will include a more absract method of retreiving and storing character data from the armory. This will be a set of class methods that anyone can use to get , cache and display armory data.

Much better method of selecting what attributes to display. I'm also currently trying to figure out how to make character "roles" work, but am unsure if that would be a possibilty or even a wise idea, due to the amount of setup on the end users part it would require.

I would estimate a week or two before i have an update ready. If anyone has suggestions or any requests, let me know.

Gooner 02-24-2008 02:43 PM

Would it be possible to make the users names interactive on the forums? based on usergroup permissions.

for example your name on your post "SWEEDE" would display your player stats... but obviously not ever on the forum will use there in game name to have the option through Cpanel to turn interactivity for your name on.

hinch 02-26-2008 09:02 AM

Just installed this and it works great but at the same time throws up some mkdir errors.

Line in question is
PHP Code:

mkdir($full_image_path ,0777,true); 

I've attached a screenshot so you can see the errors its throwing up

sweede 02-26-2008 11:14 AM

Quote:

Originally Posted by hinch (Post 1451283)
Just installed this and it works great but at the same time throws up some mkdir errors.

Line in question is
PHP Code:

mkdir($full_image_path ,0777,true); 

I've attached a screenshot so you can see the errors its throwing up


Change that line to my post above, ( https://vborg.vbsupport.ru/showpost....5&postcount=56 )
change the
@mkdir($path ,0777,true);
to
@mkdir($path ,0777);

That should fix the problem.

hinch 02-26-2008 01:12 PM

yup appears to have fixed it looking good thanks

hinch 02-26-2008 01:33 PM

I also added this into my postbit but there's a much easier way of doing it than the one listed above.

Create a custom profile field for users called whatever you like in my case i called it wow main char. (field11)

user puts in the name of their wow char there.
Then i just edited the postbit_legacy and added in the following

Code:

<if condition="$post[field11]">
<br />
<strong>WoW Char:</strong> <a style="cursor: pointer;" href="http://eu.wowarmory.com/character-sheet.xml?r=Al%27Akir&amp;n=$post[field11]" target="new" onmouseover="ajax_showTooltip(&quot;http://www.furious-angels.com/ajax.php?do=wowcharcode&server=Al'Akir&char=$post[field11]&quot;,this); return false" onmouseout="ajax_hideTooltip()">$post[field11]</a>
</if>


Mother_Dee 02-27-2008 08:19 PM

I apologize if I missed this, but our guild resides on a server with an apostrophe (Kael'thas) and I'm having issues:

The Armory pulls up those urls as:
character-sheet.xml?r=Kael%27thas&n=CHARNAME

not as:
character-sheet.xml?r=Kael'thas&n=CHARNAME

(ok well it does, sometimes, but the program doesn't give me information in mouseovers unless it's pulling up the top one, which is changed to the bottom or one with a released apostrophe on a refresh.)

So at this point I either get a very gimped version with only the username and guild and nothing more, and then on refresh of a thread I get absolutely nothing, a hang-up, or an armory error regarding the server not being found.

This would be nice to play around with, anyone have any further thoughts? I've played around a bit and haven't been able to find a work-around.

hinch 02-28-2008 06:16 AM

I'm on Al'Akir also with the apostrophe and it worked fine setting the default to Al'Akir in the admin options you dont need to put the %27 in yourself just list the server name with the apostrophe and it should work it out its self when it does the armoury request.

yours not showing data could be armoury time out.

Mother_Dee 02-28-2008 12:32 PM

Yes, it seems the Armory crapped out for a good portion of the time before my raid. It worked fine after the raid ended, I apologize. What bizarre errors it was giving me, it definitely threw me for a loop there.

Thanks again, works great. :)

sweede 02-28-2008 09:39 PM

Quote:

Originally Posted by Mother_Dee (Post 1452453)
I apologize if I missed this, but our guild resides on a server with an apostrophe (Kael'thas) and I'm having issues:

The Armory pulls up those urls as:
character-sheet.xml?r=Kael%27thas&n=CHARNAME

not as:
character-sheet.xml?r=Kael'thas&n=CHARNAME

(ok well it does, sometimes, but the program doesn't give me information in mouseovers unless it's pulling up the top one, which is changed to the bottom or one with a released apostrophe on a refresh.)

So at this point I either get a very gimped version with only the username and guild and nothing more, and then on refresh of a thread I get absolutely nothing, a hang-up, or an armory error regarding the server not being found.

This would be nice to play around with, anyone have any further thoughts? I've played around a bit and haven't been able to find a work-around.

Ya, it works, i had to fix that issue from the original author because my char resides on Vek'nilash :)

the reason why the ' doesnt work is because of the javascript code in the HTML to call the ajax.php file to get the info from armory and display it.

HTML Code:

onmouseover='ajax_showTooltip("http://www.dramaloot.com/forums/ajax.php?do=wowcharcode&amp;server=Vek'nilash&amp;char=Dragontaru",this); return false'
For some reason, i couldnt escape ' in the URL itself using either ' or \' so i just changed it to its code counterpart.

sweede 02-28-2008 09:40 PM

Quote:

Originally Posted by hinch (Post 1451416)
I also added this into my postbit but there's a much easier way of doing it than the one listed above.

Create a custom profile field for users called whatever you like in my case i called it wow main char. (field11)

user puts in the name of their wow char there.
Then i just edited the postbit_legacy and added in the following

HTML Code:

<if condition="$post[field11]">
<br />
<strong>WoW Char:</strong> <a style="cursor: pointer;" href="http://eu.wowarmory.com/character-sheet.xml?r=Al%27Akir&amp;n=$post[field11]" target="new" onmouseover="ajax_showTooltip(&quot;http://www.furious-angels.com/ajax.php?do=wowcharcode&server=Al'Akir&char=$post[field11]&quot;,this); return false" onmouseout="ajax_hideTooltip()">$post[field11]</a>
</if>


Don't forget to change your server and/or wowarmory.com locale !

sweede 02-28-2008 10:36 PM

Quote:

Originally Posted by sweede (Post 1448577)
Just as a notice, I plan on updating this in a few days.

Changes will include a more absract method of retreiving and storing character data from the armory. This will be a set of class methods that anyone can use to get , cache and display armory data.

Much better method of selecting what attributes to display. I'm also currently trying to figure out how to make character "roles" work, but am unsure if that would be a possibilty or even a wise idea, due to the amount of setup on the end users part it would require.

I would estimate a week or two before i have an update ready. If anyone has suggestions or any requests, let me know.

Just a little info on this progress.

I have the base classes that retreive and save the character information into the database. Everything is saved and will be in 2 tables (one for basic character information such as name, class, realm, etc and the other table is for all other stats).

Now i'm going to have to takle the hardest part, which is retreiving that information from the database.

I havent fully decided how to retrive that info. I know i'll have a subclass for each character class that will gather class specific details, but what to do about hybrid classes (such as a druid, which fits into dps caster, melee, tank, healer) , im not yet sure.

The planned usage of these classes will be something like,

$armory = new character(character, server, locale);
$armory->character_process();
$armory->get_stats("basic");
$armory->get_stats("melee","defense");

$armory->character_class; // would be the characters class
$armory->character_spec; // would be an array of points spent in the tree + the main trees name
$armory->health; // health, obviously
$armory->secondary; //rage or mana

Then for things like, crit you would have
$armory->crit_chance['melee']['perc']; // % crit chance, main hand melee
$armory->crit_chance['offhand']['value']; // crit rating (off hand).
$armory->crit_chance['spell']['perc']; // Returns %% of whatever your main specs crit chance is. i.e. if your link a mage and he's a frost mage but fire crit is 30% and frost crit is 28%, it will return 28%

Everything from the armory XML page will be available.

This will be a seperate include and will be available for use in any addon that you want to get armory character data from.

With the new class methods, i'll be able to allow a better degree of customization.

It may take a bit longer than planned, since i only really have one day a week to work on coding this.

Infineon12 02-29-2008 07:25 AM

This thing is really great and i thank you for your work.

The problem i have is that like any other BBCode Manipulation (e.g. Itemstats) the things break on editing.
This makes it nearly unusable as i think.

I am currently thinking about a way to not edit the [char]Beherit[/char] in the Cache to the new Link Code, but to parse and replace thise links on the fly via javascript.

So that the code keeps [char]Beherit[/char] which also can be edited but on pageload the javascript replaces [char]*[/char] to the needed htmlCode.

Is there another way?

sweede 02-29-2008 09:19 AM

It's an issue, but it seems pretty consistent on any bbcode addition that requires a callback function.

If you add a set of bbcode through the vbulletin admin Cp panel, it will work in the quick editor just fine, but you can't add callback code through there, which is what i need to do.

the only real work around is to go to your admincp, options -> message posting interface options ,

change all 3 to "enable standard controls"

hinch 02-29-2008 12:28 PM

just a note in the current version dont know if these are bugs or what.

defence is only showing the character base defence not defence + item defence bonus.
ie: warriors showing 370 defence and not 400+ (including item bonus)

on warlocks it shows shadow damage and shadow damage crit however doesn't show fire damage crit just fire damage.
perhaps changing shadow damage crit to just spell crit would be a good idea for multiple element casters.

sweede 02-29-2008 12:46 PM

Quote:

Originally Posted by hinch (Post 1453623)
just a note in the current version dont know if these are bugs or what.

defence is only showing the character base defence not defence + item defence bonus.
ie: warriors showing 370 defence and not 400+ (including item bonus)

on warlocks it shows shadow damage and shadow damage crit however doesn't show fire damage crit just fire damage.
perhaps changing shadow damage crit to just spell crit would be a good idea for multiple element casters.

Open up functions_wowcharcode.php in your editor and find
Code:

$value["fire crit change"]
The change should be obvious :)

line 474 , change

PHP Code:

$value["defense"] = $defenses['defense']['value']; 

to
PHP Code:

$value["defense"] = $defenses['defense']['plusdefense'] + $defenses['defense']['value']; 


hinch 02-29-2008 09:44 PM

the crit change isn't so obvious as in your code you have all spell crits split off separately what i'm proposing is merging them all so they're not split off anymore since for warlocks and I assume mage's too etc your crit chance with one damage type is teh same as the other damage type excluding talents (since armoury excludes talents anyway)

sweede 02-29-2008 10:27 PM

Quote:

Originally Posted by hinch (Post 1454016)
the crit change isn't so obvious as in your code you have all spell crits split off separately what i'm proposing is merging them all so they're not split off anymore since for warlocks and I assume mage's too etc your crit chance with one damage type is teh same as the other damage type excluding talents (since armoury excludes talents anyway)

HTML Code:

<critChance rating="285">
          <arcane percent="23.34"/>
          <fire percent="32.34"/>
          <frost percent="23.34"/>
          <holy percent="23.34"/>
          <nature percent="23.34"/>
          <shadow percent="23.34"/>
</critChance>

Taken from a firemage's armory.

In the future, the crit chance returned will be based on the characters spec, which would govern their primary nuke. You will also have the option to display the max crit rate and all schools individual crit rates.

pewp 03-01-2008 02:57 AM

This is awesome!

Is there any way to add like custom fields in the mouseover? perhaps custom images per character?

I'm also noticing that some of the gear bonuses aren't showing. my tankadin is only showing 370 defense.

Gooner 03-01-2008 08:34 AM

i get this error when it fetches data for a level 39.... but i get no error with level 70's

Quote:

Warning: Invalid argument supplied foreach() in includes/functions_wowcharcode.php on line 811

sweede 03-06-2008 11:22 AM

Quote:

Originally Posted by Gooner (Post 1454266)
i get this error when it fetches data for a level 39.... but i get no error with level 70's

Your lvl 39 character has no professions or just one profession ?
please post (or pm) me the armory URL of the character that causes an error.

maevonee 03-06-2008 07:07 PM

Its not working for me. When I scroll over it gives me an x for character avatar then just says LEVEL:

maevonee 03-07-2008 06:48 PM

Can I get some help please.


All times are GMT. The time now is 06:34 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.01512 seconds
  • Memory Usage 1,872KB
  • 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
  • (10)bbcode_code_printable
  • (3)bbcode_html_printable
  • (4)bbcode_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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