forums.eqdkp.com: Tearing hair out, no socket images... - forums.eqdkp.com

Jump to content

  • (2 Pages) +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

Tearing hair out, no socket images... Rate Topic: -----

#1 User is offline   milali

  • Member
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 19-September 06

Posted 06 March 2007 - 04:45 AM

Hi guys I have looked through the previous posts about no socket images and tried all of their solutions. None of them are working.

After every change, I would clear the item_cache and try again and it never shows them you just get a word Red and then Red Socket after it

The site is http://www.sacrifice...hpbb/portal.php

checking the item_html table it is

<table cellpadding='0' border='0' class='borderless'>
	<tr>
		<td valign='top' class='itemicon'>
			<img class='itemicon' src='{ITEM_ICON_LINK}'>
		</td>
		<td>
			<body>
<div class='wowitem wowitemlive'>
<span class='iname'><span class='purplename'>Wrynn Dynasty Greaves</span></span><br />
Binds when picked up<br />
Legs<span class='wowrttxt'>Plate</span><br />
1110 Armor<br />
+20 Strength<br />
+42 Stamina<br />
<span class='esock'><img src='/images/redsocket.png' alt='red' />  Red Socket</span><br />
<span class='esock'><img src='/images/yellowsocket.png' alt='yellow' />  Yellow Socket</span><br />
<span class='esock'><img src='/images/yellowsocket.png' alt='yellow' />  Yellow Socket</span><br />
<span class='esock'>Socket Bonus: +6 Stamina</span><br />
Requires Level 70<br />
<span class='itemeffectlink'>Equip: Increases defense rating by 23.</span><br />
<span class='itemeffectlink'>Equip: Increases your dodge rating by 25.</span><br />
{ITEMSTATS_LINK}</div>
		</td>
	</tr>
</table>


now to me the esock stuff is all wrong.

The settings for the sockets in the config file ( I also tried locally it made no difference to it)
define('path_sockets_image', 'http://wow.allakhazam.com/images/');


Any info would be desperately appreciated I'm dieing here :(

Mils

#2 User is offline   Dazza

  • EQdkp Moderator
  • PipPipPip
  • Group: EQdkp Administrators
  • Posts: 384
  • Joined: 13-February 06
  • Gender:Male
  • Location:Newcastle, Australia
  • Interests:Graphic Design, Web Development, Tennis, Guitar

Posted 06 March 2007 - 05:45 PM

Despite not having used itemstats for a while myself, it's clear what your problem is to me, and it's nothing to do with the configuration of your itemstats whatsoever.
May I direct your attention to the following lines:
<span class='esock'><img src='/images/redsocket.png' alt='red' />  Red Socket</span><br />
<span class='esock'><img src='/images/yellowsocket.png' alt='yellow' />  Yellow Socket</span><br />
<span class='esock'><img src='/images/yellowsocket.png' alt='yellow' />  Yellow Socket</span><br />


The "problem" lies within the source for the images:
src='/images/yellowsocket.png'


Notice that this link is a relative link. What this means is, whatever page you load up where this text is, there needs to be a sub-directory called images, and it has to have the gem item images in it.
That is the simple problem and solution.

However, this is a rather unfortunate predicament. You might notice that because the link is a relative one, if you load a page from any directory with item links in them (say, <eqdkp_root_path>/, <eqdkp_root_path>/admin/, <forum_path>/, <forum_path>/admin, etc...) each one of those folders needs a duplicate icon stored there so it will display there. Kind of a problem.
The solution would be to alter the item_cache's item html code. If possible, I would recommend adding a parsing routine in the allakhazam database querying script, that takes the item html, finds these relative image links, and replaces them with absolute ones. I believe that the item icon images already does this.

Of course, because I haven't used itemstats in a very long time, I might have made a very inaccurate assumption of what's going on behind the scenes in itemstats. Still, the problem is those relative links, and how you go about rectifying it is up to you.

#3 User is offline   milali

  • Member
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 19-September 06

Posted 06 March 2007 - 08:25 PM

cool! I shall try the quick fix of the images folder being in relative places, and then i'll look at the itemstats code

yeah to me the relative path seemed wrong but there was some parsing code which appeared to parse that like and change it, but i'm not sure it does.

will give it a go and get back to you

thank you
Mils

#4 User is offline   milali

  • Member
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 19-September 06

Posted 07 March 2007 - 06:48 AM

sadly these didn't work

I even set this to the exact directory i put the images in.

define('path_sockets_image', 'http://www.sacrifice-guild.net/phpbb/images/');


anyone run into this problem where the socket gem image is just a word?

#5 Guest_JCinDE_*

  • Group: Guests

Posted 07 March 2007 - 07:34 AM

The problem is in how ItemStats parses data from Allakhazam. It seems Allakhazam changed its design slightly after the parser was written. I fixed it like so...

open includes/allakhazam.php

Go to line 105

				if (preg_match_all('#<img class="esock" src="/images/(.*?)\.png".*?/>#s', $item['html'], $matches_sockets))
				{
					foreach ($matches_sockets[0] as $key_socket => $match_socket)
						$item['html'] = str_replace($matches_sockets[0][$key_socket], '<img src="' . $path_images_sockets . $matches_sockets[1][$key_socket] . '.png" alt="' . $matches_sockets[1][$key_socket] . '"/>', $item['html']);
				}


replace it with


				if (preg_match_all('#<span class="esock"><img src="/images/(.*?)\.png".*?/>#s', $item['html'], $matches_sockets))
				{
					foreach ($matches_sockets[0] as $key_socket => $match_socket)
						$item['html'] = str_replace($matches_sockets[0][$key_socket], '<span class="esock"><img src="' . $path_images_sockets . $matches_sockets[1][$key_socket] . '.png" alt="' . $matches_sockets[1][$key_socket] . '"/>', $item['html']);
				}


After this, you will unfortunately need to cleare your entire item cache table and let ItemStats download all the information again.

#6 User is offline   milali

  • Member
  • Pip
  • Group: Members
  • Posts: 10
  • Joined: 19-September 06

Posted 07 March 2007 - 03:51 PM

thank you so much!

This should be in the itemstats sticky as its a problem with the current release!

THANK YOU JC!

Mils

#7 Guest_ROGUE-Master_*

  • Group: Guests

Posted 14 March 2007 - 09:37 AM

How do you clear the cache table?

#8 User is offline   Dazza

  • EQdkp Moderator
  • PipPipPip
  • Group: EQdkp Administrators
  • Posts: 384
  • Joined: 13-February 06
  • Gender:Male
  • Location:Newcastle, Australia
  • Interests:Graphic Design, Web Development, Tennis, Guitar

Posted 14 March 2007 - 02:59 PM

View PostROGUE-Master, on Mar 15 2007, 04:37 AM, said:

How do you clear the cache table?


Go into your database, and run the following SQL:

TRUNCATE TABLE item_cache;


You might want to export and save what you have before you do that, just in case it's useful again at some point in time.

#9 Guest_Bachida_*

  • Group: Guests

Posted 16 March 2007 - 08:38 AM

thank you for the fix posted above, working great except on meta sockets
anyone had any trouble or luck with those?
red, yellow, and blue all show fine after your fix, but meta still just says "meta Meta Socket" no graphic
so close... lol

#10 User is offline   Therius

  • Member
  • Pip
  • Group: Members
  • Posts: 13
  • Joined: 17-February 06

Posted 19 March 2007 - 05:53 AM

Quote

thank you for the fix posted above, working great except on meta sockets
anyone had any trouble or luck with those?
red, yellow, and blue all show fine after your fix, but meta still just says "meta Meta Socket" no graphic
so close... lol


Exact same issue here.

#11 Guest_ChiliVB_*

  • Group: Guests

Posted 21 March 2007 - 02:15 PM

JC, your fix for displaying sockets worked for me also. Thank you for taking the time to post it.

I had started the day wanting to fix this on our forums and upgraded the itemstat versions which opened a new can or worms. But at least the original problem is resolved. :rolleyes:

#12 Guest_WavArt_*

  • Group: Guests

Posted 22 March 2007 - 08:55 PM

Fixed worked also for me...

Thanks to my nephew this quick and dirty fix.. worked on our server.

META SOCKET FIX

AFTER doing JC fix to line 105...

ADD this. to all your alakazam.php's

Directly under JC's lines


                   if (preg_match_all('#<span class="emsock"><img src="/images/(.*?)\.png".*?/>#s', $item['html'], $matches_sockets))
                                {
                                        foreach ($matches_sockets[0] as $key_socket => $match_socket)
                                        $item['html'] = str_replace($matches_sockets[0][$key_socket], '<span class="emsock"><img src="' . $path_images_sockets . $matches_sockets[1][$key_socket] . '.png" alt="' . $matches_sockets[1][$key_socket] . '"/>', $item['html']);
                                }


I have itemstats setup for both phpBB and eqDKP .. only edited one of the alakazam.php's .. doh!.. found other tho.. happy hunting!

Thanks in advance.

Art.

#13 Guest_Pup_*

  • Group: Guests

Posted 05 April 2007 - 07:02 AM

Just some extra info that may be useful to some.

To make the socket code work for standard and meta sockets, instead of adding an extra search you can combine it into one statement :

				if (preg_match_all('#<span class="(em?sock)"><img src="/images/(.*?)\.png".*?/>#s', $item['html'], $matches_sockets))
				{
					foreach ($matches_sockets[0] as $key_socket => $match_socket)
						$item['html'] = str_replace($matches_sockets[0][$key_socket], '<span class="' . $matches_sockets[1][$key_socket] . '"><img src="' . $path_images_sockets . $matches_sockets[2][$key_socket] . '.png" alt="' . $matches_sockets[2][$key_socket] . '"/>', $item['html']);
				}


Also remember to change the same statement further down the allakhazam.php file (near line 220) as this is pretty much the same function, but for when you use an item id, rather than a name.

One other bug that I have noticed, is if you want to specify your own location for the socket images, currently this does not work and with the above fix will still only use allakhazam's images rather than what you specify in config_itemstats.php

On line 100 & 217 change :
				// Replace Image socket
				if (defined(path_sockets_image) == true)
					$path_images_sockets = path_sockets_image;
				else
					$path_images_sockets = "http://wow.allakhazam.com/images/";



to :

				// Replace Image socket
				if (defined('path_sockets_image') == true)
					$path_images_sockets = path_sockets_image;
				else
					$path_images_sockets = "http://wow.allakhazam.com/images/";


Hope this helps

#14 Guest_lundorg_*

  • Group: Guests

Posted 07 April 2007 - 04:41 AM

That great guys thanks a lot. I'm running itemstats on a Joomla install and have had some real pain with it but thank to this and a couple of other forums I have it working a treat. :D

#15 User is offline   mikedoh

  • Member
  • Pip
  • Group: Members
  • Posts: 22
  • Joined: 01-June 06

Posted 19 April 2007 - 01:58 AM

Thanks for the help, works 100% for me!

1 small question though

When you truncate the database for itemcache, is that in PHPmyadmin ?

  • (2 Pages) +
  • 1
  • 2
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users