L* R*
HOME FORUM DOWNLOADS
Content
  Links
     Browse SVN
     SVN Commit log
     Documentation (Wiki)
  Developers
     Taskmanager
User
Welcome, Guest. Please login or register.
Did you miss your activation email?
August 07, 2008, 06:48:00 PM

Login with username, password and session length
Search



Advanced search
Support GoPHP5.org
BeBot - An Anarchy Online chat automaton > Forum > Development > Coding and development discussion > Topic: Conversion from link to text
Pages: [1]   Go Down
« previous next »
Print
Author Topic: Conversion from link to text  (Read 231 times)
0 Members and 1 Guest are viewing this topic.
onekman
Freshman
*
Offline Offline

Posts: 8


Conversion from link to text
« on: May 16, 2008, 10:31:42 AM »

Hi Smiley

small ?, in a custom module of mine, I'm using a parameter after a command. This parameter is the text of an item, which I use in a SQL query in a later process. But if I take the item from inventory and drops it right after the command, it show the text of the item as a link offcourse.

The big ? is then, is it possible to convert the link into pure text, cause when I use the linktext it wont find the item when I run the SQL query.

Weird thing is, if I save the linktext into the sql db, it looks like pure text, but if I choose to print out the parameter which are holding the linktext, it will show up as a link again.

this is probably a small problem, but I havent seen to figure out a solution yet.

thx in advance.

1k
Logged
Blueeagle
Omnipotent
BeBot Developer
Expert
********
Offline Offline

Gender: Male
Posts: 313



Re: Conversion from link to text
« Reply #1 on: May 17, 2008, 11:46:43 AM »

The item references in AO are in the form '<a href="itemref://lowid/highid/ql">name of item</a>'

In the latest svn version of core('tools') you will find two functions; parse_item() and is_item(). parse_item takes a sing itemreference and returns an associative array with both IDs, the ql and the name. is_item() checks to see if the argument passed to it is an item. There is also a make_item() that takes lowid, highid, ql and name and returns an item string.

I hope that helps.
Logged

The only problem that can't be solved by adding another wrapper is having too many wrappers.
onekman
Freshman
*
Offline Offline

Posts: 8


Re: Conversion from link to text
« Reply #2 on: May 17, 2008, 12:43:39 PM »

exactly what I needed Smiley thx alot


« Last Edit: May 17, 2008, 02:08:36 PM by onekman » Logged
Pages: [1]   Go Up
Print
BeBot - An Anarchy Online chat automaton > Forum > Development > Coding and development discussion > Topic: Conversion from link to text
« previous next »
 
Jump to:  

Recent
KOS Module w/ Guild KOS
by Theoris
[Today at 02:55:00 PM]

!items bow - 0 Results
by enhance
[Today at 11:00:27 AM]

nano
by Nogoal
[Today at 09:59:30 AM]

problem with !items
by montauk
[Today at 08:43:10 AM]

Ported Modules
by Organizer
[Today at 08:41:27 AM]

Depot - an old module rev...
by kaagee
[Today at 08:40:32 AM]

Unable to parse items: er...
by Vrykolas
[Today at 07:54:54 AM]

Script module
by Veloraptor
[Today at 05:49:40 AM]

Scripts.
by Veloraptor
[Today at 03:51:12 AM]

Teamspeak manager
by enhance
[August 06, 2008, 11:11:52 PM]
Stats
Members
Total Members: 900
Latest: Theoris
Stats
Total Posts: 10143
Total Topics: 1368
Online Today: 30
Online Ever: 168
(July 01, 2007, 09:30:02 PM)
Users Online
Users: 3
Guests: 37
Total: 40
healingpower
Wobin
Zeephonz

Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC
TinyPortal v0.9.8 © Bloc | NewDef design by Bloc
Page created in 0.131 seconds with 28 queries. (Pretty URLs adds 0.036s, 4q)
Loading...