Results 1 to 9 of 9

How to write my own showthread / forumdisplay links with vbseo URL rewriting enabled?

This is a discussion on How to write my own showthread / forumdisplay links with vbseo URL rewriting enabled? within the General Discussion forums, part of the vBSEO SEO Plugin category; Currently I have my own links in templates like: <a href="showthread.php?t=$variable"> I want to automaticaly look them as <a href="showthread.php/1234-topicname">. ...

  1. #1
    Senior Member
    Real Name
    vbul
    Join Date
    Jan 2008
    Posts
    152
    Liked
    6 times

    Arrow How to write my own showthread / forumdisplay links with vbseo URL rewriting enabled?

    Currently I have my own links in templates like: <a href="showthread.php?t=$variable">

    I want to automaticaly look them as <a href="showthread.php/1234-topicname">.

    How can I do that, what conditional variables are there?

  2. #2
    Senior Member Shadab's Avatar
    Real Name
    Shadab
    Join Date
    Oct 2007
    Location
    Bhopal
    Posts
    821
    Liked
    0 times
    Blog Entries
    12
    You don't have to change anything 'inside' the templates.

    Set the appropriate options and link structure from your vBSEO's Control Panel,
    and let vBSEO do the rest !


  3. #3
    Senior Member
    Real Name
    vbul
    Join Date
    Jan 2008
    Posts
    152
    Liked
    6 times
    I have changed my styles which involves adding additional links. Currently I have my own links in templates like: <a href="showthread.php?t=$variable">

    I want to automaticaly look them as <a href="showthread.php/1234-topicname">.

    How can I do that, what conditional variables are there?

  4. #4
    Senior Member Shadab's Avatar
    Real Name
    Shadab
    Join Date
    Oct 2007
    Location
    Bhopal
    Posts
    821
    Liked
    0 times
    Blog Entries
    12
    Can you give a live example of what you are trying to achieve ?

    What you said earlier, ie, converting URLs from showthread.php?t=$variable to showthread.php/1234-topicname
    vBSEO already does that automatically. You don't need to edit any templates to reflect the changes.

  5. #5
    Senior Member
    Real Name
    vbul
    Join Date
    Jan 2008
    Posts
    152
    Liked
    6 times
    This is what I wrote
    Code:
    <!-- show latest active threads -->
    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" 
    align="center">
    <tbody>
    <tr>
    <td class="tcat" colspan="2">
    <a style="float:$stylevar[right]" href="#top" onclick="return toggle_collapse('forumhome_external')"><img 
    id="collapseimg_forumhome_external" 
    src="$stylevar[imgdir_button]/collapse_tcat$vbcollapse[collapseimg_forumhome_external].gif" alt="" border="0" /></a>
    <a href="forumdisplay.php?f=$foruminfo[forumid]">Topics in $foruminfo[title]</a>
    </td>
    </tr>
    </tbody>
    <tbody id="collapseobj_forumhome_external" style="$vbcollapse[collapseobj_forumhome_external]">
    <tr>
     
    <td class="alt1" width="100%">
     
    <div class="smallfont">
    <script type="text/javascript" src="external.php?forumids=$foruminfo[childlist]&type=js"></script>
    <script language="" type="text/javascript">
    <!--
    for (var x in threads)
    {
    document.writeln("<a href=\"showthread.php?t="+threads[x].threadid+"&goto=newpost\"><img class=\"inlineimg\" src=\"$stylevar[imgdir_button]/firstnew.gif\" alt=\"\" border=\"0\" /></a> <a href=\"showthread.php?t="+threads[x].threadid+"\">"+threads[x].title+"</a> <br />");
    }
    //-->
    </script></div>
     
    </td>
    </tr>
    </tbody>
    <!-- show latest active threads -->
    </table>
    <br />

  6. #6
    Senior Member
    Real Name
    vbul
    Join Date
    Jan 2008
    Posts
    152
    Liked
    6 times
    are there any solutions?

  7. #7
    Senior Member
    Real Name
    Joseph Ward
    Join Date
    Jun 2005
    Posts
    23,845
    Liked
    36 times
    Blog Entries
    9
    You want your URL rewrites to look like this?

    Code:
    showthread.php/1234-topicname

  8. #8
    Senior Member
    Real Name
    vbul
    Join Date
    Jan 2008
    Posts
    152
    Liked
    6 times
    I just want them to be shown like in my forum (for example "http://www.vbseo.com/how-write-my-own-showthread-forumdisplay-links-vbseo-url-rewriting-enabled-19969/"). How can I do that?

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

    as I see, you have those links created in Javascript:
    HTML Code:
    for (var x in threads)
    {
    document.writeln("<a href=\"showthread.php?t="+threads[x].threadid+"&goto=newpost\"><img class=\"inlineimg\" src=\"$stylevar[imgdir_button]/firstnew.gif\" alt=\"\" border=\"0\" /></a> <a href=\"showthread.php?t="+threads[x].threadid+"\">"+threads[x].title+"</a> <br />");
    }
    as a result, that code is processed on client side (browser) and cannot be processed by vBSEO automatically. You can create SEOed URLs in your mod/script using vBSEO Functions for Extensibility though.

Similar Threads

  1. My Links & Download Manager Custom Re-write rules
    By SemperFideles in forum Custom Rewrite Rules
    Replies: 1
    Last Post: 03-16-2008, 05:21 PM
  2. Enabled Archive re-write
    By huntz in forum Troubleshooting
    Replies: 6
    Last Post: 01-10-2007, 07:30 PM
  3. Replies: 1
    Last Post: 07-02-2006, 07:52 AM

Posting Permissions

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