PTVPopups-Talk

Summary: Talk page for PTVPopups.
Maintainer: ccox
Users: (View / Edit)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.

Problem with German Umlauts

If a PTV is followed by a German Umlaut (ä,ö,ü), the recipe does it's action, even thoughI don't want to. For example: I have defined Pr=Personenregister, then „Präposition“ gives popup „Personenregister“ from the first two letters. What can I do? – Martin, March 23, 2020

Question 02.08.2018 - Nobody who can help me?

This recipe did work very fine, but since a few days id does only work if I put the "{(ptvpopups Site.Glossar)}" directly into the page - but not into GroupHeader or SiteHeader or tmpl file. I tried everything.

Try emailing CCox, his address is near the top of ptvpopups.phpΔ. He usually replies quickly, here he may not have noticed that this page has been modified. --Petko August 04, 2018, at 07:42 PM

I replied via email, couldn't remember if I already did. I tested the recipe on a fresh latest PmWiki and it worked. Recommended that you check if you meant PmWiki.Glossary instead of Site.Glossary. ccox August 19, 2018, at 03:53 AM

Answered Question 2017:

Excuse me for my bad English...

This rezipe ist wunderfull - but when I go to "preview", it puts html-Code like <span class='ptvpopKB' def='Exampletext'>Example</span> into my Wikicode! What can I do?

I solved the problem writing in config.php: if ($action != 'edit' and PageVar($pagename, '$FullName') != "Abnl.Abnl") include_once("cookbook/ptvpopups.php"); (Abnl.Abnl ist a file with about 3000 lines of text, where the rezipe crashed too.

In the recipe, find >retore and change it to <restore. Actually, I think that's the "right" answer. ccox July 24, 2017, at 04:53 PM


I've looked at the recipe and noticed a slight optimization is possible. The CSS does not need to be defined for every PTV popup, simply move it before the last "}" of your function:

  $HTMLStylesFmt["ptvpopspan"] =
    "#wikitext .ptvpop { border-bottom: 1px dashed #000; }";
  $HTMLStylesFmt["ptvpopsearch"] =
    "#wikitext .ptvpop:hover:after { background: rgba(20,0,0,0.85) none repeat scroll 0 0;
       border-radius: 6px;color: #fff;content: attr(def);margin-left:10px;margin-top:-10px;
       padding:3px 6px 3px 6px;position: absolute;max-width:300px;font-size:small; }";  

And the Markup replacement line:

  "<span class='ptvpop' def='$val'>$1</span>"

Note how I've removed the '$word' variable from both snippets. This way the CSS will be inserted only once and will apply to all popups. --Petko July 26, 2017, at 03:10 AM

Optimized and released! Thanks. ccox July 26, 2017, at 06:00 PM

Talk page for the PTVPopups recipe (users).

Array
(
    [post_max_size] => 64M
    [$_POST keys] => 
    [$_REQUEST keys] => n
    [$_SERVER] => Array
        (
            [CONTEXT_DOCUMENT_ROOT] => /home/pmwiki/public_html
            [CONTEXT_PREFIX] => 
            [DOCUMENT_ROOT] => /home/pmwiki/public_html
            [GATEWAY_INTERFACE] => CGI/1.1
            [HTTPS] => on
            [HTTP_ACCEPT] => */*
            [HTTP_ACCEPT_ENCODING] => gzip, br, zstd, deflate
            [HTTP_COOKIE] => imstime=1777639516; PHPSESSID=7aon5ikhksj9if1ja5hta997h4
            [HTTP_HOST] => www.pmwiki.org
            [HTTP_USER_AGENT] => Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
            [HTTP_X_HTTPS] => 1
            [PATH] => /bin:/usr/bin
            [PHP_INI_SCAN_DIR] => /opt/cpanel/ea-php70/root/etc:/opt/cpanel/ea-php70/root/etc/php.d:.
            [QUERY_STRING] => n=Cookbook%2fPTVPopups%2dTalk
            [REDIRECT_HTTPS] => on
            [REDIRECT_QUERY_STRING] => n=Cookbook%2fPTVPopups%2dTalk
            [REDIRECT_SCRIPT_URI] => https://www.pmwiki.org/wiki/Cookbook/PTVPopups-Talk
            [REDIRECT_SCRIPT_URL] => /wiki/Cookbook/PTVPopups-Talk
            [REDIRECT_SSL_TLS_SNI] => www.pmwiki.org
            [REDIRECT_STATUS] => 200
            [REDIRECT_UNIQUE_ID] => afSgcAWrbYATEXRKm3rCQQAAAMY
            [REDIRECT_URL] => /wiki/Cookbook/PTVPopups-Talk
            [REMOTE_ADDR] => 216.73.216.25
            [REMOTE_PORT] => 14598
            [REQUEST_METHOD] => GET
            [REQUEST_SCHEME] => https
            [REQUEST_URI] => /wiki/Cookbook/PTVPopups-Talk
            [SCRIPT_FILENAME] => /home/pmwiki/public_html/index.php
            [SCRIPT_NAME] => /index.php
            [SCRIPT_URI] => https://www.pmwiki.org/wiki/Cookbook/PTVPopups-Talk
            [SCRIPT_URL] => /wiki/Cookbook/PTVPopups-Talk
            [SERVER_ADDR] => 23.254.203.248
            [SERVER_ADMIN] => webmaster@pmwiki.org
            [SERVER_NAME] => www.pmwiki.org
            [SERVER_PORT] => 443
            [SERVER_PROTOCOL] => HTTP/1.1
            [SERVER_SIGNATURE] => 
            [SERVER_SOFTWARE] => Apache
            [SSL_TLS_SNI] => www.pmwiki.org
            [TZ] => America/Los_Angeles
            [UNIQUE_ID] => afSgcAWrbYATEXRKm3rCQQAAAMY
            [PHP_SELF] => /index.php
            [REQUEST_TIME_FLOAT] => 1777639536.869
            [REQUEST_TIME] => 1777639536
            [argv] => Array
                (
                    [0] => n=Cookbook%2fPTVPopups%2dTalk
                )

            [argc] => 1
        )

)