phpBB Forum

It is currently Wed 23. May 2012, 17:12

All times are UTC + 1 hour

Forum rules


Hello dearest user and welcome to our EQDKP-Plus support forum.

Please read the following rules and terms before posting anything! Failure in doing so will result in being ignored or being banned. Posting in our boards means you have read, understood and accepted those rules.

English Board Rules – Click here



Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
Online
 Post subject: Need some PHP Help
PostPosted: Fri 25. Mar 2011, 06:35 

Joined: Sat 7. Mar 2009, 07:36
Posts: 117
Hello, I modified LastItems for EQ2 to link the information from zam, I have looked all over and can not seem to find any help. Basically I am having problems with an (') apostrophe, I know apostrophe is a reserved character but the Item shows properly when being taken from the database and showing the item that was looted but not when its in the URL link. Any help or someone that could point me in the right directions. Thanks...



Top
 Profile  
 
Offline
 Post subject: Re: Need some PHP Help
PostPosted: Fri 25. Mar 2011, 18:48 

Joined: Sat 20. Feb 2010, 10:16
Posts: 115
when you want to use an apostrophe and display it as an apostrophe write
Code:
\'


Les seins c'est comme les trains électriques : c'est fait pour les enfants mais c'est papa qui joue avec



Top
 Profile  
 
Online
 Post subject: Re: Need some PHP Help
PostPosted: Sat 26. Mar 2011, 01:04 

Joined: Sat 7. Mar 2009, 07:36
Posts: 117
I'm aware of using the slash, basically the Item is entered into Raids/Items, it's then posted on the frontpage with lastitems module. I replaced the code and have a script running to read the url and show the itemstats from zam.com. I just want it to show just like it does but the url link comes out as items:whatever instead of whatever'this is for example.
Or just mouse over yourself so you can see what I'm talking about: http://www.darknyc.com/ccdkp



Top
 Profile  
 
Offline
 Post subject: Re: Need some PHP Help
PostPosted: Sat 26. Mar 2011, 01:09 
Core-Developer
User avatar

Joined: Wed 10. Dec 2008, 13:06
Posts: 9025
Location: Heilbronn, Germany
Code:
$newitemname = str_replace("'", ":", $olditemname);

this will replace the ' to a :
Should work ;) (is that was the question..)


Support my work:
Image Image
Donate your played PS3 games:
Alternative: Donate your played Playstation3 games (PAL, Region Code 2).



Top
 Profile  
 
Online
 Post subject: Re: Need some PHP Help
PostPosted: Sat 26. Mar 2011, 05:35 

Joined: Sat 7. Mar 2009, 07:36
Posts: 117
Well I don't need to replace it, I need to actually post it.. Here is an example.

Lets say the item looted is called "Ranger's Bow"

so $item['name'] = Ranger's Bow

in LastItems module $html->itemstats_item(stripslashes($item['name']))

So it will say - Ranger's Bow Whoeverlooted (5 dkp) or whatever dkp they spent....

Now I changed the link to instead of linking to the item in eqkp to
'http://eq2.zam.com/wiki/EQ2_ITEM:'.$item['name']

so the script I have running will read that link and show the tooltip of the itemstats when you mouseover.

But the way it is now, if the item has a ' in the name all it shows is:

http://eq2.zam.com/wiki/EQ2_item:Ranger

the 's bow falls off so the tooltip no longer works it should read:

http://eq2.zam.com/wiki/EQ2_item:Ranger's Bow

Anyway I hope that makes sense. I don't know enough about PHP to fix it myself. Thanks for all the help...



Top
 Profile  
 
Offline
 Post subject: Re: Need some PHP Help
PostPosted: Sat 26. Mar 2011, 10:24 
Core-Developer
User avatar

Joined: Wed 10. Dec 2008, 13:06
Posts: 9025
Location: Heilbronn, Germany
no idea. this is tricky. maybe urlencode....


Support my work:
Image Image
Donate your played PS3 games:
Alternative: Donate your played Playstation3 games (PAL, Region Code 2).



Top
 Profile  
 
Online
 Post subject: Re: Need some PHP Help
PostPosted: Sun 27. Mar 2011, 05:05 

Joined: Sat 7. Mar 2009, 07:36
Posts: 117
Basically what I don't understand is why does it show it properly as plain text in the LastItems module but not in the URL link I'm trying to display?



Top
 Profile  
 
Offline
 Post subject: Re: Need some PHP Help
PostPosted: Sun 27. Mar 2011, 09:33 

Joined: Sat 20. Feb 2010, 10:16
Posts: 115
These links are the same. Is there a way to get all codes from this site?

http://eq2.zam.com/wiki/EQ2_item:Ranger's Bow

http://eq2.zam.com/db/item.html?eq2item ... 0233e22831


Les seins c'est comme les trains électriques : c'est fait pour les enfants mais c'est papa qui joue avec



Top
 Profile  
 
Online
 Post subject: Re: Need some PHP Help
PostPosted: Mon 28. Mar 2011, 05:35 

Joined: Sat 7. Mar 2009, 07:36
Posts: 117
It would be too much work to link up each item with their item number, basically their script which is placed in overall_footer will parse everything on the page including eqdkp-plus and make the tooltip as long as its in that form etcetc/eq2_item:name of the item here...


I'm sure I'll figure it out soon enough and will post it in mods section, since it can be used for just about anything Rift, EQ1, EQ2, Warhammer, LOTRO, etc, etc...



Top
 Profile  
 
Online
 Post subject: Re: Need some PHP Help
PostPosted: Thu 31. Mar 2011, 06:50 

Joined: Sat 7. Mar 2009, 07:36
Posts: 117
This works:

<a href='http://eq2.zam.com/wiki/EQ2_Item:".rawurlencode($item['name'])."'>".$html->itemstats_item(stripslashes($item['name']))."</a>

So basically this will convert the item to a tooltip instead of a link to the item's page on eqdkp-plus. All you have to do is add this to the footer page before </body> :

<script type="text/javascript" src="http://common.allakhazam.com/shared/zampower.js"></script>



Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

(C) The EQdkp-Plus Developer Team
EQdkp Plus Template by Ramon Kaes