[pmwiki-users] ABC tunebook

Hans-Jürgen Godau juergen at godau-witten.de
Fri Jul 19 07:34:16 PDT 2019


I use abctunebook. I made some mods to cope with php 7.2 and the latest
pmwiki-release.

Here are my diffs:

--- abctunebook/cookbook/abctunebook.php 2016-01-08 15:39:00.000000000 +0100
+++ cookbook/abctunebook.php 2018-11-13 12:43:55.756779161 +0100
@@ -16,20 +16,23 @@

 $RecipeInfo['AbcTunebook']['Version'] = '2016-01-08';

-SDV($AbcTunebooks['default'], 'Tunebook');
+SDV($AbcTunebooks, array('default'=>'Tunebook', 0 => 'Liederbuch'));
+
+
 SDV($AddTunePage, 'NewTune');

 SDVA($Abcjs, array(
- 'dir' => $PubDirUrl.'/abcjs',
+ 'dir' => $FarmPubDirUrl.'/abcjs',
  'base' => 'abcjs_base-min.js',
  'editor' => 'abc_editor.js',
+ 'editor' => 'abc_editor.js',
  'plugin' => 'abc_plugin.js',
  'midi_program' => '1',
  'midi_qpm' => '160',
 ));

 # (:abcjs:) directive will load abcjs plugin scripts even if page is not
in a tunebook group.
-Markup_e('abcjs', 'directives', '/\\(:abcjs:\\)/is',
"AbcjsLoadPlugin(\$pagename)");
+Markup('abcjs', 'directives', '/\\(:abcjs:\\)/is', "AbcjsLoadPlugin");

 # otherwise abcjs will not be loaded and markup rules not be set
 $name = PageVar($pagename,'$Name');
@@ -37,17 +40,21 @@
 if (!in_array($group, $AbcTunebooks)) return;

 # load abcjs plugin
-if($action=='browse') {
+if($action!='edit') {
  AbcjsLoadPlugin($pagename);
- Markup_e('X:abc',
'>[=','/(?<!\\]\\]\n)(X:\\s*\\d+\\s*\n.*?)\n<:vspace>/s',"AbcTextMarkup(\$m[1])");
- Markup_e('#abc', '<X:abc',
-  '/\\[\\[#(abc\\d*)\\]\\](.*?)\\[\\[#\\1end\\]\\]/is',
"AbcTextMarkup(\$m[2],\$m[1])");
+ Markup('X:abc',
'>[=','/(?<!\\]\\]\n)(X:\\s*\\d+\\s*\n.*?)\n<:vspace>/s',"AbcTextMarkup");
+ Markup('#abc', '<X:abc',
+  '/\\[\\[#(abc\\d*)\\]\\](.*?)\\[\\[#\\1end\\]\\]/is', "AbcTextMarkup2");
+}
+
+function AbcTextMarkup2($m) {
+return AbcTextMarkup($m,$m[1]);
 }

 $FmtPV['$MidiTempo'] = '$GLOBALS[Abcjs]["midi_qpm"]';

-function AbcjsLoadPlugin($pagename) {
- global $Abcjs, $AbcTunebooks, $HTMLFooterFmt, $HTMLHeaderFmt,
$HTMLStylesFmt;
+function AbcjsLoadPlugin($m) {
+ global $Abcjs, $AbcTunebooks, $HTMLFooterFmt, $HTMLHeaderFmt,
$HTMLStylesFmt, $pagename;
  $speed = PageTextVar($pagename, 'speed');
  if (!$speed) $speed = 1;
  $rhythm = PageTextVar($pagename, 'R');
@@ -73,9 +80,9 @@
  ";
 }

-function AbcTextMarkup($text, $section=false) {
+function AbcTextMarkup($m, $section=false) {
  static $cnt=0; $cnt++;
- $text = trim($text);
+ $text = trim($m[2]);
  $out = '';
  if ($section) {
  $editlnk = "{[foxedit $section 'edit'
form=Site.FoxAbcTemplates#editabc]}";
----------------------------------------------------------------------------------
It seems to work for me, at least partially. I have some difficulties with
the inline-editor.

Hope this helps,

jürgen


Am Di., 16. Juli 2019 um 04:44 Uhr schrieb David Cooke <david at ellendee.co.uk
>:

> Is anyone using ABC tunebook and got it working. I used to use this a
> while ago, I came back last week to rebuild my folk song website only to
> find that it is now 'broken'. The last update was about 3 years ago with
> the previous major PHP update. Now when I try to install it,  I'm getting
> loads of error messages and no music script.
>
>  Regards
>
>
> *Dave Cooke*
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20190719/d655954a/attachment.html>


More information about the pmwiki-users mailing list