-
Creating a TOC, how to?
Hello everyone,
I was trying to create a TOC(Table Of Contents) script but I have no clue howto. Can anyone help me or give me a link to a website that teaches how to make one? Any help would be greatly appreciated.
Thanks.
-
-
Ummm.... <a href="link">link</a><br>, repeat? 
PHP could help, but only if your setup allows it to.
You could do a directory/file listing (there's a script around here that Twey ddi that could help), or you could use the information from a database. There might be other options as well, but those seem the most likley.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
-
Take a look at the following links and see if this is sort of what you are looking for.
http://www.dhtmlgoodies.com/scripts/...toc-maker.html
http://www.dhtmlgoodies.com/scripts/...-example2.html
Hope this helps.
-
-
testingsite: It is something like that but, with PHP(I may use that if I change into ajaxifying the whole layout)
drj33: Can you tell me where that script is Twey made? My server(which is localhost) would allow me to do anything.;p I am not using a database by the way. I think there are TOCs made of PHP which get the content of headings and print them in a managable way(most wikis have them like dokuwiki).
drj33, thetestingsite: Thanks anyways.
-
-
Hmm.... interesting.
You could do a directory listing script, then look for the <title> markup in the html. But, that might take a very long time. Not really sure, though.
here's my thread asking about a related topic... I'm sure some of these ideas could help you--
http://www.dynamicdrive.com/forums/s...ad.php?t=14078
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
-
Thanks, drj33!! I thought of doing a regexp search through the files(which are remotely included) but then again, I was not really good at regexps.
-
-
regex is complex, and confuses me, but there's no real reason to ever NEED to use it... it just saves time. Instead of manually using 8 ifs, several while loops and such, you can just use a regex to do it by itself.
But.... not sure how it would help here.
If you did want to parse through the html, just split at the position at which <title> occurs, then again at </title>.
You could use explode too, and just use
list($null,$varyouwant) = explode('<script>',$html,2);
list($varyouwant,$null) = explode('</script>',$varyouwant,2);
where 2 is the limt of parts in case <title> accidentally appears twice, so it's not messy on the php end of things. But that might be a little innefficient... I dunno. I tried something like it recently but it was VERY slow, but it might be faster if you're not using remote files, if you're using local files without using an include statement and output buffer like I was.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
-
drj33: Well, let me try that.Thanks again!!
-
-
Hmm... no clue why I put <script> and </script> there.... I meant title.
Oh well.
Daniel -
Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks