function photo()
 {
     $url = replace_url($_REQUEST['url'], 2);
     header('HTTP/1.1 301 Moved Permanently');
     //echo file_get_contents($url);
     header("Location: " . $url);
     //echo $this->curl($url);
 }
Esempio n. 2
0
 function _getNewsUrl($info, $param)
 {
     if (!empty($info['jump_url'])) {
         $url = replace_url($info['jump_url']);
     } else {
         $param['id'] = $info['id'];
         $url = addons_url('CustomReply://CustomReply/detail', $param);
     }
     return $url;
 }
 function _getNewsUrl($info, $param)
 {
     if (!empty($info['link'])) {
         $url = replace_url($info['link']);
     } else {
         $param['id'] = $info['id'];
         $url = U('Home/Material/news_detail', $param);
     }
     return $url;
 }
Esempio n. 4
0
    echo '<span class="l10n-name">Name</span>';
    echo '</a>';
    echo '<a class="date" href="#">';
    echo '<img src="/_h5ai/client/images/descending.png" class="sort descending" alt="descending" />';
    echo '<img src="/_h5ai/client/images/ascending.png" class="sort ascending" alt="ascending" />';
    echo '<span class="l10n-lastModified">Section</span>';
    echo '</a>';
    echo '<a class="size" href="#">';
    echo '<img src="/_h5ai/client/images/descending.png" class="sort descending" alt="descending" />';
    echo '<img src="/_h5ai/client/images/ascending.png" class="sort ascending" alt="ascending" />';
    echo '<span class="l10n-size">URL</span>';
    echo '</a>';
    if (sizeof($json) == 0) {
        die("<center><h4>No results or malformed input.</h4></center>");
    }
    foreach ($json as $data) {
        $name = $data->name;
        $host = replace_url($data->host);
        $section = $data->section;
        $url = replace_url($data->url);
        $imdb = $data->imdb;
        echo '</a><li class="entry folder"><a class="" href="' . $url . '"><span class="icon small"><img src="/_h5ai/client/icons/16x16/folder.png" /></span></span><span class="label">' . $name . '</span><span class="date">' . $section . '</span><span class="size">' . $host . '</span></a></li>';
    }
} else {
    echo "<center>Try searching something.</center>";
}
?>
</ul>
</font>
</body>
    } else {
        foreach ($__LIST__ as $key => $val) {
            $mod = $i % 2;
            ++$i;
            ?>
<div class="item mt15 masonry_brick jq_corner" data-corner="7px" iid="<?php 
            echo $val['id'];
            ?>
"><div class="item_t"><div class="img tc"><a target="_blank" href="<?php 
            echo u('item/index', array('id' => $val['id']));
            ?>
" hidefocus="true" rel="nofollow"><?php 
            if ($seo['goods_save_images']) {
                ?>
<img src="__TMPL__public/images/grey.gif" url="upload/<?php 
                echo replace_url($val['img'], 1);
                ?>
" class="no_encode_url" alt="<?php 
                echo $val['title'];
                ?>
"/><?php 
            } else {
                ?>
<img alt="<?php 
                echo $val["title"];
                ?>
" url="<?php 
                echo base64_encode($val['img']);
                ?>
" style="display:inline;" class="encode_url" src="__TMPL__public/images/grey.gif"/><?php 
            }
Esempio n. 6
0
function show_setting_row($setting_name, $value_option = "", $htmlspecialchars = 0)
{
    global $config, $setting;
    $config_value = $config[$setting_name];
    $config_value = $htmlspecialchars ? htmlspecialchars($config[$setting_name]) : $config[$setting_name];
    $setting[$setting_name] = replace_url($setting[$setting_name]);
    if ($value_option == "") {
        show_input_row($setting[$setting_name], "setting_item[" . $setting_name . "]", $config_value);
    } elseif ($value_option == "textarea") {
        show_textarea_row($setting[$setting_name], "setting_item[" . $setting_name . "]", $config_value, "", 6);
    } elseif ($value_option == "radio") {
        show_radio_row($setting[$setting_name], "setting_item[" . $setting_name . "]", $config_value);
    } else {
        echo "<tr class=\"" . get_row_bg() . "\">\n<td valign=\"top\"><p class=\"rowtitle\">" . $setting[$setting_name] . "</p></td>\n";
        echo "<td><p>";
        $value_option($setting_name, $config_value);
        echo "</p></td>\n</tr>\n";
    }
}
Esempio n. 7
0
function format_text($text, $html = 0, $word_wrap = 0, $bbcode = 0, $bbcode_img = 0)
{
    if ($word_wrap && $text != "") {
        $text = preg_replace("/([^\n\r ?&\\.\\/<>\"\\-]{" . $word_wrap . "})/i", " \\1\n", $text);
    }
    if ($html == 0 || $html == 2) {
        $text = safe_htmlspecialchars($text);
    }
    // Replace { to prevent parsing in templates
    global $site_template;
    $text = preg_replace('=' . preg_quote($site_template->start) . '([A-Z0-9_]+)' . preg_quote($site_template->end) . '=Usi', '&#123;\\1&#125;', $text);
    if ($html !== 2) {
        $text = nl2br(trim($text));
        $text = replace_url($text);
    }
    if ($bbcode == 1) {
        $search_array = array("/(\\[)(list)(=)(['\"]?)([^\"']*)(\\4])(.*)(\\[\\/list)(((=)(\\4)([^\"']*)(\\4]))|(\\]))/siU", "/(\\[)(list)(])(.*)(\\[\\/list\\])/siU", "/(\\[\\*\\])/siU", "/(\\[\\/\\*\\])/siU", "/(\\[)(url)(=)(['\"]?)(www\\.)([^\"']*)(\\4])(.*)(\\[\\/url\\])/siU", "/(\\[)(url)(=)(['\"]?)([^\"']*)(\\4])(.*)(\\[\\/url\\])/siU", "/(\\[)(url)(])(www\\.)([^\"]*)(\\[\\/url\\])/siU", "/(\\[)(url)(])([^\"]*)(\\[\\/url\\])/siU", "/(\\[)(code)(])(\r\n)*(.*)(\\[\\/code\\])/siU", "/javascript:/si", "/about:/si");
        $replace_array = array("<ol type=\"\\5\">\\7</ol>", "<ul>\\4</ul>", "<li>", "</li>", "<a href=\"http://www.\\6\" target=\"_blank\" rel=\"nofollow\">\\8</a>", "<a href=\"\\5\" target=\"_blank\" rel=\"nofollow\">\\7</a>", "<a href=\"http://www.\\5\" target=\"_blank\" rel=\"nofollow\">www.\\5</a>", "<a href=\"\\4\" target=\"_blank\" rel=\"nofollow\">\\4</a>", "<pre>Code:<hr size=1>\\5<hr size=1></pre>", "java script:", "about :");
        $text = preg_replace($search_array, $replace_array, $text);
        if (!$bbcode_img) {
            $text = preg_replace("/(\\[)(img)(])(\r\n)*([^\"]*)(\\[\\/img\\])/siU", "<a href=\"\\5\" target=\"_blank\">\\5</a>", $text);
        } else {
            $text = preg_replace("/(\\[)(img)(])(\r\n)*([^\"]*)(\\[\\/img\\])/siU", "<img src=\"\\5\">", $text);
        }
        $text = preg_replace("/(\\[)(b)(])(\r\n)*([^\"]*)(\\[\\/b\\])/siU", "<b>\\5</b>", $text);
        $text = preg_replace("/(\\[)(i)(])(\r\n)*([^\"]*)(\\[\\/i\\])/siU", "<i>\\5</i>", $text);
        $text = preg_replace("/(\\[)(u)(])(\r\n)*([^\"]*)(\\[\\/u\\])/siU", "<u>\\5</u>", $text);
        $text = replace_badwords($text);
    }
    $text = str_replace("\\'", "'", $text);
    return $text;
}
 function _getNewsUrl($info)
 {
     $param['token'] = get_token();
     $param['openid'] = get_openid();
     if (!empty($info['jump_url'])) {
         $url = replace_url($info['jump_url']);
     } else {
         $param['id'] = $info['id'];
         $url = U('detail', $param);
     }
     return $url;
 }
 function replyMsg($info)
 {
     if ($info['msg_type'] == 'news') {
         $map_news['group_id'] = $info['group_id'];
         $list = M('material_news')->where($map_news)->select();
         $param['publicid'] = get_token_appinfo('', 'id');
         foreach ($list as $k => $vo) {
             if ($k > 8) {
                 continue;
             }
             if (empty($vo['url'])) {
                 $url = $this->_getNewsUrl($vo, $param);
             } else {
                 $url = $vo['url'];
             }
             $articles[] = array('Title' => $vo['title'], 'Description' => $vo['intro'], 'PicUrl' => get_cover_url($vo['cover_id']), 'Url' => $url);
         }
         $res = $this->replyNews($articles);
     } elseif ($info['msg_type'] == 'image') {
         if ($info['image_id']) {
             // 				$d['image_id']=url_img_html(get_cover_url($d['image_id']));
             $media_id = D('Common/Custom')->get_image_media_id($info['image_id']);
         } else {
             if ($info['image_material']) {
                 $map2['id'] = $info['image_material'];
                 $media_img = M('material_image')->where($map2)->find();
                 $media_id = $media_img['image_id'];
                 if (!$media_id) {
                     $media_id = D('Common/Custom')->get_image_media_id($media_img['cover_id']);
                 }
             }
         }
         $this->replyImage($media_id);
     } else {
         $contetn = replace_url(htmlspecialchars_decode($info['content']));
         $this->replyText($contetn);
     }
 }