Results 1 to 2 of 2

VBSEO urls in none vb pages - Help

This is a discussion on VBSEO urls in none vb pages - Help within the General Discussion forums, part of the vBSEO SEO Plugin category; Hi all, I found in a great way to have url rewrites on non vb pages. It works great for ...

  1. #1
    Junior Member
    Real Name
    kaboomit
    Join Date
    Mar 2009
    Posts
    5
    Liked
    0 times

    VBSEO urls in none vb pages - Help

    Hi all,

    I found in a great way to have url rewrites on non vb pages. It works great for me but I have a problem with forum name in url:

    Custome php page: last-posts.php (the custom page retrieves last posts with seo freindly urls outside of vb)

    www.myhome.com/last-posts.php (this works fine)
    but when I embed that php file into my main page then I have a problem in the urls: The forum name is not shown properly, it comes just an /a/ instead. eg.

    I get this in the url from my homepage: www.myhome.com/forum/a/post-name.html
    However ir redirects perfect to the post, but I would like to find WHY the forum name is not retreived in the URL if I embed the php file.

    Here I post the code of this modification, please any help would be appreciated.

    PHP Code:
    <?php 
    ##########################################################################
    // RECENT TOPICS (vbSEO edition) by LBmtb
    // webmaster@socaltrailriders.org OR aim: LBmtb
    //
    // Do not remove copyright unless you donate $5 via paypal
    // to the above email address, thanks
    // CUSTOMIZED from a www.phase1media.com script found here:
    // http://www.vbulletin.org/forum/showpost.php?p=589067&postcount=7
    ##########################################################################

    ## CUSTOMIZE THE FOLLOWING    ##############################################

    // DATABASE & URL SETTINGS
    $db_host "11.149.111.85"// Change this if your MySQL database host is different.
    $db_name "S88800_5"// Change this to the name of your database.
    $db_user "Sql888800"// Change this to your database username.
    $db_pw "mypass"// Change this to your database password.
    $db_prefix ""// Change to your tables' prefix. Usually vb_
    $forum_url "http://www.mysite.com/foros"// Change this to reflect to your forum's URL.
     
    // APPEARANCE OPTIONS
    $separator "@"// this goes between last poster and date
    $limit "25"// Number of posts displayed
    $post_date_format "1"// leave as 1 for "12/18/06 05:26 PM" or change to 2 for "05:26 PM"

    // FORUM SOURCES FOR TOPICS
    // use one or the other, not both. if left blank the script will return threads from any forum
    $fidi_raw ""// ONLY include threads from these forums. seperate each ID with a comma
    $fidx_raw ""// Exclude threads from these forum. seperate each ID with a comma

    // CSS CLASSES    
    $recent_topics "vb_topics"// you can use CSS to adjust the presentation of the list 
    $recent_poster "vb_last_post";  // you can use CSS to adjust the presentation the last poster and date

    ## VBSEO SETTINGS  #####################################################
    include_once "../foros/includes/functions_vbseo.php"// change this path to reflect where your forum is
    vbseo_startup(); // if you have a vbSEO version under 3, comment this line and uncomment the next three
    // vbseo_get_options();
    // vbseo_prepare_seo_replace();
    // get_forum_info();

    ## NO NEED TO TOUCH ANYTHING BELOW    #####################################
    #############################################################################

    if (!($recent_topics_connection mysql_connect("$db_host""$db_user""$db_pw")))
    die (
    "could not connect"); 
    if (!(
    mysql_select_db("$db_name"$recent_topics_connection)))
    mysql_error(); 
    echo 
    "<ul class=\"$recent_topics\">\n";
    $fidi_array explode (','$fidi_raw);
    $fidx_array explode (','$fidx_raw);
    function 
    forum_where($f_array,$which){
        if (
    $which == "i") { $f_final .= "AND ("; }
        if (
    $which == "x") { $f_final .= "AND NOT ("; }
        foreach( 
    $f_array as $key => $value){
            if (
    $key == 0) { $f_final .= "forumid=".$value; }
            else { 
    $f_final .= " OR forumid=".$value; }
        }
        
    $f_final .= ")";
        return 
    $f_final;
    }
    if (
    $fidi_raw)  { $fidi_final forum_where($fidi_array,"i"); }
    if (
    $fidx_raw)  { $fidx_final forum_where($fidx_array,"x"); }
    $thread_sql mysql_query("SELECT threadid,title,lastpost,lastposter,forumid, rand() as random FROM ".$db_prefix."thread WHERE visible=1 AND open=1 $fidi_final $fidx_final ORDER BY  random desc LIMIT $limit");
    while(
    $thread_get=@mysql_fetch_array($thread_sql))
    {
        
    $lastpost $thread_get['lastpost'];
        
    $poster $thread_get['lastposter'];
        
    $tid $thread_get['threadid'];
        if (
    $post_date_format == "1") { $date2 date ("m/d/y h:i A" ,$lastpost); }
        elseif (
    $post_date_format == "2") { $date2 date ("h:i A" ,$lastpost); }
        else { 
    $date2 date ("m/d/y h:i A" ,$lastpost); }    
        
        
    $threadurl vbseo_thread_url_row($thread_get$pagenum);
        echo 
    "<li><a href=\"$forum_url/$threadurl\">$thread_get[title]</a></li>\n";
    }
    echo 
    "</ul>\n<div style=\"font-size: .9em;\">recent topics by <a href=\"http://www.socaltrailriders.org/\"><acronym title=\"Southern California Trail Riders\">SocalTrailRiders.org</acronym></a></div>";
    mysql_close($recent_topics_connection);
    ?>
    ]

  2. #2
    vBSEO.com Webmaster Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    22,367
    Liked
    542 times
    Blog Entries
    4
    Hello ,

    Please check vBSEO Functions for Extensibility
    Mert Gökçeimam / Crawlability Inc.

    vBSEO 3.6.0 Alpha Önizlemesi - Including Like Tree
    Unveiling the NEW vBSEO Sitemap Generator 3.0 - available NOW for vBSEO Customers!


    Twitter:@Depkac
    Personal Blog : Mert Gökçeimam

Similar Threads

  1. Manually adding urls to sitemap for translated pages
    By Dave Hybrid in forum General Discussion
    Replies: 18
    Last Post: 07-31-2009, 12:44 PM
  2. Double URLS for static pages (duplicate content)
    By webdzinez in forum General Discussion
    Replies: 11
    Last Post: 11-25-2008, 05:47 PM
  3. Replies: 4
    Last Post: 09-14-2006, 06:38 PM
  4. Ton of pages indexed but not with rewrite urls
    By lafsunlmtd in forum General Discussion
    Replies: 5
    Last Post: 06-29-2006, 07:15 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
  •