collapse collapse
* User Info
 
 
Welcome, Guest. Please login or register.
* Search

* Board Stats
  • stats Total Members: 989
  • stats Total Posts: 18363
  • stats Total Topics: 2500
  • stats Total Categories: 7
  • stats Total Boards: 35
  • stats Most Online: 1144

Author Topic: Conversion from link to text  (Read 1988 times)

0 Members and 1 Guest are viewing this topic.

Offline onekman

  • BeBot Rookie
  • *
  • Posts: 15
  • Karma: +0/-0
Conversion from link to text
« on: May 16, 2008, 05:31:42 pm »
Hi :)

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

Offline Blueeagle

  • Omnipotent
  • BeBot Hero
  • ******
  • Posts: 323
  • Karma: +0/-0
Re: Conversion from link to text
« Reply #1 on: May 17, 2008, 06:46:43 pm »
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.
The only problem that can't be solved by adding another wrapper is having too many wrappers.

Offline onekman

  • BeBot Rookie
  • *
  • Posts: 15
  • Karma: +0/-0
Re: Conversion from link to text
« Reply #2 on: May 17, 2008, 07:43:39 pm »
exactly what I needed :) thx alot


« Last Edit: May 17, 2008, 09:08:36 pm by onekman »

 

* Recent Posts
[AoC] special char for items module by bitnykk
[February 09, 2024, 09:41:18 pm]


0.8.x updates for AoC by bitnykk
[January 30, 2024, 11:16:08 pm]


0.8.x updates for AO by bitnykk
[January 30, 2024, 11:15:37 pm]


BeBot still alive & kicking ! by bitnykk
[December 17, 2023, 12:58:44 am]


Bebot and Rasberry by bitnykk
[November 29, 2023, 11:04:14 pm]

* Who's Online
  • Dot Guests: 742
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.
* Forum Staff
bitnykk admin bitnykk
Administrator
Khalem admin Khalem
Administrator
WeZoN gmod WeZoN
Global Moderator
SimplePortal 2.3.7 © 2008-2024, SimplePortal