当前位置: 首页>>代码示例>>PHP>>正文


PHP sgmdate函数代码示例

本文整理汇总了PHP中sgmdate函数的典型用法代码示例。如果您正苦于以下问题:PHP sgmdate函数的具体用法?PHP sgmdate怎么用?PHP sgmdate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了sgmdate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: sgmdate

            echo $value['viewnum'];
            ?>
<br>
好友: <?php 
            echo $value['friendnum'];
            ?>
<br>
更新: <?php 
            if ($value['updatetime']) {
                echo sgmdate('Y-m-d', $value[updatetime], 1);
            }
            ?>
<br>
创建: <?php 
            if ($value['dateline']) {
                echo sgmdate('Y-m-d', $value[dateline], 1);
            }
            ?>
</td>
<?php 
            if ($managespace) {
                ?>
<td><a href="admincp.php?ac=space&op=manage&uid=<?php 
                echo $value['uid'];
                ?>
">管理</a><br></td><?php 
            }
            ?>
</tr>
<?php 
        }
开发者ID:xiaoxiaoleo,项目名称:ngintek,代码行数:31,代码来源:admin_tpl_space.php

示例2: gethotnews2

function gethotnews2($catids)
{
    global $_SGLOBAL, $catarr;
    $hotnews2 = array();
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('spaceitems') . " WHERE folder =1 AND digest IN (1,2,3) AND catid IN (" . $catids . ") ORDER BY viewnum DESC, dateline DESC LIMIT 0, 10");
    while ($value = $_SGLOBAL['db']->fetch_array($query)) {
        $value['subject'] = cutstr($value['subject'], 30, 0);
        //标题样式
        if (!empty($value['styletitle'])) {
            $value['subject'] = '<span style=\'' . mktitlestyle($value['styletitle']) . '\'>' . $value['subject'] . '</span>';
        }
        $value['url'] = gethtmlurl2($value['catid']) . '/' . sgmdate($value['dateline'], 'Y') . '/' . sgmdate($value['dateline'], 'n') . '/' . $catarr[$value['catid']]['pre_html'] . $value['itemid'] . '.html';
        $hotnews2[] = $value;
    }
    return $hotnews2;
}
开发者ID:superman1982,项目名称:ng-cms,代码行数:16,代码来源:admin_makehtml.php

示例3: updatestat

function updatestat($type, $primary=0) {
	global $_SGLOBAL, $_SCONFIG;

	if(empty($_SGLOBAL['supe_uid']) || empty($_SCONFIG['updatestat'])) return false;
	
	$nowdaytime = sgmdate('Ymd', $_SGLOBAL['timestamp']);
	if($primary) {
		//去重
		$setarr = array(
			'uid' => $_SGLOBAL['supe_uid'],
			'daytime' => '$nowdaytime',
			'type' => $type
		);
		if(getcount('statuser', $setarr)) {
			return false;
		} else {
			inserttable('statuser', $setarr);//插入当天数据
		}
	}
	if(getcount('stat', array('daytime'=>$nowdaytime))) {
		$_SGLOBAL['db']->query("UPDATE ".tname('stat')." SET `$type`=`$type`+1 WHERE daytime='$nowdaytime'");
	} else {
		//删除昨天的防重数据
		$_SGLOBAL['db']->query("DELETE FROM ".tname('statuser')." WHERE daytime != '$nowdaytime'");
		//插入统计
		inserttable('stat', array('daytime'=>$nowdaytime, $type=>'1'));
	}
}
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:28,代码来源:function_cp.php

示例4: tname

        $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('topic') . " ORDER BY joinnum DESC LIMIT {$start},{$perpage}");
    } elseif ($_GET['view'] == 'me') {
        $count = getcount('topicuser', array('uid' => $_SGLOBAL['supe_uid']));
        $query = $_SGLOBAL['db']->query("SELECT t.* FROM " . tname('topicuser') . " tu\n\t\t\tLEFT JOIN " . tname('topic') . " t ON t.topicid=tu.topicid\n\t\t\tWHERE tu.uid='{$_SGLOBAL['supe_uid']}'\n\t\t\tORDER BY tu.dateline DESC LIMIT {$start},{$perpage}");
    } else {
        $_GET['view'] = 'new';
        $count = getcount('topic', array());
        $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('topic') . " ORDER BY lastpost DESC LIMIT {$start},{$perpage}");
    }
    $actives = array($_GET['view'] => ' class="active"');
    if ($count) {
        while ($value = $_SGLOBAL['db']->fetch_array($query)) {
            $value['pic'] = pic_get($value['pic'], $value['thumb'], $value['remote']);
            $value['lastpost'] = sgmdate('m-d H:i', $value['lastpost']);
            $value['dateline'] = sgmdate('m-d H:i', $value['dateline']);
            $value['endtime'] = $value['endtime'] ? sgmdate('m-d H:i', $value['endtime']) : '';
            $value['message'] = getstr($value['message'], 200, 0, 0, 0, 0, -1);
            realname_set($value['uid'], $value['username']);
            $list[] = $value;
        }
        $multi = multi($count, $perpage, $page, 'space.php?do=topic');
    }
    realname_get();
    $_TPL['css'] = 'event';
    include_once template('space_topic_list');
} else {
    if (!($topic = topic_get($topicid))) {
        showmessage('topic_no_found');
    }
    if ($topic['uid'] == $_SGLOBAL['supe_uid']) {
        $managetopic = 1;
开发者ID:NaturalWill,项目名称:UCQA,代码行数:31,代码来源:space_topic.php

示例5: cpmsg

 if ($_GET['itemid']) {
     $wheresql = ' i.itemid=\'' . $_GET['itemid'] . '\'';
 } else {
     cpmsg('no_item', 'admin.php?action=list&m=' . $mname);
 }
 //取得信息
 $query = DB::query('SELECT * FROM ' . tname($mname . 'items') . ' i ' . ($mname == 'album' ? '' : 'INNER JOIN ' . tname($mname . 'message') . ' m ON i.itemid=m.itemid') . ' WHERE ' . $wheresql . ' ORDER BY i.itemid DESC LIMIT 1');
 $editvalue = DB::fetch($query);
 if (empty($editvalue)) {
     cpmsg('no_item', 'admin.php?action=list&m=' . $mname);
 }
 if ($mname == 'good' || $mname == 'groupbuy') {
     $relatedarr = array();
     $relatedarr = getrelatedinfo($mname, $editvalue['itemid'], $editvalue['shopid']);
 }
 $editvalue['dateline'] = sgmdate($editvalue['dateline']);
 //管理員查看基本信息&& $mname=='shop'
 if ($_GET['op'] == 'adminview') {
     if (empty($_SGLOBAL['panelinfo'])) {
         getpanelinfo($_GET['itemid']);
     }
     if ($_GET['updatepass'] == 1) {
         $updateser = DB::fetch(DB::query("SELECT * FROM " . tname("itemupdates") . " WHERE itemid='{$_GET['itemid']}' and type = '{$mname}'"));
         $update = unserialize($updateser['update']);
         $update = sstripslashes($update);
         $update['groupid'] = $_SGLOBAL['panelinfo']['group']['title'];
         $categorylist = getmodelcategory($mname);
         $update['attr_catid'] = $update['catid'];
         $update['catid'] = $categorylist[$update['catid']]['name'];
         $categorylist = getmodelcategory('region');
         $update['region'] = $categorylist[$update['region']]['name'];
开发者ID:pan289091315,项目名称:Discuz,代码行数:31,代码来源:edit.inc.php

示例6: sgmdate

    echo $uid;
    ?>
">删除头像</a>]
</td></tr>
<tr><th>开通时间</th><td><?php 
    echo sgmdate('Y-m-d H:i', $member[dateline]);
    ?>
</td></tr>
<tr><th>更新时间</th><td><?php 
    if ($member['updatetime']) {
        echo sgmdate('Y-m-d H:i', $member[updatetime]);
    }
    ?>
</td></tr>
<tr><th>上次登录</th><td><?php 
    echo sgmdate('Y-m-d H:i', $member[lastlogin]);
    ?>
</td></tr>
<tr><th>上次登录IP</th><td><?php 
    echo $member['ip'];
    ?>
</td></tr>
<tr><th>好友数</th><td><?php 
    echo $member['friendnum'];
    ?>
</td></tr>
<tr><th>查看数</th><td><?php 
    echo $member['viewnum'];
    ?>
</td></tr>
<tr><th>批量管理</th>
开发者ID:xiaoxiaoleo,项目名称:ngintek,代码行数:31,代码来源:admin_tpl_space_manage.php

示例7: blog_post

function blog_post($POST, $olds=array()) {
	global $_SGLOBAL, $_SC, $space;
	
	//操作者角色切换
	$isself = 1;
	if(!empty($olds['uid']) && $olds['uid'] != $_SGLOBAL['supe_uid']) {
		$isself = 0;
		$__SGLOBAL = $_SGLOBAL;
		$_SGLOBAL['supe_uid'] = $olds['uid'];
		$_SGLOBAL['supe_username'] = addslashes($olds['username']);
	}

	//标题
	$POST['subject'] = getstr(trim($POST['subject']), 80, 1, 1, 1);
	if(strlen($POST['subject'])<1) $POST['subject'] = sgmdate('Y-m-d');
	$POST['friend'] = intval($POST['friend']);
	
	//隐私
	$POST['target_ids'] = '';
	if($POST['friend'] == 2) {
		//特定好友
		$uids = array();
		$names = empty($_POST['target_names'])?array():explode(' ', str_replace(cplang('tab_space'), ' ', $_POST['target_names']));
		if($names) {
			$query = $_SGLOBAL['db']->query("SELECT uid FROM ".tname('space')." WHERE username IN (".simplode($names).")");
			while ($value = $_SGLOBAL['db']->fetch_array($query)) {
				$uids[] = $value['uid'];
			}
		}
		if(empty($uids)) {
			$POST['friend'] = 3;//仅自己可见
		} else {
			$POST['target_ids'] = implode(',', $uids);
		}
	} elseif($POST['friend'] == 4) {
		//加密
		$POST['password'] = trim($POST['password']);
		if($POST['password'] == '') $POST['friend'] = 0;//公开
	}
	if($POST['friend'] !== 2) {
		$POST['target_ids'] = '';
	}
	if($POST['friend'] !== 4) {
		$POST['password'] == '';
	}

	$POST['tag'] = shtmlspecialchars(trim($POST['tag']));
	$POST['tag'] = getstr($POST['tag'], 500, 1, 1, 1);	//语词屏蔽

	//内容
	if($_SGLOBAL['mobile']) {
		$POST['message'] = getstr($POST['message'], 0, 1, 0, 1, 1);
	} else {
		$POST['message'] = checkhtml($POST['message']);
		$POST['message'] = getstr($POST['message'], 0, 1, 0, 1, 0, 1);
		$POST['message'] = preg_replace(array(
				"/\<div\>\<\/div\>/i",
				"/\<a\s+href\=\"([^\>]+?)\"\>/i"
			), array(
				'',
				'<a href="\\1" target="_blank">'
			), $POST['message']);
	}
	$message = $POST['message'];

	//个人分类
	if(empty($olds['classid']) || $POST['classid'] != $olds['classid']) {
		if(!empty($POST['classid']) && substr($POST['classid'], 0, 4) == 'new:') {
			//分类名
			$classname = shtmlspecialchars(trim(substr($POST['classid'], 4)));
			$classname = getstr($classname, 0, 1, 1, 1);
			if(empty($classname)) {
				$classid = 0;
			} else {
				$classid = getcount('class', array('classname'=>$classname, 'uid'=>$_SGLOBAL['supe_uid']), 'classid');
				if(empty($classid)) {
					$setarr = array(
						'classname' => $classname,
						'uid' => $_SGLOBAL['supe_uid'],
						'dateline' => $_SGLOBAL['timestamp']
					);
					$classid = inserttable('class', $setarr, 1);
				}
			}
		} else {
			$classid = intval($POST['classid']);

		}
	} else {
		$classid = $olds['classid'];
	}
	if($classid && empty($classname)) {
		//是否是自己的
		$classname = getcount('class', array('classid'=>$classid, 'uid'=>$_SGLOBAL['supe_uid']), 'classname');
		if(empty($classname)) $classid = 0;
	}
	
	//主表
	$blogarr = array(
		'subject' => $POST['subject'],
//.........这里部分代码省略.........
开发者ID:BGCX262,项目名称:zyyhong-svn-to-git,代码行数:101,代码来源:function_blog.php

示例8: label

 echo label(array('type' => 'table-start', 'class' => 'listtable'));
 echo '<tr">';
 echo '<th>' . $alang['cron_name'] . '</th>';
 echo '<th>' . $alang['cron_type'] . '</th>';
 echo '<th>' . $alang['cron_available'] . '</th>';
 echo '<th>' . $alang['cron_lastrun'] . '</th>';
 echo '<th>' . $alang['cron_nextrun'] . '</th>';
 echo '<th>' . $alang['space_op'] . '</th>';
 echo '</tr>';
 foreach ($listarr as $listvalue) {
     if (!discuz_exists() && ($listvalue['filename'] == 'updatebbsforums.php' || $listvalue['filename'] == 'updatebbscache.php')) {
         continue;
     }
     empty($class) ? $class = ' class="darkrow"' : ($class = '');
     $listvalue['lastrun'] = sgmdate($listvalue['lastrun'], '', 0);
     $listvalue['nextrun'] = sgmdate($listvalue['nextrun'], '', 0);
     if (!$listvalue['available']) {
         $trbgcolor = '#CCCCCC';
         $listvalue['nextrun'] = '-';
     }
     echo '<tr' . $class . ' align="center">';
     echo '<td align="left"><b>' . $listvalue['name'] . '</b></td>';
     echo '<td>' . $alang['cron_type_' . $listvalue['type']] . '</td>';
     echo '<td>' . $alang['cron_available_' . $listvalue['available']] . '</td>';
     echo '<td>' . $listvalue['lastrun'] . '</td>';
     echo '<td>' . $listvalue['nextrun'] . '</td>';
     echo '<td align="left"><a href="' . $newurl . '&op=run&cronid=' . $listvalue['cronid'] . '">' . $alang['cron_run'] . '</a> | <a href="' . $newurl . '&op=edit&cronid=' . $listvalue['cronid'] . '">' . $alang['space_edit'] . '</a>';
     if ($listvalue['type'] == 'user') {
         echo ' | <a href="' . $newurl . '&op=delete&cronid=' . $listvalue['cronid'] . '">' . $alang['space_delete'] . '</a>';
     }
     echo '</td>';
开发者ID:superman1982,项目名称:ng-cms,代码行数:31,代码来源:admin_crons.php

示例9: getattachdir

function getattachdir()
{
    global $_SCONFIG, $_SGLOBAL;
    switch ($_SCONFIG['attachmentdirtype']) {
        case 'year':
            $dirpatharr[] = sgmdate($_SGLOBAL['timestamp'], 'Y');
            break;
        case 'month':
            $dirpatharr[] = sgmdate($_SGLOBAL['timestamp'], 'Y');
            $dirpatharr[] = sgmdate($_SGLOBAL['timestamp'], 'm');
            break;
        case 'day':
            $dirpatharr[] = sgmdate($_SGLOBAL['timestamp'], 'Y');
            $dirpatharr[] = sgmdate($_SGLOBAL['timestamp'], 'm');
            $dirpatharr[] = sgmdate($_SGLOBAL['timestamp'], 'd');
            break;
        case 'md5':
            $md5string = md5($_SGLOBAL['supe_uid'] . '-' . $_SGLOBAL['timestamp'] . '-' . $_SGLOBAL['_num']);
            $dirpatharr[] = substr($md5string, 0, 1);
            $dirpatharr[] = substr($md5string, 1, 1);
            break;
        default:
            break;
    }
    $dirs = A_DIR;
    $subarr = array();
    foreach ($dirpatharr as $value) {
        $dirs .= '/' . $value;
        if (smkdir($dirs)) {
            $subarr[] = $value;
        } else {
            break;
        }
    }
    return implode('/', $subarr);
}
开发者ID:hongz1125,项目名称:devil,代码行数:36,代码来源:upload.func.php

示例10: feed_publish


//.........这里部分代码省略.........
                    $setarr['body_template'] = '<b>{subject}</b><br>' . cplang('mtag') . ': {mtag}<br>{summary}';
                    $setarr['body_data'] = array('subject' => "<a href=\"{$url}\">{$value['subject']}</a>", 'mtag' => "<a href=\"space.php?do=mtag&tagid={$value['tagid']}\">{$mtag['tagname']}</a>", 'summary' => getstr($value['message'], 150, 1, 1, 0, 0, -1));
                }
            }
            break;
        case 'pid':
            $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('poll') . " WHERE pid='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                //
                $setarr['icon'] = 'poll';
                $setarr['id'] = $value['pid'];
                $setarr['idtype'] = $idtype;
                $setarr['uid'] = $value['uid'];
                $setarr['username'] = $value['username'];
                $setarr['dateline'] = $value['dateline'];
                $setarr['hot'] = $value['hot'];
                //ϸ
                $url = "space.php?uid={$value['uid']}&do=poll&pid={$value['pid']}";
                $setarr['title_template'] = cplang('feed_poll');
                $setarr['body_template'] = '<a href="{url}"><strong>{subject}</strong></a>{option}';
                $optionstr = '';
                $opquery = $_SGLOBAL['db']->query("SELECT * FROM " . tname("polloption") . " WHERE pid='{$value['pid']}' LIMIT 0,2");
                while ($opt = $_SGLOBAL['db']->fetch_array($opquery)) {
                    $optionstr .= '<br><input type="' . ($value['maxchoice'] > 1 ? 'checkbox' : 'radio') . '" disabled name="poll_' . $opt['oid'] . '"/>' . $opt['option'];
                }
                $setarr['body_data'] = array('url' => $url, 'subject' => $value['subject'], 'option' => $optionstr);
                $setarr['body_general'] = $value['percredit'] ? cplang('reward_info', array($value['percredit'])) : '';
            }
            break;
        case 'eventid':
            $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('event') . " WHERE eventid='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                //
                $setarr['icon'] = 'event';
                $setarr['id'] = $value['eventid'];
                $setarr['idtype'] = $idtype;
                $setarr['uid'] = $value['uid'];
                $setarr['username'] = $value['username'];
                $setarr['dateline'] = $value['dateline'];
                $setarr['hot'] = $value['hot'];
                //ϸ
                $url = "space.php?do=event&id={$value['eventid']}";
                $setarr['title_template'] = cplang('event_add');
                $setarr['body_template'] = cplang('event_feed_info');
                $setarr['body_data'] = array('title' => "<a href=\"{$url}\">{$value['title']}</a>", 'country' => $value['country'], 'province' => $value['province'], 'city' => $value['city'], 'location' => $value['location'], 'starttime' => sgmdate('m-d H:i', $value['starttime']), 'endtime' => sgmdate('m-d H:i', $value['endtime']));
                //
                if ($value['poster']) {
                    $setarr['image_1'] = pic_get($value['poster'], $value['thumb'], $value['remote']);
                    $setarr['image_1_link'] = $url;
                }
            }
            break;
        case 'sid':
            $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('share') . " WHERE sid='{$id}'");
            if ($value = $_SGLOBAL['db']->fetch_array($query)) {
                //
                $setarr['icon'] = 'share';
                $setarr['id'] = $value['sid'];
                $setarr['idtype'] = $idtype;
                $setarr['uid'] = $value['uid'];
                $setarr['username'] = $value['username'];
                $setarr['dateline'] = $value['dateline'];
                $setarr['hot'] = $value['hot'];
                //ϸ
                $url = "space.php?uid={$value['uid']}&do=share&id={$value['sid']}";
                $setarr['title_template'] = '{actor} ' . $value['title_template'];
                $setarr['body_template'] = $value['body_template'];
                $setarr['body_data'] = $value['body_data'];
                $setarr['body_general'] = $value['body_general'];
                $setarr['image_1'] = $value['image'];
                $setarr['image_1_link'] = $value['image_link'];
            }
            break;
    }
    if ($setarr['icon']) {
        $setarr['appid'] = UC_APPID;
        //ݴ
        $setarr['title_data'] = serialize($setarr['title_data']);
        // groups ת
        if ($idtype != 'sid') {
            $setarr['body_data'] = serialize($setarr['body_data']);
            // groups ת
        }
        $setarr['hash_template'] = md5($setarr['title_template'] . "\t" . $setarr['body_template']);
        //ϲhash
        $setarr['hash_data'] = md5($setarr['title_template'] . "\t" . $setarr['title_data'] . "\t" . $setarr['body_template'] . "\t" . $setarr['body_data']);
        //ϲhash
        $setarr = saddslashes($setarr);
        $feedid = 0;
        if (!$add && $setarr['id']) {
            $query = $_SGLOBAL['db']->query("SELECT feedid FROM " . tname('feed') . " WHERE id='{$id}' AND idtype='{$idtype}'");
            $feedid = $_SGLOBAL['db']->result($query, 0);
        }
        if ($feedid) {
            updatetable('feed', $setarr, array('feedid' => $feedid));
        } else {
            inserttable('feed', $setarr);
        }
    }
}
开发者ID:v998,项目名称:discuzx-en,代码行数:101,代码来源:function_feed.php

示例11: foreach

			<th width="5%">' . $alang['block_select'] . '</th>
			<th>' . $alang['spaceblog_subject'] . '</th>
			<th width="15%">' . $alang['robot_robot_author'] . '</th>
			<th width="15%">' . $alang['space_order_dateline'] . '</th>
		</tr>';
        foreach ($listarr as $value) {
            $url = geturl('action/viewnews/itemid/' . $value['itemid']);
            $postip = '';
            if (!empty($value['postip'])) {
                $postip = '<br>' . $value['postip'];
            }
            echo '<tr>
			<td><input class="checkbox" type="checkbox" name="item[]" value="' . $value['itemid'] . '" checked></td>
			<td><a href="' . $url . '" target="_blank">' . $value['subject'] . '</a></td>
			<td><a href="' . geturl('uid/' . $value['uid']) . '" target="_blank">' . $value['username'] . '</a>' . $postip . '</td>
			<td>' . sgmdate($value['dateline'], 'Y-n-d\\<\\b\\r\\>H:i:s') . '</td>
			</tr>';
        }
        echo '</table>';
        if (!empty($multipage)) {
            echo $multipage;
        }
    }
    print <<<END
\t<input type="hidden" name="itemids" value="{$itemids}">
\t<div class="buttons">
\t<input type="submit" name="dosubmit" value="{$alang['submitted_operation']}" class="submit">
\t<input type="reset" name="doreset" value="{$alang['common_reset']}">
\t</div>
\t</form>
END;
开发者ID:jonycookie,项目名称:projectm2,代码行数:31,代码来源:admin_items.php

示例12: foreach

\t\t\t<table cellspacing="0" cellpadding="0" width="100%"  class="listtable">
\t\t\t\t<tr>
\t\t\t\t<th width="5%">{$alang['database_export_del']}</th>
\t\t\t\t<th width="20%">{$alang['database_export_filename']}</th>
\t\t\t\t<th width="5%">{$alang['database_export_version']}</th>
\t\t\t\t<th width="20%">{$alang['database_export_dateline']}</th>
\t\t\t\t<th width="10%">{$alang['database_export_type']}</th>
\t\t\t\t<th width="8%">{$alang['database_export_filesize']}</th>
\t\t\t\t<th width="5%">{$alang['database_export_method']}</th>
\t\t\t\t<th width="5%">{$alang['database_expot_volume']}</th>
\t\t\t\t<th width="5%">{$alang['database_export_op']}</th>
\t\t\t\t</tr>
END;
    $exportinfo = '';
    foreach ($exportlog as $info) {
        $info['dateline'] = is_int($info['dateline']) ? sgmdate($info['dateline']) : $alang['database_date_unknown'];
        $info['size'] = formatsize($info['size']);
        $info['volume'] = $info['method'] == 'multivol' ? $info['volume'] : '';
        $info['method'] = $info['type'] != 'zip' ? $info['method'] == 'multivol' ? $alang['database_multivol'] : $alang['database_shell'] : '';
        $import = $info['type'] == 'zip' ? "<td align=center><a href='{$theurl}&op=importstart&do=zip&datafile={$info['filename']}'>[{$alang['database_import_unzip']}]</td>" : "<td align='center'><a href='{$theurl}&op=importstart&do=import&datafile={$info['filename']}'" . ($info['version'] != S_VER ? " onclick=\"return confirm('{$alang['database_import_confirm']}');\"" : '') . ">[{$alang['database_import_import']}]</a></td>";
        $exportinfo .= '<tr><td align="center"><input type="checkbox" name="delexport[]" value="' . $info['filename'] . '"></td><td><a href=' . $dataurl . '/' . $info['filename'] . '>' . basename($info['filename']) . '</a><td align="center">' . S_VER . '</td><td>' . $info['dateline'] . '</td><td align="center">' . $alang['database_export_' . $info['type']] . '</td><td align="center">' . $info['size'] . '</td><td align="center">' . $info['method'] . '</td><td align="center">' . $info['volume'] . '</td>' . $import;
    }
    print <<<END
\t{$exportinfo}
\t<table cellspacing="0" cellpadding="0" width="100%"  class="btmtable">
\t<tr><th><input type="checkbox" name="chkall" onclick="checkall(this.form, 'delexport')">{$alang['space_select_all']}</th></tr>
\t</table>
\t</table>
\t<div class="buttons">
\t\t<input type="submit" name="listsubmit" value="{$alang['common_submit']}" class="submit">
\t</div>
开发者ID:hongz1125,项目名称:devil,代码行数:31,代码来源:admin_database.php

示例13: tname

     if ($offset < 0) {
         $offset = 0;
     }
     $sql = "SELECT * from " . tname('weixin_question') . " as q inner join " . tname('weixin_member') . " as m on q.uid=m.uid " . $querystr . " order by q.addtime desc limit " . $offset . "," . $pagesize;
     $list = $_SGLOBAL['db']->getall($sql);
     foreach ($list as $k => $v) {
         $list[$k]['headimg'] = $_SC['img_url'] . '/weixin_headimg/' . $v['fakeid'] . '.png';
         $list[$k]['weixin_name'] = $_SGLOBAL['db']->getone('select weixin_name from ' . tname('open_member_weixin') . ' where id=' . $v['op_wxid']);
         $list[$k]['replylist'] = $_SGLOBAL['db']->getall('select * from ' . tname('weixin_reply') . ' as r left join ' . tname('member') . ' as m on r.uid=m.uid where r.question_id=' . $v['id']);
         foreach ($list[$k]['replylist'] as $key => $value) {
             if ($list[$k]['replylist'][$key]['uid'] == 0) {
                 $list[$k]['replylist'][$key]['fullname'] = $list[$k]['weixin_name'];
             }
             $list[$k]['replylist'][$key]['addtime'] = sgmdate("Y-m-d H:i:s", $list[$k]['replylist'][$key]['addtime']);
         }
         $list[$k]['addtime'] = sgmdate("Y-m-d H:i:s", $list[$k]['addtime']);
     }
     $arr = array("pagesize" => $pagesize, "page" => $page, "pagenum" => $pagenum, "total" => $total, "offset" => $offset, "err" => 0);
     if ($total > 0) {
         $count = 1;
         foreach ($list as $k => $v) {
             $list[$k]['count'] = $count + $offset;
             $arr['list'][] = $list[$k];
             $count++;
         }
     }
     echo json_encode($arr);
     exit;
     break;
 default:
     $wxid = getstr($_GET['wxid']);
开发者ID:hugolong,项目名称:weixiao,代码行数:31,代码来源:wx_singlemsg.php

示例14: intval

<?php

include_once './common.php';
$msgid = intval($_GET['id']) ? intval($_GET['id']) : 0;
if (!$msgid) {
    exit;
}
$query = $_SGLOBAL['db']->query('select * from ' . tname('open_member_weixin_autoreply_info') . ' where id=' . $msgid);
$msg = $_SGLOBAL['db']->fetch_array($query);
if (!$msg) {
    exit;
}
$msg['content'] = htmlspecialchars_decode($msg['content']);
$msg['addtime'] = sgmdate("Y-m-d", $msg['addtime']);
$msg['url'] = $_SC['site_host'] . '/appmsg/?id=' . $msg['id'];
$smarty->assign('msg', $msg);
$smarty->display('index.dwt');
开发者ID:hugolong,项目名称:weixiao,代码行数:17,代码来源:index.php

示例15: blog_post

function blog_post($POST, $olds = array())
{
    global $_SGLOBAL, $_SC, $space;
    //�����߽�ɫ�л�
    $isself = 1;
    if (!empty($olds['uid']) && $olds['uid'] != $_SGLOBAL['supe_uid']) {
        $isself = 0;
        $__SGLOBAL = $_SGLOBAL;
        $_SGLOBAL['supe_uid'] = $olds['uid'];
        $_SGLOBAL['supe_username'] = addslashes($olds['username']);
    }
    //����
    $POST['subject'] = getstr(trim($POST['subject']), 80, 1, 1, 1);
    if (strlen($POST['subject']) < 1) {
        $POST['subject'] = sgmdate('Y-m-d');
    }
    $POST['friend'] = intval($POST['friend']);
    //��˽
    $POST['target_ids'] = '';
    if ($POST['friend'] == 2) {
        //�ض�����
        $uids = array();
        $names = empty($_POST['target_names']) ? array() : explode(' ', str_replace(cplang('tab_space'), ' ', $_POST['target_names']));
        if ($names) {
            $query = $_SGLOBAL['db']->query("SELECT uid FROM " . tname('space') . " WHERE username IN (" . simplode($names) . ")");
            while ($value = $_SGLOBAL['db']->fetch_array($query)) {
                $uids[] = $value['uid'];
            }
        }
        if (empty($uids)) {
            $POST['friend'] = 3;
            //���Լ��ɼ�
        } else {
            $POST['target_ids'] = implode(',', $uids);
        }
    } elseif ($POST['friend'] == 4) {
        //����
        $POST['password'] = trim($POST['password']);
        if ($POST['password'] == '') {
            $POST['friend'] = 0;
        }
        //����
    }
    if ($POST['friend'] !== 2) {
        $POST['target_ids'] = '';
    }
    if ($POST['friend'] !== 4) {
        $POST['password'] == '';
    }
    $POST['tag'] = shtmlspecialchars(trim($POST['tag']));
    $POST['tag'] = getstr($POST['tag'], 500, 1, 1, 1);
    //�������
    //����
    if ($_SGLOBAL['mobile']) {
        $POST['message'] = getstr($POST['message'], 0, 1, 0, 1, 1);
    } else {
        $POST['message'] = checkhtml($POST['message']);
        $POST['message'] = getstr($POST['message'], 0, 1, 0, 1, 0, 1);
        $POST['message'] = preg_replace(array("/\\<div\\>\\<\\/div\\>/i", "/\\<a\\s+href\\=\"([^\\>]+?)\"\\>/i"), array('', '<a href="\\1" target="_blank">'), $POST['message']);
    }
    $message = $POST['message'];
    //���˷���
    if (empty($olds['classid']) || $POST['classid'] != $olds['classid']) {
        if (!empty($POST['classid']) && substr($POST['classid'], 0, 4) == 'new:') {
            //������
            $classname = shtmlspecialchars(trim(substr($POST['classid'], 4)));
            $classname = getstr($classname, 0, 1, 1, 1);
            if (empty($classname)) {
                $classid = 0;
            } else {
                $classid = getcount('class', array('classname' => $classname, 'uid' => $_SGLOBAL['supe_uid']), 'classid');
                if (empty($classid)) {
                    $setarr = array('classname' => $classname, 'uid' => $_SGLOBAL['supe_uid'], 'dateline' => $_SGLOBAL['timestamp']);
                    $classid = inserttable('class', $setarr, 1);
                }
            }
        } else {
            $classid = intval($POST['classid']);
        }
    } else {
        $classid = $olds['classid'];
    }
    if ($classid && empty($classname)) {
        //�Ƿ����Լ���
        $classname = getcount('class', array('classid' => $classid, 'uid' => $_SGLOBAL['supe_uid']), 'classname');
        if (empty($classname)) {
            $classid = 0;
        }
    }
    //����
    $blogarr = array('subject' => $POST['subject'], 'classid' => $classid, 'friend' => $POST['friend'], 'password' => $POST['password'], 'noreply' => empty($_POST['noreply']) ? 0 : 1);
    //����ͼƬ
    $titlepic = '';
    //��ȡ�ϴ���ͼƬ
    $uploads = array();
    if (!empty($POST['picids'])) {
        $picids = array_keys($POST['picids']);
        $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('pic') . " WHERE picid IN (" . simplode($picids) . ") AND uid='{$_SGLOBAL['supe_uid']}'");
        while ($value = $_SGLOBAL['db']->fetch_array($query)) {
            if (empty($titlepic) && $value['thumb']) {
//.........这里部分代码省略.........
开发者ID:shiyake,项目名称:php-ihome,代码行数:101,代码来源:function_blog.php


注:本文中的sgmdate函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。