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

PHP content类代码示例

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

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



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

示例1: httpResponseContentIs

 function httpResponseContentIs(content $content)
 {
     $response = clone $this;
     $response->content = $content;
     $content->recipientOfStringLengthIs($response);
     return self::blackholeContentLengthHttpHeaderShouldBeUsedBy($response->httpHeaderIs($response->contentLength));
 }
开发者ID:estvoyage,项目名称:risingsun,代码行数:7,代码来源:http.php


示例2: addaction

 public function addaction()
 {
     $c = new content();
     if ($this->input->post("id") !== FALSE) {
         $c->get_by_id($this->input->post("id"));
     } else {
         if ($this->input->post("id") === FALSE) {
             $c->user = $this->ion_auth->get_user();
             $c->user = $c->user->id;
         }
     }
     $c->parent_section = $this->input->post("parent_section");
     $c->parent_content = $this->input->post("parent_content");
     $c->title = $this->input->post("title");
     $c->cell = $this->input->post("cell");
     $c->sort = $this->input->post("sort");
     $c->path = $this->input->post("path");
     $c->type = $this->input->post("type");
     $c->subsection = $this->input->post("subsection") == FALSE ? FALSE : TRUE;
     $c->view = $this->input->post("view");
     $c->info = $this->input->post("info");
     $c->filter = $this->input->post("filter");
     // this is a workaround, cuz it makes 2 newline characters
     // and i don't know what the hell is wrong with it.
     $c->filter = str_replace("\n\n", "\n", $c->filter);
     $p = new Content($c->parent_content);
     if ($this->input->post("id") === FALSE) {
         $this->add_info(lang('system_content_added'));
     } else {
         $this->ajax = TRUE;
         $this->print_text(lang('system_content_edited'));
     }
     $c->save();
 }
开发者ID:kabircse,项目名称:Codeigniter-Egypt,代码行数:34,代码来源:editor.php


示例3: get_rss

function get_rss()
{
    global $aa;
    require_once e_PLUGIN . "content/handlers/content_class.php";
    $aa = new content();
    $rss = array();
    $array = $aa->getCategoryTree('', '', FALSE);
    foreach ($array as $k => $v) {
        $name = '';
        for ($i = 0; $i < count($array[$k]); $i++) {
            $name .= $array[$k][$i + 1] . " > ";
            $i++;
        }
        $name = substr($name, 0, -3);
        $feed['name'] = $name;
        $feed['url'] = 'content';
        //the identifier for the rss feed url
        $feed['topic_id'] = $k;
        //the topic_id, empty on default (to select a certain category)
        $feed['path'] = 'content';
        //this is the plugin path location
        $feed['text'] = 'this is the rss feed for content category : ' . $name;
        $feed['class'] = '0';
        $feed['limit'] = '9';
        $rss[] = $feed;
    }
    return $rss;
}
开发者ID:Jimmi08,项目名称:content,代码行数:28,代码来源:e_rss.php


示例4: build

 function build($action = 'TopStories', $mode = 'rss')
 {
     require_once PATH_CORE . '/classes/content.class.php';
     $cObj = new content($this->db);
     // if $mode is rss, then echo the output
     // if $mode is api, then return the query
     switch ($action) {
         default:
             // do nothing
             break;
         case 'TopStories':
             $this->feedTitle = SITE_TITLE . ' Top Stories';
             $this->feedDescription = ' Top rated stories from ' . SITE_TITLE;
             $this->feedUrl = $this->baseUrl;
             $this->feedRssUrl = $this->baseUrl . '?p=rss&action=TopStories';
             $query = $cObj->fetchUpcomingStories('', RSS_NUMBER_STORIES);
             break;
     }
     // output the xml feed
     if ($mode == 'rss') {
         $code = $this->createXML($this->feedTitle, $this->feedUrl, $this->feedRssUrl, $this->feedDescription, $query);
         return $code;
     } else {
         return $query;
     }
 }
开发者ID:smbale,项目名称:open-social-media-toolkit,代码行数:26,代码来源:rss.class.php


示例5: postNextTopStory

 function postNextTopStory()
 {
     // only post one story every three hours
     $tstamp = $this->statusObj->getState('lastTwitterPost');
     if (!isset($_GET['test']) and time() - $tstamp < 60 * TWITTER_INTERVAL_MINUTES) {
         return;
     }
     //echo 'continuing';
     require_once PATH_CORE . '/classes/content.class.php';
     $cObj = new content($this->db);
     require_once PATH_CORE . '/classes/log.class.php';
     $logObj = new log($this->db);
     $topStories = $cObj->fetchUpcomingStories();
     $uid = 1;
     while ($data = $this->db->readQ($topStories)) {
         if (!$this->checkLog($uid, $data->siteContentId) and $data->score >= TWITTER_SCORE_THRESHOLD) {
             // post to twitter
             $result = $this->update($data->siteContentId, $data->title);
             if ($result) {
                 $logItem = $logObj->serialize(0, $uid, 'postTwitter', $data->siteContentId);
                 $logObj->add($logItem);
                 $this->statusObj->setState('lastTwitterPost', time());
             }
             // only do one at a time
             return;
         }
     }
 }
开发者ID:smbale,项目名称:open-social-media-toolkit,代码行数:28,代码来源:twitter.class.php


示例6: create

 function create()
 {
     $avatar = $this->attachlib->get_avatar($this->user['user_id']);
     $content = $this->input['thread'];
     $topic_id = $this->input['tid'];
     $pcd = intval($this->input['pcd']);
     $aid = urldecode($this->input['aid']);
     if ($aid) {
         $aid_array = array_filter(explode(',', $aid));
         $aid = $this->attachlib->tmp2att($aid_array);
     }
     if ($pcd) {
         $c = new content();
         $article = $c->get_published_content_byid($pcd);
         if ($article) {
             $extend_arc = array('title' => $article['title'], 'brief' => $article['brief'], 'href' => $article['content_url'], 'bundle_id' => $article['bundle_id'], 'module_id' => $article['module_id']);
             $article = is_array($article['indexpic']) ? array('host' => $article['indexpic']['host'], 'dir' => $article['indexpic']['dir'], 'filepath' => $article['indexpic']['filepath'], 'filename' => $article['indexpic']['filename']) : array();
             $aid .= ',' . $this->attachlib->attach($article, 'publish', 'attach', $extend_arc);
         }
     }
     if (!$topic_id) {
         $this->errorOutput("请选择一个话题");
     }
     $short_link = $this->attachlib->outlink(urldecode($this->input['outlink']));
     if ($short_link) {
         $aid .= ',' . $short_link;
     }
     $location = array('lat' => $this->input['lat'], 'lon' => $this->input['lon'], 'address' => urldecode($this->input['address']), 'gpsx' => $this->input['gpsx'], 'gpsy' => $this->input['gpsy']);
     if ($location['lat'] && $location['lon']) {
         $loc = FromBaiduToGpsXY($location['lon'], $location['lat']);
         $location['gpsx'] = $loc['x'];
         $location['gpsy'] = $loc['y'];
     } elseif ($location['gpsx'] && $location['gpsy']) {
         $loc = FromGpsToBaiduXY($location['gpsx'], $location['gpsy']);
         $location['lon'] = $loc['x'];
         $location['lat'] = $loc['y'];
     }
     if ($map = $this->attachlib->map($location)) {
         $aid .= ',' . $map;
     }
     if (!$content && !$aid) {
         $this->errorOutput("内容不能为空");
     }
     $aid = $aid ? trim($aid, ',') : '';
     $data = array('tid' => $topic_id, 'content' => $content, 'aid' => $aid, 'client' => $this->input['client'] ? $this->input['client'] : $this->user['user_name'], 'status' => 0, 'create_time' => TIMENOW, 'user_id' => $this->user['user_id'], 'avatar' => $avatar ? addslashes(serialize($avatar)) : '', 'user_name' => $this->user['user_name'], 'pcd' => $pcd, 'ip' => hg_getip());
     $sql = 'INSERT INTO ' . DB_PREFIX . 'thread SET ';
     foreach ($data as $key => $val) {
         $sql .= "`{$key}` = \"{$val}\",";
     }
     $sql = trim($sql, ',');
     $this->db->query($sql);
     $data['id'] = $this->db->insert_id();
     $data['format_create_time'] = hg_tran_time($data['create_time']);
     $data['materail'] = $this->attachlib->get_attach_by_aid($aid);
     $this->attachlib->delete_attach(urldecode($this->input['aid']));
     $this->addItem($data);
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:58,代码来源:thread_update.php


示例7: site

 function site()
 {
     $c = new content();
     $data = $c->get_site();
     if ($data) {
         foreach ($data as $val) {
             $this->addItem($val);
         }
     }
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:11,代码来源:published_content.php


示例8: submitAction

 /**
  * @param Request $request
  * @param Request $securekey
  * @param Request $redirect
  * @return \Symfony\Component\HttpFoundation\RedirectResponse|\Symfony\Component\HttpFoundation\Response
  */
 public function submitAction(Request $request, $securekey, $redirect)
 {
     $locale = $request->getLocale();
     $mode = "module-submission";
     $em = $this->getDoctrine()->getManager();
     $cs = $this->get('ssone.cms.content');
     $fieldsRepository = $this->getFieldsRepository();
     $blockService = $this->get('ssone.cms.block');
     $contentType = $this->getDoctrine()->getRepository('SSoneCMSBundle:ContentType')->findBySecurekey($securekey);
     $content = new content();
     $content->setContentType($contentType);
     $blockService->contentBlockManager($content);
     $form = $this->createForm(new ContentTYPE($mode, $fieldsRepository, $cs, $locale), $content);
     $form->handleRequest($request);
     print $contentType->getName();
     print $form->isValid();
     if ($form->isValid()) {
         $auditor = $this->get('ssone.cms.recordauditor');
         $auditor->auditRecord($content);
         //Audit blocks and fields
         foreach ($content->getBlocks() as $block) {
             $auditor->auditRecord($block);
             foreach ($block->getBlockFields() as $blockField) {
                 $auditor->auditRecord($blockField);
             }
         }
         //handle file uploads
         $uploader = $this->get('ssone.cms.fileuploader');
         foreach ($form['blocks'] as $block) {
             foreach ($block['blockFields'] as $blockField) {
                 foreach ($blockField['fieldContent'] as $input) {
                     if (strpos($input->getName(), '_fileupload') !== false) {
                         $params = explode("_", $input->getName());
                         $fieldSettings = $fieldsRepository->findBySecurekey($params[2])->getFieldTypeSettings();
                         if ($fp = $uploader->contentFileUpload($input->getData(), $fieldSettings['fileupload']['fileuploadfolder'])) {
                             //Get current field content
                             $blockFieldObj = $blockField->getData();
                             $blockFieldContents = $blockFieldObj->getFieldContent();
                             $blockFieldContents[$params[0]] = $fp;
                             unset($blockFieldContents[$input->getName()]);
                             $blockFieldObj->setFieldContent($blockFieldContents);
                         }
                     }
                 }
             }
         }
         $em->persist($content);
         $em->flush();
         $storedContent = $cs->findSecureKeyById($content->getId());
         $this->cacheContent($content->getId(), $cs, $em);
         return $this->redirect($this->generateUrl('ssone_cms_frontend', array('uri' => $redirect)));
     }
     return $this->render('SSoneCMSBundle:Content:crud.html.twig', array('form' => $form->createView(), 'contentTitle' => $content->getName(), 'mode' => $mode, 'locale' => $locale));
 }
开发者ID:ssone,项目名称:cms-bundle,代码行数:60,代码来源:ModuleContentSubmissionController.php


示例9: get_campaigns

 function get_campaigns()
 {
     $campaigns = content::get_all_campaigns();
     foreach ($campaigns as $campaign) {
         if ($campaign['force_deactivated'] == 'no' && strtotime($campaign['end']) > time()) {
             $get = content::fetch_tweets_from_twitter($campaign['campaign_hash']);
         }
     }
 }
开发者ID:AshleyJSheridan,项目名称:tweed,代码行数:9,代码来源:main_controller.php


示例10: loadFile

 static function loadFile($file, $vars = array(), $return = false)
 {
     if (!file_exists($file)) {
         return false;
     }
     @extract(self::$vars);
     @extract($vars);
     content::start();
     require $file;
     return content::end($return);
 }
开发者ID:narrenfrei,项目名称:kirbycms,代码行数:11,代码来源:template.php


示例11: status

 function status()
 {
     $sql = e107::getDb();
     $aa = new content();
     if ($maincat = $sql->retrieve("pcontent", "content_id, content_heading", " WHERE  content_parent  = '0' ORDER BY content_heading", true)) {
         $i = 0;
         foreach ($maincat as $row) {
             $count = 0;
             $array = $aa->getCategoryTree("", $row['content_id'], TRUE);
             $validparent = implode(",", array_keys($array));
             $qrycat = " content_parent REGEXP '" . $aa->CONTENTREGEXP($validparent) . "' ";
             $count = $sql->count("pcontent", "(*)", "WHERE " . $qrycat . "  AND content_refer != 'sa' ");
             $var[$i]['icon'] = "<img src='" . e_PLUGIN_ABS . "content/images/content_16.png' style='width: 16px; height: 16px; vertical-align: bottom' alt='' /> ";
             $var[$i]['title'] = $row['content_heading'];
             $var[$i]['url'] = e_PLUGIN . "content/admin_content_config.php?content." . $row['content_id'];
             $var[$i]['total'] = $count;
             $i = $i + 1;
         }
     }
     return $var;
 }
开发者ID:Jimmi08,项目名称:content,代码行数:21,代码来源:e_dashboard.php


示例12: load

 function load($template = 'default', $vars = array(), $return = false)
 {
     $file = c::get('tpl.root') . '/' . $template . '.php';
     if (!file_exists($file)) {
         return false;
     }
     @extract(self::$vars);
     @extract($vars);
     content::start();
     require $file;
     return content::end($return);
 }
开发者ID:o-github-o,项目名称:jQuery-Ajax-Upload,代码行数:12,代码来源:template.php


示例13: createTempContent

 function createTempContent($userinfo = NULL, $wireid = 0)
 {
     require_once PATH_CORE . '/classes/content.class.php';
     $cObj = new content($this->db);
     $info = $this->getWireStory($wireid);
     require_once PATH_CORE . '/classes/parseStory.class.php';
     $psObj = new parseStory();
     require_once PATH_CORE . '/classes/utilities.class.php';
     $this->utilObj = new utilities($this->db);
     $info->title = stripslashes($info->title);
     $info->caption = stripslashes($this->utilObj->shorten($info->caption));
     // to do - replace proxy feed urls with final redirect
     $info->title = $psObj->cleanTitle($info->title);
     // create permalink
     $info->permalink = $cObj->buildPermalink($info->title);
     // serialize the content
     $info->title = mysql_real_escape_string($info->title);
     $info->caption = mysql_real_escape_string($info->caption);
     $story = $cObj->serialize(0, $info->title, $info->caption, $info->source, $info->url, $info->permalink, $userinfo->ncUid, $userinfo->name, $userinfo->userid, '', $userinfo->votePower, 0, 0);
     // post wire story to content
     $siteContentId = $cObj->add($story);
     return $siteContentId;
 }
开发者ID:smbale,项目名称:open-social-media-toolkit,代码行数:23,代码来源:newswire.class.php


示例14: home

function home()
{
    $out = "there is actually no content. enable content module to manage this page";
    if (module_manager::is_enabled("content")) {
        $out = "";
        $nodes = content_database::node_load_all();
        $b = false;
        if (count($nodes) > 0) {
            page::title("Home");
            foreach ($nodes as $node) {
                if (content::node_access_read($node->nid)) {
                    $b = true;
                    $out .= "<div class='post'>";
                    if ($node->title != null) {
                        $out .= "<div class='title'>";
                        $out .= page::link("node/" . $node->nid, $node->title);
                        $out .= "</div>";
                    }
                    if ($node->description != null) {
                        $out .= "<div class='content'>";
                        $node->description = utf8_decode($node->description);
                        if (strlen($node->description) > 200) {
                            $out .= substr($node->description, 0, 200) . "... " . page::link("node/" . $node->nid, t("+ read more"));
                        } else {
                            $out .= $node->description;
                        }
                        $out .= "</div>";
                    }
                    $out .= "<div class='author'>";
                    $out .= "<hr/>";
                    $out .= content_page::post_author_date($node->uid, $node->author, $node->date);
                    $out .= "<hr/>";
                    $out .= "</div>";
                    $out .= "</div>";
                }
            }
        } else {
            $out .= "there is no content, please add a content first.";
        }
    }
    return $b ? $out : "there is no content.";
}
开发者ID:decima,项目名称:M2-platine,代码行数:42,代码来源:home.php


示例15:

if (!empty($_GET['delete']) && $_GET['delete'] == 1) {
    $content_id = $_GET['header_id'];
    $result = content::delete($content_id);
    if ($result == 1) {
        echo 'Comment is deleted!';
    } else {
        return false;
    }
}
?>
 </div></div>

<div id="json_drop_column">
 <?php 
if (!empty($_GET['delete']) && $_GET['delete'] == 1) {
    $content_name = $_GET['content_name'];
    $field_name = $_GET['field_name'];
    $result = content::drop_column($content_name, $field_name);
    if ($result == 1) {
        echo 'Comment is deleted!';
    } else {
        return false;
    }
}
?>
</div>



<?php 
include_template('footer.inc');
开发者ID:moxymokaya,项目名称:inoERP,代码行数:31,代码来源:json.content.php


示例16: getRelatedSeriesJson

/**
* 
* @param
* @return
*/
function getRelatedSeriesJson($sid)
{
    $seriesvideos = content::getCompleteSeries($sid);
    $count = count($seriesvideos);
    $json = array();
    for ($i = 0; $i < $count; $i++) {
        $obj = new video($seriesvideos[$i]);
        array_push($json, array('cid' => $obj->getContentId(), 'title' => $obj->getTitle(), 'viewcount' => $obj->getViewCount(), 'poster' => $obj->getPoster(), 'timestamp' => $obj->getTimestamp(), 'uid' => $obj->getUserId(), 'uname' => user::getFullNameS($obj->getUserId())));
    }
    return json_encode($json);
}
开发者ID:rahulrvp,项目名称:Paathshaala,代码行数:16,代码来源:interface.php


示例17: parse_ini_file

//include_once(dirname(__FILE__).'/lib/Curl.class.inc');
$source = parse_ini_file(dirname(__FILE__) . '/source.ini', true);
$fbapi = 'http://graph.facebook.com/?id=';
//$twapi    = 'http://urls.api.twitter.com/1/urls/count.json?url=';
$blogs = array();
$unique = array();
// データの取得
foreach ($source as $v) {
    $url = $v['url'];
    $rss = fetch_rss($url);
    if (!$rss) {
        var_dump($v);
        continue;
    }
    foreach ($rss->items as $content) {
        $cc = new content($content);
        // 24時間以内のデータのみ
        if ($cc->getDate() < time() - 24 * 60 * 60) {
            continue;
        }
        // urlの重複を避ける
        if (!$cc->getLink() || in_array($cc->getLink(), $unique)) {
            continue;
        }
        $unique[] = $cc->getLink();
        $tmp = $cc->getAll();
        if (isset($v['tag'])) {
            $tmp['tag'] = $v['tag'];
        }
        $blogs[] = $tmp;
    }
开发者ID:sa2ryu,项目名称:news,代码行数:31,代码来源:cron.php


示例18: content

        $content = new content();
        $content_data = $content->get($dbs, $path);
        if ($content_data) {
            $page_title = $content_data['Title'];
            echo $content_data['Content'];
            unset($content_data);
        } else {
            header("location:index.php");
        }
    }
} else {
    $metadata = '<meta name="robots" content="index, follow">';
    // homepage header info
    if (!isset($_GET['p'])) {
        if (!isset($_GET['keywords']) and !isset($_GET['page']) and !isset($_GET['title']) and !isset($_GET['author']) and !isset($_GET['subject']) and !isset($_GET['location'])) {
            // get content data from database
            include LIB_DIR . 'content.inc.php';
            $content = new content();
            $content_data = $content->get($dbs, 'headerinfo');
            if ($content_data) {
                //$header_info .= '<div id="headerInfo">'.$content_data['Content'].'</div>';
                unset($content_data);
            }
        }
    }
    include LIB_DIR . 'contents/default.inc.php';
}
// main content grab
$main_content = ob_get_clean();
// template output
require $sysconf['template']['dir'] . '/' . $sysconf['template']['theme'] . '/index_template.inc.php';
开发者ID:indonesia,项目名称:slims5_meranti,代码行数:31,代码来源:index.php


示例19: delete

 static function delete($reid)
 {
     //限制权限
     return content::delete($reid);
 }
开发者ID:acsiiii,项目名称:leeeframework,代码行数:5,代码来源:cont.php


示例20: content

<?php

if (!defined('e107_INIT')) {
    exit;
}
if (!isset($pref['plug_installed']['content'])) {
    return;
}
require_once e_PLUGIN . 'content/handlers/content_class.php';
$aa = new content();
$datequery = " AND content_datestamp < " . time() . " AND (content_enddate=0 || content_enddate>" . time() . ") ";
global $contentmode;
//contentmode : content_144 (content_ + idvalue)
if ($contentmode) {
    $headingquery = " AND content_id = '" . substr($contentmode, 8) . "' ";
} else {
    $headingquery = "";
}
//get main parent types
$sqlm = new db();
if (!($mainparents = $sqlm->db_Select("pcontent", "*", "content_class REGEXP '" . e_CLASS_REGEXP . "' AND content_parent = '0' " . $datequery . " " . $headingquery . " ORDER BY content_heading"))) {
    $LIST_DATA = "no valid content category";
    return;
}
while ($rowm = $sqlm->db_Fetch()) {
    $ICON = "";
    $HEADING = "";
    $AUTHOR = "";
    $CATEGORY = "";
    $DATE = "";
    $INFO = "";
开发者ID:Jimmi08,项目名称:content,代码行数:31,代码来源:e_list.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP content_object类代码示例发布时间:2022-05-23
下一篇:
PHP connector类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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