PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Hi guys,
I am not sure whether the title used is appriopriate to the I have. I am developing a multilingual site. It is a kind of a news site. The problem I have is that my boss wants it to be created in this way that when a user clicks on a word definition of its to be shown in a new window. My first idea was to create a function which will be invoked before the text is displayed(The text is got from a database) and replaces all words which casn be found in our dict table(I am not sure whether I am clean enough so:
We have minister as a word.
Before it is printed all words are checked and this is found in the dict table.
Then we replace it with
Must the definitions be accessible, without the user's interaction of more than a click, from the page?
The problem with pouring links all over the page is your pages become link farms. This is not very useful to many people as it's not very simple and takes far too long to process.
If the definitions must be accessible from the page, I would give the user a dictionary lookup form they can write a word or phrase into themselves.
I do agree with you and I though about a creation of a JavaSript function but then I will have to separate each word in a span or another container because for example "onClick" or "onDoubleClick" require it. There are such sites which do this witha float block of text. Even here in this forum when you post a code you have a link to http://www.php.net within each function. Any suggestions?
The code we run here links only the function names. That's handled before the page is sent. I prefer processing as much as possible on the server.
If you must incorporate the links to the dictionary data, I would suggest only linking the first time the word appears and using CSS to set those links apart from standard links. Whether you do it through Javascript or not is up to you though.
Sorry, feyd but I do not get what you mean by showing it only the first time. How do I know whether this is the first time?Which is the user(I do not require users to be register to use this function)? What kind of identifier on user;'s browser to use(Cookie) etc.?
If I misunderstood you, please excuse me and giving me some more explnatory post would be great.
user___ wrote:Sorry, feyd but I do not get what you mean by showing it only the first time. How do I know whether this is the first time?Which is the user(I do not require users to be register to use this function)? What kind of identifier on user;'s browser to use(Cookie) etc.?
If I misunderstood you, please excuse me and giving me some more explnatory post would be great.