DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:tagentry

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
plugin:tagentry [2019-10-17 20:54] trailjeepplugin:tagentry [2020-06-06 03:54] trailjeep
Line 3: Line 3:
 ---- plugin ---- ---- plugin ----
 description : Assign tags using checkboxes description : Assign tags using checkboxes
-author      : Robin Gareus, Sphaira +author      : Trailjeep 
-email       : sphairadev@null.net+email       : trailjeep@gmail.com
 type        : action type        : action
-lastupdate 2018-02-15 +lastupdate 2019-10-17 
-compatible  : 2008-05-05, Mulled Wine, Lemming, Anteater, Rincewind, Angua, 2014-09-29 "Hrun", Frusterick Manners+compatible  : 2008-05-05, Mulled Wine, Lemming, Anteater, Rincewind, Angua, 2014-09-29 "Hrun", Frusterick Manners, hogfather
 depends     : tag depends     : tag
 conflicts   : fckg, codemirror conflicts   : fckg, codemirror
 similar     : tagadd similar     : tagadd
 tags        : navigation, tags, editing, javascript tags        : navigation, tags, editing, javascript
-downloadurl : https://github.com/sphaira-dev/dokuwiki-tagentry/releases/download/v2.2/tagentry_2018-02-15.zip +downloadurl : https://github.com/trailjeep/dokuwiki-plugin-tagentry/tarball/master 
-sourcerepo  : https://github.com/sphaira-dev/dokuwiki-tagentry +sourcerepo  : https://github.com/trailjeep/dokuwiki-plugin-tagentry 
-bugtracker  : https://github.com/sphaira-dev/dokuwiki-tagentry/issues+bugtracker  : https://github.com/trailjeep/dokuwiki-plugin-tagentry/issues
 ---- ----
  
-The //tagentry// plugin displays a set of //tag-name checkboxes// just below the edit form and automatically adds or modifies %%{{tag>}}%% in the wiki-text using JavaScript when a checkbox is activated.+The //tagentry// plugin displays a set of //tags// just below the edit form and automatically adds or modifies %%{{tag>}}%% in the wiki-text using JavaScript when a tag is clicked.
  
-===== Download and installation =====+===== Previous Authors =====
  
-Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.+  * Robin Gareus 
 +  * Sphaira <sphairadev@null.net>
  
 +===== Changes =====
  
 +{{rss>https://github.com/trailjeep/dokuwiki-plugin-tagentry/commits/master.atom date 5}}
  
-===== Author information ===== +===== Download and installation =====
- +
-I am not the author of this plugin but [[robin@gareus.org|Robin Gareus]] yes. I improve or correct this plugin during my spare time. Fixing an error or adding a new function takes time (development, testing and publication), that's why I do not react quickly. +
- +
-Thank you for your understanding ;-). +
- +
-===== Changelogs ===== +
- +
-  * [[https://github.com/trailjeep/dokuwiki-tagentry|2019-10-17]] +
-    * Add code to repository +
-    * Add previous code fixes +
-    * Optimize & fix CSS +
-    * Hide checkboxes - simply click on tag to add. +
-  * [[https://github.com/sphaira-dev/dokuwiki-tagentry/releases/download/v2.2/tagentry_2018-02-15.zip|2018-02-15]] :  +
-    * Fix PHP 7 deprecated [[#php_70_issue|"split" function replaced by "explode"]]. +
-  * [[https://github.com/sphaira-dev/dokuwiki-tagentry/releases/download/v2.1/tagentry_2017-07-20.zip|2017-07-20]] :  +
-    * Update for **Dokuwiki 2017-02-19 "Frusterick Manners"** +
-    * Fix the following bugs : [[#or_-_appears_before_tags|"+" or "-" apears before tags]] and [[#tagentry_checkboxes_vanished_when_using_the_dokuwiki_anteater_release_2010-11-07_and_newer|Tagentry checkboxes vanished]]. +
-  * [[https://github.com/sphaira-dev/dokuwiki-tagentry/releases/download/v2.0/tagentry_2015-08-13.zip|2015-08-13]] : Since the original author does not update this plugin (2 years) I started to edit and fix bugs for personal use. +
-  * [[https://github.com/sphaira-dev/dokuwiki-tagentry/releases/download/v1.0/tagentry_2009-09-18.zip|2009-09-18]] : old release from **Robin Gareus**. +
- +
  
 +Search and install the plugin using the [[plugin:extension|Extension Manager]]. Refer to [[:Plugins]] on how to install plugins manually.
  
 ===== Bugs ===== ===== Bugs =====
  
-==== "+" or "-" appears before tags ====+Moved to [[plugin:tagentry:bugs]]
  
-When we use ''%%{{topic>}}%%'' syntax with "+" or "-" before tags in order to select results, labels of checkboxes appears with this "+" or "-", as if they were part of the tag (although this is not the case). I suppose  it is because of ''%%{{topic>}}%%'' accept parameters in its syntax.  --- //[[ner0lph+antispam@gmail.com|Ner0lph]] 2010-02-11 16:59 (Europe/Paris timezone)//+===== Discussion =====
  
-==== Tagentry checkboxes vanished when using the Dokuwiki "Anteater" Release 2010-11-07 (and newer) ==== +Moved to [[plugin:tagentry:discussion]]
- +
-Just like the plugin was no more active in the edit page. +
- +
-> Had the same problem...  Here is a quick and dirty fix; someone with more experience can probably provide a better solution.  In ''lib/plugins/tagentry/action.php'' comment out the following in the function ''handle_editform_output'': +
- +
-  if (   !empty($event->data->_hidden['prefix']) +
-      || !empty($event->data->_hidden['suffix'])) return; +
-  if ($event->data->findElementByType('wikitext')===false) return +
- +
-> //tmul - 2010-11-18// +
- +
->> Thanks, the fix worked for me, using Anteater. If I experience any inconvenience, I'll post them. +
->> //2011-03-23// +
- +
- +
->>> Thanks tmul. +
->>> This fix worked also for me with the "Rincewind" release. +
->>> //BidiX - 2011-06-14// +
- +
->>>> This fix works for the Angua release as well (at least on my wiki). +
- +
->>>>> Hmm, seems the behaviour returned with the latest development version :-(. Any suggestions? +
->>>>> //krid - 2012-08-28// +
- +
->>>>>> Not displayed for me too. :-( +
->>>>>> //Yoshiki - 2012-0830// +
- +
->>>>>>> Same here - haven't been able to see it since the last few releases, even with the fix.  Any news on this?  +
->>>>>>> //Shoe - 2012-1022// +
- +
->>>>>>>> The problem comes from the new version tag plugin. You need to change the way the $alltags variable is initialised. Make the following change in function ''handle_editform_output'': +
- +
-  if ($this->getConf('tagsrc') == 'All tags') { +
-    $alltags=array_map('trim', idx_getIndex('subject', '_w')); +
-  } else { +
-    $alltags=$this->_getpages($tagns);  +
-  } +
- +
->>>>>>>> This works fine for me with tag plugin released on 2012-08-24 and Dokuwiki 2012-10-13 +
->>>>>>>> You can see more in http://blog.dinel.org.uk/?p=272 +
->>>>>>>> // Dinel - 2012-11-25 // +
- +
->>>>>>>>> Works fine for me, too! +
->>>>>>>>> DokuWiki: git@8ca9187; tag: git@41fb82b; tagentry: git@6c654d5 +
->>>>>>>>>  --- [[user>krid|krid]] //2012/11/25 14:43// +
- +
->>>>>>>>> Doesn't work on Dokuwiki 2012-10-13 and tag 2013-02-15... +
->>>>>>>>> // Filter - 2013-3-19 // +
- +
->>>>>>>>> To make it working for version 2013-05-10 "Weatherwax" you need to apply following patch +
-<code> +
-./action.php.old 2009-09-18 13:32:00.000000000 +0400 +
-+++ ./action.php 2013-05-30 12:29:47.000000000 +0400 +
-@@ -55,7 +55,7 @@ +
-       $pos = $event->data->findElementByAttribute('type','submit'); +
-       if(!$pos) return; // no button -> source view mode +
-       #echo "DEBUG: <pre>".print_r($event->data,true).'</pre>'; +
--      if (   !empty($event->data->_hidden['prefix']) +
-+      if (   empty($event->data->_hidden['prefix']) +
-           || !empty($event->data->_hidden['suffix'])) return; +
-       if ($event->data->findElementByType('wikitext')===false) return; +
-     }elseif(!$event->data['writable']){ +
-@@ -72,7 +72,7 @@ +
-     } +
-  +
-     if ($this->getConf('tagsrc') == 'All tags' && $thlp) { +
--      $alltags=$this->_gettags($thlp); +
-+      $alltags=array_map('trim', idx_getIndex('subject', '_w')); +
-     } else { +
-       $alltags=$this->_getpages($tagns); +
-     } +
-</code> +
- --- [[user>linvinus|Denis]] //2013/05/30 10:22// +
- +
->>>>>>>>> The last fix work fine on Dokuwiki 2013-12-08 "Binky" (after an update you have to empty all the cache) +
- +
-==== PHP 7.0 Issue ==== +
- +
-Neither the old nor the new version of this plugins works with Dokuwiki 2017-02-19 “Frusterick Manners” on PHP 7.0. Error shown is this: +
-<code> +
- Got error 'PHP message: PHP Fatal error:  Uncaught Error:  +
-Call to undefined function split() in  +
-/var/www/.../dokuwiki/lib/plugins/tagentry/action.php +
-... +
-</code> +
- +
-I have no time to look into the code and fix it. \\ +
-JohnG 2017/09/13 16:30 CET +
- +
-Quick search shows that split() has been deprecated and removed from 7.0. It was replaced by preg_split() and explode(). The line in question is line 111 of action.php. Although making this change alone has not fixed the issue for me.\\ +
-EvanC 2017/09/14 15:15 EST +
- +
-Seems to work for me. I replaced the calls to split() with explode(). There are two calls, on line 111 and 125.\\ +
-nuess0r 2018/01/01 16:28 CET +
- +
-==== Plugin Installation Error - "Header does not match it's checksum" ==== +
-Upon attempting to install this plugin via the Extension Manager, I receive the error mentioned above. The same also happens when I attempt to manually install it using the URL. I'm on DokuWiki Release 2017-02-19e "Frusterick Manners", Windows 10, PHP 7. Any ideas about what's going on?\\ +
---- [[user>riseup|RiseUp]] //2018/01/24 22:41:30// +
- +
- +
----- +
- +
- +
-===== Discussions ===== +
- +
-> it doesn't work with Opera — tested with 9.64 +
-> JavaScript is enabled and other scripts (e.g. show/hide contents) is working +
- +
---------------------------------- +
-\\ +
-==== Tag tables formatting ===== +
-// Phi - 2010/08/25 // +
- +
-> Good plugin as far as I have used it. But the screen formatting was not very exciting. +
-> The very simple / basic modification below is done in order to get a better formatting of the XML tables of tags: +
- +
-  * uniform width for the columns of the table +
-  * one line for each box + tag label item. +
- +
-> Around line 250 in ''action.php'' of the plugin replace the three following lines: +
-<code php> +
-    $rv.='<div class="'.$options['class'].'">'; +
-    $rv.=' <div><label>'.$this->getLang('assign').'</label></div>'; +
-    $rv.=' <div class="taglist"'.$dstyle.'>'; +
-</code> +
- +
-> with the following +
-<code php> +
-    $rv.='<div class="'.$options['class'].'">'; +
-    if (!$options['tagboxtable']) $rv.=' <div><label>'.$this->getLang('assign').'</label></div>'; +
-    $rv.=' <div><label>&#160</label></div>'; +
-    $rv.=' <div class="taglist"'.$dstyle.'>'; +
-    if ($options['tagboxtable']) { +
-       $rv.='<table>'; +
-       $rv.='<thead><tr>'; +
- +
-       $i=0; +
-       $ls=0; +
-       $lsmax=0; +
-       natcasesort($alltags); +
-       foreach ($alltags as $t) { +
-          if (is_array($options['blacklist'])  +
-              && $this->_in_casearray($t, $options['blacklist']))  +
-            continue; +
-          $i++; +
-          $ls = strlen($t); +
-          if ($ls > $lsmax) $lsmax=$ls; +
-       } +
- +
-       For ($j=1;$j<=$options['tablerowcnt'];$j++) { +
-            $rv.='<th>'; +
-            if ($j == 1) $rv.="Liste&#160des&#160tags&#160".str_repeat("&#160",$lsmax-8); +
-            if ($j > 1) $rv.=str_repeat("_",$lsmax+1); +
-            $rv.='</th>'; +
-       } +
-       $rv.='</tr></thead>'; +
-       $rv.='<tbody><tr>'; +
-    } +
-    else { +
-       $rv.='  <div>'; +
-    } +
- +
-</code> +
- +
-**__Note:__** The title **Liste des tags** is in french but can be changed by whatever you want. Take care to use the &#160 "no-break space" characters to replace your space characters in the title. +
---------------------------------- +
-\\ +
-I tried this edit, but my website wouldn't load when I made the change. Once I reverted back to the original code, my website ran normally. //-JC// +
- +
----- +
- +
-==== Use Heading of tag page ==== +
- +
-When the tag entry is a page in the namesapce **tag** (default [[plugin:tag|tag]] plugin setting) you can display the first heading of the page (if [[config:useheading|useheading]] setting is checked) with this modifications in **tagentry/action.php** : +
- +
-<code php> +
-    /** +
-     * Return Header title or tag name +
-     * @param $tagname The name of tag without namespace +
-     * @return Title of the tag page or tag name formatted +
-     */ +
-    function _getTagTitle($tagname){ +
-        global $conf; +
-        if( $conf['useheading'){ +
-            $tagplugin = plugin_load('helper', 'tag'); +
-            if ( plugin_isdisabled('tag') || !$tagplugin ) { +
-                //msg('The Tag Plugin must be installed to display tagentry.', -1); +
-                return $this->clipstring($tagname); +
-            } +
- +
-            $id = $tagname; +
-            $exist = false; +
-            resolve_pageID($tagplugin->namespace, $id, $exist); +
-            if( $exist ){ +
-                return p_get_first_heading($id, false); +
-            } +
-        } +
-        return $this->clipstring($tagname); +
-    } +
-     +
-    // Replace this line (in function _format_tags) +
-    $rv.=' /> '.$this->clipstring($t).'</label>&nbsp;'; +
-    // By this +
-    $rv.=' /> '.$this->_getTagTitle($t).'</label>&nbsp;'; +
-</code> +
- +
---- [[user>sphaira|Sphaira]] //2013/12/23 14:43:26// +
- +
-----+
  
plugin/tagentry.txt · Last modified: 2023-10-30 23:10 by Klap-in

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki