• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP feed_publish函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: empty

$Message = empty($_POST['message']) ? '' : getstr($_POST['message']);
$TagId = empty($_POST['tagid']) ? 0 : intval($_POST['tagid']);
$FromDevice = trim($_POST['fromdevice']);
if (trim($Message) == null || trim($Subject) == null) {
    $arrs = array('flag' => 'null');
} else {
    if (strlen($Message) < 2 || strlen($Subject) < 2) {
        $arrs = array('flag' => 'content_is_too_short');
    } else {
        $setarr = array("topicid" => 0, "tagid" => intval($TagId), "eventid" => 0, "uid" => intval($userid), "username" => getstr($username, 15, 1, 1, 1), "subject" => getstr($Subject, 80, 1, 1, 1), "magiccolor" => 0, "magicegg" => 0, "lastpost" => 0, "viewnum" => 0, "replynum" => 0, "lastauthor" => getstr($username, 15, 1, 1, 1), "lastauthorid" => 0, "displayorder" => 0, 'dateline' => $_SGLOBAL['timestamp'], 'digest' => 0, "click_11" => 0, "hot" => 0, "click_12" => 0, "click_13" => 0, "click_14" => 0, "click_15" => 0, 'fromdevice' => $FromDevice);
        $tid = inserttable('thread', $setarr, 1);
        $psetarr = array('tid' => intval($tid), "tagid" => intval($TagId), "uid" => intval($userid), "username" => getstr($username, 15, 1, 1, 1), "message" => getstr($Message, 5000, 1, 1, 1), "ip" => getonlineip(), 'dateline' => $_SGLOBAL['timestamp'], "isthread" => 1);
        //更新群组统计
        $_SGLOBAL['db']->query("UPDATE " . tname("mtag") . " SET threadnum=threadnum+1 WHERE tagid='{$Tagid}'");
        //统计
        updatestat('thread');
        updatestat('post');
        $pid = inserttable('post', $psetarr, 1);
        include_once S_ROOT . './source/function_feed.php';
        feed_publish($tid, 'tid', empty($_POST['tid']) ? 1 : 0, $FromDevice);
        if ($tid && $pid) {
            $arrs = array('flag' => 'success');
        } else {
            $arrs = array('flag' => 'fail');
        }
    }
}
$result = json_encode($arrs);
$result = preg_replace("#\\\\u([0-9a-f]+)#ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '\\1'))", $result);
echo $result;
exit;
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:do_addtopic.php


示例2: getAtName

                if (empty($realname)) {
                    $realname = $rs['username'];
                }
                //调用检查函数将@后的内容进行验证,为UID对应的姓名相同则返回@与姓名,不相同则继续判断下一个@,没有找到匹配的最终将返回false
                $ValidValue = getAtName($TmpString, $TmpName, $realname);
                $ValidValue = trim($ValidValue);
                $at_friend = "space.php?uid=" . $UserId;
                if ($ValidValue != false) {
                    $Message = str_replace($ValidValue, "<a href={$at_friend}>@" . $realname . "</a> ", $Message);
                    $UserIds[] = $UserId;
                }
            }
        }
        //Add by Add by am 2013-12-07  end
        $arr = array("topicid" => 0, "uid" => intval($userid), "username" => getstr($username, 15, 1, 1, 1), "subject" => getstr($Subject, 80, 1, 1, 1), "classid" => 0, "viewnum" => 0, "replynum" => 0, "hot" => 0, "picflag" => 0, "noreply" => 0, 'dateline' => $_SGLOBAL['timestamp'], 'friend' => 1, 'click_1' => 0, 'click_2' => 0, 'click_3' => 0, 'click_4' => 0, 'click_5' => 0, 'fromdevice' => $FromDevice);
        $blogid = inserttable('blog', $arr, 1);
        $arr1 = array("blogid" => intval($blogid), "uid" => intval($userid), "message" => getstr($Message, 5000, 1, 1, 1), "postip" => getonlineip(), "relatedtime" => 0, "magiccolor" => 0, "magicpaper" => 0, "magiccall" => 0);
        $blogfield = inserttable('blogfield', $arr1, 1);
        include_once S_ROOT . './source/function_feed.php';
        feed_publish($blogid, 'blogid', 0, $FromDevice);
        if ($blogid) {
            $arrs = array('flag' => 'success');
        } else {
            $arrs = array('flag' => 'fail');
        }
    }
}
$result = json_encode($arrs);
$result = preg_replace("#\\\\u([0-9a-f]+)#ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '\\1'))", $result);
echo $result;
exit;
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:do_addblog.php


示例3: bwzt_post


//.........这里部分代码省略.........
        }
        $bwztarr['pics'] = json_encode($pics);
    }
    //没有填写任何东西
    $ckmessage = preg_replace("/(\\<div\\>|\\<\\/div\\>|\\s|\\&nbsp\\;|\\<br\\>|\\<p\\>|\\<\\/p\\>)+/is", '', $message);
    if (empty($ckmessage)) {
        return false;
    }
    //添加slashes
    $message = addslashes($message);
    //从内容中读取图片
    if (empty($titlepic)) {
        $titlepic = getmessagepic($message);
        $bwztarr['picflag'] = 0;
    }
    $bwztarr['pic'] = $titlepic;
    //热度
    if (checkperm('managebwzt')) {
        $bwztarr['hot'] = intval($POST['hot']);
    }
    if ($olds['bwztid']) {
        //更新
        $bwztid = $olds['bwztid'];
        updatetable('bwzt', $bwztarr, array('bwztid' => $bwztid));
        $fuids = array();
        $bwztarr['uid'] = $olds['uid'];
        $bwztarr['username'] = $olds['username'];
    } else {
        //参与热闹
        $bwztarr['topicid'] = topic_check($POST['topicid'], 'bwzt');
        $bwztarr['uid'] = $_SGLOBAL['supe_uid'];
        $bwztarr['username'] = $_SGLOBAL['supe_username'];
        $bwztarr['dateline'] = empty($POST['dateline']) ? $_SGLOBAL['timestamp'] : $POST['dateline'];
        $bwztid = inserttable('bwzt', $bwztarr, 1);
    }
    $bwztarr['bwztid'] = $bwztid;
    //附表
    $fieldarr = array('message' => $message, 'postip' => getonlineip(), 'target_ids' => $POST['target_ids']);
    //TAG
    $oldtagstr = addslashes(empty($olds['tag']) ? '' : implode(' ', unserialize($olds['tag'])));
    $tagarr = array();
    if ($POST['tag'] != $oldtagstr) {
        if (!empty($olds['tag'])) {
            //先把以前的给清理掉
            $oldtags = array();
            $query = $_SGLOBAL['db']->query("SELECT tagid, bwztid FROM " . tname('tagbwzt') . " WHERE bwztid='{$bwztid}'");
            while ($value = $_SGLOBAL['db']->fetch_array($query)) {
                $oldtags[] = $value['tagid'];
            }
            if ($oldtags) {
                $_SGLOBAL['db']->query("UPDATE " . tname('tag') . " SET bwztnum=bwztnum-1 WHERE tagid IN (" . simplode($oldtags) . ")");
                $_SGLOBAL['db']->query("DELETE FROM " . tname('tagbwzt') . " WHERE bwztid='{$bwztid}'");
            }
        }
        $tagarr = tag_batch($bwztid, $POST['tag']);
        //更新附表中的tag
        $fieldarr['tag'] = empty($tagarr) ? '' : addslashes(serialize($tagarr));
    }
    if ($olds) {
        //更新
        updatetable('bwztfield', $fieldarr, array('bwztid' => $bwztid));
    } else {
        $fieldarr['bwztid'] = $bwztid;
        $fieldarr['uid'] = $bwztarr['uid'];
        inserttable('bwztfield', $fieldarr);
    }
    //空间更新
    if ($isself) {
        if ($olds) {
            //空间更新
            $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET updatetime='{$_SGLOBAL['timestamp']}' WHERE uid='{$_SGLOBAL['supe_uid']}'");
        } else {
            if (empty($space['bwztnum'])) {
                $space['bwztnum'] = getcount('bwzt', array('uid' => $space['uid']));
                $bwztnumsql = "bwztnum=" . $space['bwztnum'];
            } else {
                $bwztnumsql = 'bwztnum=bwztnum+1';
            }
            //积分
            $reward = getreward('publishbwzt', 0);
            $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET {$bwztnumsql}, lastpost='{$_SGLOBAL['timestamp']}', updatetime='{$_SGLOBAL['timestamp']}', credit=credit+{$reward['credit']}, experience=experience+{$reward['experience']} WHERE uid='{$_SGLOBAL['supe_uid']}'");
            //统计
            updatestat('bwzt');
        }
    }
    //产生feed
    if ($POST['makefeed']) {
        include_once S_ROOT . './source/function_feed.php';
        feed_publish($bwztid, 'bwztid', $olds ? 0 : 1);
    }
    //热闹
    if (empty($olds) && $bwztarr['topicid']) {
        topic_join($bwztarr['topicid'], $_SGLOBAL['supe_uid'], $_SGLOBAL['supe_username']);
    }
    //角色切换
    if (!empty($__SGLOBAL)) {
        $_SGLOBAL = $__SGLOBAL;
    }
    return $bwztarr;
}
开发者ID:NaturalWill,项目名称:UCQA,代码行数:101,代码来源:function_bwzt.php


示例4: blog_post


//.........这里部分代码省略.........
					unset($uploads[$urlmd5]);
				}
			}
		}
		foreach ($uploads as $value) {
			$picurl = pic_get($value['filepath'], 'album', $value['thumb'], $value['remote'], 0);
			$message .= "<div class=\"uchome-message-pic\"><img src=\"$picurl\"><p>$value[title]</p></div>";
		}
	}

	$ckmessage = preg_replace("/(\<div\>|\<\/div\>|\s|\&nbsp\;|\<br\>|\<p\>|\<\/p\>)+/is", '', $message);
	if(empty($ckmessage)) {
		return false;
	}


	if(checkperm('manageblog')) {
		$blogarr['hot'] = intval($POST['hot']);
	}

	if($olds['blogid']) {

		if($blogarr['catid'] != $olds['catid']) {
			if($olds['catid']) {
				C::t('home_blog_category')->update_num_by_catid(-1, $olds['catid'], true, true);
			}
			if($blogarr['catid']) {
				C::t('home_blog_category')->update_num_by_catid(1, $blogarr['catid']);
			}
		}

		$blogid = $olds['blogid'];
		C::t('home_blog')->update($blogid, $blogarr);

		$fuids = array();

		$blogarr['uid'] = $olds['uid'];
		$blogarr['username'] = $olds['username'];
	} else {

		if($blogarr['catid']) {
			C::t('home_blog_category')->update_num_by_catid(1, $blogarr['catid']);
		}

		$blogarr['uid'] = $_G['uid'];
		$blogarr['username'] = $_G['username'];
		$blogarr['dateline'] = empty($POST['dateline'])?$_G['timestamp']:$POST['dateline'];
		$blogid = C::t('home_blog')->insert($blogarr, true);

		C::t('common_member_status')->update($_G['uid'], array('lastpost' => $_G['timestamp']));
		C::t('common_member_field_home')->update($_G['uid'], array('recentnote'=>$POST['subject']));
	}

	$blogarr['blogid'] = $blogid;
	$class_tag = new tag();
	$POST['tag'] = $olds ? $class_tag->update_field($POST['tag'], $blogid, 'blogid') : $class_tag->add_tag($POST['tag'], $blogid, 'blogid');
	$fieldarr = array(
		'message' => $message,
		'postip' => $_G['clientip'],
		'target_ids' => $POST['target_ids'],
		'tag' => $POST['tag']
	);

	if(!empty($titlepic)) {
		$fieldarr['pic'] = $titlepic;
	}

	if($olds) {
		C::t('home_blogfield')->update($blogid, $fieldarr);
	} else {
		$fieldarr['blogid'] = $blogid;
		$fieldarr['uid'] = $blogarr['uid'];
		C::t('home_blogfield')->insert($fieldarr);
	}

	if($isself && !$olds && $blog_status == 0) {
		updatecreditbyaction('publishblog', 0, array('blogs' => 1));

		include_once libfile('function/stat');
		updatestat('blog');
	}

	if($olds['blogid'] && $blog_status == 1) {
		updatecreditbyaction('publishblog', 0, array('blogs' => -1), '', -1);
		include_once libfile('function/stat');
		updatestat('blog');
	}

	if($POST['makefeed'] && $blog_status == 0) {
		include_once libfile('function/feed');
		feed_publish($blogid, 'blogid', $olds?0:1);
	}

	if(!empty($__G)) $_G = $__G;
	if($blog_status == 1) {
		updatemoderate('blogid', $blogid);
		manage_addnotify('verifyblog');
	}
	return $blogarr;
}
开发者ID:xDiglett,项目名称:discuzx30,代码行数:101,代码来源:function_blog.php


示例5: hot_update

function hot_update($idtype, $id, $hotuser)
{
    global $_G;
    $hotusers = empty($hotuser) ? array() : explode(',', $hotuser);
    if ($hotusers && in_array($_G['uid'], $hotusers)) {
        return false;
    } else {
        $hotusers[] = $_G['uid'];
        $hotuser = implode(',', $hotusers);
    }
    $newhot = count($hotusers) + 1;
    if ($newhot == $_G['setting']['feedhotmin']) {
        $tablename = gettablebyidtype($idtype);
        $query = DB::query("SELECT uid FROM " . DB::table($tablename) . " WHERE {$idtype}='{$id}'");
        $item = DB::fetch($query);
        updatecreditbyaction('hotinfo', $item['uid']);
    }
    switch ($idtype) {
        case 'blogid':
            DB::query("UPDATE " . DB::table('home_blogfield') . " SET hotuser='{$hotuser}' WHERE blogid='{$id}'");
            DB::query("UPDATE " . DB::table('home_blog') . " SET hot=hot+1 WHERE blogid='{$id}'");
            break;
        case 'picid':
            DB::query("REPLACE INTO " . DB::table('home_picfield') . " (picid, hotuser) VALUES ('{$id}', '{$hotuser}')");
            DB::query("UPDATE " . DB::table('home_pic') . " SET hot=hot+1 WHERE picid='{$id}'");
            break;
        case 'sid':
            DB::query("UPDATE " . DB::table('home_share') . " SET hot=hot+1, hotuser='{$hotuser}' WHERE sid='{$id}'");
            break;
        default:
            return false;
    }
    $query = DB::query("SELECT feedid, friend FROM " . DB::table('home_feed') . " WHERE id='{$id}' AND idtype='{$idtype}'");
    if ($feed = DB::fetch($query)) {
        if (empty($feed['friend'])) {
            DB::query("UPDATE " . DB::table('home_feed') . " SET hot=hot+1 WHERE feedid='{$feed['feedid']}'");
        }
    } elseif ($idtype == 'picid') {
        require_once libfile('function/feed');
        feed_publish($id, $idtype);
    }
    return true;
}
开发者ID:Kingson4Wu,项目名称:php_demo,代码行数:43,代码来源:function_spacecp.php


示例6: getcount

        }
        // update  user Statistics
        if (empty($space['sharenum'])) {
            $space['sharenum'] = getcount('share', array('uid' => $space['uid']));
            $sharenumsql = "sharenum=" . $space['sharenum'];
        } else {
            $sharenumsql = 'sharenum=sharenum+1';
        }
        // points
        $needle = $id ? $type . $id : '';
        $reward = getreward('createshare', 0, 0, $needle);
        $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET {$sharenumsql}, lastpost='{$_SGLOBAL['timestamp']}', updatetime='{$_SGLOBAL['timestamp']}', credit=credit+{$reward['credit']}, experience=experience+{$reward['experience']} WHERE uid='{$_SGLOBAL['supe_uid']}'");
        //̬
        if (ckprivacy('share', 1)) {
            include_once S_ROOT . './source/function_feed.php';
            feed_publish($sid, 'sid', 1);
        }
        if ($_POST['topicid']) {
            topic_join($_POST['topicid'], $_SGLOBAL['supe_uid'], $_SGLOBAL['supe_username']);
            $url = 'space.php?do=topic&topicid=' . $_POST['topicid'] . '&view=share';
        } else {
            $url = $_POST['refer'];
        }
        showmessage('do_success', $url, 0);
    }
    //ʾ
    $arr['body_data'] = serialize($arr['body_data']);
    // groups ת
    $arr = mkshare($arr);
    realname_get();
}
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:cp_share.php


示例7: blog_post


//.........这里部分代码省略.........
    }
    //���slashes
    $message = addslashes($message);
    //�������ж�ȡͼƬ
    if (empty($titlepic)) {
        $titlepic = getmessagepic($message);
        $blogarr['picflag'] = 0;
    }
    $blogarr['pic'] = $titlepic;
    //�ȶ�
    if (checkperm('manageblog')) {
        $blogarr['hot'] = intval($POST['hot']);
    }
    //����
    if ($_POST['attachid'] && $_POST['attachpath'] && $_POST['attachname'] && $_POST['attachsize']) {
        $blogarr['attachid'] = $_POST['attachid'];
        $blogarr['attachpath'] = $_POST['attachpath'];
        $blogarr['attachname'] = $_POST['attachname'];
        $blogarr['attachsize'] = $_POST['attachsize'];
    }
    if ($olds['blogid']) {
        //����
        $blogid = $olds['blogid'];
        updatetable('blog', $blogarr, array('blogid' => $blogid));
        $fuids = array();
        $blogarr['uid'] = $olds['uid'];
        $blogarr['username'] = $olds['username'];
    } else {
        //��������
        $blogarr['topicid'] = topic_check($POST['topicid'], 'blog');
        $blogarr['uid'] = $_SGLOBAL['supe_uid'];
        $blogarr['username'] = $_SGLOBAL['supe_username'];
        $blogarr['dateline'] = empty($POST['dateline']) ? $_SGLOBAL['timestamp'] : $POST['dateline'];
        $blogid = inserttable('blog', $blogarr, 1);
    }
    $blogarr['blogid'] = $blogid;
    //����
    $fieldarr = array('message' => $message, 'postip' => getonlineip(), 'target_ids' => $POST['target_ids']);
    //TAG
    $oldtagstr = addslashes(empty($olds['tag']) ? '' : implode(' ', unserialize($olds['tag'])));
    $tagarr = array();
    if ($POST['tag'] != $oldtagstr) {
        if (!empty($olds['tag'])) {
            //�Ȱ���ǰ�ĸ������
            $oldtags = array();
            $query = $_SGLOBAL['db']->query("SELECT tagid, blogid FROM " . tname('tagblog') . " WHERE blogid='{$blogid}'");
            while ($value = $_SGLOBAL['db']->fetch_array($query)) {
                $oldtags[] = $value['tagid'];
            }
            if ($oldtags) {
                $_SGLOBAL['db']->query("UPDATE " . tname('tag') . " SET blognum=blognum-1 WHERE tagid IN (" . simplode($oldtags) . ")");
                $_SGLOBAL['db']->query("DELETE FROM " . tname('tagblog') . " WHERE blogid='{$blogid}'");
            }
        }
        $tagarr = tag_batch($blogid, $POST['tag']);
        //���¸����е�tag
        $fieldarr['tag'] = empty($tagarr) ? '' : addslashes(serialize($tagarr));
    }
    if ($olds) {
        //����
        updatetable('blogfield', $fieldarr, array('blogid' => $blogid));
    } else {
        $fieldarr['blogid'] = $blogid;
        $fieldarr['uid'] = $blogarr['uid'];
        inserttable('blogfield', $fieldarr);
    }
    //�ռ����
    if ($isself) {
        if ($olds) {
            //�ռ����
            $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET updatetime='{$_SGLOBAL['timestamp']}' WHERE uid='{$_SGLOBAL['supe_uid']}'");
        } else {
            if (empty($space['blognum'])) {
                $space['blognum'] = getcount('blog', array('uid' => $space['uid']));
                $blognumsql = "blognum=" . $space['blognum'];
            } else {
                $blognumsql = 'blognum=blognum+1';
            }
            //���
            $reward = getreward('publishblog', 0);
            $_SGLOBAL['db']->query("UPDATE " . tname('space') . " SET {$blognumsql}, lastpost='{$_SGLOBAL['timestamp']}', updatetime='{$_SGLOBAL['timestamp']}', credit=credit+{$reward['credit']}, experience=experience+{$reward['experience']} WHERE uid='{$_SGLOBAL['supe_uid']}'");
            //ͳ��
            updatestat('blog');
        }
    }
    //����feed
    if ($POST['makefeed']) {
        include_once S_ROOT . './source/function_feed.php';
        feed_publish($blogid, 'blogid', $olds ? 0 : 1);
    }
    //����
    if (empty($olds) && $blogarr['topicid']) {
        topic_join($blogarr['topicid'], $_SGLOBAL['supe_uid'], $_SGLOBAL['supe_username']);
    }
    //��ɫ�л�
    if (!empty($__SGLOBAL)) {
        $_SGLOBAL = $__SGLOBAL;
    }
    return $blogarr;
}
开发者ID:shiyake,项目名称:php-ihome,代码行数:101,代码来源:function_blog.php


示例8: array

 }
 //添加授权记录
 $apps_users_arr = array('uid' => $uid, 'appsid' => $appsid, 'clicktime' => 1);
 inserttable('apps_users', $apps_users_arr, 0);
 //更新应用使用人数
 $app_arr['usernumber'] = $app['usernumber'] + 1;
 $app_arr['clicktime'] = $app['clicktime'] + 1;
 updatetable('apps', $app_arr, array('id' => $appsid));
 //默认评分
 $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname('apps_detail') . " WHERE uid={$uid} AND appsid={$appsid}");
 if (!$_SGLOBAL['db']->fetch_array($query)) {
     $detailarr = array('appsid' => $appsid, 'uid' => $uid, 'anonymous' => 1, 'score' => 5, 'score_easy' => 5, 'score_service' => 5, 'score_speed' => 5, 'content' => '', 'ip' => getonlineip(), 'time' => $nowtime, 'vision' => 1, 'issystem' => 1);
     gradeForApp($detailarr, $app, $appsid, 0);
 }
 if (@(include_once S_ROOT . './source/function_feed.php')) {
     feed_publish($appsid, 'appsid');
 }
 if ($app['category'] == 1) {
     //校内应用
     echo $app['url'];
     exit;
 } elseif ($app['category'] == 3) {
     //第三方应用
     if ($app['iauth_type'] == 'WSC') {
         //Web Site Client 授权
         $rightStr = implode(':', $_POST['api']);
         $state = $_POST['state'];
         $iauth_url = 'plugin.php?pluginid=apps';
         try {
             $iauth_url = IAUTH_auth($app['iauth_id'], $uid, $rightStr, $state);
         } catch (IAuthException $e) {
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:detail.php


示例9: serialize

        $type = 'link';
        $_GET['op'] = 'link';
        break;
}
$arr['body_general'] = $Body;
$arr['type'] = $type;
$arr['id'] = $id;
$arr['uid'] = $userid;
$arr['username'] = $username;
$arr['dateline'] = $_SGLOBAL['timestamp'];
$arr['topicid'] = 0;
$arr['body_data'] = serialize($arr['body_data']);
//数组转化
$arr['fromdevice'] = $FromDevice;
//入库
$setarr = saddslashes($arr);
//增加转义
$sid = inserttable('share', $setarr, 1);
//统计
updatestat('share');
include_once S_ROOT . './source/function_feed.php';
feed_publish($sid, 'sid', 1, $FromDevice);
if ($sid) {
    $arrs = array('flag' => 'success');
} else {
    $arrs = array('flag' => 'fail');
}
$result = json_encode($arrs);
$result = preg_replace("#\\\\u([0-9a-f]{4})#ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '\\1'))", $result);
echo $result;
exit;
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:do_addshare.php


示例10: articles

        $q = "insert into articles (title,class,type,shortdesc,test,date,linkover,link,sourceurl,source,publish," . "enteredby,updatedby,datecreated,contact) values('" . $title . "','" . $class . "','" . $type . "','','" . $text . "','" . $d->Fields("dcdate") . "','" . $linkover . "','" . addslashes($d->Fields("link")) . "','','1','0','" . $ID . "','" . $ID . "',now(),'" . $contact . "')";
    } else {
        $q = "insert into articles (title,class,type,shortdesc,test,date,linkover,link,source,sourceurl,publish," . "uselink,enteredby,updatedby,datecreated) values('" . $title . "','" . $class . "','" . $type . "','" . $shortdesc . "','" . $text . "','" . $d->Fields("dcdate") . "','" . $linkover . "','" . addslashes($d->Fields("link")) . "','" . addslashes($d->Fields("ftitle")) . "','" . addslashes($d->Fields("link")) . "','1','1','" . $ID . "','" . $ID . "',now())";
    }
    $dbcon->execute($q) or die($dbcon->errorMsg());
    feed_read($id);
}
if ($_POST[act]) {
    foreach ($_POST[read] as $k => $v) {
        if ($v == 1) {
            feed_read($k);
        }
    }
    foreach ($_POST[publish] as $k => $v) {
        if ($v == 1) {
            feed_publish($k, $_POST[type][$k], $_POST[fclass][$k]);
        }
    }
}
if ($_GET[feed]) {
    $feedsql = " and p.feed_id = " . $_GET[feed] . " ";
}
if ($_GET[offset]) {
    $offset = $_GET[offset];
} else {
    $offset = 0;
}
if ($_GET[limit]) {
    $limit = $_GET[limit];
} else {
    $limit = 30;
开发者ID:radicalsuz,项目名称:amp,代码行数:31,代码来源:feeds_view.php


示例11: showmessage

$desc = $_POST['desc'];
$file = $_FILES['uploadvideo'];
if ($file) {
    if (strlen($title) > 40) {
        showmessage("标题过长了,请控制在20汉字以内!");
    }
    if (strlen($title) < 4) {
        showmessage("标题过短!请在2个汉字以上20汉字以下!");
    }
    if (strlen($desc) > 400) {
        showmessage("内容过长了,请控制在200汉字以内!");
    }
    if (strlen($desc) > 20) {
        showmessage("内容过短,请在10个汉字以上!");
    }
    $title = getstr($title, 40, 1, 1, 1);
    //标题为20个字
    $desc = getstr($desc, 400, 1, 1, 1);
    //描述为200个字
} else {
    showmessage('no_file');
}
if (submitcheck('uploadflv')) {
    $videosave = video_save($file, $title, $desc);
    //写个上传视频的函数--上传视频
    if ($videosave && is_array($videosave)) {
        //--上传视频成功之后,增加feed就算大功告成了
        feed_publish($videosave['id'], 'videoid');
        //--发布feed
    }
}
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:cp_video.php


示例12: elseif

    }
} elseif ($_GET['op'] == 'goto') {
    $id = intval($_GET['id']);
    $uid = $id ? getcount('bwzt', array('bwztid' => $id), 'uid') : 0;
    showmessage('do_success', "space.php?uid={$uid}&do=bwzt&id={$id}", 0);
} elseif ($_GET['op'] == 'edithot') {
    //权限
    if (!checkperm('managebwzt')) {
        showmessage('no_privilege');
    }
    if (submitcheck('hotsubmit')) {
        $_POST['hot'] = intval($_POST['hot']);
        updatetable('bwzt', array('hot' => $_POST['hot']), array('bwztid' => $bwzt['bwztid']));
        if ($_POST['hot'] > 0) {
            include_once S_ROOT . './source/function_feed.php';
            feed_publish($bwzt['bwztid'], 'bwztid');
        } else {
            updatetable('feed', array('hot' => $_POST['hot']), array('id' => $bwzt['bwztid'], 'idtype' => 'bwztid'));
        }
        showmessage('do_success', "space.php?uid={$bwzt['uid']}&do=bwzt&id={$bwzt['bwztid']}", 0);
    }
} else {
    //添加编辑
    //获取个人分类
    $bwztclassarr = $bwzt['uid'] ? getbwztclassarr($bwzt['uid']) : getbwztclassarr($_SGLOBAL['supe_uid']);
    //获取科室分类
    $bwztdivisionarr = $bwzt['uid'] ? getbwztdivisionarr($bwzt['uid']) : getbwztdivisionarr($_SGLOBAL['supe_uid']);
    //获取相册
    $albums = getalbums($_SGLOBAL['supe_uid']);
    $tags = empty($bwzt['tag']) ? array() : unserialize($bwzt['tag']);
    $bwzt['tag'] = implode(' ', $tags);
开发者ID:NaturalWill,项目名称:UCQA,代码行数:31,代码来源:cp_bwzt.php


示例13: pick_blog_post


//.........这里部分代码省略.........
        $POST['message'] = censor($POST['message']);
    } else {
        $POST['message'] = checkhtml($POST['message']);
        $POST['message'] = getstr($POST['message'], 0, 1, 0, 0, 1);
        //$POST['message'] = addslashes($POST['message']);
        $POST['message'] = preg_replace(array("/\\<div\\>\\<\\/div\\>/i", "/\\<a\\s+href\\=\"([^\\>]+?)\"\\>/i"), array('', '<a href="\\1" target="_blank">'), $POST['message']);
    }
    $message = $POST['message'];
    $blog_status = 0;
    if ($olds['blog_id']) {
        $info = DB::fetch_first("SELECT blogid FROM " . DB::table('home_blog') . " WHERE blogid='" . $olds['blog_id'] . "'");
    }
    if (empty($olds['classid']) || $POST['classid'] != $olds['classid']) {
        if (!empty($POST['classid']) && substr($POST['classid'], 0, 4) == 'new:') {
            $classname = dhtmlspecialchars(trim(substr($POST['classid'], 4)));
            $classname = getstr($classname, 0, 1, 1);
            $classname = censor($classname);
            if (empty($classname)) {
                $classid = 0;
            } else {
                $classid = DB::result(DB::query("SELECT classid FROM " . DB::table('home_class') . " WHERE uid='{$_G['uid']}' AND classname='{$classname}'"));
                if (empty($classid)) {
                    $setarr = array('classname' => $classname, 'uid' => $_G['uid'], 'dateline' => $_G['timestamp']);
                    $classid = DB::insert('home_class', $setarr, 1);
                }
            }
        } else {
            $classid = intval($POST['classid']);
        }
    } else {
        $classid = $olds['classid'];
    }
    if ($classid && empty($classname)) {
        $classname = DB::result(DB::query("SELECT classname FROM " . DB::table('home_class') . " WHERE classid='{$classid}' AND uid='{$_G['uid']}'"));
        if (empty($classname)) {
            $classid = 0;
        }
    }
    $blogarr = array('subject' => $POST['subject'], 'classid' => $classid, 'viewnum' => $POST['view_num'], 'friend' => $POST['friend'], 'password' => $POST['password'], 'noreply' => empty($POST['noreply']) ? 0 : 1, 'catid' => intval($POST['catid']), 'status' => $blog_status);
    $titlepic = '';
    $ckmessage = preg_replace("/(\\<div\\>|\\<\\/div\\>|\\s|\\&nbsp\\;|\\<br\\>|\\<p\\>|\\<\\/p\\>)+/is", '', $message);
    if (empty($ckmessage)) {
        return false;
    }
    $message = addslashes($message);
    if (checkperm('manageblog')) {
        $blogarr['hot'] = intval($POST['hot']);
    }
    if ($blogarr['catid']) {
        DB::query("UPDATE " . DB::table('home_blog_category') . " SET num=num+1 WHERE catid='{$blogarr['catid']}'");
    }
    $blogarr['uid'] = $_G['uid'];
    $blogarr['username'] = $_G['username'];
    $blogarr['dateline'] = empty($POST['public_time']) ? $_G['timestamp'] : $POST['public_time'];
    if ($info['blogid']) {
        DB::update('home_blog', $blogarr, array('blogid' => $info['blogid']));
        $blogid = $info['blogid'];
    } else {
        $blogid = DB::insert('home_blog', $blogarr, 1);
    }
    DB::update('common_member_status', array('lastpost' => $POST['public_time']), array('uid' => $_G['uid']));
    DB::update('common_member_field_home', array('recentnote' => $POST['subject']), array('uid' => $_G['uid']));
    $blogarr['blogid'] = $blogid;
    if (function_exists('modblogtag')) {
        $POST['tag'] = $olds ? modblogtag($POST['tag'], $blogid) : addblogtag($POST['tag'], $blogid);
    } else {
        $class_tag = new tag();
        $POST['tag'] = $olds ? $class_tag->update_field($POST['tag'], $blogid, 'blogid') : $class_tag->add_tag($POST['tag'], $blogid, 'blogid');
    }
    $fieldarr = array('message' => $message, 'postip' => $_G['clientip'], 'target_ids' => $POST['target_ids'], 'tag' => $POST['tag']);
    if (!empty($titlepic)) {
        $fieldarr['pic'] = $titlepic;
    }
    $fieldarr['blogid'] = $blogid;
    $fieldarr['uid'] = $blogarr['uid'];
    if ($info['blogid']) {
        DB::update('home_blogfield', $fieldarr, array('blogid' => $info['blogid']));
    } else {
        DB::query("UPDATE " . DB::table('common_member_count') . " SET blogs=blogs+1 WHERE uid='{$fieldarr['uid']}'");
        //更新数
        DB::insert('home_blogfield', $fieldarr);
    }
    if ($isself && !$olds && $blog_status == 0) {
        updatecreditbyaction('publishblog', 0, array('blogs' => 1));
        include_once libfile('function/stat');
        updatestat('blog');
    }
    if ($POST['makefeed'] && $blog_status == 0) {
        include_once libfile('function/feed');
        feed_publish($blogid, 'blogid', $olds ? 0 : 1);
    }
    if (!empty($__G)) {
        $_G = $__G;
    }
    if ($blog_status == 1) {
        updatemoderate('blogid', $blogid);
        manage_addnotify('verifyblog');
    }
    return $blogarr;
}
开发者ID:edmundwong,项目名称:V604,代码行数:101,代码来源:function.article.php


示例14: intval

*/
include_once '../iauth_verify_forward.php';
$userid = intval(iauth_verify());
include_once '../../../common.php';
include_once S_ROOT . './uc_client/client.php';
@(include_once S_ROOT . './data/data_profield.php');
//$username = 'anminghao';
//$userid = 96 ;
$Subject = empty($_POST['subject']) ? '' : getstr($_POST['subject']);
$Message = empty($_POST['message']) ? '' : getstr($_POST['message']);
$TagId = empty($_POST['tagid']) ? 0 : intval($_POST['tagid']);
$setarr = array("topicid" => 0, "tagid" => intval($TagId), "eventid" => 0, "uid" => intval($userid), "username" => getstr($username, 15, 1, 1, 1), "subject" => getstr($Subject, 80, 1, 1, 1), "magiccolor" => 0, "magicegg" => 0, "lastpost" => 0, "viewnum" => 0, "replynum" => 0, "lastauthor" => getstr($username, 15, 1, 1, 1), "lastauthorid" => 0, "displayorder" => 0, 'dateline' => $_SGLOBAL['timestamp'], 'digest' => 0, "click_11" => 0, "hot" => 0, "click_12" => 0, "click_13" => 0, "click_14" => 0, "click_15" => 0);
$tid = inserttable('thread', $setarr, 1);
$psetarr = array('tid' => intval($tid), "tagid" => intval($TagId), "uid" => intval($userid), "username" => getstr($username, 15, 1, 1, 1), "message" => getstr($Message, 5000, 1, 1, 1), "ip" => getonlineip(), 'dateline' => $_SGLOBAL['timestamp'], "isthread" => 1);
//更新群组统计
$_SGLOBAL['db']->query("UPDATE " . tname("mtag") . " SET threadnum=threadnum+1 WHERE tagid='{$Tagid}'");
//统计
updatestat('thread');
updatestat('post');
$pid = inserttable('post', $psetarr, 1);
include_once S_ROOT . './source/function_feed.php';
feed_publish($tid, 'tid', empty($_POST['tid']) ? 1 : 0);
if ($tid && $pid) {
    $arrs = array('flag' => 'success');
} else {
    $arrs = array('flag' => 'fail');
}
$result = json_encode($arrs);
$result = preg_replace("#\\\\u([0-9a-f]+)#ie", "iconv('UCS-2BE', 'UTF-8', pack('H4', '\\1'))", $result);
echo $result;
exit;
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:do_addtopic.php


示例15: while

        while ($value = $_SGLOBAL['db']->fetch_array($query)) {
            $imgs[] = pic_get($value['filepath'], $value['thumb'], $value['remote']);
            $imglinks[] = "space.php?do=event&id={$eventid}&view=pic&picid=" . $value['picid'];
        }
        $picnum = 0;
        if ($imgs) {
            $picnum = $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM " . tname("eventpic") . " WHERE eventid='{$eventid}'"), 0);
            feed_add('event', cplang('event_feed_share_pic_title'), '', cplang('event_feed_share_pic_info'), array("eventid" => $eventid, "title" => $event['title'], "picnum" => $picnum), '', $imgs, $imglinks);
        }
        $_SGLOBAL['db']->query("UPDATE " . tname("event") . " SET picnum='{$picnum}', updatetime='{$_SGLOBAL['timestamp']}' WHERE eventid='{$eventid}'");
        showmessage('do_success', 'space.php?do=event&view=pic&id=' . $eventid, 0);
    } else {
        //相册feed
        if (ckprivacy('upload', 1)) {
            include_once S_ROOT . './source/function_feed.php';
            feed_publish($_POST['opalbumid'], 'albumid');
        }
        //单个图片feed
        if ($_POST['topicid']) {
            topic_join($_POST['topicid'], $_SGLOBAL['supe_uid'], $_SGLOBAL['supe_username']);
            $url = "space.php?do=topic&topicid={$_POST['topicid']}&view=pic";
        } else {
            $url = "space.php?uid={$_SGLOBAL['supe_uid']}&do=album&id=" . (empty($_POST['opalbumid']) ? -1 : $_POST['opalbumid']);
        }
        capi_showmessage_by_data('upload_images_completed', $url, 0);
    }
} else {
    if (!checkperm('allowupload')) {
        ckspacelog();
        capi_showmessage_by_data('no_privilege');
    }
开发者ID:NaturalWill,项目名称:UCQA,代码行数:31,代码来源:cp_upload.php


示例16: isset

$isdoodle = isset($_GET['doodle']) ? true : false;
$fileurl = '';
if (!empty($_POST['uid'])) {
    $_SGLOBAL['supe_uid'] = intval($_POST['uid']);
    if (empty($_SGLOBAL['supe_uid']) || $_POST['hash'] != md5($_SGLOBAL['supe_uid'] . UC_KEY)) {
        exit;
    }
} elseif (empty($_SGLOBAL['supe_uid'])) {
    showmessage('to_login', 'do.php?ac=' . $_SCONFIG['login_action']);
}
if ($op == "finish") {
    $albumid = intval($_GET['albumid']);
    $space = getspace($_SGLOBAL['supe_uid']);
    if (ckprivacy('upload', 1)) {
        include_once S_ROOT . './source/function_feed.php';
        feed_publish($albumid, 'albumid');
    }
    exit;
} elseif ($op == 'config') {
    $hash = md5($_SGLOBAL['supe_uid'] . UC_KEY);
    if ($isupload && !checkperm('allowupload')) {
        $hash = '';
    } else {
        $filearr = $dirstr = array();
        //大头贴背景图
        if ($iscamera) {
            $directory = sreaddir(S_ROOT . './image/foreground');
            foreach ($directory as $key => $value) {
                $dirstr = S_ROOT . './image/foreground/' . $value;
                if (is_dir($dirstr)) {
                    $filearr = sreaddir($dirstr, array('jpg', 'jpeg', 'gif', 'png'));
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:do_swfupload.php


示例17: showmessage

        showmessage("请填写视频描述", "plugin.php?pluginid=video&ac=upload");
    }
    if (!$title) {
        showmessage("请填写视频标题", "plugin.php?pluginid=video&ac=upload");
    }
    $video_detail = video_save($video, $title, $desc, $abstract);
    pic_save($image, 0, $title);
    $sql = "SELECT * FROM " . tname("pic") . " WHERE title='" . $title . "' order by dateline desc limit 1";
    $picid = 0;
    $query = $_SGLOBAL['db']->query($sql);
    while ($row = $_SGLOBAL['db']->fetch_array($query)) {
        $picid = $row['picid'];
    }
    if ($video_detail && is_array($video_detail)) {
        include_once S_ROOT . './source/function_feed.php';
        feed_publish($video_detail['id'], 'videoid');
    }
    $sql = "UPDATE " . tname("video") . " SET picid = " . $picid . " WHERE id = " . $video_detail['id'];
    $_SGLOBAL['db']->query($sql);
    showmessage("视频已经成功上传", "plugin.php?pluginid=video");
    exit;
} elseif ($ac == 'add_view') {
    $query = $_SGLOBAL['db']->query("UPDATE " . tname(video) . " SET view=view+1 WHERE id=" . $_GET['vid']);
    echo "correct";
    exit;
} elseif ($ac == 'view') {
    $vid = $_GET['vid'];
    $query = $_SGLOBAL['db']->query("SELECT * FROM " . tname(video) . " WHERE id = {$vid} ");
    if ($value = $_SGLOBAL['db']->fetch_array($query)) {
        $video[] = $value;
        $url = $_SC['attachurl'] . $value['filepath'];
开发者ID:shiyake,项目名称:php-ihome,代码行数:31,代码来源:index.php


示例18: tname

    $sql = "DELETE FROM " . tname("language_user") . " WHERE uid=" . $_SGLOBAL['supe_uid'];
    $_SGLOBAL['db']->query($sql);
    $sql = "DELETE FROM " . tname("notification") . " WHERE uid=" . $_SGLOBAL['supe_uid'] . " and type='language_help'";
    $_SGLOBAL['db']->query($sql);
    $sql = "UPDATE " . tname("language_user") . " SET fuid=NULL WHERE fuid= " . $_SGLOBAL['supe_uid'];
    $_SGLOBAL['db']->query($sql);
    showmessage("您已取消中外语言互助", "plugin.php?pluginid=language_help&ac=request_list");
} elseif ($ac == 'cancel') {
    $sql = "SELECT * FROM " . tname("language_user") . " WHERE uid=" . $_SGLOBAL['supe_uid'];
    $query = $_SGLOBAL['db']->query($sql);
    while ($row = $_SGLOBAL['db']->fetch_array($query)) {
        $sql = "UPDATE " . tname("language_user") . 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP feed_to_label_id函数代码示例发布时间:2022-05-15
下一篇:
PHP feed_has_icon函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap