Beispiel #1
0
function addComment($type, $id)
{
    global $_MooClass, $dbTablePre, $user_arr;
    $content = Text2Html(MooGetGPC('content', 'string', 'P'));
    $temp = mb_convert_encoding($content, 'gbk', 'utf-8');
    if ($content == '' || isset($temp[220])) {
        return false;
    }
    $arr_in = array('type' => $type, 'id' => $id, 'uid' => $user_arr['uid'], 'username' => $user_arr['nickname'], 'dateline' => time(), 'ischeck' => 0, 'comment' => $content);
    return inserttable('comment', $arr_in, 1);
}
/**
 *  获得特定的关键字列表
 *
 * @access    public
 * @param     object  $dsql  数据库操作类
 * @param     int  $pageno  页面数
 * @param     int  $pagesize  页面尺寸
 * @return    string
 */
function GetList(&$dsql, $pageno, $pagesize)
{
    global $cfg_phpurl, $cfg_ml;
    $pagesize = intval($pagesize);
    $pageno = intval($pageno);
    $start = ($pageno - 1) * $pagesize;
    $dsql->SetQuery("SELECT * FROM `#@__member_guestbook` WHERE mid='" . $cfg_ml->M_ID . "' ORDER BY aid DESC LIMIT {$start},{$pagesize} ");
    $dsql->Execute();
    $line = '';
    while ($row = $dsql->GetArray()) {
        $line .= "<table width='100%' border='0' cellpadding='0' cellspacing='0' class='list'>\r\n          <thead>\r\n            <tr>\r\n              <th colspan='6'><strong class='fLeft' style='padding-left: 5px;'>留言标题:" . $row['title'] . "</strong><span class='fRight'>\r\n              <input name=\"ids\" type=\"checkbox\" id=\"ids\" value=\"" . $row['aid'] . "\" />\r\n              <a href='#' onclick='DelNote(" . $row['aid'] . ")' style='color:#29A5C9;'>删除</a></span></th>\r\n            </tr>\r\n          </thead>\r\n          <tbody>\r\n            <tr>\r\n              <td width='18%' style='padding-left: 10px;'>用户称呼:" . $row['uname'] . "</td>\r\n              <td>时间:" . MyDate("Y-m-d H:i", $row['dtime']) . "&nbsp;IP地址:" . $row['ip'] . "&nbsp;";
        if (!empty($row['gid'])) {
            $line .= " <a href='index.php?uid={$row['uname']}&action=infos' target='_blank'>资料</a> <a href='index.php?uid={$row['uname']}' target='_blank'>空间</a> <a href='index.php?uid={$row['uname']}&action=guestbook' target='_blank'>回复</a> ";
        }
        $line .= "</td>\r\n            </tr>\r\n            <tr>\r\n              <td colspan='2' style='padding-left: 10px;'>" . Text2Html($row['msg']) . "</td>\r\n            </tr>\r\n          </tbody>\r\n        </table>";
    }
    $line = $line == '' ? '暂无留言' : $line;
    echo $line;
}
Beispiel #3
0
function GetList($dsql, $pageno, $pagesize)
{
    global $cfg_phpurl, $cfg_ml;
    $pagesize = intval($pagesize);
    $pageno = intval($pageno);
    $start = ($pageno - 1) * $pagesize;
    $dsql->SetQuery("Select * From `#@__member_guestbook` where mid='" . $cfg_ml->M_ID . "' order by aid desc limit {$start},{$pagesize} ");
    $dsql->Execute();
    $line = '';
    while ($row = $dsql->GetArray()) {
        $line .= "<table cellspacing='1' class='list mB10'>\r\n  <thead>\r\n    <tr>\r\n      <th colspan='2' ><strong class='fLeft'>留言标题:" . $row['title'] . "</strong><span class='fRight'>\r\n        <input name=\"ids\" type=\"checkbox\" id=\"ids\" value=\"" . $row['aid'] . "\" />\r\n        <a href='#' onclick='DelNote(" . $row['aid'] . ")'>删除</a></span></th>\r\n    </tr>\r\n  </thead>\r\n  <tbody>\r\n    <tr>\r\n      <td width='15%' align='left' valign='top'>用户称呼:" . $row['uname'] . "</td>\r\n      <td>时间:" . MyDate("Y-m-d H:i", $row['dtime']) . "&nbsp;IP地址:" . $row['ip'] . "&nbsp;";
        if (!empty($row['gid'])) {
            $line .= " <a href='index.php?uid={$row['uname']}&action=infos' target='_blank'>资料</a> <a href='index.php?uid={$row['uname']}' target='_blank'>空间</a> <a href='index.php?uid={$row['uname']}&action=guestbook' target='_blank'>回复</a> ";
        }
        $line .= "\r\n\t\t</td>\r\n    </tr>\r\n    <tr>\r\n      <td align='left' valign='top'><p>Email:" . $row['email'] . "</p><p>联系电话:" . $row['tel'] . "</p><p>其它:" . $row['qq'] . "</p></td>\r\n      <td align='left' valign='top'>" . Text2Html($row['msg']) . "</td>\r\n    </tr>\r\n  </tbody>\r\n</table>";
    }
    $line = $line == '' ? '暂无留言' : $line;
    echo $line;
}
	function MakeField($fname,$fvalue,$addvalue="")
	{

		if($fvalue==""){ $fvalue = $this->ChannelFields[$fname]["default"]; }
		$ftype = $this->ChannelFields[$fname]["type"];

		//执行函数
		if($this->ChannelFields[$fname]["function"]!=""){
			$fvalue = $this->EvalFunc($fvalue,$this->ChannelFields[$fname]["function"]);
		}
		//处理各种数据类型
		
		if($ftype=="text"||$ftype=="textchar"){
			$fvalue = ClearHtml($fvalue);
		}
		else if($ftype=="multitext"){
			$fvalue = ClearHtml($fvalue);
			$fvalue = Text2Html($fvalue);
		}
		else if($ftype=="img"){
			$fvalue = $this->GetImgLinks($fvalue);
		}
		else if($ftype=="textdata"){
			if(!is_file($GLOBALS['cfg_basedir'].$fvalue)) return "";
			$fp = fopen($GLOBALS['cfg_basedir'].$fvalue,'r');
			$fvalue = "";
			while(!feof($fp)){ $fvalue .= fgets($fp,1024); }
			fclose($fp);
		}
		else if($ftype=="addon"){
			$foldvalue = $fvalue;
			$tempStr = GetSysTemplets("channel/channel_addon.htm");
			$tempStr = str_replace('~phppath~',$GLOBALS['cfg_plus_dir'],$tempStr);
			$tempStr = str_replace('~link~',$foldvalue,$tempStr);
			$fvalue = $tempStr;
		}
		else if($ftype=="softlinks"){
			$fvalue = $this->GetAddLinkPage($fvalue);
		}
		else if($ftype=="specialtopic"){
			
			$fvalue = $this->GetSpecList($fname,$fvalue,$addvalue);
			
		}
		return $fvalue;
	}
Beispiel #5
0
				  <a href="<?php 
echo $song->website;
?>
" target="_blank"><img class="request" src="images/home.png" alt="More artist details" title="More artist details" border="0" /></a>
				  <a href="<?php 
echo $song->buycd;
?>
" target="_blank"><img class="buy" src="images/buy.png" alt="Buy this CD or Track now!" title="Buy this CD or Track now!" border="0" /></a>
				</dd>

				<dt>Dedications</dt>
				<dd class="broad">
					<?php 
if ($song->isDedication) {
    $rmessage = stripslashes($_REQUEST['rmessage']);
    $dedicationMessage = Text2Html(trim($rmessage));
    $dedicationName = stripslashes($_REQUEST['rname']);
    ?>
					<div id="dedicationMessage">"<?php 
    echo $dedicationMessage;
    ?>
"</div>
					<div id="dedicationName">Dedicated by <?php 
    echo $dedicationName;
    ?>
</div>

					<?php 
} else {
    ?>
						<form method="post">
Beispiel #6
0
function ReplaceField($field, $value, &$message) {
	if ($value instanceof DateTime) {
		$value = $value->format('Y-m-d H:i:s');
	}

	$message = preg_replace("/\{" . $field . "\}/i", "$value", $message);
	$message = preg_replace("/\[" . $field . "\]/i", Text2Html($value), $message);
	$message = preg_replace("/#" . $field . "#/i", urlencode($value), $message);
}