PDA

View Full Version : VB3 Easy Archive


JamesFrost
02-21-2004, 10:00 PM
OK, this isn't the nicest way of doing it I'm sure, but it works!

What this does is change the path of archive files in VB

from /forums/archive/index.php/.......

to /archive/......

In theory google should spider the archive pages better, as they do not look php generated. My archive (www.martialartsplanet.com/archive) is certainly getting google picking it up, where it was not before.

I've only tested this on one site - let me know how it goes!

colicab-d
02-22-2004, 07:52 AM
why not set your archive up as a subdomain and have it redirect to your www.doamin.com/forum/archive :D

JamesFrost
02-22-2004, 08:35 AM
why not set your archive up as a subdomain and have it redirect to your www.doamin.com/forum/archive :D
To be honest you could put it anywhere and call it anything - the same technique should work.

I just like putting it in the root folder of my domain. :)

ChrisSy
02-22-2004, 10:06 AM
hmm cant upload the 'archive' file, in rc3

JamesFrost
02-22-2004, 10:13 AM
hmm cant upload the 'archive' file, in rc3

Chris - not quite sure what you mean - it should still work in rc3. How are you trying to upload?

Make sure you keep the file as 'archive.txt' before uploading it, and rename it to 'archive' once it is on your server.

JamesFrost
02-22-2004, 10:34 AM
hmm cant upload the 'archive' file, in rc3

Chris - have had a look at your site. I think the problem is that your current archive is in /archive instead of /forums/archive. For this reason it wont let you have a file called 'archive' in your root directory as there is already a folder called this.

Try calling the file 'archive2' and renaming the references to archive as archive2 in .htaccess. You can then test that it works before switching over to it.

you will also need to change the chdir commands in archive.txt to the following :

chdir('./archive'); //substitute for your forums path if different
require_once('./global.php');
require_once('./includes/functions_bigthree.php');
chdir('./..');


once you are happy, you could rename the archive directory to archiveold and change archive.txt to reflect this.

Hope this makes sense!

ChrisSy
02-22-2004, 10:54 AM
excellent thanks!, thanks for the quick reply :)

JamesFrost
02-22-2004, 11:00 AM
excellent thanks!, thanks for the quick reply :)

New instructions for users who's forum archive is currently in /archive (as opposed to /forums/archive). Still use the .htaccess from the first post.

If your archive is currently /forums/archive then please use the instructions in the first post.

dslteam
02-22-2004, 11:58 AM
Does it work on IIS 6 ? (Extremely important) ?

JamesFrost
02-22-2004, 12:47 PM
Does it work on IIS 6 ? (Extremely important) ?
I dont believe .htaccess files will work on IIS. If anyone knows different, or a workaround then let me know.

dslteam
02-22-2004, 01:10 PM
.htaccess files works great on IIS (if you install an ISAPI filter for it), but the problem is that the native vb3 archive uses something apache specific and that is why - it doesnt work

JamesFrost
02-22-2004, 01:40 PM
.htaccess files works great on IIS (if you install an ISAPI filter for it), but the problem is that the native vb3 archive uses something apache specific and that is why - it doesnt work
Ah, I see. This hack uses the native vb3 archive as a starting point (and only changes a redirect function within it). Unlikely that it would work on IIS if the native one doesn't.

I'm thinking of writing one from scratch, but that will be many months away due to other commitments.

Out of interest, what is the code that is apache specific?

dslteam
02-22-2004, 01:46 PM
I am extremely interested, because for users of IIS there is no archive feature for vb3 at the moment. I am not sury what is apache specific, but I know, that even with this ISAPI filter which is 100% compatible to htaccess - it comes a blank page.

JamesFrost
02-22-2004, 02:01 PM
I am extremely interested, because for users of IIS there is no archive feature for vb3 at the moment. I am not sury what is apache specific, but I know, that even with this ISAPI filter which is 100% compatible to htaccess - it comes a blank page.
dslteam - is this not your archive?

http://www.dslteam.de/forum/archive/index.php/

It seems to work OK to me!

JamesFrost
02-22-2004, 02:18 PM
Also, I'm no VB expert, but try changing the following code in /archive/global.php


// check to see if server is too busy. this is checked at the end of session.php
if ((!empty($servertoobusy) AND $bbuserinfo['usergroupid'] != 6) OR $vboptions['archiveenabled'] == 0 OR strpos(SAPI_NAME, 'apache') === false)
{
exec_header_redirect("$vboptions[bburl]/$vboptions[forumhome].php");
}


to


// check to see if server is too busy. this is checked at the end of session.php
if ((!empty($servertoobusy) AND $bbuserinfo['usergroupid'] != 6) OR $vboptions['archiveenabled'] == 0 )
{
exec_header_redirect("$vboptions[bburl]/$vboptions[forumhome].php");
}


as the original code seems to specifically check if it is running apache. Surely this cant be the problem!

dslteam
02-22-2004, 02:56 PM
I am running apache under windows 2003 at the moment. That is the reason why it is working now.

JamesFrost
02-22-2004, 03:26 PM
I am running apache under windows 2003 at the moment. That is the reason why it is working now.
I've tried the global.php change in my previous post on my XP machine running IIS, and this does indeed fix the issue of the archive redirecting to the forum page.

I get the first page OK, but the subsequent links dont work. However, W2k may handle this better.

dslteam
02-22-2004, 03:50 PM
hmm... but nevertheless - the archive doesnt support IIS and it is really a big problem according to the fact, that about 30 % of all servers running IIS.

Itworx4me
02-22-2004, 05:46 PM
Just an FYI. But why would you make a hack that is already included in RC4??? I see no difference from yours to the one that is included in RC4.

JamesFrost
02-22-2004, 05:59 PM
Just an FYI. But why would you make a hack that is already included in RC4??? I see no difference from yours to the one that is included in RC4.
The hack is designed to make the url of the archive more 'spider friendly' - nothing else. The archive works as before.

I may look at extra functionality in future, such as dynamic meta tags etc, but I'm sure someone else will beat me to this.

Personally, I wrote because I thought it would be useful to my own site. I think that

http://www.martialartsplanet.com/archive/t-10794

will rate higher than

http://www.martialartsplanet.com/forums/archive/index.php/t-10794

to a search engine. But maybe not - the ratings systems change all the time!

It certainly made a difference when I were a lad.

AWS
02-22-2004, 08:02 PM
I'm working on a way to make it work on IIS. You have to use adutils.vbs to enable script mapping on the webserver. I'm working on the new archive script that can be used to replace the current script if you run IIS.
I should have this done within the next 2 weeks.

There is a hack to use isapi_mod_rewrite in the vb 2 beta hack section which works well to rewrite the forumj urls. I used it until I went with vb3. With vb3 the urls are spidered very well.

gmarik
02-23-2004, 10:08 AM
James, thank you, it's what I was waiting for!

JamesFrost
02-23-2004, 04:23 PM
excellent thanks!, thanks for the quick reply :)
Chris - did the new instructions work OK for your setup?

dethfire
03-06-2004, 05:06 PM
I couldn't quite get mine to work because my forum are deep in a file structure like root/site/forums/archive and I couldn't figure the path changes I'd need to make.

on another note, had anyones vb3 actually been spidered? I've had mine up on a big forum for a month and nothing has been spidered.

JamesFrost
03-07-2004, 06:33 AM
I couldn't quite get mine to work because my forum are deep in a file structure like root/site/forums/archive and I couldn't figure the path changes I'd need to make.

on another note, had anyones vb3 actually been spidered? I've had mine up on a big forum for a month and nothing has been spidered.
PM me your site's URL and I'll have a look if you like.

I'm still waiting for the spiders to pickup the forums - I was hoping this hack would improve things. It used to take around 3 months to get fully spidered on Google, but I'm not convinced this is the case anymore. Keeping fingers very crossed!

Vivi Ornitier
03-20-2004, 02:04 PM
I don't get it, why must you rename the archive folder to archiveold if you have a deeper forum structure? Wouldn't it function the same? I"m confused,

JamesFrost
03-20-2004, 08:32 PM
I don't get it, why must you rename the archive folder to archiveold if you have a deeper forum structure? Wouldn't it function the same? I"m confused,
The archive works by having the archive php page called 'archive' (no extension) and using .htaccess to process this as php. If you already have a /archive directory then this will not work (as you cant have a 'archive' directory and an 'archive' file in the same directory.)

If your archive is in the normal /forums/archive then you dont need to worry about this.

jons5150
05-10-2004, 11:02 PM
James...I am getting this error above my archive:

Warning: chdir(): SAFE MODE Restriction in effect. The script whose uid is 503 is not allowed to access ./../.. owned by uid 0 in /home/virtual/site1/fst/var/www/html/archive on line 28

Any help?

dstruct2k
05-11-2004, 03:05 AM
SAFE MODE --- turn it off, or ask your host to

JamesFrost
05-11-2004, 10:39 AM
SAFE MODE --- turn it off, or ask your host to
Thanks dstruct2k - this should fix the issue short term.

I might look at a longer term fix in code, but I'm also thinking about re-writing the archive from scratch anyway, as I'm personally not keen on how it works. This would probably be several months away.

hamy
05-22-2004, 07:53 AM
Works on 3.0.1 and Google likes it more than normal archive!
Thank you

JamesFrost
05-24-2004, 08:03 AM
no problem - glad someone else has 'seen the light'! :D

Ruffneck
06-24-2004, 05:48 PM
Nice hack!

ehsanix
11-29-2004, 12:33 PM
Nice hack!
I get this error,
Premature end of script headers: /home/******/public_html/forum/archive

JamesFrost
11-30-2004, 10:17 AM
ehsanix - did the original VB archive work OK before you tried this? What is your website address?

vonedaddy
12-07-2004, 10:34 AM
My vb3 archive does not work because I do not have php compiled as a module. Can this be used as a solution to that?
I appreciate any help.

JamesFrost
12-07-2004, 10:47 AM
My vb3 archive does not work because I do not have php compiled as a module. Can this be used as a solution to that?
I appreciate any help.
I'm afraid not - this hack is just a small mod to the existing vb archive to allow the url's to be more search engine friendly. Have you tried Xenon's archive hack? (which is to be honest better than mine, as it is a total re-write)

https://vborg.vbsupport.ru/showthread.php?t=65703&highlight=archive

vonedaddy
12-07-2004, 11:06 AM
Thank you sir. You are a gentlemen and a scolar.

bL@De
12-25-2004, 08:06 PM
Hi Guys,
Great little script, I'm very impressed and very simple and easy to seutp.

EDIT: By the way I'm running 3.0.3 and it works perfectly.

JamesFrost
01-01-2005, 10:51 AM
Thanks bL@De - Happy New Year :D