|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
I have a question. How a can do autolink? For example, if I wrote 'INTEL', it must changing on the www.intel.com.
But if I wrote Intel Pentium it mustn`t change. |
|
#2
|
|||
|
|||
|
what i would do
okay here is what I have done for my site, and you can see it other places...
I have a table, call it tags. In the table I have two rows, tag, and replace, or something to that affect. In the tag row I place <a href=" then I have another one "> and one more </a> now in replace, I have [link], [midlink], [/link] in the page, I use PHP Code:
and finally, in the text you want to replace the tag in, PHP Code:
Now the user basically writes this when they want a link: [link]www.intel.com[midlink]Intel.com[/link] I jsut placed a link, and this isn't what devarticles does... but it will look like this anyway! intel.com\ this is useful for other replacing methods, which is why I use it, although a quicker way of linking would be better maybe. But this is what I do.
__________________
hey it's the CHARKING |
|
#3
|
|||
|
|||
|
Thank. But...
If I write Intel Pentium then script will show intel Pentium, but I need that if I want say about company it must change, but if write about company product it mustn`t change. And also, how I can do that in the final os story script write last news on this topic. For example, If write about Intel company script must wtite last news about Intel. ![]() |
|
#4
|
|||
|
|||
|
okay, well with the metod I descrived, it wouldn't change intel pentium to intel pentium, only if you wrote:
[link]http://www.intel.com[midlink]intel[/link] pentium... get it? It depends on repacing the bracketed words with html... an dI really didn't understand your second question, can you try to clarify? thanks |
|
#5
|
|||
|
|||
|
Quote:
Yes, of course. My english is bad, sorry I wanted say: "Related topics" For example, as on www.theinquirer.net, where in the final of story script put links on news of that subject. Look: subject of article - "New processors from Intel" and in the end of story will be write : "New processors from AMD" "New chip from Intel" e.t.c Thank. |
|
#6
|
|||
|
|||
|
hmm I've never thought about it, but here is my guess:
i would say that if this is news you are CREATING, just have a news title (which I'm sure you would anyway), and after you have set all that up, do this query: PHP Code:
this should query the table for titles similar to the one you already queried for. If a user were to search, simply use the search terms instead of the $title. Hope this helps, and works. I have never thought of it before, I think I should do something like this! |
|
#7
|
|||
|
|||
|
Ok. Thank.
But I decided, that i will use else one field - meta. When author publish news, he must obliged to fill in a field Meta. When he will posting script sends query to MySQL. News with identical meta will write bellow. How are you think: what more preferable for news storage: text(*.php, *.html, *.txt) file or database? Now I use text files but I think that better is a MySQL. |
|
#8
|
|||
|
|||
|
hmm, i don't know much about the differences between text and database. but I'l go start a thread for us on it, cause I'm interested also!
edit: here is the link to the thread: text vs database |
|
#9
|
|||
|
|||
|
I will use and database and text file.
Thank you thecharking Now I am ready to the next feats Oh, look here $topic_title = "How change button colors in 2.0.6"; $topic_title_ar = explode(" ", $topic_title); while (list ($line_num, $line) = each ($topic_title_ar)) { $topic_title_some = trim("$line"); } where mistakes? |
|
#10
|
|||
|
|||
|
sorry i'm not very good at php, that didn't make much sense to me... uh, what does it do? does it give errors? you may need to enlist someone a bit more proficient in php... sorry.
|
|
#11
|
|||
|
|||
|
nothing...
Thank you. You helped me. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Autolink |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|