hello all,

i have a website like forum not exactly forum but similar. honestly, i bought it cos i didnt have any idea for php. but something about linking is not as i want. for example:

when i link some webpage it shows the link

Click Here

but i want a system to show link link

hello

here hello is just an example. it must depend whatever a user writes.

i want exactly in textbox to choose a word by mouse and when i click link button to write the link and in message when i send it will show me "the word" which i wrote and chose before link box for linking. otherwise, if i dont choose a word before link button, it will show me the link orginally.

here are my codes about linking in system:

if ($string)
            $mesaj = preg_replace("'$string'Ui","<SPAN class=marker>$string</SPAN>",$mesaj);

$mesaj = preg_replace("'\(http://(.*)\)'Ui","<a target=blank_ href=\"http\\3://\\1\">http\\3://\\1</a>",$mesaj);

and for link box:

<input type="button" class="but" onclick="var a=prompt('<?=$language[link_adress]?>', 'http://');if(a.length>0&&a!='<?=$language[picture]?>: http://')hen('d', '(' + a + '', ')', '');" value="http://" title="link" />

if i need to write something other code please tell me...

Member Avatar
diafol

i want exactly in textbox to choose a word by mouse and when i click link button to write the link and in message when i send it will show me "the word" which i wrote and chose before link box for linking. otherwise, if i dont choose a word before link button, it will show me the link orginally.

Not exactly clear.

hmmm sorry for bad english

so i can explain like in forum i want some codes to change my system.. for example in this forum i can name links

choose a word whatever a user types and it becomes link like "hello" that i gave example before.

not only www.aaa.com

Member Avatar
diafol

OK.
You need a js dialog with 2 form fields: url and label. You need to use js to relaise the selected range it will be using - whether text was highlighted prior to button click. If so, that text should be placed into one or both of the fields. When the 'insert' button is pressed, the data should be aranged into a link and inserted into the selected range.