• 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
    • NuWiki bbcode converter omits WIKI tag rename

    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: NuWiki bbcode converter omits WIKI tag rename

    • Issue Tools
      • View Changes
    1. issueid=1371 April 5, 2010 10:34 AM
      Kaelon Kaelon is offline
      Regular Member
      NuWiki bbcode converter omits WIKI tag rename
      Disregards piping where [wiki]RealName|DisplayName[/wiki]

      The NuWiki bbcode converter does not touch the widely used NuWiki bbcode convention [wiki]WikiName|WikiDisplayName[/wiki] which should become in VaultWiki [wiki=WikiName]WikiDisplayName[/wiki]. The NuWiki bbcode converter should be updated to correct this functionality.

      As an aside -- is there anything that those of us who have already converted our NuWiki posts to VaultWiki posts can do to correct this?
    Issue Details
    Issue Number 1371
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category Importing
    Status Fixed
    Priority 3 - Loss of Functionality
    Affected Version 3.0.0 RC 1
    Fixed Version 3.0.0 RC 1
    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 5, 2010 12:59 PM
      pegasus pegasus is offline
      VaultWiki Team
      Fixed in the current ZIP. In vault/special_legacy_nuwiki.php, find:
      Code:
      		return preg_replace('#\[\[(.*)\]\]#U', "[$tag]\\1[/$tag]", $text);
      Replace with:
      Code:
      		$text = preg_replace('#\[\[(.*)\]\]#U', "[$tag]\\1[/$tag]", $text);
      		$text = preg_replace('#\[wiki\]([^\|\[\]]*)\|([^\|\[\]]*)\[/wiki\]#U', "[$tag=\\1]\\2[/$tag]", $text);
      
      		return $text;
      You should be able to run the converter again, but if you had problems with the == equals signs in the past, make sure the following line:
      Code:
      		if (preg_match_all('#(={1,7})(.*)\1#U', $text, $matches))
      is replaced with:
      Code:
      		if (preg_match_all('#(?:^|\v)(={1,7})(.*)\1#', $text, $matches))
      Reply Reply  
    2. This petition for a change to Confirmed was accepted
      April 5, 2010 1:15 PM
      Kaelon Kaelon is offline
      Regular Member
      I just ran this without checking your code. This is broken. You caused the tags to appear as:

      Code:
       [wiki=Wikiname]Display Name[/tag]
      Note the "[/tag]" at the end. How can I quickly repair this on my Wiki?
       
    3. April 5, 2010 1:18 PM
      Mokonzi Mokonzi is offline
      Senior Member
      The first replacement code was wrong, should have been:

      Code:
      		$text = preg_replace('#\[\[(.*)\]\]#U', "[$tag]\\1[/$tag]", $text);
      		$text = preg_replace('#\[wiki\]([^\|\[\]]*)\|([^\|\[\]]*)\[/wiki\]#U', "[$tag=\\1]\\2[/$tag]", $text);
      
      		return $text;
      If you've got a roll back (i.e. a backup from before you ran the converter), I'd run it again with that code.
      Reply Reply  
    4. April 5, 2010 1:21 PM
      Kaelon Kaelon is offline
      Regular Member
      Quote Originally Posted by Mokonzi
      The first replacement code was wrong, should have been:

      Code:
      		$text = preg_replace('#\[\[(.*)\]\]#U', "[$tag]\\1[/$tag]", $text);
      		$text = preg_replace('#\[wiki\]([^\|\[\]]*)\|([^\|\[\]]*)\[/wiki\]#U', "[$tag=\\1]\\2[/$tag]", $text);
      
      		return $text;
      If you've got a roll back (i.e. a backup from before you ran the converter), I'd run it again with that code.
      Unfortunately, I did not run a roll-back (it takes us around 30 mins to backup our entire database, so we tend to do this nightly). Can you supply me with a quick code-snippet to insert (and where to inset it) into the conversion to correct all instances of [/tag] with [/wiki] -- so that I can run it again on the current-state database?
      Reply Reply  
    5. April 5, 2010 1:37 PM
      pegasus pegasus is offline
      VaultWiki Team
      Find:
      Code:
      $text = preg_replace('#\[wiki\]
      Add before:
      Code:
      $text =str_replace('[/tag]', '[/wiki]', $text);
      Remove that line when you're done.
      Reply Reply  
    6. April 5, 2010 1:41 PM
      Kaelon Kaelon is offline
      Regular Member
      Thanks, pegasus. That fixed it!
      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 9:53 AM.
    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.