News:

Wondering if this will always be free?  See why free is better.

Main Menu

WoW - World of Warcraft Tooltips

Started by Garou, March 28, 2009, 04:31:05 AM

Previous topic - Next topic

Garou

Well for starters you've the java script calls in there twice.

Change...
      // ]]></script>

<script src="http://www.wowhead.com/widgets/power.js"></script>
<script src="wow/jquery-1.3.2.min.js"></script>
<script src="wow/wowhead_linker.js"></script> ';

   echo '
</head>
<script src="http://www.wowhead.com/widgets/power.js"></script>
<script src="wow/jquery-1.3.2.min.js"></script>
<script src="wow/wowhead_linker.js"></script>
<body topmargin="0">


To...
      // ]]></script>

<script src="http://www.wowhead.com/widgets/power.js"></script>
<script src="wow/jquery-1.3.2.min.js"></script>
<script src="wow/wowhead_linker.js"></script> ';

   echo '
</head>
<body topmargin="0">


Make sure the file permissions for the wow folder is set to 644 or 755. If that doesn't work ( I have a feeling it wont) you'll have to talk to your host and find out if they are using ModSecurity or some similar program.  There is a problem with some server security software that is causing a false positive with the System Command Injection and this script.

tanyril

Yo Garou, do you know how we can get rid of the font size and background color change made when the text is parsed and just use the size in the post with no background color?

Garou

Its in the wowhead php file in the wow folder. Ill have to look it up when I get home.

If you are using a white background for your theme you will want to change it to a different color other then white otherwise you wont be able to see anything that wowhead uses white text for, like common quality items.

Ill dig through the code in a few hours when I can get to a real computer. :D

Garou

Ouch was I wrong LOL

Its in ./Sources/Subs.php

Find...
'content' => '<b><a style="background-color:#303030" href="wow/wowhead_wrapper.php?item=$1" class="wowhead">[$1]</a></b>',

To change the background to another color replace #303030 with a different color code.

To remove the background all together replace with...
'content' => '<b><a href="wow/wowhead_wrapper.php?item=$1" class="wowhead">[$1]</a></b>',

Again I don't recommend this and any color you change the background to shouldn't be similar to the other quality colors as you wont be able to see the text.

As for the font and font size there isn't anything in the mod that effects those. Its actually imports the font styles that Wowhead is using on their site.

Your other option be to use something like...
[url=http://www.wowhead.com/?item=30987]Lightbringer Faceguard[/url]
instead of the "wow" tag.

Carya

Alrighty. First off hi hi, and thanks much for taking on this mod and getting it working in SMF. :) That having been said, wish I could say I got it working!

Here's where I am:
- Using 1.9 -- does this matter? Just upgraded tonight before trying to install this mod.
- 100% sure I installed it right.
- 100% sure fopen and libcurl are installed. (I used the attachment stfox provided, thanks much).
- mod_security is NOT an issue
- Fiddled up and down with permissions and left them at 755. Tried 777, 755, and the behavior is the same.
- The [url=http://www.wowhead.com/?item=30987]Lightbringer Faceguard[/url] works fine.
- Added the code $wowhead_use_fopen = 0; to force use of libcurl, that didn't change anything.
- Tried $wowhead_use_fopen = 1; and that didn't work either.
- Nothing looks amiss in the suexec log or error_log
- when I click on the link that is the output of the [wow][/wow] command I end up at the forum home page.

So... I'm at a loss...

1) When I mouse over the output of [wow]Lightbringer Faceguard[/wow] am I supposed to see a URL that looks like
blahblahblah/forum/index.php/wow/wowhead_wrapper.php?item=Lightbringer%20Faceguard
and if not what should it look like. I am no php expert (other languages, not php) but you'd think from the xml call, it'd grab the item id and embed the link with the other ones right and use the javascript that is working? That is the idea?

2) Is there a forum where this is working where I can go take a look?

3) Erm. I want there to be a three so I can figure this out.

Garou

When I modified Horis' original code on my test server at home it worked fine right out of the box. It worked fine for the SMF approval team or the mod would never have been approved.

My test server is Xampp and I didn't have to tweak a thing in it to make this work. I'm just using their default settings in the install.

*sigh* If your host isn't using mod security or a similar type program I don't know what what else the issue could be.

Ive got a site under construction for the mods Ive been working on be they mine or someone else's.
The demo thread for the mod is http://smf.balancegames.net/index.php?topic=2.msg3#msg3 at least it will give you an idea of what its supposed to do.

Right now it looks like the wowhead_wrapper.php isn't getting interpreted correctly on your site as the link to the wrapper should actually be pointing to the item on Wowhead.

The way the mod works is that the WoW tag links to the wrapper then the wrapper, along with the java script,s look for the item on Wowhead finds the quality of the item then changes the link in the forum to the proper color for the items quality and provides a link to the item on Wowhead.

The fact that so many servers are having problems with this is extremely frustrating and I honestly believe that's why Horis quit development on his original mod for phpbb and wordpress.  :(

Carya

Thanks for the response...

- Yep no mod_security here's what's compiled in the server:

Compiled in modules:
  core.c
  mod_authn_file.c
  mod_authn_default.c
  mod_authz_host.c
  mod_authz_groupfile.c
  mod_authz_user.c
  mod_authz_default.c
  mod_auth_basic.c
  mod_include.c
  mod_filter.c
  mod_log_config.c
  mod_env.c
  mod_setenvif.c
  mod_ssl.c
  prefork.c
  http_core.c
  mod_mime.c
  mod_status.c
  mod_autoindex.c
  mod_asis.c
  mod_suexec.c
  mod_cgi.c
  mod_negotiation.c
  mod_dir.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_so.c

- Yes, the frustrating thing is seeing the wrapper.php not executing at all OR producing an error page. Obviously it's translating the [wow][/wow] call correctly, so THAT part works. Because I'm seeing it translate that to the call to the wrapper right?

- So the call to the wrapper isn't being executed. I do have other mods installed -- I noted earlier that others with tinyportal installed couldn't get it to work -- I can't recall if you said you could get it to work with TP. But I do have other mods installed in their own top level directories (eg, in the forum/ directory) and they 'work.'

- The fact that clicking the link just runs me back to the forum home page -- any insight into the whys of this behavior?

- Is there a way that I can invoke this from the shell, wowhead_wrapper.php? To try to call it from a simple Php page without going through SMF... meh. I know perl, tcl, a bit of java, just you know, not php (only to hack at it). I suppose I can start trying to figure this out.

Garou

If you are using a shared or virtual server, mod security may not show up as its all setup in the hosts area of the server. I'm not sure if they can use it to effect dedicated servers. Unless you are running your own server from your business or house you may want to check with your host anyway.

Ive had never run into the issue till I switched hosts and even then my host had to get his host to do the work around as its a virtual server.

If you are using your own private server, attach your php.ini and Ill compare your settings to mine.

It shouldn't be an issue with TP as the site I originally complied this for was running TP and SMF1.1.7. Since then the guild fell apart and I havent tested on a TP site since. As you can tell from the link I put up earlier it does work with Simple Portal though.

stfox100

One other note. If you have the files set to something other than 644, it won't execute the script with the new mod security.
All files inside the WOW folder should be 644.

Garou

ok I thought you said 755. Doesnt 644 remove the rights of the owner to delete as well? That would mean that you have to have the host remove them for you, unless Im mistaken.

stfox100

644 gives the owner permission to execute, not group or public.

Garou

I was at work at the time and did the math wrong. LOL

Carya

Hi guys -- thanks much for the responses, Garou and Fox --

Here are a few answers.

- I'm root. It's run under a virtual hosted domain on a web server.

- Mod_Security: I asked with the folks who I rent the server from before I submitted first post to be -sure- and they confirmed mod_security is not supported nor part of a vanilla install of what I'm using. I never installed it. So that's why I said it's a non-issue.

- Permissions: I'm confused a bit... Are you talking umasks while I'm talking chmods? 755 would be xwrx-rx-r and 644 would be -wr--r--r and since the wrapper is php I thought it would have to be executable and readable. I know a lot of things in SMF are fussy about also being writable so I experimented between 755 and 777 on the directory. Here's what it looks like at server level.

# ls -al wow
total 72
drwxrwxrwx   2 www  www    512 Jun  1 03:38 ./
drwxrwxrwx  16 www  www   1024 Jun  1 06:07 ../
-rwxrwxrwx   1 www  www  57254 Jun  1 03:38 jquery-1.3.2.min.js*
-rwxrwxrwx   1 www  www    364 Jun  1 03:38 wowhead_linker.js*
-rwxrwxrwx   1 www  www    596 Jun  1 12:07 wowhead_wrapper.php*
# ls -al wow
total 72
drwxr-xr-x   2 www  www    512 Jun  1 03:38 ./
drwxrwxrwx  16 www  www   1024 Jun  1 06:07 ../
-rwxr-xr-x   1 www  www  57254 Jun  1 03:38 jquery-1.3.2.min.js*
-rwxr-xr-x   1 www  www    364 Jun  1 03:38 wowhead_linker.js*
-rwxr-xr-x   1 www  www    596 Jun  1 12:07 wowhead_wrapper.php*


- Ini File. I removed some things that folks might take advantage of, cookies etc. and posted it as you asked.

- Other options? Were there other options for trying to play with the wrapper xml call as a shell script or php call from the master web server (eg, not a virtual server) I suppose I could temporarily move the forum up to the web root and see what happened. Not sure what config stuff that would break. What about copy & paste the wrapper file contents into a file somewhere so that it's not having to inject into that file and essentially make it more a hack instead of an addon (meh I know) but make it a function call or something...


Carya

Oops saw you just said php.ini and not info.php. Stupid dyslexia.

Where's the php.ini file live?

Garou

Carya, the php.ini file could be anywhere depending on the server setup, there is no standard for this. If its a Linux server and you have shell access, type "locate php.ini" if its a Win server try the search function.

By file permissions we mean chmod.  :D

The wrapper creates a "virtual file" based on information it scrapes off of Wowheads site. For instance
yoursite.com/forum/wow/wowhead_wrapper.php?item=Lightbringer Faceguard should pull up an xml file like...
<wowhead>

<item id="30987">
<name>Lightbringer Faceguard</name>
<level>146</level>
<quality id="4">Epic</quality>
<class id="4">Armor</class>
<subclass id="4">Plate Armor</subclass>
<icon displayId="45684">INV_Helmet_96</icon>
<inventorySlot id="1">Head</inventorySlot>

<htmlTooltip>
<table><tr><td><b class="q4">Lightbringer Faceguard</b><br /><!--bo-->Binds when picked up<table width="100%"><tr><td>Head</td><th>Plate</th></tr></table>1483 Armor<br />+50 Strength<br />+67 Stamina<!--e--><br /><span class="socket-yellow q0">Yellow Socket</span><br /><span class="socket-meta q0">Meta Socket</span><!--ps--><br /><!--sb--><span class="q0">Socket Bonus: +4 Dodge Rating</span><br />Durability 100 / 100<br />Classes: Paladin<br />Requires Level 70</td></tr></table><table><tr><td><span class="q2">Equip: Increases defense rating by 28&nbsp;<small>(<!--r70:12:28-->11.84&nbsp;@&nbsp;L70)</small>.</span><br /><span class="q2">Equip: Increases your dodge rating by 37&nbsp;<small>(<!--r70:13:37-->1.96%&nbsp;@&nbsp;L70)</small>.</span><br /><br /><span class="q">Lightbringer Armor (0/8)</span><div class="q0 indent"><span><!--si30991-->Lightbringer Chestguard</span><br /><span><!--si30987-->Lightbringer Faceguard</span><br /><span><!--si30985-->Lightbringer Handguards</span><br /><span><!--si30995-->Lightbringer Legguards</span><br /><span><!--si30998-->Lightbringer Shoulderguards</span><br /><span><!--si34488-->Lightbringer Waistguard</span><br /><span><!--si34433-->Lightbringer Wristguards</span><br /><span><!--si34560-->Lightbringer Stompers</span></div><br /><span class="q0"><span>(2) Set: Increases the mana gained from your Spiritual Attunement ability by 10%.</span><br /><span>(4) Set: Increases the damage dealt by your Consecration ability by 10%.</span></span></td></tr></table>
</htmlTooltip>

<json>
id:30987,name:'3Lightbringer Faceguard',level:146,reqlevel:70,armor:1483,slot:1,source:[5],sourcemore:[{t:1,ti:23381,n:'Tydormu',z:3606}],classs:4,subclass:4
</json>

<jsonEquip>
slotbak:1,displayid:45684,reqlevel:70,classes:2,armor:1483,itemset:679,socket1:4,socket2:1,socketbonus:2871,defrtng:28,dodgertng:37,str:50,sta:67,dura:100,nsockets:2
</jsonEquip>
<link>http://www.wowhead.com/?item=30987</link>
</item>
</wowhead>


Then it looks in that for the items quality to color the text and replaces the link to itself with the link in the code. I don't think moving the forum would help nor would finding a way to internalize the code into SMF.


Carya

Alrighty thanks -- that helps. So I looked at the site you listed where it was working, and yep you have it working and I sure do not...

Here is the ini file. Thanks for the tip on locate. :-) Some day I need a formal sysop class.

I skimmed it and saw nothing from my meager understanding, maybe you will find something.

Garou

Got it. Ill take a look at it tonight as I leave for work in 5 minutes.  :)

trip001

#57
Hi,

I installed the mod the other day as the support of Itemstats has now ended. Currently have the same issue as in the quoted link below. Basically it is just a link to xml and no script appears to have run.
Quote from: Nana23 on April 15, 2009, 05:07:27 AM

hxxp:inrage-guild.com/index.php?topic=5.msg5#msg5 [nonactive]

Color dont work right and no tool tip shown

i run smf 1.1.9 with a separate theme. The mod doesn't work in either the default or theme, even though both have index.templates modified for this mod.

my host supports libcurl and fopen and i have changed permissions to 644 in the wow folder supplied with the mod.

Any other ideas on things i could try?

Site is hosted on hxxp:fasthosts.co.uk [nonactive]

Carya

Trip --

Can tell you now, they may want some info Re: mod_security and whether it is installed on the server and such. Check out the posts in this topic regarding mod_security.

Garou --

Thanks much :-)

Garou

Carya, I Dont know for sure that these will help for sure but I still recommend them...
magic_quotes_gpc = ON
variables_order = EGPCS

I also suggest you increase these a bit...
max_execution_time
max_input_time
memory_limit
It will help to prevent your site from timing out and preform a little better.

Nothing in that strikes me that it would actually effect the mod though but if this doesn't work I really don't know what else to tell you.  :-[

trip001, Carya is correct. mod security is the first major issue Ive come across with this mod. Then there's whatever is causing Carya's problems. The funny thing is, its acting just like the mod security issue but his host says its not running.

Advertisement: