• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 3.x Series
    • Bug
    • Help with Button for "New Article"

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: Help with Button for "New Article"

    • Issue Tools
      • View Changes
    1. issueid=1391 April 6, 2010 9:02 PM
      Kaelon Kaelon is offline
      Regular Member
      Help with Button for "New Article"

      I am trying to create a graphical button for a "New Article" within one of my Wiki articles (a main portal page that I am creating), but doing so creates the link as if it were an external link. Is there a way that I can suppress the external link graphic (the arrows), or is there a preferred/better way of creating a link to create a new article within the current Wiki namespace? Thank you in advance!
    Issue Details
    Issue Number 1391
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category BB-Code Parsing
    Status Fixed
    Priority 1 - Security / Login / Data Loss
    Affected Version 3.0.0 RC 1
    Fixed Version 3.0.0 RC 2
    Milestone VaultWiki 3.0.0
    Software DependencyAny
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. April 6, 2010 10:18 PM
      pegasus pegasus is offline
      VaultWiki Team
      This is a bug, and will be fixed for the next build. In vault/special_class_bbcode.php, find:
      Code:
      		$protocol[7] = substr($rightlink, 0, 7);
      		$newslink = false;
      
      		if ($this->registry->options['newshow_filename'])
      		{
      			$newslink = (strpos($rightlink, $this->registry->options['newshow_filename'] . ".php?t=") !== false);
      		}
      
      		if (
      			(
      				$protocol[7] == "http://" OR
      				strpos($rightlink, "gopher://") !== false
      			) AND
      			!$newslink
      		)
      		{
      			$class = ' class="link-http"';
      		}
      		else if (strpos($rightlink, "https://") !== false)
      		{
      			$class = ' class="link-https"';
      		}
      		else if ($protocol[7] == "news://" OR $newslink)
      		{
      			$class = ' class="link-news"';
      		}
      		else
      		{
      			$protocol[5] = substr($rightlink, 0, 6);
      
      			if ($protocol[5] == "ftp://")
      			{
      				$class = ' class="link-ftp"';
      			}
      			else if ($protocol[5] == "irc://")
      			{
      				$class = ' class="link-irc"';
      			}
      		}
      		unset($protocol, $newslink);
      Replace with:
      Code:
      		$newslink = false;
      
      		if ($this->registry->options['newshow_filename'])
      		{
      			$newslink = (strpos($rightlink, $this->registry->options['newshow_filename'] . ".php?t=") !== false);
      		}
      
      		$protocol5 = substr($rightlink, 0, 6);
      		$protocol7 = substr($rightlink, 0, 7);
      
      		if ($protocol5 == 'ftp://')
      		{
      			$class = ' class="link-ftp"';
      		}
      		else if ($protocol5 == 'irc://')
      		{
      			$class = ' class="link-irc"';
      		}
      		else if ($protocol7 == 'news://' OR $newslink)
      		{
      			$class = ' class="link-news"';
      		}
      		else if ($is_external)
      		{
      			if (strpos($rightlink, 'https://') === 0)
      			{
      				$class = ' class="link-https"';
      			}
      			else
      			{
      				$class = ' class="link-http"';
      			}
      		}
      Reply Reply  
    2. April 6, 2010 10:41 PM
      Kaelon Kaelon is offline
      Regular Member
      Thanks so much, pegasus. Awesome fix.
      Reply Reply  
    3. April 7, 2010 3:25 AM
      Mokonzi Mokonzi is offline
      Senior Member
      That worked for me, thanks Pegasus.
      Reply Reply  
    4. This petition for a change to Confirmed was accepted
      April 8, 2010 5:27 PM
      Kaelon Kaelon is offline
      Regular Member
      A couple of problems:

      1. The external link is simply removed from the first external link; it appears on the second (and all subsequent) external link, without regard to whether or not it is a newthread button.

      2. There needs to be a way to exempt links to wiki-forums and links to create posts/replies on wiki forums. These are often used on interface panels.

      Thoughts?
       
    5. April 8, 2010 6:31 PM
      pegasus pegasus is offline
      VaultWiki Team
      In vault/special_class_bbcode.php, find:
      Code:
      				$target_url = preg_replace('#^([a-z0-9]+:(//)?)#', '', $rightlink);
      
      				foreach ($allowed AS $host)
      				{
      					if (stripos($target_url, $host) !== false)
      					{
      						$is_external = false;
      					}
      				}
      			}
      Replace with:
      Code:
      			}
      
      			$target_url = preg_replace('#^([a-z0-9]+:(//)?)#', '', $rightlink);
      
      			foreach ($allowed AS $host)
      			{
      				if (stripos($target_url, $host) !== false)
      				{
      					$is_external = false;
      				}
      			}
      Reply Reply  
    6. April 8, 2010 6:37 PM
      Kaelon Kaelon is offline
      Regular Member
      Thanks. Does this keep external links on non-wiki forum posts? I definitely want to keep the external links on those.
      Reply Reply  
    7. April 8, 2010 8:04 PM
      pegasus pegasus is offline
      VaultWiki Team
      Currently the wiki parser class that we are modifying here is not used in non-wiki forum posts.
      Reply Reply  
    8. April 8, 2010 8:37 PM
      Kaelon Kaelon is offline
      Regular Member
      Quote Originally Posted by pegasus
      Currently the wiki parser class that we are modifying here is not used in non-wiki forum posts.
      Sorry, that's not what I meant.

      The modifications we did here only prevents the first "external" link on a wiki post from appearing with the external arrows icon. Any other external links will have the arrows. What I was hoping we would do was exempt links to wiki-type forums and wiki-type forum functions (newthread, newreply, etc.) on qualifying wiki forums and threads. Is this possible?
      Reply Reply  
    9. April 9, 2010 3:12 PM
      Mokonzi Mokonzi is offline
      Senior Member
      Quote Originally Posted by Kaelon
      1. The external link is simply removed from the first external link; it appears on the second (and all subsequent) external link, without regard to whether or not it is a newthread button.
      As a note, I'm not getting this problem. I've got a table displaying several links to the Profile page, each one for a different user, none are showing the external link symbol to appear.
      Reply Reply  
    10. April 9, 2010 3:15 PM
      pegasus pegasus is offline
      VaultWiki Team
      In vBulletin 4, the second part of the bug only occurs if Settings > Options > BB Code Settings > Add nofollow attribute to URL BB Code is set to "Yes".
      Reply Reply  
    11. This petition for a change to Awaiting Feedback was accepted
      April 10, 2010 5:54 PM
      Kaelon Kaelon is offline
      Regular Member
      Pegasus - any chance you've been able to review this?

      1. This fix just has any links to to the same domain being considered "internal". I just want links outside of the Wiki being considered external. Can this be fixed?

      2. Additionally, can we simply exempt links to wiki-type forums from being considered "external"? This would fix the problem altogether, I think.
       
    12. April 15, 2010 6:38 PM
      pegasus pegasus is offline
      VaultWiki Team
      1. As of the next build, all links are considered external if they use [URL].

      2. There is no way to reliably test links to see if they resolve as wiki-type forums without using something like CURL, which from a performance standpoint is a no-no for something as trivial as setting a CSS class.

      Instead, the little-known feature of URL-flagging has been extended for the next build. You can force a class by setting the flag: FTP, IRC, NEWS, SECURE. You can also force the link to not gain the external class by setting the INTERNAL flag. All of these flags are translateable phrases.
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 11:43 PM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2023 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2023 DragonByte Technologies Ltd.
    Copyright © 2008 - 2013 VaultWiki Team, Cracked Egg Studios, LLC.