Page 1 of 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... LastLast
Results 1 to 15 of 245
Like Tree1Likes

vBSEO Functions for Extensibility

This is a discussion on vBSEO Functions for Extensibility within the General Discussion forums, part of the vBSEO SEO Plugin category; vBSEO Functions for Extensibility There are several vBSEO functions that can be used by external scripts. NOTE: Always include the ...

  1. #1
    vBSEO Staff Juan Muriente's Avatar
    Real Name
    Juan Carlos Muriente
    Join Date
    Jun 2005
    Location
    Puerto Rico
    Posts
    14,266
    Liked
    584 times

    vBSEO Functions for Extensibility

    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:
    Code:
    include_once 'includes/functions_vbseo.php';
    1. Use the following function to convert text to the vBSEO format. This is useful for custom (non-vBulletin) urls.
    Code:
    $seo_title = vbseo_filter_text($title); // " A simple example here!" => "simple-example-here"
    Also discussed here: Custom Addons Rewrite

    2. To create vB URLs, the following calls are required (these should be executed *once*):
    Code:
    vbseo_get_options();
    vbseo_prepare_seo_replace();
    vbseo_get_forum_info();
    3. The following function returns the vBSEO URL for the forum specified by id:
    Code:
    $forumurl = vbseo_forum_url($forumid, $pagenum);
    4. This function returns the vBSEO URL for the thread based on the *associated array fetched from the database (db record)*:
    Code:
    $threadurl = vbseo_thread_url_row($threadrow, $pagenum);
    where $threadrow is
    array(
    'threadid'=>xxx,
    'title'=>xxx,
    ....
    );

    5. This function returns the vBSEO URL for the member profile based on the user id and username:
    Code:
    $memberurl = vbseo_member_url_row($userid, $username);
    6. This function returns the vBSEO URL for the member list:
    Code:
    $memberlisturl = vbseo_memberlist_url($letter, $pagenum);
    7. This function allows the rewritting of a dynamic URL with the corresponding SEO URL (including custom rewrite rules applied).
    Code:
    vbseo_any_url($url)
    For instance, if the following CRR is defined:
    'index.php?page=(w+)$' => 'page-$1.html'
    The following function call can be used:
    $seourl = vbseo_any_url('index.php?page=news'); // $seourl = 'page-news.html'
    This function will allow to integrate side rewrites with CRRs better (including sitemap hack additions).

    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:
    vbseo_replace_meta($metaname, $meta_content);
    example:
    vbseo_replace_meta('keywords', 'keywords replacement');

    9. This function returns the specific vBSEO URL for the thread based thread row:
    $threadurl_spec = vbseo_thread_url_row_spec($thread_row, $spec);
    $spec can be either:
    'new' - new post URL
    'last' - last post URL
    'next' - next thread URL
    'prev' - previous thread URL
    Last edited by Oleg Ignatiuk; 11-16-2007 at 03:37 PM.

  2. #2
    Senior Member acers's Avatar
    Real Name
    Ajay
    Join Date
    Jul 2005
    Location
    India
    Posts
    508
    Liked
    0 times
    awesome list.. juan.. brilliant
    will help a lot for the custom hacks i am doing for my site ..

  3. #3
    Senior Member
    Real Name
    Mike Simonds
    Join Date
    Oct 2005
    Location
    Texas
    Posts
    240
    Liked
    2 times
    this is great Juan but can it be used if the scripts are in the root! as is with mine?

  4. #4
    vBSEO Staff Juan Muriente's Avatar
    Real Name
    Juan Carlos Muriente
    Join Date
    Jun 2005
    Location
    Puerto Rico
    Posts
    14,266
    Liked
    584 times
    The functions referenced here create vB URLs only. From this point, they should work fine no matter where the scripts reside

  5. #5
    Senior Member
    Join Date
    Nov 2005
    Posts
    165
    Liked
    0 times
    Hi Juan,

    Maybe yo can give me some additional help here. I have a page located a domain.com/directory/page.php and my forums are at domain.com/forum/. page.php includes vb functions with global.php and others as needed. So I can add the include for the functions_vbseo.php no problem but what would this actually look like for this page?
    Code:
    $seotitle = vbseo_filter_text($title); // " A simple example here!" => "simple-example-here"

  6. #6
    vBSEO Staff Juan Muriente's Avatar
    Real Name
    Juan Carlos Muriente
    Join Date
    Jun 2005
    Location
    Puerto Rico
    Posts
    14,266
    Liked
    584 times
    Quote Originally Posted by reefland
    Hi Juan,

    Maybe yo can give me some additional help here. I have a page located a domain.com/directory/page.php and my forums are at domain.com/forum/. page.php includes vb functions with global.php and others as needed. So I can add the include for the functions_vbseo.php no problem but what would this actually look like for this page?
    Code:
    $seotitle = vbseo_filter_text($title); // " A simple example here!" => "simple-example-here"
    Since your are rewritting vB URLs, you should use direct functions like:
    • vbseo_forum_url
    • vbseo_thread_url_row
    • vbseo_member_url_row
    • vbseo_memberlist_url.
    The vbseo_filter_text() function is used to manually construct URLs for non-vB pages.

    Also, with new vBSEO 2.2.1 it is possible to create CRR for non-vB folders.

  7. #7
    vBSEO Staff Juan Muriente's Avatar
    Real Name
    Juan Carlos Muriente
    Join Date
    Jun 2005
    Location
    Puerto Rico
    Posts
    14,266
    Liked
    584 times
    Added function #7 (available in vBSEO 2.3.0 and up)

  8. #8
    Member
    Real Name
    gringo
    Join Date
    Sep 2005
    Location
    Deutscheland
    Posts
    63
    Liked
    0 times
    Hallo, wäre jemand so freundlich und würde das übersetzen? Danke

  9. #9
    Senior Member
    Real Name
    Philipp Herbers
    Join Date
    Sep 2005
    Location
    Meppen, Germany
    Posts
    8,436
    Liked
    0 times
    Hallo,

    Quote Originally Posted by dongdong
    Hallo, wäre jemand so freundlich und würde das übersetzen? Danke
    ich kann es gerne in den nächsten Tagen übersetzen

  10. #10
    Member
    Real Name
    gringo
    Join Date
    Sep 2005
    Location
    Deutscheland
    Posts
    63
    Liked
    0 times
    vielen dank phillipp

  11. #11
    Senior Member KW802's Avatar
    Real Name
    Kevin
    Join Date
    Jan 2006
    Posts
    163
    Liked
    0 times
    For function #4 listed above, vbseo_thread_url_row, is there also a way of getting the 'new post' version as well? In specific, the 'Newest Post in Thread' Redirect URL Format version? (Even though last-post and new-post have in the same name in the vbseocp menu, it's the new-post format I'm after.)

    Thanks,
    Kevin

  12. #12
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,741
    Liked
    168 times
    Hello Kevin,

    we will include a special function for this in vBSEO2.4.1: vbseo_thread_url_row_spec($thread_row, $spec);
    Updated tutorial: vBSEO Functions for Extensibility

    thank you for suggestion!

  13. #13
    Senior Member KW802's Avatar
    Real Name
    Kevin
    Join Date
    Jan 2006
    Posts
    163
    Liked
    0 times
    Quote Originally Posted by Oleg Ignatiuk
    we will include a special function for this in vBSEO2.4.1: vbseo_thread_url_row_spec($thread_row, $spec);
    Excellent, thank you. In my replacement version of external.php for the RSS2 specs I use the "&goto=newpost" version of the thread for 'link' tag and the normal thread URL for the 'guid' tag.

  14. #14
    Senior Member
    Join Date
    Sep 2005
    Posts
    131
    Liked
    0 times
    [QUOTE=Juan Muriente]4. This function returns the vBSEO URL for the thread based on the *associated array fetched from the database (db record)*:
    Code:
    $threadurl = vbseo_thread_url_row($threadrow, $pagenum);
    where $threadrow is
    array(
    'threadid'=>xxx,
    'title'=>xxx,
    ....
    );
    Where can I get more information about that array?! I cannot get that function to work ;(

    Tobi

  15. #15
    vBSEO Staff Oleg Ignatiuk's Avatar
    Real Name
    Oleg Ignatiuk
    Join Date
    Jun 2005
    Location
    Belarus
    Posts
    25,741
    Liked
    168 times
    Hello Tobi,

    this is an array retrieved with mysql_fetch_array() function from "thread" db table.
    Here is an example:
    PHP Code:
    $getthreads $db->query("
    SELECT *
    FROM " 
    TABLE_PREFIX "thread
    WHERE threadid=123
    "
    );
    $threadrow $db->fetch_array($getthreads);

    $threadurl vbseo_thread_url_row($thread_row); 

Page 1 of 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 ... LastLast

Similar Threads

  1. vBSEO 2.4.0 Released - Includes Google AdSense Targeting Feature!
    By Juan Muriente in forum vBSEO Announcements
    Replies: 74
    Last Post: 05-20-2006, 09:29 PM
  2. vBSEO 2.0 RC7 Released
    By Juan Muriente in forum vBSEO Announcements
    Replies: 17
    Last Post: 09-08-2005, 11:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •