示例#1
0
 /**
  * Функция получения комментариев к одному элементу: при просмотре комментариев хозяином элемента ставится метка у всех 
  * непрочитанных комментариев элемента о том, что они прочитаны.
  * @param integer $id номер элемента. 
  * @param string $module название/номер модуля.
  * @param integer $listNum номер листа.
  * @param integer $user номер просматриваемого пользователя.
  * @param integer $visitor номер просматривающего пользователя.
  * @return Array ассоциативный массив.
  */
 public function readComments($id, $module, $listNum, $user, $visitor)
 {
     $result = $this->_sql->query("SELECT * FROM `commentor` WHERE `pid`='{$id}' AND `module`='{$module}'");
     while ($ar = $this->_sql->fetchArr($result)) {
         $resArr[] = $ar;
     }
     if ($visitor == $user) {
         $notanswered = 0;
         $this->_sql->Query("UPDATE `commentor` SET `notanswered`='0' WHERE `pid`='{$id}' AND `module`='{$module}'");
     }
     /*  if (count($resArr)==0)
         {
         	throw new Exception("Комментарии отсутствуют.");
         }*/
     $resArr = listing($resArr, $listNum, 50);
     return $resArr;
 }
示例#2
0
文件: index.php 项目: senyor/dojorama
function run()
{
    $method = strtolower($_SERVER["REQUEST_METHOD"]);
    $id = ltrim($_SERVER["REQUEST_URI"], dirname($_SERVER["SCRIPT_NAME"]));
    $id = $id !== '' ? $id : null;
    $items = array(array('id' => 0, 'title' => 'Title 1', 'format' => 1, 'releaseDate' => '2012-12-21', 'price' => '100', 'publish' => false, 'info' => ''), array('id' => 1, 'title' => 'Title 2', 'format' => 1, 'releaseDate' => '2013-12-21', 'price' => '50', 'publish' => false, 'info' => ''), array('id' => 2, 'title' => 'Title 3', 'format' => 1, 'releaseDate' => '2014-12-21', 'price' => '1000', 'publish' => false, 'info' => ''));
    switch ($method) {
        case 'get':
            return $id === null ? listing($items) : detail($id, $items);
        case 'post':
            return $id === null ? create() : badRequest();
        case 'put':
            return $id !== null ? update($id) : badRequest();
        case 'delete':
            return $id !== null ? remove($id) : badRequest();
    }
    return badRequest();
}
示例#3
0
function listing_page ($message = null) {
	global $self, $directory, $sort, $reverse;
	html_header();
	$list = getlist($directory);
	if (array_key_exists('sort', $_GET)) $sort = $_GET['sort']; else $sort = 'filename';
	if (array_key_exists('reverse', $_GET) && $_GET['reverse'] == 'true') $reverse = true; else $reverse = false;
	sortlist($list, $sort, $reverse);
	echo '
<form enctype="multipart/form-data" action="' . $self . '?tool=Files" method="post">
<table id="main">
';
	directory_choice();
	if (!empty($message)) {
		spacer();
		echo $message;
	}
	if (@is_writable($directory)) {
		upload_box();
		create_box();
	} else {
		spacer();
	}
	if ($list) {
		listing($list);
	} else {
		echo error('not_readable', $directory);
	}
	echo '</table>
</form>
';
	html_footer();
}
示例#4
0
function contents_dir($current_dir, $directory)
{
    global $index;
    global $font, $direction, $order, $totalsize, $mess, $tablecolor, $lightcolor;
    global $file_out_max_caracters, $normalfontcolor, $phpExt, $hidden_dirs, $showhidden;
    global $comment_max_caracters, $datetimeformat, $logged_user_name;
    global $user_status, $activationcode, $max_filesize_to_mail, $mail_functions_enabled, $timeoffset, $grants;
    $direction = 0;
    $num_row = 0;
    // Read directory
    list($liste, $totalsize) = listing($current_dir);
    if (is_array($liste)) {
        while (list($filename, $mime) = each($liste)) {
            $num_row++;
            if (is_dir("{$current_dir}/{$filename}")) {
                if (eregi($hidden_dirs, $filename) && !$showhidden) {
                    continue;
                }
                $filenameandpath = "index.{$phpExt}?index={$index}&direction={$direction}&order={$order}&directory=";
                if ($directory != '') {
                    $filenameandpath .= "{$directory}/";
                }
                $filenameandpath .= $filename;
            } else {
                $filenameandpath = '';
                if ($directory != '') {
                    $filenameandpath .= "{$directory}/";
                }
                $filenameandpath .= $filename;
            }
            $dir_protegidos = array('Biblioteca', 'Recursos educativos', 'Departamentos');
            $subdir_protegidos = array('Recursos educativos', 'Departamentos');
            echo "    <tr>\n";
            echo "      <td>\n";
            echo "        <img src=\"images/" . get_mimetype_img("{$current_dir}/{$filename}") . "\" width=\"32\" alt=\"\">\n";
            if (is_dir("{$current_dir}/{$filename}")) {
                echo "<a href=\"{$filenameandpath}\">";
            }
            if (strlen($filename) > $file_out_max_caracters) {
                echo htmlspecialchars(substr($filename, 0, $file_out_max_caracters - 4) . '...', ENT_QUOTES, 'ISO-8859-1');
            } else {
                echo htmlspecialchars($filename, ENT_QUOTES, 'ISO-8859-1');
            }
            if (is_dir("{$current_dir}/{$filename}")) {
                echo "</a>";
            }
            echo "        {$content}\n";
            echo "      </td>\n";
            echo "      <td nowrap>\n";
            if ($grants[$user_status][DELALL] || $upl_user == $logged_user_name && $grants[$user_status][DELOWN]) {
                if (!is_dir("{$current_dir}/{$filename}")) {
                    echo "<a href=\"index.{$phpExt}?index={$index}&action=deletefile&filename={$filename}&directory={$directory}\" data-bb=\"confirm-delete\" rel=\"tooltip\" title=\"Eliminar\"><span class=\"fa fa-trash-o fa-lg fa-fw\" alt=\"{$mess['169']}\"></span></a>";
                } else {
                    if ($grants[$user_status][DELALL]) {
                        if (!in_array($filename, $dir_protegidos) && !in_array($directory, $subdir_protegidos) || in_array($directory, $subdir_protegidos) && stristr($_SESSION['cargo'], '1') == TRUE) {
                            echo "<a href=\"index.{$phpExt}?index={$index}&action=deletedir&filename={$filename}&directory={$directory}\" data-bb=\"confirm-delete\" rel=\"tooltip\" title=\"Eliminar\"><span class=\"fa fa-trash-o fa-lg fa-fw\" alt=\"{$mess['169']}\"></span></a>";
                        }
                    }
                }
            }
            if ($grants[$user_status][MODALL] || $upl_user == $logged_user_name && $grants[$user_status][MODOWN]) {
                if (!in_array($filename, $dir_protegidos) && !in_array($directory, $subdir_protegidos)) {
                    // RENOMBRAR
                    echo "<a href=\"#\" data-toggle=\"modal\" data-target=\"#modal_{$num_row}\" rel=\"tooltip\" title=\"Renombrar\"><span class=\"fa fa-edit fa-lg fa-fw\" alt=\"Renombrar\"></span></a>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div id=\"modal_{$num_row}\" class=\"modal fade\">\n\t\t\t\t\t\t  <div class=\"modal-dialog\">\n\t\t\t\t\t\t  \t<form method=\"post\" action=\"\">\n\t\t\t\t\t\t\t    <div class=\"modal-content\">\n\t\t\t\t\t\t\t      <div class=\"modal-header\">\n\t\t\t\t\t\t\t        <button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Cerrar\"><span aria-hidden=\"true\">&times;</span></button>\n\t\t\t\t\t\t\t        <h4 class=\"modal-title\">Renombrar</h4>\n\t\t\t\t\t\t\t      </div>\n\t\t\t\t\t\t\t      <div class=\"modal-body\">\n\t\t\t\t\t\t\t        \t\t\n\t\t\t\t\t        \t\t<input type=\"hidden\" name=\"action\" value=\"rename\">\n\t\t\t\t\t        \t\t<input type=\"hidden\" name=\"directory\" value=\"{$directory}\">\n\t\t\t\t\t        \t\t<input type=\"hidden\" name=\"filename\" value=\"{$filename}\">\n\t\t\t\t\t        \t\t<input type=\"hidden\" name=\"index\" value=\"{$index}\">\n\t\t\t\t\t        \t\t<input type=\"hidden\" name=\"direction\" value=\"{$direction}\">\n\t\t\t\t\t        \t\t\n\t\t\t\t\t\t        \t<div class=\"form-group\">\n\t\t\t\t\t\t        \t\t<label for=\"userfile\">Nuevo nombre</label>\n\t\t\t\t\t        \t\t\t<input type=\"text\" class=\"form-control\" id=\"userfile\" name=\"userfile\" value=\"{$filename}\" maxlenght=\"250\">\n\t\t\t\t\t        \t\t</div>\n\t\t\t\t\t\t\t        \t\n\t\t\t\t\t\t\t      </div>\n\t\t\t\t\t\t\t      <div class=\"modal-footer\">\n\t\t\t\t\t\t\t        <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Cancelar</button>\n\t\t\t\t\t\t\t        <button type=\"submit\" class=\"btn btn-primary\">Renombrar</button>\n\t\t\t\t\t\t\t      </div>\n\t\t\t\t\t\t\t    </div><!-- /.modal-content -->\n\t\t\t\t\t\t\t   </form>\n\t\t\t\t\t\t  </div><!-- /.modal-dialog -->\n\t\t\t\t\t\t</div><!-- /.modal -->";
                }
                if (!is_dir("{$current_dir}/{$filename}") || $grants[$user_status][MODALL]) {
                }
            }
            if ($grants[$user_status][DOWNLOAD] && !is_dir("{$current_dir}/{$filename}")) {
                // DESCARGAR ARCHIVO
                echo "<a href=\"index.{$phpExt}?index={$index}&action=downloadfile&filename={$filename}&directory={$directory}\" rel=\"tooltip\" title=\"Descargar\"><span class=\"fa fa-cloud-download fa-lg fa-fw\" alt=\"{$mess['23']}\"></span></a>";
            }
            if ($_GET['index'] == 'privado' && !is_dir("{$current_dir}/{$filename}")) {
                // COMPARTIR ARCHIVO
                if (isset($directory)) {
                    $share_string = urlencode("<br><br>Archivo adjunto:<br><span class=\"fa fa-download fa-fw\"></span> <a href=\"http://" . $_SERVER['SERVER_NAME'] . "/intranet/varios/" . $_SESSION['ide'] . "/{$directory}/{$filename}\" target=\"_blank\">{$filename}</a>");
                } else {
                    $share_string = urlencode("<br><br>Archivo adjunto:<br><span class=\"fa fa-download fa-fw\"></span> <a href=\"http://" . $_SERVER['SERVER_NAME'] . "/intranet/varios/" . $_SESSION['ide'] . "/{$filename}\" target=\"_blank\">{$filename}</a>");
                }
                echo "<a href=\"../admin/mensajes/redactar.php?texto={$share_string}\" rel=\"tooltip\" title=\"Compartir\"><span class=\"fa fa-share-alt fa-lg fa-fw\" alt=\"{$mess['23']}\"></span></a>";
            }
            echo "</td>";
            echo "<td class=\"hidden-xs hidden-sm\" nowrap>";
            echo "<span class=\"text-muted\">";
            // TIPO DE ARCHIVO
            if (is_dir("{$current_dir}/{$filename}")) {
                echo "directorio";
            } else {
                echo get_filesize("{$current_dir}/{$filename}");
            }
            echo "</span>";
            echo "</td>";
            echo "<td class=\"hidden-xs hidden-sm\" nowrap>";
            // FECHA DE MODIFICACIÓN
            $file_modif_time = filemtime("{$current_dir}/{$filename}") - $timeoffset * 3600;
            echo "<span class=\"text-muted\">" . date($datetimeformat, $file_modif_time) . "</span>";
            echo "</td>\n";
            echo "</tr>\n";
        }
    }
}
示例#5
0
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td colspan="2">
                  <table width="100%" border="0" cellspacing="4" name="tab04">
                    <tr>
                      <td class="titrtabl" width="24%">date de cr&eacute;ation</td>
                      <td class="titrtabl" width="24%">titre</td>
                      <td class="titrtabl" width="24%">auteur</td>
                      <td class="titrtabl" width="24%">sujet</td>
                     <td  width="24%"></td>
                     </tr>
                    <tr><?php 
listing($is_user, $service, $page);
?>
                    <td width="4%" valign="bottom" align="right" bgcolor="#FFFFFF"><!-- #BeginLibraryItem "/Library/haut.lbi" --><a href="#haut"><img src="../zimages/haut.gif" width="25" height="26" border="0"></a><!-- #EndLibraryItem --></td>
                    </tr>
                    </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table><!-- #EndLibraryItem -->

                 continue;
             }
         }
     }
     if ($post['only_select'] && !is_select($query)) {
         continue;
     }
     if ($get['md5'] && $i != $md5_i) {
         continue;
     }
     if ($get['md5'] && $i == $md5_i) {
         if (!is_select($query)) {
             trigger_error('not select query', E_USER_ERROR);
         }
     }
     $exec = listing($query, $md5 . '_' . $i);
     $query_trunc = str_truncate(html_once($query), 1000);
     $query_trunc = query_color($query_trunc);
     $query_trunc = nl2br($query_trunc);
     $query_trunc = html_spaces($query_trunc);
     if ($exec['error']) {
         $exec['error'] = preg_replace('#error:#i', '', $exec['error']);
         $top_html .= sprintf('<div style="background: #ffffd7; padding: 0.5em; border: #ccc 1px solid; margin-bottom: 1em; margin-top: 1em;"><b style="color:red">Error</b>: %s<div style="margin-top: 0.25em;"><b>Query %s</b>: %s</div></div>', $exec['error'], $i, $query_trunc);
         $commit = false;
         break;
     } else {
         $query_html = sprintf('<div class="query"><b style="font-size: 10px;">Query %s</b>:<div style="' . $sql_font . ' margin-top: 0.35em;">%s</div></div>', $i, $query_trunc);
         $data_html .= $query_html;
         $data_html .= $exec['data_html'];
     }
 }
示例#7
0
(sombrero function) with the same first zero.
</P><P>
Producing plots for use in a scientific paper
is simplified with functions designed to accept
gnuplot script language and then
place the produced image on the page.
</P><P>
Advice: generate large cropped images with thick lines
then specify smaller width and height for images in the paper
to improve appearance of resulting plots.
Also, note that legend (key) positioning and spacing
requires adjustment to avoid overlap with lines and curves.

</P>
AiryVsSinc
 . newline() . X_section([keyword => 'Figures', title => 'can be loaded from external files', level => 1]) . newline() . figure([filename => 'NoisyGrayStep.png', caption => 'me', id => 'fig11'], [filename => 'Synchronic.png', caption => 'it', id => 'fig12', width => 256, height => 320]) . newline() . figure([filename => 'NoisyGrayStep.png', caption => 'me', id => 'fig2']) . newline() . newline() . figure([filename => 'NoisyGrayStep.png', caption => 'me', id => 'fig4']) . newline() . figure('fig11', 'fig12') . PHP_EOL . figure('fig2') . PHP_EOL . figure('fig4') . PHP_EOL . newline() . 'rCount 2: ' . PHP_EOL . rCount([filename => 'NoisyGrayStep.png', caption => 'me', id => 'step1'], [filename => 'Synchronic.png', caption => 'syn1', id => 'plot', width => 256, height => 320])[filename] . newline() . 'rCount 4: ' . PHP_EOL . rCount([[filename => 'NoisyGrayStep.png', caption => 'me', id => 'step3'], [filename => 'Synchronic.png', caption => 'syn2', id => 'plot', width => 256, height => 320]], [[filename => 'NoisyGrayStep.png', caption => 'me', id => 'step4'], [filename => 'Synchronic.png', caption => 'syn3', id => 'plot', width => 256, height => 320]])[filename] . newline() . X_section([keyword => 'Equations', title => 'can be formatted with TeX', level => 1]) . equation([tex => 'A=B', id => 'A:B', label => 'identity']) . equation([tex => '\\frac{A}{B}', id => 'A/B', label => 'division']) . newline() . X_section([keyword => 'Listings', title => 'can be loaded from external files', level => 1]) . listing([id => 'A', label => 'A little', listing => 'This is an example.']) . listing('A') . newline() . listing([id => 'B', label => 'B little', listing => 'This is another example.']) . listing('A', 'B') . $foobar(0) . PHP_EOL . $foobar(2) . PHP_EOL . $foobar(4) . PHP_EOL . X_tex('I am boxed') . X_appendix([keyword => 'Numbering', title => "Equations, Figures, Listings, Sections"]) . <<<TEXT_NUMBERING
<P>
Objects in a paper are numbered sequentially to identify
the order in which they appear in the paper.
They are numbered hierarchically to identify
the section, subsection, or grouping to which they belong.
Sections are typically identified by numbers such as "1. Introduction".
Subsections may be numbered or may use letters such as "1.a Field of inquiry".
Appendices are typically identified by letters such as "Appendix A".
When subsections are deeply nested, different sequence types are used.
For instance, subsubsections may use roman numerals.
</P><P>
This library provides resources for numbering in more than
the traditional Arabic/English/Roman styles.
The available styles are {$number_style_names}.
These styles are selectable for an object type.
示例#8
0
文件: logs.php 项目: Lymdun/LymOS
                    $ext_fichier = '';
                }
                if ($ext_fichier != 'php' and $ext_fichier != 'html') {
                    //utile pour exclure certains types de fichiers à ne pas lister
                    array_push($fichier, $file);
                }
            }
        }
    }
    $nb = count($fichier);
    //ajout perso : ajoute la date au fichier
    for ($i = 0; $i < $nb; $i++) {
        $fichier[$i] = "(" . date("y.m.d.H.i.s", filemtime($fichier[$i])) . ")" . $fichier[$i];
    }
    //natcasersort($fichier); //la fonction natcasesort( ) est la fonction de tri standard sauf qu'elle ignore la casse
    rsort($fichier);
    //ajout perso:changé par rsort pour sort à l'envers et fonction moins lourde
    $nb = count($fichier);
    //ajout perso : on vire la date des fichiers maintenant qu'ils sont classés
    for ($i = 0; $i < $nb; $i++) {
        $coup = explode(')', $fichier[$i]);
        $fichier[$i] = $coup[1];
    }
    foreach ($fichier as $value) {
        echo '<a href="' . rawurlencode($repertoire) . '/' . rawurlencode(str_replace('/', '', $value)) . '">' . $value . '</a><br />';
    }
}
//exemple d'utilisation :
listing('.');
//chemin du dossier
#
示例#9
0
function contenu_dir($nom_rep)
	{
	global $font,$id,$sens,$ordre,$rep,$poidstotal;
	
	// LECTURE DU REPERTOIRE ET CLASSEMENT DES FICHIERS
	list($liste,$poidstotal)=listing($nom_rep);
		
	// AFFICHAGE
	if(is_array($liste))
		{
		while (list($fichier,$mime) = each($liste))
			{
			// DEFINITION DU LIEN SUR LE FICHIER
			if(is_dir("$nom_rep/$fichier"))
				{
				$lien="index.php3?id=$id&sens=$sens&ordre=$ordre&rep=";
				if($rep!=""){$lien.="$rep/";}
				$lien.=$fichier;
				$affiche_copier="non";
				}
			else 
				{
				$lien="";
				if($rep!=""){$lien.="$rep/";}
				$lien.=$fichier;
				$lien="javascript:popup('$lien')";
				$affiche_copier="oui";
				}
			
			// AFFICHAGE DE LA LIGNE
			echo "<tr>\n";
			echo "<td><font face=\"$font\" size=\"2\">\n";
			if(is_editable($fichier) || is_image($fichier) || is_dir("$nom_rep/$fichier")) {echo "<a href=\"$lien\">";}
			echo "<img src=\"images/".mimetype("$nom_rep/$fichier","image")."\" width=\"20\" height=\"20\" align=\"ABSMIDDLE\" border=\"0\">";
			echo "$fichier";
			if(is_editable($fichier) || is_image($fichier) || is_dir("$nom_rep/$fichier")) {echo "</a>\n";}
			echo "</font></td>\n";
			echo "<td width=\"11%\"><font face=\"$font\" size=\"1\">";
			echo taille("$nom_rep/$fichier");
			echo "</font></td>\n";
			echo "<td width=\"15%\"><font face=\"$font\" size=\"1\">";
			echo mimetype("$nom_rep/$fichier","type");
			echo "</font></td>\n";			
			echo "<td width=\"17%\"><font face=\"$font\" size=\"1\">";
			echo date_modif("$nom_rep/$fichier");
			echo "</font></td>\n";
			echo "<td width=\"21%\">";
			
			// IMAGE COPIER
			if($affiche_copier=="oui")
				{
				echo "<a href=\"index.php3?id=$id&action=copier&sens=$sens&ordre=$ordre&rep=";if($rep!=""){echo "$rep&fic=$rep/";}else{echo "&fic=";}
				echo "$fichier\"><img src=\"images/copier.gif\" alt=\"$mess[66]\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
				}
			else
				{
				echo "<img src=\"images/pixel.gif\" width=\"20\" height=\"20\">\n";
				}

			// IMAGE DEPLACER
			if($affiche_copier=="oui")
				{
				echo "<a href=\"index.php3?id=$id&action=deplacer&ordre=$ordre&sens=$sens&rep=";if($rep!=""){echo "$rep&fic=$rep/";}else{echo "&fic=";}
				echo "$fichier\"><img src=\"images/deplacer.gif\" alt=\"$mess[70]\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
				 }
			else {echo "<img src=\"images/pixel.gif\" width=\"20\" height=\"20\">\n";}

			// IMAGE RENOMMER
			echo "<a href=\"index.php3?id=$id&ordre=$ordre&sens=$sens&action=rename&rep=";if($rep!=""){echo "$rep&fic=$rep/";}else{echo "&fic=";}
			echo "$fichier\"><img src=\"images/renommer.gif\" alt=\"$mess[6]\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
			
			// IMAGE SUPPRIMER
			echo "<a href=\"index.php3?id=$id&action=supprimer&ordre=$ordre&sens=$sens&rep=";if($rep!=""){echo "$rep&fic=$rep/";}else{echo "&fic=";}
			echo "$fichier\"><img src=\"images/supprimer.gif\" alt=\"$mess[7]\" width=\"20\" height=\"20\" border=\"0\"></a>\n";

			// IMAGE EDITER
			if(is_editable($fichier) && !is_dir("$racine/$fichier"))
				{
				echo "<a href=\"index.php3?id=$id&ordre=$ordre&sens=$sens&action=editer&rep=";if($rep!=""){echo "$rep&fic=$rep/";}else{echo "&fic=";}
				echo "$fichier\"><img src=\"images/editer.gif\" alt=\"$mess[51]\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
				}
			else {echo "<img src=\"images/pixel.gif\" width=\"20\" height=\"20\">\n";}
			
			// IMAGE TELECHARGER
			if($affiche_copier=="oui")
				{
				echo "<a href=\"index.php3?id=$id&action=telecharger&fichier=";
				if($rep!=""){echo "$rep/";}
				echo "$fichier\">";
				echo "<img src=\"images/download.gif\" alt=\"$mess[88]\" width=\"20\" height=\"20\" border=\"0\"></a>\n";
				}
							
			echo "</td>\n";				
			echo "</tr>\n";
			}
		}	
	}
示例#10
0
function listing_page($message = null)
{
    global $self, $directory, $sort, $reverse;
    html_header();
    $list = getlist($directory);
    if (array_key_exists('sort', $_GET)) {
        $sort = $_GET['sort'];
    } else {
        $sort = 'filename';
    }
    if (array_key_exists('reverse', $_GET) && $_GET['reverse'] == 'true') {
        $reverse = true;
    } else {
        $reverse = false;
    }
    $list = sortlist($list, $sort, $reverse);
    echo '<h1 style="margin-bottom: 0">Web File Browser (webadmin.php)</h1>

<form enctype="multipart/form-data" action="' . $self . '" method="post">

<table id="main">
';
    directory_choice();
    if (!empty($message)) {
        spacer();
        echo $message;
    }
    if (@is_writable($directory)) {
        upload_box();
        create_box();
    } else {
        spacer();
    }
    if ($list) {
        listing($list);
    } else {
        echo error('not_readable', $directory);
    }
    echo '</table>

</form>

';
    html_footer();
}
示例#11
0
<?php

if (!defined('PERCH_RUNWAY')) {
    include $_SERVER['DOCUMENT_ROOT'] . '/perch/runtime.php';
}
$title = perch_pages_title(true);
perch_layout('header', ['title' => $title . ' | perch.io']);
// perch_layout('homepage-header');
?>
      
        <div class="outer-container">
            <main class="main-body">
                <?php 
listing(perch_get('s'), array('template' => 'addons_item.html'));
?>
            </main>
            <?php 
perch_layout('user-sidebar');
?>
        </div>
        
    <?php 
perch_layout('footer');
示例#12
0
function listData($listQuery, $userID)
{
    listing($userID, $table);
    echo "<br /><br /><a href='simpleTable.php?u={$userID}&t={$table}&action=new'>Add Item</a>";
}
示例#13
0
function showComments4OneGalary($module, $visitor, $userID, $listNum, $altname)
{
    $gal = new Galary();
    $comm = new Commentor();
    $commArr = $comm->readAllComments($userID);
    if (count($commArr) == 0) {
        $r["text"] = "Отсутствуют комментарии!";
        return $r;
    }
    $galIdsArr = $gal->getGalaryIDs($altname);
    if (count($galIdsArr) == 0) {
        $r["text"] = "Отсутствуют изображения!";
        return $r;
    }
    foreach ($commArr as $index => $value) {
        //$tempArr[] = $commArr[$index][$value["id"]];
        //$tempArr[] =
        foreach ($galIdsArr as $index2 => $value2) {
            if ($value["pid"] == $value2["id"]) {
                $tempArr[] = $value;
            }
        }
    }
    $sortedArr = listing($tempArr, $listNum, 10);
    //20 - здесь указывается количество элементов на листе
    foreach ($sortedArr as $index => $value) {
        if ($index !== "listCount" && $index !== "listCurrent") {
            $user = new User($value["poster_user"]);
            $photo = $user->getPhoto();
            $userName = $user->name . "&nbsp;" . $user->secondName;
            $commDate = $value["comment_time"];
            $comment = $value["comment"];
            $imgProp = $gal->getImgProperties($value["pid"]);
            $link = "/" . "galary" . "/" . $imgProp["altname"] . "/" . $imgProp["id"] . "/";
            if ($visitor == $userID || $visitor == $value["poster_user"]) {
                $delUser = $value["poster_user"];
                $commID = $value["id"];
                $delLink = "<a href=\"{$link}?comm={$commID}\">Удалить</a>";
            } else {
                $delLink = "";
            }
            $previewPath = $gal->getPreviewPathById($value["pid"]);
            $imgCommented = "<a href=\"{$link}\"> <img src=\"{$previewPath}\" style=\"max-width:90px; max-height: 90px;\"> </a>";
            $strTable = $strTable . "<table border=\"1\">\n<tr>\n<td>\n  \r\n\t\t\t\t<img src=\"{$photo}\" style=\"max-width:90px; max-height: 90px;\" > \r\n\t\t\t\t\n</td>\n\r\n\t\t\t\t<td> {$userName}  &nbsp;&nbsp;&nbsp; {$commDate} &nbsp;&nbsp;&nbsp;   {$delLink} <br /> {$comment} </td>\r\n\t\t\t\t<td> {$imgCommented} </td></tr>\n</table>\n";
        }
    }
    $numerator = makeNumerator($sortedArr["listCount"], $sortedArr["listCurrent"], "g");
    $res["text"] = $numerator . $strTable . $numerator;
    return $res;
}