Page 17 of 17 FirstFirst ... 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Results 241 to 247 of 247
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; Originally Posted by mmllc Alright, this is over my head - I'm trying to add a simple link in the ...

  1. #241
    Junior Member Array
    Real Name
    Cody Overcash
    Join Date
    May 2008
    Posts
    22
    Liked
    0 times
    Quote Originally Posted by mmllc View Post
    Alright, this is over my head - I'm trying to add a simple link in the newsbits of vBAdvanced on my forum, so each news post also has a link to it in the vBSEO rewritten style - NOT the vB style link. I can't figure it out. I know the answer is in this thread somewhere, but am clueless as to where. Help?
    Quote Originally Posted by mmllc View Post
    Alright, I've been Googling and searching here as well for 3 days now, I give up...
    Quote Originally Posted by mmllc View Post
    I'd be happy to pay someone for their time.
    Alright, finally figured this out. For anyone who Googles around trying to figure out what I did, here's what worked.

    I created a plugin, I called it vbseod url.

    The product was vBulletin, hook location is vbcms_article_populate_end. Execution order I set at 5. The following was the plugin code that eventually worked:

    Code:
    $replace_forvbseo = array('http://modmyi.com','http://www.modmyi.com','content.php?r=','.');
    $replace_withvbseo= array('','','','-');
    
    $replace_forvbseo2 = array('-as-','-of-','-in-','-is-','-an-','-and-','-with-','-for-','-to-','-this-');
    $replace_withvbseo2 = array('-','-','-','-','-','-','-','-','-','-');
    
    $view->page_url_vbseo = str_replace($replace_forvbseo2,$replace_withvbseo2,strtolower($vbulletin->options['bburl'] . '/content' . (str_replace($replace_forvbseo,$replace_withvbseo,($view->page_url))) . '.html'));
    This creates a variable you can use in vBCMS called page_url_vbseo. You can of course set that to whatever you'd like, that's just what I used. You'll also need to change where I have Apple, iPhone and iPad Forums at ModMyi - Home and Apple, iPhone and iPad Forums at ModMyi - Home to your domain.

    For some reason simply using the $replace_withvbseo wasn't working for CMS articles, so I had to add in some manual stuff. I think I have the majority of them replaced (see $replace_forvbseo2 where I have listed the words I've found which still needed to be removed). If you need to add to those, you'll have to add them in that line.

    Then I had a nice variable working which I could put in my templates anywhere by adding {vb:raw page_url_vbseo}.

    For instance, in my site, I decided to put Twitter, Facebook, and Google Plus on the homepage as options, so used this code:

    Code:
    <div id="share" style="margin: 3px 0 3px 0;"><a href="http://twitter.com/share" class="twitter-share-button" data-text="Nice article -" data-url="{vb:raw page_url_vbseo}" data-count="horizontal" data-via="modmyi">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script><g:plusone size="medium" href="{vb:raw page_url_vbseo}"></g:plusone><script type="text/javascript">
      (function() {
        var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
        po.src = 'https://apis.google.com/js/plusone.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
      })();
    </script><span id="fb-root"></span>
    <script>(function(d){
      var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
      js = d.createElement('script'); js.id = id; js.async = true;
      js.src = "//connect.facebook.net/en_US/all.js#appId=246181135426205&xfbml=1";
      d.getElementsByTagName('head')[0].appendChild(js);
    }(document));</script>
    <span class="fb-like" data-href="{vb:raw page_url_vbseo}" data-send="false" data-layout="button_count" data-width="115" data-height="18" data-show-faces="false"></span></div>
    That may change as each platform adjusts their button codes, but it's just the individual button codes (Google any buttons you'd like to get their code). Notice in there where I have put the {vb:raw page_url_vbseo} code. Make sure when you get your button code you tell it NOT to use the URL it's on, but a custom URL. Then replace it with the above bold code, and that's how I got the correct code from the large block above.

    Anyway, months and months later, finally arrived at a solution, no help from here. Figured I'd give back as it seems a fairly common need to be able to have share buttons per article on the front page (almost all large news blogs do this). Hope this helps.

  2. #242
    Member Array
    Real Name
    Marcus Maciel
    Join Date
    Oct 2006
    Location
    Brazil
    Posts
    83
    Liked
    4 times
    I made same thing with less lines...

    try create plugin like

    Code:
    $teste1 = $this->content->getNodeId();
    $teste2 = vB_Content::getTitle();
    
    
    $testurl = "$teste1-$teste2";
    $newcmsurl =  vbseo_cms_url($testurl, 'content', true, array('r'=>$testurl));
    
    
    $newcmsurl = "http://yoururl.com/" . $newcmsurl;
    
    
    $view->fburlseo = $newcmsurl;

  3. #243
    Member Array
    Real Name
    Jon
    Join Date
    Apr 2010
    Posts
    41
    Liked
    0 times
    So I can not figure this out.

    I have a link like so: "showbattle.php?b=3"

    How can I get it so the showbattle.php file gets the title and rewrites it into the URL?

  4. #244
    vBSEO.com Webmaster Array Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,463
    Liked
    721 times
    Blog Entries
    4
    You first need to modify your script to add titles to the URLs then use CRR's to rewrite URLs
    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

  5. #245
    Member Array
    Real Name
    Jon
    Join Date
    Apr 2010
    Posts
    41
    Liked
    0 times
    Quote Originally Posted by Mert Gökçeimam View Post
    You first need to modify your script to add titles to the URLs then use CRR's to rewrite URLs
    Ok. I got making the SEO title but how do I add it to the url?

  6. #246
    vBSEO.com Webmaster Array Mert Gökçeimam's Avatar
    Real Name
    Lizard King
    Join Date
    Oct 2005
    Location
    Istanbul, Turkey, Turkey
    Posts
    23,463
    Liked
    721 times
    Blog Entries
    4
    Hello ,

    You need to use CRR module to include them. Please check examples supplied on CRR module or create a thread on your own with examples url that needs to be rewritten.
    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

  7. #247
    Senior Member Array
    Real Name
    John
    Join Date
    Dec 2005
    Posts
    786
    Liked
    36 times
    I have this working great except for the letter "a/" appearing before the thread URL. I'm calling things like this:
    PHP Code:
    vbseo_startup();
    $threadrow mysql_fetch_array($resultMYSQL_ASSOC); 
    $threadurl vbseo_thread_url_row($threadrow); 
    Any ideas?

Page 17 of 17 FirstFirst ... 4 5 6 7 8 9 10 11 12 13 14 15 16 17

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
  •