Not logged in. · Lost password · Register
Page:  1  2  3  next 

All posts by roga (35)

topic: [SOLVED] Meta Data: Date Value  in the forum: General Help and Support Syntax and Usage
Avatar
roga #1
Member since Sep 2018 · 35 posts · Location: Zürich, Switzerland
Group memberships: Members
Show profile · Link to this post
Hi schplurtz,

It work's! Thank you very much!

Your answer was exactly what I was searching for :-)

regards,
Roland
topic: [SOLVED] Meta Data: Date Value  in the forum: General Help and Support Syntax and Usage
Avatar
roga #2
Member since Sep 2018 · 35 posts · Location: Zürich, Switzerland
Group memberships: Members
Show profile · Link to this post
Subject: [SOLVED] Meta Data: Date Value
Hi,

I saw, that DokuWiki store the creation Date of a page in the File pagename.meta, like e.g.  i:1548864478;

This stored value is in a unknow format for me and I would like to convert it in a readable date/time value.

Can someone tell me, how I could convert this integer value in a date/time value?

I would be happy for every help!

regards,
Roland
This post was edited on 2019-01-30, 20:06 by roga.
topic: Editing section  in the forum: General Help and Support Features and Functionality
Avatar
roga #3
Member since Sep 2018 · 35 posts · Location: Zürich, Switzerland
Group memberships: Members
Show profile · Link to this post
Subject: Editing section
Hi,

I have sometimes the Issue, when I like to edit a section, that the editor does not present my selected section. Instead it present the whole article from the beginning and with a notice that dokuwiki has detect a draftpage. My default editor is ckgedit.

Is anybody here who knows this issue?

regards
Roland
topic: [GELÖST] Vorlage für spezielle Seiten  in the forum: Non-English Discussion German discussion
Avatar
roga #4
Member since Sep 2018 · 35 posts · Location: Zürich, Switzerland
Group memberships: Members
Show profile · Link to this post
In reply to post ID 64145
PLUGIN REGEX_TEMPLATE läuft wieder !!!!

Nach ein wenig nachforschen und probieren habe ich das Plugin schliesslich wieder zum laufen gebracht. Es muss eigentlich nicht sehr viel korrigiert werden. Für den Fall, dass sich noch jemand für dieses Plugin interessiert, hier die komplette Datei action.php in angepasster Version:

<?php
/**
 * Regex Template plugin, Choose template from regex on $ID
 * @author     Cédric Villemain <cedric.villemain@dalibo.com>
 */

if(!defined('DOKU_INC')) die();

if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
require_once(DOKU_PLUGIN.'action.php');

class action_plugin_regextemplate extends DokuWiki_Action_Plugin {

  /**
   * return some info
   */
  function getInfo(){
          return confToHash(dirname(__FILE__).'/plugin.info.txt');
  }

  /**
   * register the eventhandlers
   */
  function register(Doku_Event_Handler $controller){

    $controller->register_hook('COMMON_PAGETPL_LOAD', 'BEFORE', $this, 'regex_template', array());
  }

  function regex_template(Doku_Event $event, $param) {
        global $ID;
        global $conf;
        global $INFO;
        $path = dirname(wikiFN($ID));

        if(@file_exists($path.'/_template.txt')){
          $tpl = io_readFile($path.'/_template.txt');
        }else{
          // search upper namespaces for templates
          $len = strlen(rtrim($conf['datadir'],'/'));
          while (strlen($path) >= $len){
                if(@file_exists($path.'/__template.txt')){
                  $tpl = io_readFile($path.'/__template.txt');
                  break;
                }
                $path = substr($path, 0, strrpos($path, '/'));
          }
        }

        $array_regex = (array)explode("\n",$conf['plugin']['regex_template']['reg_tpl_regex']);
        reset($array_regex);
        foreach ($array_regex as $regex) {
          list($pattern, $replacement) = explode(',', $regex);
          $my_new_ID = @preg_replace($pattern, $replacement, $event->data['id']);
          $my_new_file = wikiFN($my_new_ID);
          if(@file_exists($my_new_file)){
                $tpl = io_readFile($my_new_file);
                break;
          }
        }

        //if(!$tpl) return '';
        if($tpl) $event->data['tpl'] = $tpl;

        // replace placeholders
        $tpl = str_replace('@ID@',$ID,$tpl);
        $tpl = str_replace('@NS@',getNS($ID),$tpl);
        $tpl = str_replace('@PAGE@',strtr(noNS($ID),'_',' '),$tpl);
        $tpl = str_replace('@USER@',$_SERVER['REMOTE_USER'],$tpl);
        $tpl = str_replace('@NAME@',$INFO['userinfo']['name'],$tpl);
        $tpl = str_replace('@MAIL@',$INFO['userinfo']['mail'],$tpl);
        $tpl = str_replace('@DATE@',$conf['dformat'],$tpl);
        // we need the callback to work around strftime's char limit
        $tpl = preg_replace_callback('/%./',create_function('$m','return strftime($m[0]);'),$tpl);

        $event->result=$tpl;
        $event->preventDefault();
  }
}

An dieser Stelle noch ein Dankeschön an Michaelsy für den Tipp mit dem Plugin Regex_Template :-)

Freundliche Grüsse
Roland
This post was edited 2 times, last on 2019-01-04, 09:52 by roga.
topic: [SOLVED] Plugin is registered but would not be called  in the forum: General Help and Support Development
Avatar
roga #5
Member since Sep 2018 · 35 posts · Location: Zürich, Switzerland
Group memberships: Members
Show profile · Link to this post
In reply to post ID 64164
LarsDW223,

Thank you for your reply,

You're right! I repeated your steps and can confirm it works now!

I don't know, what i have made wrong, but i'm happy now and can investigate the plugin further.

thank you for your help + time

kind regards
Roland
topic: [SOLVED] tpl_actionlink() is deprecated  in the forum: General Help and Support Development
Avatar
roga #6
Member since Sep 2018 · 35 posts · Location: Zürich, Switzerland
Group memberships: Members
Show profile · Link to this post
In reply to post ID 64161
@LarsDW223

I wanted to report the error and have seen this is already done by an other user. So I hope, the developer soon will release a new Version.
Thank you!

@Michaelsy
Thank you also for explanation that I have nothing to do at the moment ;-)

Kind regards,
Roland
topic: [SOLVED] Plugin is registered but would not be called  in the forum: General Help and Support Development
Avatar
roga #7
Member since Sep 2018 · 35 posts · Location: Zürich, Switzerland
Group memberships: Members
Show profile · Link to this post
In reply to post ID 64159
That's Right. I wrote, that I used that Plugin. I created a new page but in the debug.log after that I could not found a entry. I have no Idea why ...
This post was edited on 2019-01-03, 19:15 by roga.
topic: [SOLVED] Plugin is registered but would not be called  in the forum: General Help and Support Development
Avatar
roga #8
Member since Sep 2018 · 35 posts · Location: Zürich, Switzerland
Group memberships: Members
Show profile · Link to this post
Subject: [SOLVED] Plugin is registered but would not be called
Hi,

I have to modify a Plugin and for this, I first have to investigate how does it work. My Knowledge in php is low and I don't know how Plugins in dokuwiki works exactly.

In the Code below I added two lines for debugging.

The first below entry function Register()

dbglog("PLUGIN REGEX_TEMPLATE REGISTERED!");

The second below entry function regex_template()

dbglog("PLUGIN REGEX_TEMPLATE CALLED!");

Then I tried to use the Plugin ...

Now my Question: The debug.log only shows me entries for PLUGIN REGEX_TEMPLATE REGISTERED! but I never see an entry for PLUGIN REGEX_TEMPLATE CALLED!

This means, that the Plugin would not be invoked?

Why?

Any help are welcome.
Kind regards,
Roland


<?php
/**
 * Regex Template plugin, Choose template from regex on $ID
 * @author     Cédric Villemain <cedric.villemain@dalibo.com>
 */

if(!defined('DOKU_INC')) die();

if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/');
require_once(DOKU_PLUGIN.'action.php');

class action_plugin_regextemplate extends DokuWiki_Action_Plugin {

  /**
   * return some info
   */
  function getInfo(){
          return confToHash(dirname(__FILE__).'/plugin.info.txt');
  }

  /**
   * register the eventhandlers
   */
  function register(Doku_Event_Handler $controller){

    $controller->register_hook('COMMON_PAGETPL_LOAD', 'BEFORE', $this, 'regex_template', array());
    dbglog("PLUGIN REGEX_TEMPLATE REGISTERED!");
  }

  function regex_template(Doku_Event $event, $param) {
        global $ID;
        global $conf;
        global $INFO;
        dbglog("PLUGIN REGEX_TEMPLATE CALLED!");
        $path = dirname(wikiFN($ID));

        if(@file_exists($path.'/_template.txt')){
          $tpl = io_readFile($path.'/_template.txt');
        }else{
          // search upper namespaces for templates
          $len = strlen(rtrim($conf['datadir'],'/'));
          while (strlen($path) >= $len){
                if(@file_exists($path.'/__template.txt')){
                  $tpl = io_readFile($path.'/__template.txt');
                  break;
                }
                $path = substr($path, 0, strrpos($path, '/'));
          }
        }

        $array_regex = (array)explode("\n",$conf['plugin']['regex_template']['reg_tpl_regex']);
        reset($array_regex);
        foreach ($array_regex as $regex) {
          list($pattern, $replacement) = explode(',', $regex);
          $my_new_ID = @preg_replace($pattern, $replacement, $event->data['id']);
          $my_new_file = wikiFN($my_new_ID);
          if(@file_exists($my_new_file)){
                $tpl = io_readFile($my_new_file);
                break;
          }
        }

        //if(!$tpl) return '';
        if($tpl) $event->data['tpl'] = $tpl;

        // replace placeholders
        $tpl = str_replace('@ID@',$ID,$tpl);
        $tpl = str_replace('@NS@',getNS($ID),$tpl);
        $tpl = str_replace('@PAGE@',strtr(noNS($ID),'_',' '),$tpl);
        $tpl = str_replace('@USER@',$_SERVER['REMOTE_USER'],$tpl);
        $tpl = str_replace('@NAME@',$INFO['userinfo']['name'],$tpl);
        $tpl = str_replace('@MAIL@',$INFO['userinfo']['mail'],$tpl);
        $tpl = str_replace('@DATE@',$conf['dformat'],$tpl);
        // we need the callback to work around strftime's char limit
        $tpl = preg_replace_callback('/%./',create_function('$m','return strftime($m[0]);'),$tpl);

        $event->result=$tpl;
        $event->preventDefault();
  }
}
This post was edited 2 times, last on 2019-01-03, 21:07 by roga.
topic: [SOLVED] tpl_actionlink() is deprecated  in the forum: General Help and Support Development
Avatar
roga #9
Member since Sep 2018 · 35 posts · Location: Zürich, Switzerland
Group memberships: Members
Show profile · Link to this post
Subject: [SOLVED] tpl_actionlink() is deprecated
Hi,

I found following message in my dokuwiki debug.log.

12:12:20 192.168.xyz.xyz: tpl_actionlink() is deprecated. It was called from bootstrap3_action() in /www/dokuwiki/lib/tpl/bootstrap3/tpl_functions.php:379 see devel:menus should be used instead!

I searched in the Internet for devel:menus and found that: https://www.dokuwiki.org/devel:menus

I have no Idea, how I can resolve this error. How could I replace tpl_actionlink() with the new devel:menus???

What do I have to do?

Can anybody give me a hint?

Kind regards,
Roland
This post was edited on 2019-01-03, 19:12 by roga.
topic: [SOLVED] How to see debug-log  in the forum: General Help and Support Development
Avatar
roga #10
Member since Sep 2018 · 35 posts · Location: Zürich, Switzerland
Group memberships: Members
Show profile · Link to this post
In reply to post ID 64155
I found the solution myself in following article: https://www.dokuwiki.org/devel:debugging

The log file can be found in:

./data/cache/debug.log
This post was edited on 2019-01-03, 19:32 by roga.
topic: [SOLVED] How to see debug-log  in the forum: General Help and Support Development
Avatar
roga #11
Member since Sep 2018 · 35 posts · Location: Zürich, Switzerland
Group memberships: Members
Show profile · Link to this post
Subject: [SOLVED] How to see debug-log
Hi all,

I'm a beginner in PHP and also DokuWiki Plugins. But I have a Need to modifiy an existing Plugin that is no longer up-to-date but necessary for me to use. (Background-info: https://forum.dokuwiki.org/thread/16573

I activated the option allowdebug and in the Plugin-Code Action.php I had added the Code dbglog("PLUGIN CALLED !"); to the function Register()

Now I want to see if the Plugin is invoked but I have no Idea where I can found the debug-logfile.

Can anybody give me a hint?

Kind regards,
Roland
This post was edited 2 times, last on 2019-01-03, 11:30 by roga.
topic: [GELÖST] Vorlage für spezielle Seiten  in the forum: Non-English Discussion German discussion
Avatar
roga #12
Member since Sep 2018 · 35 posts · Location: Zürich, Switzerland
Group memberships: Members
Show profile · Link to this post
In reply to post ID 64144
Hallo Michaelsy,

Danke für deine Antwort. Ich bin froh, das du mich jetzt besser verstanden hast. Ja, in der Tat ist es unglücklich, dass bei DokuWiki unter Templates vorwiegend die Skins gemeint sind und nicht wirklich Vorlagen im eigentlichen Sinn.

Ich muss gestehen, ich komme eingentlich von MediaWiki und bin auf DokuWiki umgestiegen, weil sich meine Users dem Wiki-Syntax im Editor nicht annehmen wollten. DokuWiki bot an dieser Stelle einen WYSIWYG-Editor der dem MS-Word sehr nah kam und meine Users konnten sich damit recht schnell anfreunden.

Nun musste ich alles von MediaWiki auf DokuWiki umkrempeln, was weitestgehend klappte. Nur in Sachen Templates, da hat MediaWiki die Nase gegenüber DokuWiki weit, weit vorne. Templates für die Skins heissen bei MediaWiki übrigens definitiv Skins, deshalb hatte ich hier auch meine Schwierigkeiten, mich Ansatzweise verständlich auszudrücken.

Das von dir vorgeschlagene Plugin Regex_Template war nach meinem Verständis her das, was ich suchte. Leider ist es nicht mehr aktuell und lässt sich offensichtlich nicht in das aktuellste DokuWiki integrieren.

Meine PHP-Kenntnisse sind leider noch zu bescheiden, als das ich mich diesem Plugin persönlich annehmen könnte. Daher wäre es ohne fremde Hilfe für mich nicht möglich, diese Plugin wieder zum fliegen zu bringen.

Falls sich hier jemand finden lässt, der sich jetzt angesprochen fühlt und gerne diese Herausforderung annehmen möchte, wäre ich darüber äusserst erfreut. :-)

Natürlich wäre ich auch über Tipps erfreut, die mir helfen würden, das Plugin Regex_Template selbst wieder zum laufen zu bringen. Ich habe keine berührungsängste mit PHP lediglich mit dem Einstieg in unbekanntes Terrain. :-)


Freundliche Grüsse
Roland
This post was edited 3 times, last on 2019-01-03, 07:30 by roga.
topic: [GELÖST] Vorlage für spezielle Seiten  in the forum: Non-English Discussion German discussion
Avatar
roga #13
Member since Sep 2018 · 35 posts · Location: Zürich, Switzerland
Group memberships: Members
Show profile · Link to this post
Subject: [GELÖST] Vorlage für spezielle Seiten
Hallo,

ich suche nach einer Möglichkeit, eine Vorlage (ähnlich wie _template.txt oder __template.txt) zu erstellen, die aber nur auf bestimmte Seiten (z.B. Seiten die mit dem Namen inc-cli-* beginnen) angewendet wird.

Die Vorlage _template.txt wird für alle neuen Seiten im aktuellen Namespace bzw. __template.txt für alle neuen Seiten im aktuellen Namespace und darunter (vererbt) angewendet. Diese beiden Vorlagen erfüllen nicht meine Anforderungen.

Ich nutze das Plugin Include um damit ein CLI-Fenster zu simulieren. z.B.

{{page>inc-cli-052}}

Wenn dieser Code in meine Seite eingefügt wird, dann habe ich nach dem speichern der Seite die Möglichkeit, auf eine Schaltfläche (ähnlich wie die Schaltflächen für Section-Edit) zu klicken, die mir automatisch die neue Include-Datei im aktuellen Namespace erstellt.

Nun wäre es natürlich super, wenn ich für diese neue Include-Datei eine Vorlage definieren könnte, damit ich gleich den Code für die Darstellung eines CLI-Fenster integriert hätte. Das würde mir viel Arbeit ersparen.

Die Include-Datei sollte dann durch das Template ein Grundgerüst das wie folgt aussieht, vorweisen (hier werden weitere Plugin's eingebettet):

~~MULTI_PLUGIN_OPEN~~

<WRAP level3>
<WRAP cli><wrap title>Command Line Interface CLI</wrap></WRAP>
<cli prompt='#'>
root@gentoo / #
</cli>
</WRAP>
~~MULTI_PLUGIN_CLOSE~~

Ich hoffe, es ist nicht zu verwirrend, was ich hier zu Beschreiben vesuche :-)

Für einen Tipp wäre ich sehr dankbar.

Freundliche Grüsse
Roland
This post was edited 2 times, last on 2019-01-03, 22:00 by roga.
topic: [SOLVED] Template only for special pagenames  in the forum: General Help and Support Templates and Layout
Avatar
roga #14
Member since Sep 2018 · 35 posts · Location: Zürich, Switzerland
Group memberships: Members
Show profile · Link to this post
In reply to post ID 64141
Ok, I will open a new thread in the German forum...

thank's!

Edit: that is the thread for the continuation in the german forum: https://forum.dokuwiki.org/post/64145
This post was edited on 2019-01-01, 20:48 by roga.
topic: [SOLVED] Template only for special pagenames  in the forum: General Help and Support Templates and Layout
Avatar
roga #15
Member since Sep 2018 · 35 posts · Location: Zürich, Switzerland
Group memberships: Members
Show profile · Link to this post
In reply to post ID 64113
I didn't realise that you are the author of that Plugin (loadskin),  sorry :blush:

Please, can you tell me, if that Plugin would do what I wish?

Kind regards,
Roland
Close Smaller – Larger + Reply to this post:
Special characters:
Page:  1  2  3  next 
Special queries
Go to forum
Imprint
This board is powered by the Unclassified NewsBoard software, 20150713-dev, © 2003-2015 by Yves Goergen
Current time: 2019-10-15, 15:57:25 (UTC +02:00)