ChernoWiki.ru: web collaboraion (powered by CoWiki)
Current user:   guest    Change     Preferences 
   List directory   History   Similar   Print version 
root 
dev 
   PostgreSQL 
   PHP 
   XML 
   DHTML 
   Design Patterns 
   Graph in RDBMS 
   Social networks 
   Adaptive Web 
   Wiki 
   Philosophy 
os 
   Unix, Linux, FreeBSD 
other 
   212.861.1881 
   searchers 



dev > Wiki > Wiki engines

 
rw-rw-r--   dmytro   wheel

Wiki engines

Есть интересные статьи? Очень буду признателен, если оставите ссылку (в комментариях к этой странице)!

Comparisons of Wiki engines

The grave disadvantage of coWiki is impossibility of attachments in articles. It's a pity...


Hack 'Attachments' for coWiki:

1. {%INCLUDE%}/cowiki/plugin/class.CustomEmbed.php, line 184 (after "break;"):

            // <akie>
            // !!! +comment line #139 ("return true;  // leave silently if unrecoginzed format")
            default:
                $sStr .= "Attached file: <a href=\"$sSrc\">" . basename($sSrc) . "</a> (" . number_format(filesize($sSrc)) . " bytes)";
            // </akie>

2. {%INCLUDE%}/cowiki/plugin/class.PrivateFrontDocumentEditor.php, line 180 (after "$sContent = $Parser->parse($this->Request->get('content'));"):

                // <akie>
                // File attachment processing
                $attachment = @$_FILES['attachment'];
                if ($attachment['name']) {
                    $newFileName = $this->Env->get('DOCUMENT_ROOT') . '/upload/' . $attachment['name'];
                    /*if (file_exists($newFileName)) {
                        die("File {$attachment['name']} already exists!!!");
                    }*/
                    move_uploaded_file($attachment['tmp_name'], $newFileName);
                    $sTmpContent = $this->Request->get('content');
                    $sAddition = "\n<plugin Embed src=\"/upload/{$attachment['name']}\">";
                    if (strpos($sTmpContent, $sAddition) === false) {
                        $sTmpContent .= $sAddition;
                    }                    

                    $sContent = $Parser->parse($sTmpContent);
                }
                // </akie>

3. {%HTDOCS%}/tpl/default/plugin.front.doc.edit.tpl:

  • add 'enctype="multipart/form-data"' to second line
  • line 125:
<!-- <akie> -->
  <tr>
    <td>
      <table cellpadding="2" cellspacing="0" border="0">
        <tr>
          <td><B>(NEW!)</B> Attach file: <input type="file" name="attachment"></td>
        </tr>
      </table>
    </td>
  </tr>
<!-- </akie> -->

4. Final steps:

cd %HTDOCS%
mkdir upload
chmod +w upload
chown nobody.nobody upload


Reference Wiki engines
http://www.chernowiki.ru/Dev/WikiEngines

Comments: 2 New comment
начал писать плагин для аттачментов   Nikolay Samokhvalov   11 Jul 05, 00:16
Ну да, да. Но оно ещё себя покажет   Nikolay Samokhvalov   02 Jun 05, 23:06



Russian Internet News | AJAX news | avianews

Driven by coWiki 0.3.4 (Boron) web collaboration tool. Processed in 0.160 sec.