Creating your own relevant replacements in vBulletin

Discussion in 'vBulletin Discussions' started by Michael, Oct 3, 2009.

  1. Michael

    Michael Regular Member

    Joined:
    Jan 18, 2004
    Messages:
    166
    Likes Received:
    35
    In vbseo you get relevant replacements, but unfortunately sometimes you cant afford vbseo for all your sites. Would anyone recommend replicating them using template conditionals on forumdisplay per forum and using h2 etc within them instead of forking out for vbseo?

    The only problem I can see is if you rename a forum maybe, but if you dont do that and theyre set in stone surely this would be fine :D

    What are your thoughts on this?

    Thanks.
     
  2. Nick

    Nick Regular Member

    Joined:
    Jul 27, 2008
    Messages:
    7,441
    Likes Received:
    218
    Re: Creating your own relevant replacements

    Yes, this is a highly recommended tip to, recommended to users who want to optimize their vBulletin installation without vBSEO. On my new parrot forum, I just set this up a few days ago. It looks no different than the default text, but it is now using h1 and h2 tags. The one thing I cannot get is the little bit of text to show up in the relevant replacement (the thread preview), but that's okay.

    Anyways, if you want to set it up how I have it, first check it out: here and here. (See the green box above the thread and above the thread listing).

    Here's the code needed to display this: Try it on a test style first! - In the navbar template, find:
    Code:
    <!-- / breadcrumb, login, pm info -->
    add below it: (there is most likely a portion of this code already there; replace it with this)
    Code:
    <br />
    <if condition="$show['forumdesc']">
    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
    <tr>
    <td class="alt1" width="100%">
    
    <if condition="THIS_SCRIPT != 'showthread'">
    <if condition="THIS_SCRIPT != 'forumdisplay'">
    <strong>$foruminfo[title]</strong> <span class="smallfont">$foruminfo[description]</span>
    </if></if>
    
    <if condition="THIS_SCRIPT == 'showthread'">Discuss <h1 class="myh1">$thread[title]</h1> in the <h2 class="myh2">$foruminfo[title_clean]</h2> section at TalkParrots.
    </if>
    
    <if condition="THIS_SCRIPT == 'forumdisplay'">
    <h1 class="smallfont"><strong>$foruminfo[title_clean]</strong></h1>
    <h2 class="smallfont">$foruminfo[description]</h2>
    </if>
    
    </td>
    </tr>
    </table>
    <br />
    </if>
    H tag CSS Definitions:
    By default, h-tags are large and force a line break. This will make your custom descriptions/titles look rather awkward. To override this natural behavior, add the following to the Additional CSS Definitions box in the style manager:
    Code:
    /* ***** H1 Tags ***** */
    h1.myh1 {font: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 11px;
    color: #000000; font-weight: bold;}
    
    h2.myh2 {font: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 11px;
    color: #000000; font-weight: bold;}
    
    h2.myh3 {font: verdana, geneva, lucida, 'lucida grande', arial, helvetica, sans-serif; font-size: 11px;
    color: #000000; font-weight: none;}
    
    
    h1,h2,h3,h4,h5,h6 {display:inline;}
    
    You can customize the definitions to your liking (font, size, color, etc.) :)
     
    3 people like this.
  3. Michael

    Michael Regular Member

    Joined:
    Jan 18, 2004
    Messages:
    166
    Likes Received:
    35
    Re: Creating your own relevant replacements

    This is awesome Nick! So you can use the variables like: $foruminfo[title_clean] without vbseo? I was thinking I would only be able to do these manually lol I am glad this is possible :D

    Thank you!
     
  4. Nick

    Nick Regular Member

    Joined:
    Jul 27, 2008
    Messages:
    7,441
    Likes Received:
    218
    Re: Creating your own relevant replacements

    Seeing as these are in the default templates and are used by default, yes you can use them. :D
     
    2 people like this.
  5. Michael

    Michael Regular Member

    Joined:
    Jan 18, 2004
    Messages:
    166
    Likes Received:
    35
    Re: Creating your own relevant replacements

    Excellent, this has made my day, I was actually going to do this by typing in each forum name manually as well as the description! I might actually just use the title to pull that automatically and write up my own descriptions for each one so that it isnt the same as the description on the index, but then again it would be easier doing it your way so im not sure now :D
     
  6. Nick

    Nick Regular Member

    Joined:
    Jul 27, 2008
    Messages:
    7,441
    Likes Received:
    218
    Re: Creating your own relevant replacements

    Oh, one thing I forgot to include was the CSS definitions so that the h1 and h2 tags are not gigantic. I've updated my former post. ;)
     
    2 people like this.
  7. Michael

    Michael Regular Member

    Joined:
    Jan 18, 2004
    Messages:
    166
    Likes Received:
    35
    Re: Creating your own relevant replacements

    Thank you Nick :D We have decided to do the descriptions manually so it isnt the same text as from the homepage so I will be sat here almost all day now doing it :D lol
     
  8. Nick

    Nick Regular Member

    Joined:
    Jul 27, 2008
    Messages:
    7,441
    Likes Received:
    218
    Re: Creating your own relevant replacements

    Also, I've stuck this thread and moved it to the vBulletin forum. :)
     
  9. Michael

    Michael Regular Member

    Joined:
    Jan 18, 2004
    Messages:
    166
    Likes Received:
    35
    It should be an article really Nick :D You done a good job ;)
     
  10. Michael

    Michael Regular Member

    Joined:
    Jan 18, 2004
    Messages:
    166
    Likes Received:
    35
    Just tried [first_post_20_words]... and it doesnt work on showthread :( Anyone know how to get that to work?
     
  11. Nick

    Nick Regular Member

    Joined:
    Jul 27, 2008
    Messages:
    7,441
    Likes Received:
    218
    I'm pretty sure that's not a standard variable. Where did you see this?
     
  12. Michael

    Michael Regular Member

    Joined:
    Jan 18, 2004
    Messages:
    166
    Likes Received:
    35
    Its used in vbseo to pull the first x words of the thread to use in your RR's, it doesnt seem to be a standard variable unfortunately lol
     
  13. Michael

    Michael Regular Member

    Joined:
    Jan 18, 2004
    Messages:
    166
    Likes Received:
    35
    We have just installed this mod:
    Search Engine Optimized Keywords & Description per Forum - vBulletin.org Forum

    But for some reason if you dont add your own custom description it will look like this:

    <meta name="description" content=",Are you trying to get pregnant? Discuss getting pregnant including ovulation, fertility charting, infertility, sperm donors, In Vitro Fertilisation (IVF) and more." />

    I am not sure if that nuisance comma at the beginning would make any difference considering SE's arent supposed to index special characters etc although with it being a comma I aint sure with this one :D
     
  14. Ak Worm

    Ak Worm Grand Master

    Joined:
    May 22, 2009
    Messages:
    979
    Likes Received:
    20
    First Name:
    Corey
    Durr, tested it on Default style, don't work :(
     
  15. Michael

    Michael Regular Member

    Joined:
    Jan 18, 2004
    Messages:
    166
    Likes Received:
    35
    It doesnt display anything?
     
  16. ArnyVee

    ArnyVee Regular Member

    Joined:
    May 25, 2009
    Messages:
    1,264
    Likes Received:
    39
    If you guys are trying to do the $threadinfo['preview'] thing, all you have to do is follow this article....

    description for meta and bookmarksite on showthread - vBulletin.org Forum and this post ..... vBulletin.org Forum - View Single Post - How to use "$thread[preview]" in meta description

    ....and it'll add the threadpreview into the meta and then you can use the same $threadinfo['preview'] and add it to your showthread like this....

    http://www.adminaddict.net/forum/vb...few-words-post-showing-3678/index2/#post45112

    ....hope that helps! :D
     
    3 people like this.
  17. Michael

    Michael Regular Member

    Joined:
    Jan 18, 2004
    Messages:
    166
    Likes Received:
    35
    How much does $threadinfo['preview'] give you from the thread, I mean how many words or characters? :D

    Thank you Arny!
     
  18. ArnyVee

    ArnyVee Regular Member

    Joined:
    May 25, 2009
    Messages:
    1,264
    Likes Received:
    39
  19. Mikey

    Mikey Mikeylicio.us

    Joined:
    Sep 12, 2009
    Messages:
    484
    Likes Received:
    92
    Location:
    United Kingdom
    First 25 words from a thread, I believe, the product is on my list of things to release.
     
  20. Michael

    Michael Regular Member

    Joined:
    Jan 18, 2004
    Messages:
    166
    Likes Received:
    35
    Its a pretty good idea releasing this as a product, I can imagine plenty of people without vbseo using it!
     

Share This Page