vBSEO Functions for Extensibility
There are several vBSEO functions that can be used by external scripts.
NOTE: Always include the functions_vbseo.php file. Since it may already be included, the following statement should be used:
1. Use the following function to convert text to the vBSEO format. This is useful for custom (non-vBulletin) urls.Code:include_once 'includes/functions_vbseo.php';
Also discussed here: Custom Addons RewriteCode:$seo_title = vbseo_filter_text($title); // " A simple example here!" => "simple-example-here"
2. To create vB URLs, the following calls are required (these should be executed *once*):
3. The following function returns the vBSEO URL for the forum specified by id:Code:vbseo_get_options(); vbseo_prepare_seo_replace(); vbseo_get_forum_info();
4. This function returns the vBSEO URL for the thread based on the *associated array fetched from the database (db record)*:Code:$forumurl = vbseo_forum_url($forumid, $pagenum);
where $threadrow isCode:$threadurl = vbseo_thread_url_row($threadrow, $pagenum);
array(
'threadid'=>xxx,
'title'=>xxx,
....
);
5. This function returns the vBSEO URL for the member profile based on the user id and username:
6. This function returns the vBSEO URL for the member list:Code:$memberurl = vbseo_member_url_row($userid, $username);
7. This function allows the rewritting of a dynamic URL with the corresponding SEO URL (including custom rewrite rules applied).Code:$memberlisturl = vbseo_memberlist_url($letter, $pagenum);
For instance, if the following CRR is defined:Code:vbseo_any_url($url)
The following function call can be used:'index.php?page=(w+)$' => 'page-$1.html'
This function will allow to integrate side rewrites with CRRs better (including sitemap hack additions).$seourl = vbseo_any_url('index.php?page=news'); // $seourl = 'page-news.html'
These are the most useful functions. If you are doing a specific hack (or modification) and need more insight don't hesitate to ask
We'll be launching an enhanced API, but that's further down the road
Update (supported in vBSEO2.4.1+)
8. This function allows to replace META tags with custom value:
example:vbseo_replace_meta($metaname, $meta_content);
vbseo_replace_meta('keywords', 'keywords replacement');
9. This function returns the specific vBSEO URL for the thread based thread row:
$spec can be either:$threadurl_spec = vbseo_thread_url_row_spec($thread_row, $spec);
'new' - new post URL
'last' - last post URL
'next' - next thread URL
'prev' - previous thread URL









Reply With Quote

