PDA

View Full Version : replace part of url with...


TECK
09-29-2002, 10:11 PM
ok the chopped url for forums is:
forumdisplay.php?forumid=10

my goal is to replace the ".php?forumid=" with a "/" so i can spider the forums. i got it do far like that:
index.php
- forum 1
- forum 2...

when you click on the list of forums, it will show me the list of threads contained in that forum (only the title and the link):
- title 1
- title 2....

when i click on the thread link, it displays the message and the title, with a link to the actual thread.

my problem is that it uses the classic links:
forumdisplay.php?forumid=2 and
showthread.php?threadid=5

so if i create a function that will replace the ".php?forumid=" with a slash (but when i click on it to still recognise that is the actual forumdisplay.php link, that will solve my problem.

i looked at overgrow's hack and i think is not a reliable piece of code. security is non existant, connection information is included on the class file, etc. i will not use it. but his idea is great. it just needs to be simplified.

i find his system complex, to split it over weeks etc. there is no need for that. just keeping the actual forums/threads order will do just fine.
same thing with fastforward's hack. i know it can be done only using vBulletin...

let me know if you have something in mind. the ugliest part (the threads indexer) is done. all i have to do is use somehow the $REQUEST_URI into it to replace the pieces of code listed above.

thanks for helping.

DrkFusion
09-29-2002, 10:19 PM
<a href="http://www.milov.nl/forum/1/82" target="_blank">http://www.milov.nl/forum/1/82</a>

The first table has something about changing extensions or urls to include slashes.

Hope it helps
-Arunan

TECK
09-30-2002, 01:45 AM
thanks, that's what i was looking for. let me quote from the post:
The php var $PATH_INFO is a string containing everything you tack onto your script url with a forward slash. It can be used to specify parameters without using questionmarks and ampersands.

I used it to replace the syntax of my forum urls:
milov.nl/forum/?board=1&thread=8&limit=0
with this syntax:
milov.nl/forum.php/1/8/0

And all I had to do was include this statement at the top of my forum script:
// get params from path_info:
list($dummy, $board, $thread, $limit) = explode('/', $PATH_INFO);

Whether urls like this actually look better is subjective of course, but it does prevent certain search engines from not indexing pages (altavista ignores most if not all urls with questionmarks in them).

i will try it now... :)

update:
ok i tried this on forumhome:
list($s, $forumid) = explode('/', $PATH_INFO);
it doesnt replace the values. i place the line just above the require global.

also, is it recommended to list only the threads? i would like to spider all content of my site...
any expert oppinion on this?

DrkFusion
10-01-2002, 12:44 AM
Sorry, I really don't understand what you need :-/

I just want to know if it worked? making the slashes etc..

I remember there is a meta tag which states in the header after howmany days you want a spider to crawl.

If this may work please tell me I will go try to find the code for you.

Sorry again
-Arunan

TECK
10-01-2002, 12:46 AM
np. it can be don only with vBulletin, by making a function, you dont need a metatag.
basically you create a function that replaces all the variables vbulletin uses to define the url with slashes.
so, this url:
|www.vbulletin.org/forum/showthread.php?postid=304446

will look like:
|www.vbulletin.org/forum/showthread/304446

but it will still point to the actual link.

DrkFusion
10-01-2002, 09:26 PM
Neat, I am guessing it is working alright?

I tried this but failed hehe, so I jut quit. Ive actually attempted this before, but just ended up quitting. Anyways, hope you will be able to bring your site up soon, alot of people are waiting :) Not to hassle you though.

Anyway goodluck
-Arunan

DrkFusion
10-01-2002, 11:55 PM
Hey when you do that slash thing, doesn't it affect your images as well when viewing it?

-Arunan

TECK
10-02-2002, 09:38 PM
i still dont know how to do this.. anyone can help me on it?
thank you.

DrkFusion
10-02-2002, 09:49 PM
I tried this, I got the url to work and all, but there are images problems, I get red X

DrkFusion
10-05-2002, 09:17 PM
Ok I have it fully working now, just need to change some template, I am not sure if the search engine are catching it I do not know how to check :-/

-Arunan