Results 1 to 1 of 1

Thread: please fix avatarurl with absolute urls, once and for all

  1. #1
    Join Date
    Feb 2004
    Posts
    3

    Default please fix avatarurl with absolute urls, once and for all

    Hi,

    Every single time I update cmps I have to hack the sources. It's not a big hack, but annoying nonetheless. The issue is that welcomeblock.php does not check if avatarurl is a relative or absolute url, and unconditionally prepends bburl to the avatarurl. This is wrong, since every other part of vb is perfectly happy with avatarurl that is absolute. Here is my patch, I imagine you will want to include https and/or do it otherwise.

    PHP Code:
    --- /home/mazdamp3/downloads/vBadvancedCMPS-4_0_1/forum/modules/welcomeblock.php        1956-06-29 17:31:44.000000000 -0400
    +++ modules/welcomeblock.php    2010-09-07 11:00:49.060307487 -0400
    @@ -29,+29,10 @@

                            if (
    $avatarurl[0])
                            {
    -                               
    $avatarurl $vbulletin->options['bburl'] . '/' $avatarurl[0];
    +                               if (
    0===stripos($avatarurl[0], "http:"))
    +                                       
    $avatarurl $avatarurl[0];
    +                               else
    +                                       
    $avatarurl $vbulletin->options['bburl'] . '/' $avatarurl[0];
                            }
                            else if (
    $mod_options['portal_noavatarurl'])
                            {


    --- /
    home/mazdamp3/downloads/vBadvancedCMPS-4_0_1/forum/modules/news.php        1956-06-29 16:31:44.000000000 -0500
    +++ news.php    2010-09-07 13:06:41.697584486 -0400
    @@ -398,+398,10 @@
                                    {
                                          if (
    $news['avatarpath'])
                                          {
    -                                       
    $news['avatarpath'] = $vbulletin->options['bburl'] . '/' $news['avatarpath'];
    +                                       if (
    0===stripos($news['avatarpath'], "http:"))
    +                                               
    $news['avatarpath'] = $news['avatarpath'];
    +                                       else
    +                                               
    $news['avatarpath'] = $vbulletin->options['bburl'] . '/' $news['avatarpath'];
                                          }
                                          else if (
    $news['hascustom'])
                                          { 
    Thanks for a great product.
    Last edited by enry; 09-07-2010 at 02:15 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Can´not add some URLs
    By redlabour in forum Troubleshooting & Problems
    Replies: 3
    Last Post: 12-07-2008, 04:50 PM
  2. Absolute navbar links?
    By M_C in forum Troubleshooting & Problems
    Replies: 1
    Last Post: 05-12-2008, 03:21 PM
  3. Relative vs absolute path ?
    By wii in forum "How Do I..." Questions
    Replies: 1
    Last Post: 02-21-2008, 10:37 PM
  4. How to change the $avatarurl
    By SE7ENSINS com in forum Troubleshooting & Problems
    Replies: 1
    Last Post: 12-19-2006, 06:10 PM
  5. Create an absolute page?
    By Grumpy ol' Jim in forum "How Do I..." Questions
    Replies: 4
    Last Post: 06-05-2006, 05:49 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
  •