Ver Mensaje Individual
  #12 (permalink)  
Antiguo 11/05/2013, 17:47
Avatar de Nemutagk
Nemutagk
Colaborador
 
Fecha de Ingreso: marzo-2004
Ubicación: México
Mensajes: 2.633
Antigüedad: 20 años, 1 mes
Puntos: 406
Respuesta: Como dejo urls amigables

Cita:
Iniciado por ChatDelMundo Ver Mensaje
En el archivo boot.inc.php sale asi el menu:

Código PHP:
// menu
if (!strlen($parr[1]))
    
$current_menu_path $parr[0];
else
    
$current_menu_path $parr[0].'/'.$parr[1];
$menu_items = array();
$res sql_query("select * from ".tb()."menu order by weight ASC");
while (
$row sql_fetch_array($res)) {
    
$row['allowed_roles'] = explode(',',$row['allowed_roles']);
    
$menu_items[$row['path']] = $row;
    if (
$row['protected'] && !allow_access($row['allowed_roles'])) {
        continue;
    }
    if (
$row['type'] == 'personal' && $row['actived']) {
        
$personal_menu[] = $row;
    }
    elseif (
$row['type'] == 'community' && $row['actived']) {
        
$community_menu[] = $row;
    }
    elseif (
$row['type'] == 'admin' && $row['actived']) {
        
$admin_menu[] = $row;
    }
    elseif (
$row['type'] == 'tab') {
        
$all_tab_menu[] = $row;
    }
}
if (
strlen($menu_items[$current_menu_path]['parent'])) {
    
$top_menu_path $menu_items[$current_menu_path]['parent'];
}
else {
    
$top_menu_path $current_menu_path;
}
if (
strlen($menu_items[$current_menu_path]['name'])) {
    
set_title(t($menu_items[$current_menu_path]['name']));
}
if (
strlen($menu_items[$top_menu_path]['name'])) {
    
$top_title t($menu_items[$top_menu_path]['name']);
}
if (
is_array($all_tab_menu)) {
    foreach (
$all_tab_menu as $arr) {
        if (
$arr['parent'] == $top_menu_path) {
            
$tab_menu[] = $arr;
        }
    }
}

$hide_ad_roles explode('|',get_gvar('hide_ad_roles'));
if (
is_array($hide_ad_roles)) {
    foreach (
$hide_ad_roles as $role) {
        if (
in_array($role$client['roles'])) {
            
$config['hide_ad'] = 1;
        }
    }
}

$nav[] = url('home','Home');
require_once 
'./includes/libs/apps.inc.php'
En el archivo page.tpl.php sale asi:

Código PHP:
<div id="jcow_community_menu">
<ul class="menu">
<?php
echo '<li '.check_menu_on('home/index').'>'.url(uhome(),t('Home')).'</li>';
if (
is_array($community_menu)) {
    foreach (
$community_menu as $item) {
        echo 
'<li '.check_menu_on($item['path']).'>'.url($item['path'],t($item['name'])).'</li>';
    }
}
?>
</ul>
</div>

</div>
</div>
Al editar el En el archivo page.tpl.php me funciona si hago esto:
Código PHP:
<div id="jcow_community_menu">
<
ul class="menu">
<
li  class="menugen" ><a href="http://chatdelmundo.com.es">Inicio</a></li><li  class="menugen" ><a href="/pages">Páginas</a></li><li  class="menugen" ><a href="/feed">Noticias</a></li><li  class="menugen" ><a href="/events">Eventos</a></li><li  class="menugen" ><a href="/browse">Buscar</a></li><li  class="menugen" ><a href="/videos">Videos</a></li><li  class="menugen" ><a href="/blogs">Blogs</a></li><li  class="menugen" ><a href="/photos">Fotos</a></li><li  class="menugen" ><a href="/mobile">Movil</a></li><li  class="menuon" ><a href="/test">Chat</a></li></ul>
</
div>

</
div>
</
div
Son muchos los enlaces que tengo,
En la web la gente se registra y suben cosas
¿como hago para que todos esos enlaces esten amigables?
Lo mismo que te han dicho, tienes que hace el cambio MANUALMENTE, no hay forma de que automáticamente sin tocar código se cambien, ahora, en el código que has mostrado deberías buscar donde esta definida la función url(), ya que se ve que hay es donde se generan los links...
__________________
Listo?, tendría que tener 60 puntos menos de IQ para considerarme listo!!!
-- Sheldon Cooper
http://twitter.com/nemutagk
PD: No contestaré temas vía mensaje personal =)