Anyway to make a redirect script for VBSEO Album URLs?

BirdOPrey5

Well-known member
VBSEO Album URLs are like this:

Code:
http://www.domain.com/forum/members/username-my-album-title-here.html

There is absolutely no 'id' number in the URL.

I was thinking initially I could make a redirect script similar to @Jake Bunce 's script for member profiles.

My problem though is I don't see anywhere in the database the album title is stored like it appears in the URL (with hyphens for spaces and special characters removed.)

That means I really can't find which album "my-album-title-here" belongs to- it is most like an album with the title "My Album Title Here" but who is to say it isn't named "M'y Album Title Here?" which would be a valid album title.

I can get the username from the URL, so I suppose I could look for a sub-string of the title with a LIKE comparison in MySQL, limited to albums by that user, but that would be awfully sloppy and slow.

I usually think "anything is possible" with enough coding but I'm not so sure on this one.
 
Were the albums imported into XenForo? Because that is not a standard thing to import.

First we need to know the old and new URL for a specific album, but we can start to build a redirect.
 
They were imported into Xenforo Media Gallery using the Import Albums feature for vBulletin 3.8. Original IDs were kept- same as they were in vBulletin.

An actual URL (with domain changed is):

VBSEO URL:
Code:
http://www.domain.com/forum/members/warcry78-albums-my-lego-collection.html

XenForo Gallery URL:
Code:
http://www.domain.com/forum/media/albums/my-lego-collection.1609/

You can see the problem, there is no id in the VBSEO url, just a username and album name.

It would be easy to look up the album name and spit back the id via PHP, but the album name (best I can tell) isn't stored in that format in the database. In the database the album title is: My LEGO Collection

I'm looking in the xengallery_album table.

Perhaps I'm looking in the wrong table? Maybe "my-lego-collection" is stored somewhere else?
 
XenForo uses purely the ID, the bit after the dot to identify content in most cases, e.g.

Rich (BB code):
http://www.domain.com/forum/media/albums/my-STAMP-collection.1609/

That would still locate the same content, the string in the URL is merely to make it slightly more SEO friendly. There are exceptions to this for some URLs where specifically the ID is a string, but for most content it's this way.

The question needs to be not so much how does XenForo find its content, but moreso how does vB and vBSEO actually locate the content using this part of the URL?

Code:
warcry78-albums-my-lego-collection.html

A custom script could take that URL, do the same thing vB does to locate the item in the database, which would then give you the album ID (in this case 1609) and then that could be used to find the content in XF.
 
Yeah it's VBSEO that figures it out but I am at a loss as to how- I thought it would be a plugin on some album hook as a place to start looking, but of course there is no VBSEO plugin on any album hook. I thought maybe there was a VBSEO table that had the string and the ID connected, but don't see any such tables either. Thanks though, reaffirms where I need to look. Will post back if I ever get it.
 
Back
Top Bottom