Benutzer-Werkzeuge

Webseiten-Werkzeuge


playground:playgrounddb

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
Nächste ÜberarbeitungBeide Seiten, nächste Überarbeitung
playground:playgrounddb [2020/07/28 16:44] adminplayground:playgrounddb [2020/11/06 10:20] admin
Zeile 1: Zeile 1:
 +<php>
 // load the helper plugin // load the helper plugin
 /** @var helper_plugin_sqlite $sqlite */ /** @var helper_plugin_sqlite $sqlite */
Zeile 10: Zeile 11:
  
 // initialize the database connection // initialize the database connection
-if(!$sqlite->init('struct',DOKU_PLUGIN.'struct/db/')){+if(!$sqlite->init('pf2wiki',DOKU_PLUGIN.'starocotes')){
     return;     return;
 } }
 +
 // use the plugin // use the plugin
-$res = $sqlite->query("select * from data_talent left join (select rid, count(*) as zahl from multi_talent where value In ("Abstammung","Elf") group by rid) as m on data_talent.rid = m.rid where zahl = 2");+$res = $sqlite->query("select * from data_talent left join (select rid, count(*) as zahl from multi_talent where value In ('Abstammung','Elf') group by rid) as m on data_talent.rid = m.rid where zahl = 2");
  
 $arr = $sqlite->res2arr($res); $arr = $sqlite->res2arr($res);
-print_r($val);+ 
 +foreach ($arr as $val) 
 +
 + 
 +  // use the plugin 
 +  $res2 = $sqlite->query("select * from multi_talent where colref = 5 and rid = ".$val['rid']); 
 + 
 +  $arr2 = $sqlite->res2arr($res2); 
 + 
 +  $cat = "";
      
-//foreach($arr => $val) +  foreach ($arr2 as $val2) 
-//+  { 
-//  print_r($val); +     $cat .= '<span class="wrap_notice ">'.$val2['value'].'</span> '; 
-//}+  } 
 +print('<div class="wrap_box plugin_wrap">'); 
 +print('<p>'); 
 +print('<strong>'.$val['col1'].'</strong>'); 
 +print(' <img src="/lib/exe/fetch.php?media='.$val['col6'].'" class="media" alt="" /> <strong>'.$val['col7'].'</strong><br/>'); 
 +print('<span class="wrap_safety ">'.$val['col3']." ".$val['col9']."</span><br/>"); 
 +print($cat."<br/>"); 
 +if($val['col4'] !== ''
 +
 +print('<strong>Voraussetzungen:</strong> '.$val['col4'].'<br/>'); 
 +}
  
 +if($val['col8'] !== '')
 +{
 +print('<strong>Häufigkeit:</strong> '.$val['col8'].'<br/>');
 +}
  
-<php>+if($val['col10'] !== ''
 +
 +print('<strong>Auslöser:</strong> '.$val['col10'].'<br/>'); 
 +}
  
-// load the helper plugin +print('<br/>'.$val['col2'].'<br/>');
-/** @var helper_plugin_sqlite $sqlite */+
  
-$sqlite plugin_load('helper''sqlite');+if($val['col12'] !== ''
 +
 +print('<strong>Kritischer Erfolg:</strong> '.$val['col12'].'<br/>'); 
 +}
  
-if(!$sqlite){ +if($val['col13'] !== '') 
-    msg('This plugin requires the sqlite pluginPlease install it', -1)+
-    return;+print('<strong>Erfolg:</strong> '.$val['col13'].'<br/>');
 } }
  
-// initialize the database connection +if($val['col14'] !== ''
-if(!$sqlite->init('struct',DOKU_PLUGIN.'struct/db/')){ +
-    return;+print('<strong>Fehlschlag:</strong> '.$val['col14'].'<br/>');
 } }
-// use the plugin 
-$res = $sqlite->query("select * from data_talent left join (select rid, count(*) as zahl from multi_talent where value In ("Abstammung","Elf") group by rid) as m on data_talent.rid = m.rid where zahl = 2"); 
  
-$arr = $sqlite->res2arr($res); +if($val['col15'] !== ''
-print_r($val); +{ 
-   +print('<strong>Kritischer Fehlschlag:</strong> '.$val['col15'].'<br/>'); 
-//foreach($arr => $val+}
-//{ +
-//  print_r($val); +
-//} +
- +
-</php>+
  
 +print('</p>');
 +print('</div>');
  
 +}
  
 +</php>
playground/playgrounddb.txt · Zuletzt geändert: 2020/12/01 08:09 von 127.0.0.1