Telefonbuch Modul
Verfasst: Sa 22. Mai 2004, 23:00
Hallo zusammen, hat jemand von euch schon einmal versucht ein Telefonbuch zu intigrieren? Bzw. ein vorhandenes Script zu includen?
Das Diskussionsforum zum Open Source Content Management System
https://www.forum.contenido.org/
Code: Alles auswählen
<?PHP
include("/serverpfad/script.php");
?>
Code: Alles auswählen
/***********************************************
* CONTENIDO MODUL
*
* Modulname : MOD_NUplFile_IFrame_Picker
* Modulversion : 0.1 alpha
* Author : Stefan Bürk
* Kontakt : Email: webmaster@skyblader.org
* Copyright : SkyBlader Networxx - Stab 7. Panzerdivision, Stefan Bürk
* C-Version : 4.4.4
* Created : 26-04-2004
* Modified : 28-05-2004
*
* Beschreibung :
*
* Dieses Modul zeigt in einem IFRAME im Frontend entweder
* eine ausgewählte Datei aus UPLOAD Verzeichnis ODER
* eine eingegebene HTTP-Adresse an.
*
* Dieses Modul ist noch im frühen Entwicklungsstadium
* und evtl mit vielen unabgefangenen Fehlerquellen
* behaftet.
*
* Dieses Modul wird schon benützt und ist funktions-
* fähig, eine ausführliche Testphase wird erst erfolgen
* wenn weitere Features implementiert wurden.
*
************************************************/
28.05.2004
==========
in/out Erstellen von Kommentaren für ein PRE-ALPHA-RELSEASE für
ein Community-Mitglied im Contenido-Forum.
26.04.2004
==========
out Anzeige für "sky_selected_file" und "sky_iframe_httpinput" und
die Umwandlung in ein entsprechendes IFRAME erstellt.
in Auswahloption für "sky_selected_file" und "sky_iframe_httpinput"
und deren Speicherung in entsprechende CMS_VALUE[x] erstellt
Code: Alles auswählen
//------------------------------------------------------------------------------
// MODUL CONFIG
//
// Modul-Path in <CLIENTPATH>/upload/
// Uploaddirectory for the filepicker part
$moddir = "iframedata/";
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
// !!! DO NOT CHANGE ANYTHING BELOW IF YOU DO NOT KNOW WHAT YOU DO !!!!
//------------------------------------------------------------------------------
$sky_selectedfile = "CMS_VALUE[4000]";
$sky_iframe_httpinput = "CMS_VALUE[4006]";
// folgende Values werden noch nicht verwendet
$sky_iframe_width = "CMS_VALUE[4001]";
$sky_iframe_heiht = "CMS_VALUE[4002]";
$sky_iframe_border = "CMS_VALUE[4003]";
$sky_iframe_style = "CMS_VALUE[4004]";
$sky_iframe_class = "CMS_VALUE[4005]";
// starting Modul Options Table
echo "<table cellspacing=\"0\" cellpadding=\"10\" border=\"0\">";
// ################################################################################################
// START FileChoose
// ################################################################################################
/* based on contenido internal upl function */
function sky_listdir_recursive ($currentdir, $startdir=NULL, $files=array(), $depth=-1, $pathstring="")
{
$depth++;
$unsorted_files = array();
if (chdir ($currentdir) == false)
{
return;
}
// remember where we started from
if (!$startdir) {
$startdir = $currentdir;
}
$d = opendir (".");
//list the files in the dir
while ($file = readdir ($d)) {
if ($file != ".." && $file != ".") {
$unsorted_files[] = $file;
}
}
if (is_array($unsorted_files)) sort($unsorted_files);
$sorted_files = $unsorted_files;
if(is_array($sorted_files)) {
foreach ($sorted_files as $file) {
if ($file != ".." && $file != ".") {
if ((filetype(getcwd()."/".$file) == "dir") &&
(opendir(getcwd()."/".$file) !== false)) {
$a_file['name'] = $file;
$a_file['depth'] = $depth;
$a_file['pathstring'] = $pathstring.$file.'/';;
$files[] = $a_file;
// If $file is a directory take a look inside
$files = sky_listdir_recursive (getcwd().'/'.$file, getcwd(), $files, $depth, $a_file['pathstring']);
} else {
// If $ file is not a directory then do nothing
$a_file['name'] = $file;
$a_file['depth'] = $depth;
$a_file['pathstring'] = $pathstring;
$files[] = $a_file;
}
}
}
}
closedir ($d);
chdir ($startdir);
return $files;
}
echo " <tr valign=\"top\">
<td>Upload Ordner Wählen:</td>
<td>
<select name=\"CMS_VAR[4000]\">";
if ( $sky_selectedfile = "--KEIN--" )
{
echo " <option value=\"--KEIN--\" selected=\"selected\">-- KEIN --</option>";
}
else
{
echo " <option value=\"--KEIN--\">-- KEIN --</option>";
}
$sql = 'SELECT frontendpath FROM ' . $cfg["tab"]["clients"].' WHERE idclient = "'.$client.'"';
$db->query( $sql );
$db->next_record();
$l_upldir = $db->f("frontendpath");
function blub ( $vid , $vtxt)
{
echo '<option value="'.$vid.'">'.$vtxt.'</option>';
}
$sky_uploaddir = $cfgClient[$client]["upl"]["path"] . $moddir;
$sky_files = sky_listdir_recursive ( $sky_uploaddir , getcwd() );
if ( is_array($sky_files) )
{
// Array ( [0] => Array ( [name] => cms [depth] => 0 [pathstring] => cms/ )
while (list($lkey, $lvalue) = each ($sky_files))
{
if ( file_exists($sky_uploaddir.$lvalue['pathstring'].$lvalue['name']))
{
if ( $sky_selectedfile == $lvalue['pathstring'].$lvalue['name'] )
{
echo '<option value="'.$lvalue['pathstring'].$lvalue['name'].'" selected="selected">'.$lvalue['pathstring'].$lvalue['name'].'</option>';
}
else
{
echo '<option value="'.$lvalue['pathstring'].$lvalue['name'].'">'.$lvalue['pathstring'].$lvalue['name'].'</option>';
}
}
}
}
echo " </select>
</td>
</tr>";
// ################################################################################################
// End File Choose
// ################################################################################################
// ################################################################################################
// START HTTPInput
// ################################################################################################
echo " <tr valign=\"top\">";
echo " <td>HTTP Link:</td>";
echo " <td>";
echo " <input type=\"text\" name=\"CMS_VAR[4006]\" value=\"".$sky_iframe_httpinput."\"> ";
echo " </td>";
echo " </tr>";
// ################################################################################################
// EBD HTTPInput
// ################################################################################################
// closing Module Options Table
echo "</table>";
Code: Alles auswählen
<?php
// read selected file.
$sky_selected_file = "CMS_VALUE[4000]";
$sky_iframe_httpinput = "CMS_VALUE[4006]";
// following vars are reserved for future versions
$sky_iframe_width = "CMS_VALUE[4001]";
$sky_iframe_heiht = "CMS_VALUE[4002]";
$sky_iframe_border = "CMS_VALUE[4003]";
$sky_iframe_style = "CMS_VALUE[4004]";
$sky_iframe_class = "CMS_VALUE[4005]";
// check for NO FILE Selected
if ( $sky_selected_file != "--KEIN--" )
{
// using selected file
// überprüfe ob ausgewählte Datei noch existiert
if ( file_exists( $sky_selected_file ) )
{
// erzeuge IFrame Ausgabecode
echo '<iframe src="'.$sky_selected_file.'" width="300" height="200" frameborder="0">';
echo '<p>Ihr Browser unterstützt keine IFrames. Bitte aktualisieren Sie ihren Browser.</p>';
echo '</iframe>';
}
else
{
// using HTTP Input
echo '<iframe src="'.$sky_iframe_httpinput.'" width="100%" height="100%" frameborder="0">';
echo '<p>Ihr Browser unterstützt keine IFrames. Bitte aktualisieren Sie ihren Browser.</p>';
echo '</iframe>';
}
}
else
{
// using HTTP Input
echo '<iframe src="'.$sky_iframe_httpinput.'" width="100%" height="100%" frameborder="0">';
echo '<p>Ihr Browser unterstützt keine IFrames. Bitte aktualisieren Sie ihren Browser.</p>';
echo '</iframe>';
}
?>