コード例 #1
0
ファイル: cms.weibo.php プロジェクト: jechiy/PHPWind
 function init($id)
 {
     $this->_cid = $id;
     require_once R_P . 'mode/cms/require/core.php';
     $articleDB = C::loadDB('article');
     $article = $articleDB->get($this->_cid);
     empty($article) && Showmsg('data_error');
     $this->_url = $this->_url . "&id=" . $this->_cid;
     $title = $content = '我发现了一篇文章' . sprintf("[url=%s] %s [/url]", urlRewrite($this->_url), $article['subject']) . ',特别推荐。';
     $descrip = $article['descrip'];
     $mailSubject = getLangInfo('app', 'cms_recommend');
     $mailContent = getLangInfo('app', 'ajax_sendweibo_cmsinfo', array('title' => $title, 'descrip' => $descrip));
     $this->_content = $content;
     $this->_mailSubject = $mailSubject;
     $this->_mailContent = $mailContent;
 }
コード例 #2
0
ファイル: postnew.php プロジェクト: jechiy/PHPWind
 if ($postActForBbs) {
     //活动初始化
     $postActForBbs->insertData($tid, $fid);
 }
 if ($buildIfcheck) {
     //抢楼
     $robbuildService->insertData($tid);
 }
 $isAtcEmail = (int) $atc_email;
 $isAtcNewrp = (int) $atc_newrp;
 $userService = L::loadClass('UserService', 'user');
 $userService->setUserStatus($winduid, PW_USERSTATUS_REPLYEMAIL, $isAtcEmail);
 $userService->setUserStatus($winduid, PW_USERSTATUS_REPLYSITEEMAIL, $isAtcNewrp);
 $j_p = "read.php?tid={$tid}&ds=1";
 if ($db_htmifopen) {
     $j_p = urlRewrite($j_p);
 }
 if (empty($j_p) || $pwforum->foruminfo['cms']) {
     $j_p = "read.php?tid={$tid}&ds=1";
 }
 $pinfo = defined('AJAX') ? "success\t" . $j_p : "";
 if (!$iscontinue) {
     if ($postdata->getIfcheck()) {
         if ($prompts = $pwpost->getprompt()) {
             isset($prompts['allowhide']) && ($pinfo = getLangInfo('refreshto', "post_limit_hide"));
             isset($prompts['allowsell']) && ($pinfo = getLangInfo('refreshto', "post_limit_sell"));
             isset($prompts['allowencode']) && ($pinfo = getLangInfo('refreshto', "post_limit_encode"));
         }
     }
 }
 //defend start
コード例 #3
0
ファイル: m_post.php プロジェクト: sherlockhouse/aliyun
        //解决因错误导致附件丢失问题
        $articleModule->setAttach($flashatt);
        $articleModule->showError();
        $result = $articleService->addArticle($articleModule);
        if ($result) {
            $jumpUrl = $addnewpage ? $basename . "q=post&action=edit&id=" . $result . "&page=add" : $basename . "q=view&id=" . $result;
            $columnService = C::loadClass('columnservice');
            /* @var $columnService PW_ColumnService */
            $cname = $columnService->getColumnNameByCIds($cid);
            $weiboService = L::loadClass('weibo', 'sns');
            /* @var $weiboService PW_Weibo */
            $weiboContent = substrs(stripWindCode($weiboService->escapeStr($articleModule->descrip)), 125);
            //	print_r ($weiboContent);exit;
            $weiboExtra = array('title' => stripslashes($cms_subject), 'cid' => $cid, 'cname' => $cname);
            $weiboService->send($winduid, $weiboContent, 'cms', $result, $weiboExtra);
            $msg = defined('AJAX') ? "success\t" . urlRewrite($jumpUrl) : '添加文章成功!';
            refreshto($jumpUrl, $msg);
        } else {
            Showmsg('添加文章失败');
        }
    }
} elseif ($action == 'edit') {
    S::gp(array('id', 'page'));
    $articleModule = $articleService->getArticleModule($id);
    $userid = $articleModule->userId;
    if (!checkEditPurview($windid, $articleModule->columnId) && $userid != $winduid) {
        Showmsg('你没有权限编辑本栏目的文章');
    }
    if (!$step) {
        if (!$page) {
            $page = 1;
コード例 #4
0
ファイル: register.php プロジェクト: jechiy/PHPWind
        }
    } elseif ($option == '4') {
        //精彩推荐
        $rg_recommendcontent = pwHtmlspecialchars_decode($rg_config['rg_recommendcontent']);
        //可能感兴趣的内容~最新图酷帖->最新帖
        $threadsService = L::loadClass('threads', 'forum');
        /* @var $threadsService PW_Threads */
        $latestImageThreads = $threadsService->getLatestImageThreads(7);
        foreach ($latestImageThreads as $k => $v) {
            //$recommendContent['attachurl'] =
            $a_url = geturl($v['attachurl'], 'show', 1);
            $latestImageThreads[$k]['subject'] = substrs($v[subject], 12);
            $latestImageThreads[$k]['thumb'] = getMiniUrl($v['attachurl'], $v['ifthumb'], $a_url[1]);
            //url
            $latestImageThreads[$k]['url'] = "read.php?tid={$v['tid']}";
            $db_htmifopen && ($latestImageThreads[$k]['url'] = urlRewrite($latestImageThreads[$k]['url']));
            //thumb
            !$latestImageThreads[$k]['thumb'] && ($latestImageThreads[$k]['thumb'] = 'images/defaultactive.jpg');
        }
    }
    require_once PrintEot('register');
    footer();
} elseif ($step == 'permit') {
    if (isset($_GET['ajax'])) {
        define('AJAX', '1');
    }
    require_once PrintEot('register');
    ajax_footer();
} else {
    Showmsg('undefined_action');
}
コード例 #5
0
 function _getSubjectUrl($tid)
 {
     global $db_bbsurl;
     $temp = 'read.php?tid=' . $tid;
     return $db_bbsurl . '/' . urlRewrite($temp);
 }
コード例 #6
0
 /**
  * 格式化数据统一输出
  * @param array $data
  * @return array
  */
 function _cookData($data)
 {
     global $db_bbsurl;
     $data['author'] = $data['username'];
     $data['authorurl'] = 'u.php?uid=' . $data['userid'];
     $data['url'] = urlRewrite($db_bbsurl . '/' . getArticleUrl($data['article_id']));
     $data['title'] = strip_tags($data['subject']);
     $data['forumname'] = $data['columnname'] = $this->_getColumnName($data['column_id']);
     $data['forumurl'] = $data['columnurl'] = getColumnUrl($data['column_id']);
     $data['postdate'] = strtotime($data['postdate']);
     return $data;
 }
コード例 #7
0
ファイル: function_common.php プロジェクト: nymbian/codelib
function Htm_cv($url, $tag)
{
    echo urlRewrite($url);
    return stripslashes($tag) . urlRewrite($url) . '"';
}
コード例 #8
0
ファイル: collection.class.php プロジェクト: jechiy/PHPWind
 function findByUidAndTypeInPage($uid, $type, $page = 1, $perpage = 20, $ftype = null)
 {
     if (!$uid || !$type) {
         return false;
     }
     $page = (int) $page;
     $perpage = (int) $perpage;
     if ($page <= 0 || $perpage <= 0) {
         return array();
     }
     $offset = ($page - 1) * $perpage;
     $collectionDB = $this->_getCollectionDB();
     $tmpDate = $result = array();
     $tmpDate = $collectionDB->findByUidAndType($uid, $type, $offset, $perpage, $ftype);
     $weiboService = L::loadClass('weibo', 'sns');
     /* @var $weiboService PW_Weibo */
     foreach ($tmpDate as $key => $temp) {
         $temp['content'] = unserialize($temp['content']);
         $temp['type'] == 'postfavor' && ($temp['content']['link'] = urlRewrite($temp['content']['link']));
         if (strpos($temp['content']['link'], '{#APPS_BASEURL#}') !== false) {
             $temp['content']['link'] = str_replace('{#APPS_BASEURL#}', 'apps.php?', $temp['content']['link']);
         }
         //$temp['title']	= ($temp['type'] == 'postfavor') ? getLangInfo('app','collection_postfavor_name',array('type'		=> getLangInfo('app',$temp['type']),'postdate'	=> get_date($temp['content']['lastpost']),)) : getLangInfo('app','collection_type_name',array('type'		=> getLangInfo('app',$temp['type']),'postdate'	=> get_date($temp['postdate']),));
         $temp['title'] = getLangInfo('app', 'collection_type_name', array('type' => getLangInfo('app', $temp['type']), 'postdate' => get_date($temp['postdate'])));
         $result[] = $temp;
     }
     return $result;
 }
コード例 #9
0
 function init($id)
 {
     global $cyid;
     $this->_tid = $id;
     $pw_tmsgs = GetTtable($this->_tid);
     $topicDB = $this->_db->get_one("SELECT t.tid,t.subject,t.anonymous,t.ifshield,t.authorid,t.author,t.postdate,tm.content FROM pw_threads t LEFT JOIN {$pw_tmsgs} tm ON t.tid=tm.tid WHERE t.tid=" . S::sqlEscape($this->_tid));
     if (!$topicDB) {
         return false;
     }
     $uid = $topicDB['authorid'];
     $username = $topicDB['anonymous'] == 1 ? $db_anonymousname : $topicDB['author'];
     $descrip = $topicDB['subject'];
     $this->_url = !$cyid ? $this->_url . $this->_tid : $GLOBALS['db_bbsurl'] . "/apps.php?q=group&a=read&cyid={$cyid}&tid=" . $this->_tid;
     $content = sprintf("[url=%s] %s [/url]", urlRewrite($this->_url), $topicDB['subject']);
     $title = $content;
     $mailSubject = getLangInfo('app', 'topic_recommend');
     $mailContent = getLangInfo('app', 'ajax_sendweibo_info', array('db_bbsurl' => $GLOBALS['db_bbsurl'], 'uid' => $uid, 'username' => $username, 'title' => $title, 'descrip' => substrs($descrip, 50)));
     if ($cyid) {
         require_once R_P . 'apps/groups/lib/colonys.class.php';
         $newColony = new PW_Colony();
         $colonyDB = $newColony->getColonyById($cyid);
         $cname = $colonyDB['cname'];
         $mailContent = getLangInfo('app', 'ajax_sendweibo_groupinfo', array('cname' => $cname, 'title' => $title, 'descrip' => substrs($descrip, 50)));
     }
     $this->_content = $content;
     $this->_mailSubject = $mailSubject;
     $this->_mailContent = $mailContent;
 }
コード例 #10
0
ファイル: global.php プロジェクト: sherlockhouse/aliyun
/**
 * 302跳转
 *
 * @param string $url
 */
function ObHeader($URL)
{
    global $db_obstart, $db_bbsurl, $db_htmifopen;
    if ($db_htmifopen && strtolower(substr($URL, 0, 4)) !== 'http') {
        $URL = urlRewrite($URL);
    }
    ob_end_clean();
    if (!$db_obstart) {
        ObStart();
        echo "<meta http-equiv='refresh' content='0;url={$URL}'>";
        exit;
    }
    header("Location: {$URL}");
    exit;
}