Foros del Web » Programando para Internet » PHP »

PHP OO Agregar Fan Pages al buscador

Estas en el tema de Agregar Fan Pages al buscador en el foro de PHP en Foros del Web. Como hago para que las fan pages creadas salgan cuando alguien use el buscador de la web? Codigos Fan Pages http://pastebin.com/PGFh3Qt6 Buscador Código PHP: class  ...
  #1 (permalink)  
Antiguo 26/01/2014, 23:23
Avatar de ChatDelMundo  
Fecha de Ingreso: abril-2013
Mensajes: 98
Antigüedad: 11 años
Puntos: 1
Agregar Fan Pages al buscador

Como hago para que las fan pages creadas salgan cuando alguien use el buscador de la web?

Codigos Fan Pages

http://pastebin.com/PGFh3Qt6

Buscador
Código PHP:
class search{
    
    function 
index() {
        
c('
        <form action="'
.url('search/listing').'" method="post">
        <p>
        <label>title</label> <input type="text" name="title" />
        </p>
        <p>
        <input type="submit" class="button" value="'
.t('Submit').'" />
        </p>
        </form>
        '
);
    }
    
    function 
listing() {
        global 
$offset$num_per_page$page;
        
$title trim($_POST['title']);
        
$display_title stripslashes(trim($_POST['title']));
        
c('Searching <strong>'.h($title).'</strong><br />');
        if (
strlen($title) < 3) {
            
sys_back(t('Keyword is too short'));
        }
        else {
            
$hash substr(md5($title),0,12);
            if (
$c get_cache($hash)) {
                
header("location:".url('search/result/'.$hash));
                exit;
            }
            else {
                
$c '<h1>'.h($display_title).'</h1>';
                
$res sql_query("select * from ".tb()."accounts where username like '%{$title}%' or fullname like '%{$title}%'  order by lastlogin DESC limit 10");
                while (
$user sql_fetch_array($res)) {
                    
$users .= '<li>'.url('u/'.$user['username'],$user['username']).'<br />'.avatar($user).'<br />'.h($user['fullname']).'</li>';
                }
                if (
strlen($users)) {
                    
$c .= '<h2>'.t('Members').'</h2>';
                    
$c .= '<ul class="small_avatars">'.$users.'</ul>';
                }
                
$c .= '<h2>'.t('Stories').'</h2>
                    <p>Searching for <strong>"'
.h($title).'"</strong></p>';
                
$res sql_query("select s.*,u.username from `".tb()."stories` as s left join ".tb()."accounts as u on u.id=s.uid where s.title LIKE '%$title%' ORDER BY s.id DESC LIMIT 20");
                if (!
sql_counts($res)) {
                    
$c .= '<p>no story matched</p>';
                }
                else {
                    
$c .= 'Stories:<br /><ul class="post">';
                    while(
$story sql_fetch_array($res)) {
                        
$c .= '<li>
                        ['
.url($story['app'],app_name($story['app'])).'] 
                        <a href="'
.url($story['app'].'/viewstory/'.$story['id']).'">'.str_replace($title,'<strong>'.h($title).'</strong>',htmlspecialchars($story['title'])).'</a><br />'.get_date($story['created']).', by '.url('u/'.$story['username'],$story['username']).'
                        </li>'
;
                    }
                    
$c .= '</ul>';
                }

            
                                
                
set_cache($hash$c48);
                
header("location:".url('search/result/'.$hash));
                exit;

                                                      
$c .= '<h2>'.t('Forums').'</h2>
<p>Searching for <strong>"'
.h($title).'"</strong></p>';
$res sql_query("select * from `".tb()."forum_threads` where topic LIKE '%$title%' ORDER BY lastpostcreated DESC LIMIT 20");
if (!
sql_counts($res)) {
$c .= '<p>no threads matched</p>';
}
else {
$c .= 'Threads:<br /><ul class="post">';
while(
$thread sql_fetch_array($res)) {
$res2 sql_query("select * from `".tb()."forums` where id=".$thread['fid']."");
$forum sql_fetch_array($res2);
$c .= '<li>
['
.url('forums/listthreads/'.$forum['id'].'',t($forum['name'])).']
<a href="'
.url('forums/viewthread/'.$thread['id'].'').'">'.str_replace($title,'<strong>'.h($title).'</strong>',htmlspecialchars($thread['topic'])).'</a><br />'.get_date($thread['created']).', by '.url('u/'.$thread['username'],$thread['username']).'
</li>'
;
}
$c .= '</ul>';
}
                           

            }
        }
    }

    function 
result($hash) {
        
set_title('Search result');
        
c(get_cache($hash).get_gvar('ad_block_search'));
    }
    

__________________
chatdelmundo.es

Etiquetas: buscador, fan, html, pages, select, sql
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 01:16.