Ir para conteúdo
Fórum Script Brasil
  • 0

Listar Arquivos


Zer0

Pergunta

4 respostass a esta questão

Posts Recomendados

  • 0

Companheiro, talves este código te ajude:

1)Página 01: Salve como easyarticle.php

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<TITLE>sem titulo</TITLE>

</head>

<body bgcolor="#ffffff" text="#000000" link="#000099" vlink="#000099" alink="#ffff33">

<?

/*

*/

/* ------------------------------------------------------------------------------------------

Variable definitions

---------------------------------------------------------------------------------------------*/

$filename="easyarticle.php";

$printhead='Article name (print version)<br>';

$head='

<div align="center"><table width=60% border=0 bgcolor="#000000" cellpadding=1 cellspacing=0>

<tr><td><table width=100% border=0 cellpadding=5 cellspacing=0><tr><td bgcolor="#cccccc"><font face="verdana,arial,helvetica" size="-1">

';

$foot='

</font></td></tr></table></td></tr></table></div>

';

$article='

Brasil Aleluia (Título 1 aqui)

<cont>

vai o texto aqui vai o texto aqui vai o texto aqui vai o texto aqui vai o texto aqui vai o texto aqui

vai o texto aqui vai o texto aqui vai o texto aqui vai o texto aqui vai o texto aqui vai o texto aqui vai o texto aqui

vai o texto aqui vai o texto aqui vai o texto aquivai o texto aqui vai o texto aqui vai o texto aqui

vai o texto aqui vai o texto aqui vai o texto aquivai o texto aqui vai o texto aqui vai o texto aqui

vai o texto aqui vai o texto aqui vai o texto aquivai o texto aqui vai o texto aqui vai o texto aqui

vai o texto aqui vai o texto aqui vai o texto aquivai o texto aqui vai o texto aqui vai o texto aqui

vai o texto aqui vai o texto aqui vai o texto aquivai o texto aqui vai o texto aqui vai o texto aqui.

<chapter>Assunto 2 <cont>

vai o texto aqui vai o texto aqui vai o texto aqui vai o texto aqui vai o texto aqui vai o texto aqui

<chapter>

Capítulo 20

<cont>

CPI dos Correios!

<chapter>

Chamada 2 aqui!

<cont>

Brasil Aleluia

<cont>

Introduction to the demoarticle

<chapter>

Capítulo 10

<cont>

Saiu o novo Pentium da...!

<chapter>

Introduction to the demoarticle

<chapter>

Capítulo 10

<cont>

Chapter one content!

<chapter>

Capítulo 20

<cont>

CPI dos Correios!

<chapter>

Chamada 2 aqui!

<cont>

Brasil Aleluia

<chapter>

Chamada 2 aqui!

<cont>

Saiu o novo Pentium da...!

';

/* ------------------------------------------------------------------------------------------

Print version

---------------------------------------------------------------------------------------------*/

if ($print=="yes"){

echo '<ul><font face="arial,helvetica" size=2><b>';

# Display print head

echo $printhead.'</b>';

# Display File location using Server Variables

# echo '<br>Location: '.$SERVER_NAME.$PATH_INFO.'<br><br>';

# Split article into chapters <chapter>

$chapters=explode('<chapter>',$article);

# Loop over chapters

for ($all=0;$all<=sizeof($chapters);$all++){

# Split into title and content <cont>, display titles in bold and articles normal

$disp=explode('<cont>',$chapters[$all]);

echo '<br><b>'.$disp[0].'</b><br>'.$disp[1].'<br>';

}

echo "<br><br>CREATED WITH EasyArticle http://omediador.com/easyarticle/";

echo '</font></ul>';

}

else {

/* ------------------------------------------------------------------------------------------

Online version

--------------------------------------------------------------------------------------------*/

# Display HTML head

echo $head;

# Split article into chapters <chapter>

$chapters=explode('<chapter>',$article);

# When there is no chapter variable set, set it to 0

if (!$art){ $art=0; }

# Split chosen chapter into title and content <cont>, display titles in bold and articles normal

$disp=explode('<cont>',$chapters[$art]);

echo "<b>".$disp[0]."</b><br>";

echo $disp[1];

# Display the more link

if ($art!=(sizeof($chapters)-1)){

echo '&nbsp;<a href="'.$filename.'?art='.($art+1).'">more</a><br>';

}

# Links to other chapters

echo "<ul>";

# Loop over all chapters

for ($all=0;$all<=sizeof($chapters)-1;$all++){

# Split into title and content -> Getting the Link names

$disp=explode('<cont>',$chapters[$all]);

# If chapter is not the chosen one, create a link to it.

if ($all != $art){echo ($all+1).'<a href="'.$filename.'?art='.$all.'">'.$disp[0].'</a><br>';}

# otherwise don't create a link, display bold text

else{echo ($all+1).'<b>'.$disp[0].'</b><br>';}

}

echo'<br><a href="'.$filename.'?print=yes">print version</a></ul>';

echo $foot;

echo "<!-- CREATED WITH EasyArticle http://omediador.com/easyarticle/ -->";

}

?>

</body>

</html>

-------------------

2) Mais esta (salve como source.php:

/*

EasyArticle v1.0

written by Chris Heilmann (info@onlinetools.org)

Homepage: http://www.onlinetools.org/easyarticle/

Please do not delete these lines

*/

/* ------------------------------------------------------------------------------------------

Variable definitions

---------------------------------------------------------------------------------------------*/

#

# Filename of this file, needed to create the links.

#

$filename="easyarticle.php";

#

# The head section for the print version

#

$printhead='Article name (print version)<br>';

#

# The head section for the non print version

# You are allowed to use every letter except for ', replace this one with a &acute; !

# This is an example, replace them with yours...

$head='

<font face="arial" size=2>

';

#

# The footer section for the non print version

# You are allowed to use every letter except for ', replace this one with a &acute; !

#

$foot='

</font>

';

#

# The article

# -----------

# For every new chapter insert a <chapter> tag, followed by the title

# displayed in the link to the chapter

# and as the title of the chapter in bold)

# after the title start the content with a <cont> tag!

# You are allowed to use every letter except for ', replace this one with a &acute; !

# These are examples from the demo page, just insert your data smile.gif

$article='

Articlename

<cont>

content1

<chapter>

Chapter One

<cont>

Chapter one content!

';

/* ------------------------------------------------------------------------------------------

Print version

---------------------------------------------------------------------------------------------*/

if ($print=="yes"){

echo '<ul><font face="arial,helvetica" size=2><b>';

# Display print head

echo $printhead.'</b>';

# Display File location using Server Variables

# echo '<br>Location: '.$SERVER_NAME.$PATH_INFO.'<br><br>';

# Split article into chapters <chapter>

$chapters=explode('<chapter>',$article);

# Loop over chapters

for ($all=0;$all<=sizeof($chapters);$all++){

# Split into title and content <cont>, display titles in bold and articles normal

$disp=explode('<cont>',$chapters[$all]);

echo '<br><b>'.$disp[0].'</b><br>'.$disp[1].'<br>';

}

echo "<br><br>CREATED WITH EasyArticle http://www.onlinetools.org/easyarticle/";

echo '</font></ul>';

}

else {

/* ------------------------------------------------------------------------------------------

Online version

--------------------------------------------------------------------------------------------*/

# Display HTML head

echo $head;

# Split article into chapters <chapter>

$chapters=explode('<chapter>',$article);

# When there is no chapter variable set, set it to 0

if (!$art){ $art=0; }

# Split chosen chapter into title and content <cont>, display titles in bold and articles normal

$disp=explode('<cont>',$chapters[$art]);

echo "<b>".$disp[0]."</b><br>";

echo $disp[1];

# Display the more link

if ($art!=(sizeof($chapters)-1)){

echo '&nbsp;<a href="'.$filename.'?art='.($art+1).'">more</a><br>';

}

# Links to other chapters

echo "<ul>";

# Loop over all chapters

for ($all=0;$all<=sizeof($chapters)-1;$all++){

# Split into title and content -> Getting the Link names

$disp=explode('<cont>',$chapters[$all]);

# If chapter is not the chosen one, create a link to it.

if ($all != $art){echo ($all+1).'<a href="'.$filename.'?art='.$all.'">'.$disp[0].'</a><br>';}

# otherwise don't create a link, display bold text

else{echo ($all+1).'<b>'.$disp[0].'</b><br>';}

}

# display link to print version

echo'<br><a href="'.$filename.'?print=yes">print version</a></ul>';

# display HTML footer

echo $foot;

# don't delete the following!

echo "<!-- CREATED WITH EasyArticle http://www.onlinetools.org/easyarticle/ -->";

}

3) é só testar!!!! Espero que te ajude (sou novato em php mas utilizo este script)

Abração

Link para o comentário
Compartilhar em outros sites

  • 0

o codigo acima é bem interessante, mas eu queria fazer assim oh, por exemplo, eu tenho 3 arquivos .txt no host, ai minha pagina index mostraria esses 3 arquivos, quando eu clicasse em um deles, na index aparecia o conteudo desse txt que foi clicado, tipo um include em tempo real... tem como fazer?

Link para o comentário
Compartilhar em outros sites

  • 0

o codigo acima é bem interessante, mas eu queria fazer assim oh, por exemplo, eu tenho 3 arquivos .txt no host, ai minha pagina index mostraria esses 3 arquivos, quando eu clicasse em um deles, na index aparecia o conteudo desse txt que foi clicado, tipo um include em tempo real... tem como fazer?

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,1k
    • Posts
      651,8k
×
×
  • Criar Novo...