Beispiel #1
0
 public function getfrom404()
 {
     $istem = parse_url($_SERVER['REQUEST_URI']);
     $this->output->set_header("HTTP/1.0 200 OK");
     $this->output->set_header("HTTP/1.1 200 OK");
     $istem = parse_url($_SERVER['REQUEST_URI']);
     $i = $istem['path'];
     $flag404 = TRUE;
     $d = explode("/", $i, -1);
     $id = '';
     foreach ($d as $k) {
         if (strlen($k) > 2) {
             redirect();
         }
         //Direkt ID ile içerik çekilmesi engelleniyor. Parçalar 2 şer harften büyük olamaz.
         if ($k == '') {
             continue;
         }
         $k = is_numeric($k) ? $k : '00';
         $id .= $k;
     }
     if ($id < 1) {
         redirect();
     }
     $person = $this->db->select('id,name')->from('liste')->where('id', $id)->limit('1')->get()->row();
     if (!isset($person->id) || $person->id < 1) {
         redirect();
     }
     redirect(base_url() . 'face/get/' . genid_from_id($person->id) . '/' . url_title($person->name), 'location', 301);
 }
function ba_cevir_url($id = '', $name = '')
{
    $pageurl = "/mobile/get.php?id=";
    $pageurl .= genid_from_id($id);
    $pageurl .= '&' . ba_cevir($name);
    return $pageurl;
}
 public function img_mapcreator($sayfa = '')
 {
     $sayfa = (int) $sayfa;
     $data = $this->db->select('id,name')->from('liste')->order_by('primary', 'asc')->limit('1000', $sayfa * 1000)->get()->result();
     $cikti = '<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">';
     foreach ($data as $k) {
         $cikti .= '<url><loc>' . base_url() . 'face/get/' . genid_from_id($k->id) . '/' . url_title($k->name) . "</loc><image:image><image:loc>" . site_url('picture/large/' . genid_from_id($k->id)) . "</image:loc><image:title>Photo of " . convert_accented_characters($k->name) . "</image:title></image:image></url>";
     }
     $cikti .= '</urlset>';
     echo $cikti;
 }
 public function face($field = 'name')
 {
     $name = $this->input->get('term');
     if (strlen($name) < 3) {
         return;
     }
     $person = $this->db->select('id,name')->from('liste')->like('name', $name)->limit('10')->get()->result();
     foreach ($person as &$k) {
         $k->link = site_url('face/get/' . genid_from_id($k->id) . '/' . url_title($k->name));
         $k->picture = "//graph.facebook.com/" . $k->id . "/picture?type=square";
     }
     echo json_encode($person);
 }
    <div class="span9">
        <h5>Search</h5>

        <div class="well">
            <input name="search" class="search input-xxlarge"/>
            <span class="help-inline">e.g. James Bond</span>
        </div>

        <h5>Random Faces</h5>
        <ul class="media-grid">
            <?php 
foreach ($random_faces as $k) {
    ?>
                <li>
                    <a href="<?php 
    echo site_url('face/get/' . genid_from_id($k->id) . '/' . url_title($k->name) . '?q=' . urlencode($k->name));
    ?>
"
                       class="thumbnail" rel="popover" title="<?php 
    echo convert_accented_characters($k->name);
    ?>
">
                        <img src="//graph.facebook.com/<?php 
    echo $k->id;
    ?>
/picture?type=square"
                             alt="Photo of <?php 
    echo convert_accented_characters($k->name);
    ?>
" width="50" height="50"/>
                        <?php