Skip to content

Commit

Permalink
Varios fixes de URL absoluta
Browse files Browse the repository at this point in the history
  • Loading branch information
guaycuru committed Nov 29, 2016
1 parent 7b65182 commit 4e3c4b7
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 81 deletions.
8 changes: 4 additions & 4 deletions .htaccess
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ Options -MultiViews
RewriteEngine On

# Add trailing slash
RewriteCond %{REQUEST_URI} !(/$|\.)
RewriteRule (.*) %{REQUEST_URI}/ [R=301,L]
# RewriteCond %{REQUEST_URI} !(/$|\.)
# RewriteRule (.*) %{REQUEST_URI}/ [R=301,L]

# Force HTTPS
RewriteCond %{HTTP:X-Forwarded-Proto} !https
Expand All @@ -19,9 +19,9 @@ RewriteRule ^$ views/index.php [L,QSA]
# Rewrite views
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule ^([^\/\.]+)/$ views/$1.php [L,QSA]
RewriteRule ^([^\/\.]+)/?$ views/$1.php [L,QSA]

# Rewrite views with ID
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteRule ^([^\/\.]+)/([^\/\.\?\&]+)/$ views/$1.php?id=$2 [L,QSA]
RewriteRule ^([^\/\.]+)/([^\/\.\?\&]+)/?$ views/$1.php?id=$2 [L,QSA]
4 changes: 2 additions & 2 deletions classes/GDE/Acontecimento.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,9 @@ public function getFoto($th = true) {
if(($this->getOrigem() !== null) || ($this->getGrupo_Origem() !== null))
return ($this->getOrigem() !== null) ? $this->getOrigem()->getFoto(true, $th) : $this->getGrupo_Origem()->getFoto(true, $th);
elseif($this->tipo == 'ga')
return ($th) ? "../web/images/gde_th.gif" : "../web/images/gde.gif";
return ($th) ? CONFIG_URL . "web/images/gde_th.gif" : "../web/images/gde.gif";
elseif($this->tipo == 'gc')
return ($th) ? "../web/images/gde_th.gif" : "../web/images/gde.gif";
return ($th) ? CONFIG_URL . "web/images/gde_th.gif" : "../web/images/gde.gif";
}

public function Pode_Responder(Usuario $Usuario) {
Expand Down
2 changes: 1 addition & 1 deletion views/disciplina.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
<table id="tabela_informacoes" cellspacing="0" class="tabela_bonyta_branca">
<tr>
<td width="25%"><b>Sigla:</b></td>
<td><?= ((isset($_GET['of']))?'<a href="<?= CONFIG_URL; ?>disciplina/?id='.$Disciplina->getSigla(true).'">':null).$Disciplina->getSigla(true).((isset($_GET['of']))?'</a>':null); ?></td>
<td><?= ((isset($_GET['of']))?'<a href="'.CONFIG_URL.'disciplina/'.$Disciplina->getSigla(true).'">':null).$Disciplina->getSigla(true).((isset($_GET['of']))?'</a>':null); ?></td>
</tr>
<tr>
<td width="25%"><b>Nome:</b></td>
Expand Down
54 changes: 25 additions & 29 deletions views/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
$_SESSION['atualizacoes_last_id'] = 0; //Acontecimento::Ultimo_Id_Por_Data($_SESSION['ultimo_acesso']);

?>
<script type="text/javascript" src="../web/js/gde.amizades.js?<?= REVISION; ?>"></script>
<script type="text/javascript" src="../web/js/gde.atualizacoes.js?<?= REVISION; ?>"></script>
<script type="text/javascript" src="../web/js/gde.calendario.js?<?= REVISION; ?>"></script>
<script type="text/javascript" src="../web/js/gde.favoritos.js?<?= REVISION; ?>"></script>
<script type="text/javascript" src="../web/js/gde.notas.js?<?= REVISION; ?>"></script>
<script type="text/javascript" src="../web/js/gde.aviso.js?<?= REVISION; ?>"></script>
<script type="text/javascript" src="../web/js/gde.grupos.js?<?= REVISION; ?>"></script>
<script type="text/javascript" src="<?= CONFIG_URL; ?>web/js/gde.amizades.js?<?= REVISION; ?>"></script>
<script type="text/javascript" src="<?= CONFIG_URL; ?>web/js/gde.atualizacoes.js?<?= REVISION; ?>"></script>
<script type="text/javascript" src="<?= CONFIG_URL; ?>web/js/gde.calendario.js?<?= REVISION; ?>"></script>
<script type="text/javascript" src="<?= CONFIG_URL; ?>web/js/gde.favoritos.js?<?= REVISION; ?>"></script>
<script type="text/javascript" src="<?= CONFIG_URL; ?>web/js/gde.notas.js?<?= REVISION; ?>"></script>
<script type="text/javascript" src="<?= CONFIG_URL; ?>web/js/gde.aviso.js?<?= REVISION; ?>"></script>
<script type="text/javascript" src="<?= CONFIG_URL; ?>web/js/gde.grupos.js?<?= REVISION; ?>"></script>
<script type="text/javascript">
// <![CDATA[
var carregou_horario = false;
Expand All @@ -33,7 +33,7 @@
var procurando_amigo = [];
var Cardapio_Muda = function(id) {
$("#cardapio_conteudo").Carregando('Carregando Card&aacute;pio...<br /><br /><br /><br /><br />');
$.post("../ajax/cardapio.php", { c: id }, function(data) {
$.post("<?= CONFIG_URL; ?>ajax/cardapio.php", { c: id }, function(data) {
if(data) {
$("#cardapio_conteudo").html(data);
$("a#cardapio_semana").fancybox({
Expand Down Expand Up @@ -70,9 +70,9 @@
$("#atualizar_status").unbind('click');
$("#atualizar_status").text('Salvando...');
$("#meu_status").addClass('enviando');
$.post('../ajax/ax_acontecimento.php', {tp: 'us', txt: status}, function(data) {
$.post('<?= CONFIG_URL; ?>ajax/ax_acontecimento.php', {tp: 'us', txt: status}, function(data) {
if(data != 0) {
$("#meu_status_atual").load('../ajax/ax_status.php', {q: 'carregar'});
$("#meu_status_atual").load('<?= CONFIG_URL; ?>ajax/ax_status.php', {q: 'carregar'});
$("#limpar_status").show();
$("#meu_status").Padrao();
Adicionar_Atualizacao('', data);
Expand All @@ -86,7 +86,7 @@

var Limpar_Status = function() {
$("#limpar_status").text('Removendo...');
$.post('../ajax/ax_status.php', {q: 'limpar_status'}, function(data) {
$.post('<?= CONFIG_URL; ?>ajax/ax_status.php', {q: 'limpar_status'}, function(data) {
if(data != 0) {
$("#meu_status_atual").html('');
$("#limpar_status").hide();
Expand All @@ -97,7 +97,7 @@
}

var Adicionar_Amigo_Sugestao = function(id) {
$.post('../ajax/ax_amigo.php', {i: id, tipo: 'a'}, function(data) {
$.post('<?= CONFIG_URL; ?>ajax/ax_amigo.php', {i: id, tipo: 'a'}, function(data) {
$.guaycuru.confirmacao("Foi enviado um pedido de autoriza&ccedil;&atilde;o!", null);
$("#amigo_"+id).hide();
});
Expand Down Expand Up @@ -144,7 +144,7 @@

$("span.ui-icon").css({'display': 'none'});

/*$.post('../ajax/ax_previsao.php', {}, function(data){
/*$.post('<?= CONFIG_URL; ?>ajax/ax_previsao.php', {}, function(data){
$("#previsao_tempo").html(data);
});*/

Expand Down Expand Up @@ -203,23 +203,23 @@
$("#limpar_status").hide();
$("img.nota_botao_x").live('hover', function(e) {
if(e.type == 'mouseenter') {
$(this).attr('src', '../web/images/CancelON.png');
$(this).attr('src', '<?= CONFIG_URL; ?>web/images/CancelON.png');
} else {
$(this).attr('src', '../web/images/CancelOFF.png');
$(this).attr('src', '<?= CONFIG_URL; ?>web/images/CancelOFF.png');
}
});
$("img.nota_botao_lapis").live('hover', function(e) {
if(e.type == 'mouseenter') {
$(this).attr('src', '../web/images/EditON.png');
$(this).attr('src', '<?= CONFIG_URL; ?>web/images/EditON.png');
} else {
$(this).attr('src', '../web/images/EditOFF.png');
$(this).attr('src', '<?= CONFIG_URL; ?>web/images/EditOFF.png');
}
});
$("img.nota_botao_save").live('hover', function(e) {
if(e.type == 'mouseenter') {
$(this).attr('src', '../web/images/SaveON.png');
$(this).attr('src', '<?= CONFIG_URL; ?>web/images/SaveON.png');
} else {
$(this).attr('src', '../web/images/SaveOFF.png');
$(this).attr('src', '<?= CONFIG_URL; ?>web/images/SaveOFF.png');
}
});
$('#periodo_horario').live('change', function() {
Expand All @@ -245,7 +245,7 @@
});
$("input.tipo_calendario").click(function() {
$("div."+$(this).attr('id')).toggle();
$.post('../ajax/ax_opcao_calendario.php', {c: $(this).attr('id'), v: ($(this).is(":checked") ? 1 : 0)});
$.post('<?= CONFIG_URL; ?>ajax/ax_opcao_calendario.php', {c: $(this).attr('id'), v: ($(this).is(":checked") ? 1 : 0)});
});
$("#toggle_menu_requisicoes").click(Amizade_Requisicoes_Toggle);
$("a.amizade_aceitar").click(Amizade_Aceitar);
Expand Down Expand Up @@ -302,14 +302,14 @@
<div id="perfil_mensagem">
<textarea class="arredondado-all" id="meu_status" name="status" rows="1" cols="50"></textarea> <a href="#" id="atualizar_status" class="perfil_link_enviar">Salvar</a>
<div id="cardapio">
<div id="cardapio_botao"><img src="../web/images/cardapio_icone.gif" alt="Cardapio" /></div>
<div id="cardapio_botao"><img src="<?= CONFIG_URL; ?>web/images/cardapio_icone.gif" alt="Cardapio" /></div>
</div>
<div id="cardapio_conteudo" style="width: 260px; float: left; margin-left: 10px"></div>
<!--<div id="previsao_tempo" style="float: left; margin-left: 20px"></div> -->
</div>
</div>
</div>
<!-- <div class="tip" id="perfil_tip" style="text-align: center;"><strong>Ajude a escolher o futuro do GDE.</strong> Clique <a href="../ajax/ax_enquete.php?id=5" id="enquete">aqui</a> e d&ecirc; sua opini&atilde;o!</div> -->
<!-- <div class="tip" id="perfil_tip" style="text-align: center;"><strong>Ajude a escolher o futuro do GDE.</strong> Clique <a href="<?= CONFIG_URL; ?>ajax/ax_enquete.php?id=5" id="enquete">aqui</a> e d&ecirc; sua opini&atilde;o!</div> -->
<div id="perfil_abas">
<div id="tabs">
<ul>
Expand Down Expand Up @@ -398,7 +398,7 @@
</a>
</div>
<div class="amigo_nome">
<img src="../web/images/status_vs.png" class="status_icone status_icone_<?= $Amigo->getAmigo()->getID(); ?>" alt="?" />
<img src="<?= CONFIG_URL; ?>web/images/status_vs.png" class="status_icone status_icone_<?= $Amigo->getAmigo()->getID(); ?>" alt="?" />
<a href="Perfil.php?l=<?= $Amigo->getAmigo()->getLogin() ?>" class="amigo" title="<?= $Amigo->getAmigo()->getNome_Completo(true) ?>"><?= Util::Limita($Amigo->getApelido(true), 10); ?></a>
</div>
</div>
Expand All @@ -423,7 +423,7 @@
</a>
</div>
<div class="amigo_nome">
<img src="../web/images/status_vs.png" class="status_icone status_icone_<?= $Amigo->getID(); ?>" alt="?" />
<img src="<?= CONFIG_URL; ?>web/images/status_vs.png" class="status_icone status_icone_<?= $Amigo->getID(); ?>" alt="?" />
<a href="Perfil.php?l=<?= $Amigo->getLogin(); ?>" class="amigo" title="<?= $Amigo->getNome_Completo(true); ?>"><?= $Amigo->getNome(true); ?></a>
</div>
</div>
Expand All @@ -433,8 +433,4 @@
<div id="lista_grupos" ><img src="<?= CONFIG_URL; ?>web/images/loading.gif" alt="..." /> Carregando...</div>
</div>
</div>
<?php

echo $FIM;

?>
<?= $FIM; ?>
8 changes: 4 additions & 4 deletions views/oferecimento.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
$html_oferecimento_pagina = "<a href='".$oferecimento_pagina."' target='_blank'>".$oferecimento_pagina."</a>"; //.' <a href="#" id="pagina_reclamar" class="link_reclamar">Reclamar</a>';

?>
<!-- <script type="text/javascript" src="../web/js/gde.forum.js?<?= REVISION; ?>"></script> -->
<!-- <script type="text/javascript" src="<?= CONFIG_URL; ?>web/js/gde.forum.js?<?= REVISION; ?>"></script> -->
<script type="text/javascript">
// <![CDATA[
var carregou_informacoes = false;
Expand Down Expand Up @@ -162,7 +162,7 @@
</table>
</div>
<div id="tab_disciplina" class="tab_content">
<img src="../web/images/loading.gif" alt="..." /> Carregando dados da disciplina...
<img src="<?= CONFIG_URL; ?>web/images/loading.gif" alt="..." /> Carregando dados da disciplina...
</div>
<div id="tab_horario" class="tab_content">
<table cellspacing="0" class="tabela_bonyta_branca">
Expand All @@ -181,7 +181,7 @@
</table>
</div>
<!-- <div id="tab_forum" class="tab_content">
<img src="../web/images/loading.gif" alt="..." /> Carregando F&oacute;rum...
<img src="<?= CONFIG_URL; ?>web/images/loading.gif" alt="..." /> Carregando F&oacute;rum...
</div> -->
</div>
</div>
Expand All @@ -196,7 +196,7 @@
<input type="radio" id="apenas_amigos" name="filtro_amigos" class="tipo_atualizacoes"><label for="apenas_amigos">Apenas Amigos</label>
</div><br />
<input type="text" class="busca_simples" id="filtro_nome" />
<div id="lista_alunos"><img src="../web/images/loading.gif" alt="..." /></div>
<div id="lista_alunos"><img src="<?= CONFIG_URL; ?>web/images/loading.gif" alt="..." /></div>
</td></tr>
</table>

Expand Down
2 changes: 1 addition & 1 deletion views/sala.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace GDE;

if(isset($_GET['cm']))
die("<img src='../web/images/loading.gif' /> Carregando Mapa...");
die("<img src='".CONFIG_URL."web/images/loading.gif' /> Carregando Mapa...");

define('TITULO', 'Sala');

Expand Down
20 changes: 10 additions & 10 deletions web/js/gde.atualizacoes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ var Atualizar_Atualizacoes = function(id, tp, mais, novas) {
var args = {i: id, st: 0, msg: msg, min: min, am: am, gr: gr, gde: gde, ultimo: atualizacao_maior_id, nvs: 1};
else
var args = {g: id, st: 0, msg: msg, min: min, am: am, gr: gr, gde: gde, ultimo: atualizacao_maior_id, nvs: 1};
$.post('../ajax/acontecimentos.php', args, function(data) {
$.post(CONFIG_URL + 'ajax/acontecimentos.php', args, function(data) {
if(data) {
$("#div_tem_atualizacoes").remove();
$("div.atualizacao_nova_escondida").remove();
Expand All @@ -21,12 +21,12 @@ var Atualizar_Atualizacoes = function(id, tp, mais, novas) {
}
});
} else if(mais) {
$("#atualizacoes_mais").before('<div id="carregando_mais_atualizacoes"><img src="../web/images/loading.gif" />Carregando...</div>');
$("#atualizacoes_mais").before('<div id="carregando_mais_atualizacoes"><img src="' + CONFIG_URL + 'web/images/loading.gif" />Carregando...</div>');
if(tp == 'u')
var args = {i: id, st: $("div.atualizacao:visible").length, msg: msg, min: min, am: am, gr: gr, gde: gde, ultimo: atualizacao_maior_id, pp: atualizacao_por_pagina, mais: 1};
else
var args = {g: id, st: $("div.atualizacao:visible").length, msg: msg, min: min, am: am, gr: gr, gde: gde, ultimo: atualizacao_maior_id, pp: atualizacao_por_pagina, mais: 1};
$.post('../ajax/acontecimentos.php', args, function(data) {
$.post(CONFIG_URL + 'ajax/acontecimentos.php', args, function(data) {
var mais = $(data).find(".atualizacao");
if(mais.length == 0)
$("#atualizacoes_mais").remove();
Expand All @@ -51,8 +51,8 @@ var Atualizar_Atualizacoes = function(id, tp, mais, novas) {
var args = {i: id, st: 0, msg: msg, min: min, am: am, gr: gr, gde: gde, ultimo: -1, pp: atualizacao_por_pagina};
else
var args = {g: id, st: 0, msg: msg, min: min, am: am, gr: gr, gde: gde, ultimo: -1, pp: atualizacao_por_pagina};
$("#tab_atualizacoes_conteudo").load('../ajax/acontecimentos.php', args, function() {
//$.post('../ajax/acontecimentos.php', {ui: 1}, function(data) {
$("#tab_atualizacoes_conteudo").load(CONFIG_URL + 'ajax/acontecimentos.php', args, function() {
//$.post(CONFIG_URL + 'ajax/acontecimentos.php', {ui: 1}, function(data) {
atualizacao_maior_id = parseInt($("#atualizacao_maior_id").html());
//});
$("#tab_atualizacoes_conteudo").append('<div id="atualizacoes_mais"><a href="#" id="atualizacoes_mais_link">Mais...</a></div>');
Expand All @@ -65,7 +65,7 @@ var Remover_Atualizacao = function() {
var id = ids[1];
var tmp = $("#remover_"+id).html();
$("#remover_"+id).html('Aguarde');
$.post('../ajax/ax_acontecimento.php', {tp: 'x', id: id}, function(data) {
$.post(CONFIG_URL + 'ajax/ax_acontecimento.php', {tp: 'x', id: id}, function(data) {
if(data != 0) {
$("#atualizacao_"+id).hide("slow");
$("#respostas_"+id).hide("slow");
Expand Down Expand Up @@ -96,9 +96,9 @@ var Responder_Atualizacao_Enviar = function() {
if((txt == null) || (txt == 'Responder...'))
return false;
$("#input_responder_"+id+"_"+original).addClass('enviando');
$.post('../ajax/ax_acontecimento.php', {tp: 'um', txt: $("#input_responder_"+id+"_"+original).val(), ori: original}, function(data) {
$.post(CONFIG_URL + 'ajax/ax_acontecimento.php', {tp: 'um', txt: $("#input_responder_"+id+"_"+original).val(), ori: original}, function(data) {
if(data != 0) {
$("#respostas_"+original).load('../ajax/acontecimentos.php div.atualizacao_resposta', {o: original, ultimo: atualizacao_maior_id}, function() {
$("#respostas_"+original).load(CONFIG_URL + 'ajax/acontecimentos.php div.atualizacao_resposta', {o: original, ultimo: atualizacao_maior_id}, function() {
// Remove o link de exibir todas as respostas (porque depois que respondo, ja carrego todas
$("#div_responder_"+id).remove();
$('#todas_respostas_'+original).parent().remove();
Expand All @@ -120,7 +120,7 @@ var Responder_Atualizacao_Cancelar = function() {
}

var Adicionar_Atualizacao = function(i, o) {
$.post('../ajax/acontecimentos.php', {i: i, o: o}, function(data) {
$.post(CONFIG_URL + 'ajax/acontecimentos.php', {i: i, o: o}, function(data) {
$("#tab_atualizacoes_conteudo").prepend(data);
});
}
Expand All @@ -131,7 +131,7 @@ var Todas_Respostas_Atualizacao = function() {
var id = ids[2];
var old = $(this).html();
$(this).text('Aguarde...');
$.post('../ajax/acontecimentos.php', {o: id, ultimo: atualizacao_maior_id, rt: 1}, function(data) {
$.post(CONFIG_URL + 'ajax/acontecimentos.php', {o: id, ultimo: atualizacao_maior_id, rt: 1}, function(data) {
if(data) {
$('#'+idf).parent().remove();
$("#respostas_"+id).html($(data).find('div.atualizacao_resposta'));
Expand Down
Loading

0 comments on commit 4e3c4b7

Please sign in to comment.