Beispiel #1
0
function HTML2JS($string)
{
    if (is_array($string)) {
        foreach ($string as $key => $val) {
            $string[$key] = HTML2JS($val);
        }
    } else {
        $string = str_replace(array("\n", "\r", "\\", "\""), array(' ', ' ', "\\\\", "\\\""), $string);
    }
    return $string;
}
Beispiel #2
0
                 break;
             case "flash":
                 /*$ad->code['flash']['width'] && $width=" width=\"$ad->code['flash']['width']\"";
                 		$ad->code['flash']['height'] &&$height=" height=\"$ad->code['flash']['height']\"";*/
                 $ad->code['flash']['width'] && ($width = " width=\"{$ad->code['flash']['width']}\"");
                 //zhaoyanmin
                 $ad->code['flash']['height'] && ($height = " height=\"{$ad->code['flash']['height']}\"");
                 //zhaoyanmin
                 $html = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" {$width}{$height}><param name=\"movie\" value=\"{$ad->code['flash']['url']}\" /><param name=\"quality\" value=\"high\" /><embed src=\"{$ad->code['flash']['url']}\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\"{$width}{$height}></embed></object>";
                 break;
             case "text":
                 $ad->code['text']['size'] && ($style = " style=\"font-size:{$ad->code['text']['size']};\"");
                 $html = "<a href=\"{$ad->code['text']['link']}\" target=\"_blank\" title=\"{$ad->code['text']['title']}\"{$style}>{$ad->code['text']['title']}</a>";
                 break;
         }
         echo "document.write('" . HTML2JS($html) . "');\r\n";
     }
     break;
 case 'digg':
     if ($action == 'do') {
         $at = time() - get_cookie('digg_' . $id) > $cookietime ? true : false;
         if ($at) {
             set_cookie('digg_' . $id, time(), $cookietime);
             if ($id && $DreamCMS->db->query("UPDATE `#DC@__article` SET `digg` = digg+1  WHERE id='{$id}'")) {
                 echo "{state:'1'}";
             }
         } else {
             echo "{state:'0',text:'" . $DreamCMS->language('digged') . "' }";
         }
     }
     if ($action == 'show') {
Beispiel #3
0
        ?>
</td>
            <td><a href="<?php 
        echo __USERCP__;
        ?>
=article&do=add&id=<?php 
        echo $rs[$i]['id'];
        ?>
" class="edit" title="编辑此文章">编辑</a> | <a href="<?php 
        echo __USERCP__;
        ?>
=article&do=del&id=<?php 
        echo $rs[$i]['id'];
        ?>
" target="iCMS_FRAME" class="del" onclick="return confirm('确定要删除“<?php 
        echo HTML2JS($rs[$i]['title']);
        ?>
”?');" title='删除此文章,此操作不可恢复'>删除</a> | <a target="_blank" href="<?php 
        echo $rs[$i]['url'];
        ?>
">
              <?php 
        if ($rs[$i]['status'] == "1") {
            ?>
              查看
              <?php 
        } else {
            ?>
              预览
              <?php 
        }
Beispiel #4
0
 function doreadme()
 {
     $data = plugin::readme($_GET['name']);
     javascript::dialog($data ? array(HTML2JS(htmlspecialchars($data)), '查看说明') : '暂无说明', 'js:', 'msg', '-1');
 }