• 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
    • Footnote numbering error

    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: Footnote numbering error

    • Issue Tools
      • View Changes
    1. issueid=639 June 20, 2009 11:22 PM
      tommythejoat tommythejoat is offline
      Regular Member
      Footnote numbering error
      Footnote reuse does not work correctly.

      Footnote references for multiple references to the same footnote are not handled properly. Rather than reusing the original reference number, they generate a new number each time. It should behave as it does on Wikipedia. Also the back references should start with a instead of b for multiples. Although clicking on the numbered link goes to the proper reference, the highlighting does not appear, so it can be difficult to determine exactly what the reference was.
    Issue Details
    Issue Number 639
    Issue Type Bug
    Project VaultWiki 3.x Series
    Category BB-Code Parsing
    Status Fixed
    Priority 4 - Warnings / Script Errors
    Affected Version 2.3.1
    Fixed Version 2.3.2
    Milestone (none)
    Software DependencyAny
    Users able to reproduce bug 0
    Users unable to reproduce bug 0
    Attachments 1
    Assigned Users (none)
    Tags (none)


    Page 1 of 2 12 Next LastLast


    1. June 21, 2009 1:44 AM
      pegasus pegasus is offline
      VaultWiki Team
      This is somewhat difficult to achieve because the BB-Code parser doesn't necessarily parse the footnotes in the order they appear. I will try to find a workaround tomorrow.
      Reply Reply  
    2. June 21, 2009 12:24 PM
      pegasus pegasus is offline
      VaultWiki Team
      Please provide a link to an article where this erroneous numbering has occurred.
      Reply Reply  
    3. June 21, 2009 2:54 PM
      tommythejoat tommythejoat is offline
      Regular Member
      Here is a link to an article with confusing footnote numbers.

      http://mb.nawcc.org/showwiki.php?tit...C+Aaron+Lufkin

      The author also wrote exactly the same article on Wikipedia, if you would like to see the footnote management that we would like.

      http://en.wikipedia.org/wiki/Aaron_Lufkin_Dennison
      Reply Reply  
    4. June 21, 2009 4:36 PM
      pegasus pegasus is offline
      VaultWiki Team
      I noticed that your editor is kind of screwy for me. For starters, make this edit (vault/special_plugins.php):
      Code:
      	if (
      		$vbulletin->options['vault_seo'] AND
      		strpos($_SERVER['REQUEST_URI'], '/' . $vbulletin->options['ces_wiki_php'] . '/') !== false
      	)
      Replace with:
      Code:
      	if (THIS_SCRIPT == 'showwiki')
      Reply Reply  
    5. June 21, 2009 4:50 PM
      tommythejoat tommythejoat is offline
      Regular Member
      I am not sure what you mean about the editor? I just installed 3.8.3 last night. As far as I know our editor is the standard vBulletin editor with mods from you.

      Is it different from the editors others are using with Vault Wiki?

      =========== Later =========================

      I find that I don't know where you are suggesting that the edits be made. Which module is this code in? Is it a template edit?
      Reply Reply  
    6. June 21, 2009 5:41 PM
      pegasus pegasus is offline
      VaultWiki Team
      Sorry forgot to put the filename: vault/special_plugins.php
      Reply Reply  
    7. June 21, 2009 6:01 PM
      tommythejoat tommythejoat is offline
      Regular Member
      What happened here? The editor was not really working at all. None of the buttons were functional.

      Editing an article is thoroughly broken. None of the edit buttons ae functional. The above change did not affect that behavior.

      Text can be entered, but nothing else.

      ============================ Later ===============================

      Initial creation of an article is working just fine (do=create), but editing disables all the references in the editor. Is it possible that this is related to the changes for vbseo that required updates to htaccess. I am still running the same htaccess I was running with pl1.
      Reply Reply  
    8. June 21, 2009 6:52 PM
      pegasus pegasus is offline
      VaultWiki Team
      In showwiki.php, find:
      PHP Code:
      $xml->add_tag('url', $threadinfo['url'] . $vbulletin->session->vars['vw_sessionurl_d'] . "do={1:tabid}"); 
      Replace with:
      PHP Code:
      $xml->add_tag('url', $threadinfo['url'] . $vbulletin->session->vars['vw_sessionurl_js'] . "do={1:tabid}"); 
      Reply Reply  
    9. June 21, 2009 7:26 PM
      tommythejoat tommythejoat is offline
      Regular Member
      Thanks, that fixed it.

      I am still curious how this got into the release (if that is what happened).

      ================================

      My users tell me that smileys were working before this last upgrade, but they no longer display. It is not really editor related since the smiley codes show up, but they are suppressed and not displayed.
      Reply Reply  
    10. June 21, 2009 7:32 PM
      pegasus pegasus is offline
      VaultWiki Team
      The internal URL structure was changed. Now that your editor is working, I can have a look into the original footnotes issue.
      Reply Reply  
    11. June 22, 2009 12:13 PM
      pegasus pegasus is offline
      VaultWiki Team
      Please link to a page with the smilies issue. I have checked the changelogs, and there were no significant changes to the parser in 2.3.1 that would account for something like this.
      Reply Reply  
    12. June 22, 2009 12:34 PM
      tommythejoat tommythejoat is offline
      Regular Member
      http://mb.nawcc.org/showwiki.php?tit...it&redirect=no

      The page is a frustration vent by one of our users trying to learn the wiki.

      There seems to be a throttling control on smileys that is probably a good thing. Smileys in articles also require a leading space, which they do not require in forum posts.

      i.e. Ooooh I am mad.:bang::bang::bang: results in no display but does show the text, while "I am confused. shows neither the text nor the smiley.

      If it is a bug it is a very minor one. We don't want smileys in articles in any case.
      Reply Reply  
    13. June 22, 2009 12:57 PM
      pegasus pegasus is offline
      VaultWiki Team
      Fixed the smilies problem. The code was still from 3.7 and Jelsoft definitely updated the smiley code since then.

      In vault/special_class_bbcode.php, find:
      Code:
      	function parse_smilies($text, $do_html = false)
      	{
      		$cache =& $this->cache_smilies($do_html);
      		$this->local_smilies =& $cache;
      
      		$quoted = array();
      		foreach ($cache AS $find => $replace)
      		{
      			$quoted[] = preg_quote($find, '#');
      
      			if (sizeof($quoted) > 100)
      			{
      				$text = preg_replace_callback(
      					'#(?:^|[^\w]){1}(?<!&amp|&quot|&lt|&gt|&copy|&\#[0-9]{1}|&\#[0-9]{2}|&\#[0-9]{3}|&\#[0-9]{4}|&\#[0-9]{5})(' . 
      						implode('|', $quoted) . ')(?:$|[^\w]){1}#s',
      					array(&$this, 'replace_smilies'),
      					$text
      				);
      
      				$quoted = array();
      			}
      		}
      
      		if (sizeof($quoted) > 0)
      		{
      			$text = preg_replace_callback(
      				'#(?:^|[^\w]){1}(?<!&amp|&quot|&lt|&gt|&copy|&\#[0-9]{1}|&\#[0-9]{2}|&\#[0-9]{3}|&\#[0-9]{4}|&\#[0-9]{5})(' .
      					implode('|', $quoted) . ')(?:$|[^\w]){1}#s',
      				array(&$this, 'replace_smilies'),
      				$text
      			);
      		}
      
      		return $text;
      	}
      Replace with:
      Code:
      	function parse_smilies($text, $do_html = false)
      	{
      		static $regex_cache;
      
      		$this->local_smilies =& $this->cache_smilies($do_html);
      
      		$cache_key = ($do_html ? 'html' : 'nohtml');
      
      		if (!isset($regex_cache["$cache_key"]))
      		{
      			$regex_cache["$cache_key"] = array();
      			$quoted = array();
      
      			foreach ($this->local_smilies AS $find => $replace)
      			{
      				$quoted[] = preg_quote($find, '/');
      				if (sizeof($quoted) > 500)
      				{
      					$regex_cache["$cache_key"][] = '/(?<!&amp|&quot|&lt|&gt|&copy|&#[0-9]{1}|&#[0-9]{2}|&#[0-9]{3}|&#[0-9]{4}|&#[0-9]{5})(' . implode('|', $quoted) . ')/s';
      					$quoted = array();
      				}
      			}
      
      			if (sizeof($quoted) > 0)
      			{
      				$regex_cache["$cache_key"][] = '/(?<!&amp|&quot|&lt|&gt|&copy|&#[0-9]{1}|&#[0-9]{2}|&#[0-9]{3}|&#[0-9]{4}|&#[0-9]{5})(' . implode('|', $quoted) . ')/s';
      			}
      		}
      
      		foreach ($regex_cache["$cache_key"] AS $regex)
      		{
      			$text = preg_replace_callback($regex, array(&$this, 'replace_smilies'), $text);
      		}
      
      		return $text;
      	}
      Reply Reply  
    14. June 22, 2009 1:22 PM
      pegasus pegasus is offline
      VaultWiki Team
      Fixed footnotes. In vault/special_class_bbcode.php, find:
      PHP Code:
      function handle_bbcode_footnote($value, $option) 
      Replace with:
      PHP Code:
      function handle_bbcode_footnote($title = '', $option = '') 
      Find:
      Code:
      		$title = html_entity_decode($value);
      		$option = $vault->anchorify($option);
      Replace with:
      Code:
      		if (!empty($option))
      		{
      			$option = $vault->anchorify($option);
      		}
      Find:
      Code:
      		if ($new)
      		{
      			$vault->parser['footnote']['list'][count($vault->parser['footnote']['list']) + 1] = array(
      				'refname' => $option,
      				'content' => $title
      			);
      		}
      Replace with:
      Code:
      		if ($new)
      		{
      			$num = count($vault->parser['footnote']['list']) + 1;
      
      			$vault->parser['footnote']['list']["$num"] = array(
      				'refname' => $option,
      				'content' => $title
      			);
      		}
      		else
      		{
      			foreach ($vault->parser['footnote']['list'] AS $key => $info)
      			{
      				if ($info['refname'] != $option)
      				{
      					continue;
      				}
      
      				$num = $key;
      
      				if (empty($info['content']) AND !empty($title))
      				{
      					$vault->parser['footnote']['list']["$key"]['content'] = $title;
      				}
      
      				break;
      			}
      		}
      Find:
      PHP Code:
      $return_value .= ">[" . $vault->parser['footnote']['total'] . "]</a></span>"; 
      Replace with:
      PHP Code:
      $return_value .= ">[$num]</a></span>"; 
      Find:
      Code:
      					$i++;
      
      					$note .= " <a href=\"";
      Replace with:
      Code:
      					$note .= " <a href=\"";
      Find:
      Code:
      					if ($ref_count > 1)
      					{
      						$note .= "><i>$alphabet[$i]</i></a>";
      					}
      Add after:
      Code:
      					$i++;
      And that's it!
      Reply Reply  
    15. June 22, 2009 4:00 PM
      tommythejoat tommythejoat is offline
      Regular Member
      Quote Originally Posted by pegasus
      Fixed the smilies problem. The code was still from 3.7 and Jelsoft definitely updated the smiley code since then.
      Thanks for the work on this, but I seem to have different source code than displayed in your target for the patch;

      Wow!!! that is too insanely cool. The code] [/code] bb codes do not work so I could not see the real target or replacement code until I tried to edit my reply saying that there was something wrong.
      Reply Reply  
    Page 1 of 2 12 Next LastLast
    + 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 4:21 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.