Results 1 to 4 of 4

modifying functions_vbseo to make the keywords global?

This is a discussion on modifying functions_vbseo to make the keywords global? within the Ad Networks forums, part of the Monetizing category; As part of our contextual adverts attempt we are hitting a stumbling block where we dont seem to be able ...

  1. #1
    Junior Member
    Real Name
    James Robinson
    Join Date
    Feb 2007
    Location
    Birmingham UK
    Posts
    16
    Liked
    0 times

    modifying functions_vbseo to make the keywords global?

    As part of our contextual adverts attempt we are hitting a stumbling block where we dont seem to be able to access the keywords themselves via our plugin. We have tried to access them using the same / simular syntax to that used in templates:

    Code:
    echo $vbulletin->thread['keywords'];
    echo $vbulletin->threadinfo['keywords'];
    echo $vbulletin->vboptions['keywords'];
    None echo out any results.

    I managed to echo out the keywords in the postbit_legacy template successfully using:
    {vb:raw thread.keywords}

    It is in postbit_legacy that i am trying to 'call' the output of my external file.. but obviously the plugin is executed back at global_bootstrap_init_start so i cant feed the keywords to the plugin there.. and even if i could.. i have no idea how to put {vb:raw thread.keywords} into a variable that can be used by the external file..

    I hope all that makes sense :erm:

    so while looking into vbseo's files finding how/when it replaces the default keywords I came across this section:

    Code:
    if(VBSEO_REWRITE_META_KEYWORDS && $kw_content)
    {
    $kw_content = strip_tags($kw_content);
    if(VBSEO_STOPWORDS)
    $kw_content = preg_replace('#,?\b(' . VBSEO_STOPWORDS . ')\b#i', '', $kw_content);
    if(strlen($kw_content) > VBSEO_META_DESCRIPTION_MAX_CHARS)
    {
    $kw_content = vbseo_substr_words($kw_content, VBSEO_META_DESCRIPTION_MAX_CHARS);
    }
    $newtext = preg_replace('#(<meta name="keywords".*?content=)"#is', '$1"'.str_replace('$','\$',$kw_content).',', $newtext);
    }
    so $kw_content clearly contains the new keywords..

    but is there anyway to assign that to a global so I can access it with my plugin? rather than just be used in the preg_replace??

    when is this code called hook wise? Just in case im calling my plugin prior to the code

    cheers guys

  2. #2
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    If you want to use it in a template, you need to register the vars in vb4.
    https://www.vbulletin.com/forum/entr...emplate-Syntax

  3. #3
    Junior Member
    Real Name
    James Robinson
    Join Date
    Feb 2007
    Location
    Birmingham UK
    Posts
    16
    Liked
    0 times
    By it you mean the variable $kw_content?? so you are confirming that it can be made accessabel to the plugin?

    The link you sent only mentions registering templates and then about the <vb> tag and its uses.. not making the variable available globally/to other plugins. If you could show me what you mean codewise to 'register' the vbseo generated keywords to be accesses globally im sure im not the only one who would be appreciative.

  4. #4
    vBSEO Staff Brian Cummiskey's Avatar
    Real Name
    Brian Cummiskey
    Join Date
    Jul 2009
    Location
    btwn NYC and Boston
    Posts
    12,789
    Liked
    657 times
    Blog Entries
    2
    The vbseo code is only available when vbseo runs. Most of this happens before the $vb super class even exists.

    If you're wanting to use vbseo varaibles, you should be hacking the vbseo php files to perform your replacememnts. Otherwise, it will be out of scope.

Similar Threads

  1. vBulletin 4.x Modifying title of threads
    By nightfish in forum Troubleshooting
    Replies: 1
    Last Post: 11-14-2010, 03:37 PM
  2. Shouldnt subforum keywords show up in meta keywords?
    By dingo in forum General Discussion
    Replies: 1
    Last Post: 08-23-2009, 07:34 AM
  3. Modifying Outgoing Links
    By njdevils in forum Custom Rewrite Rules
    Replies: 0
    Last Post: 11-07-2008, 06:28 PM
  4. Modifying ad panel
    By AndyS in forum Template Modifications
    Replies: 2
    Last Post: 07-15-2006, 03:17 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
  •