本文整理汇总了PHP中Item::setTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP Item::setTitle方法的具体用法?PHP Item::setTitle怎么用?PHP Item::setTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item::setTitle方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: autoMail
function autoMail()
{
global $database;
//$itemsArr = array();
$today = date("Y-m-d");
$this->query = "select * from items where BidEndOn ='{$today}' AND highest_bid!=0";
$result = mysql_query($this->query);
while ($row = mysql_fetch_array($result)) {
$item = new Item();
$item->setItemId($row["ItemID"]);
$item->setTitle($row["Title"]);
$item->setMinPrice($row["min_price"]);
$item->setCategory($row["Category"]);
$item->setOwnerId($row["OwnerID"]);
$ad = date("Y-m-d H:i:s", strtotime($row['addedOn']));
$item->setHighestBid($row["highest_bid"]);
$item->setAddedOn($ad);
$item->setBiddingEndOn($row["BidEndOn"]);
$item->setDesc($row["Description"]);
$item->setStatus($row["Status"]);
$this->query = "SELECT PicDate,PicPath FROM itempics WHERE OwnId = " . $item->ownerId . " AND PicDate = '" . $ad . "'";
$res = mysql_query($this->query);
$r = mysql_fetch_array($res);
$item->setPicPath($r['PicPath']);
$this->query = "select email from user where UserID={$item->ownerId}";
$res = mysql_query($this->query);
$r = mysql_fetch_row($res);
$OwnerEmail = $r[0];
$this->query = "select bids.BidderID from items INNER JOIN bids ON items.highest_bid=bids.amount where items.ItemID ={$item->itemId}";
$res = mysql_query($this->query);
$r = mysql_fetch_row($res);
$bidderId = $r[0];
$this->query = "select email from user where UserID={$bidderId}";
$res = mysql_query($this->query);
$r = mysql_fetch_row($res);
$WinnerEmail = $r[0];
echo "\nOwner email:" . $OwnerEmail . "\n";
echo "\nWinner email:" . $WinnerEmail . "\n";
$this->query = "update account set balance=balance+{$item->highestBid} where UserID={$item->ownerId}";
mysql_query($this->query);
$this->query = "delete from bids where ItemID={$item->itemId}";
mysql_query($this->query);
$this->query = "update items set OwnerId ={$bidderId}, status='sold' where ItemID={$item->itemId}";
mysql_query($this->query);
$this->query = "insert into WonItems (winnerId,ownerId) values ({$bidderId}, {$item->ownerId} )";
mailForOwner($OwnerEmail, $item);
mailForWinner($WinnerEmail, $item);
}
}
示例2: arrayToMenuItem
private static function arrayToMenuItem($pages, $depth, $curDepth, $order)
{
$items = array();
foreach ($pages as $pageRow) {
$page = new \Ip\Page($pageRow['id']);
$item = new Item();
$subSelected = false;
if ($curDepth < $depth) {
$children = ipDb()->selectAll('page', '*', array('parentId' => $page->getId(), 'isVisible' => 1, 'isSecured' => 0, 'isDeleted' => 0), "ORDER BY {$order}");
if ($children) {
$childrenItems = self::arrayToMenuItem($children, $depth, $curDepth + 1, $order);
$item->setChildren($childrenItems);
}
}
if ($page->isCurrent() || $page->getRedirectUrl() && $page->getLink() == \Ip\Internal\UrlHelper::getCurrentUrl()) {
$item->markAsCurrent(true);
} elseif ($page->isInCurrentBreadcrumb() || $subSelected || $page->getRedirectUrl() && self::existInBreadcrumb($page->getLink())) {
$item->markAsInCurrentBreadcrumb(true);
}
if ($page->isDisabled()) {
$item->setUrl('');
} elseif ($page->getRedirectUrl()) {
$url = $page->getRedirectUrl();
if (!preg_match('/^((http|https):\\/\\/)/i', $url)) {
$url = 'http://' . $url;
}
$item->setUrl($url);
} else {
$item->setUrl($page->getLink());
}
$metaTitle = $page->getMetaTitle();
$item->setBlank($page->isBlank());
$item->setTitle($page->getTitle());
$item->setDepth($curDepth);
$item->setDisabled($page->isDisabled());
$item->setId($page->getId());
$item->setAlias($page->getAlias());
$item->setPageTitle(empty($metaTitle) ? $page->getTitle() : $metaTitle);
$items[] = $item;
}
return $items;
}
示例3: getItem
function getItem($id)
{
global $database;
$item = new Item();
$this->query = "select * from items where ItemID='{$id}'";
$result = mysql_query($this->query);
if (mysql_num_rows($result) > 0) {
$row = mysql_fetch_row($result);
$item->setItemId($row[0]);
$item->setTitle($row[1]);
$item->setMinPrice($row[2]);
$item->setHighestBid($row[3]);
$item->setCategory($row[4]);
$item->setOwnerId($row[5]);
$item->setAddedOn($row[6]);
$item->setBiddingEndOn($row[7]);
$item->setDesc($row[8]);
$item->setStatus($row[9]);
}
return $item;
}
示例4: scrapeHtml
function scrapeHtml()
{
$url = "http://nivent.nicovideo.jp/";
$items = array();
$html = file_get_html($url);
foreach ($html->find('div[id=list] div[class=box clearfix]') as $key => $html_item) {
//データの元
//var_dump($html_item);
$title = $html_item->find('div[class=infoUpper] strong a');
$link = $html_item->find('div[class=infoUpper] strong a');
$description = $html_item->find('div[class=infoLower] p[class=body]');
$thumbnail = $html->find('div[class=thumb] img');
//var_dump($link);
//アイテムを格納
$item = new Item();
$item->setTitle($title[0]->innertext);
$item->setLink("http://nivent.nicovideo.jp" . $link[0]->href);
$item->setDescription(createImgTag($thumbnail[$key]->src) . $description[0]->innertext);
$items[] = $item;
}
return $items;
}
示例5: testSetTitle
public function testSetTitle()
{
$item = new Item();
$item->setTitle('<a>my link</li>');
$this->assertEquals('my link', $item->getTitle());
$this->assertContains('title', $item->getUpdatedFields());
}
示例6: while
post_author_email,
post_author_name,
post_date,
post_source_uri,
post_source_name,
post_category,
category_id,
category_name
FROM post
LEFT JOIN category ON category_id = post_category_id
WHERE post_valid=1
LIMIT 10');
while ($row = mysql_fetch_object($request)) {
// Creating a new feed item
$rssItem = new Item();
$rssItem->setTitle($row->post_title);
$rssItem->setDescription($row->post_description);
$rssItem->setLink('http://www.mywebsite.com/blog/post.php?id=' . $row->post_id);
$rssItem->setGuid('http://www.mywebsite.com/blog/post.php?id=' . $row->post_id, true);
$rssItem->setComments('http://www.mywebsite.com/blog/post.php?id=' . $row->post_id . '#comments');
$rssItem->setAuthor($row->post_author_email, $row->post_author_name);
$rssItem->setPubDate($row->post_date);
$rssItem->setSource($row->post_source_uri, $row->post_source_name);
$rssItem->setEnclosure('http://www.mywebsite.com/blog/images/nopicture.jpg', 2800, 'image/jpg');
$rssItem->setCategory('http://www.mywebsite.com/blog/category.php.idCat=' . $row->category_id, $row->category_name);
// Add the item to the feed
$rssFeed->appendItem($rssItem);
}
// Save the feed
$rssFeed->save();
// SQL connection closing
示例7: Item
<?php
session_start();
require_once 'Logic/ItemLogic.php';
$title = $_POST['title'];
$minPrice = $_POST['minPrice'];
$category = $_POST['category'];
$Enddate = $_POST['inputDate'];
$desc = $_POST['desc'];
$item = new Item();
$item->setTitle($title);
$item->setMinPrice($minPrice);
$item->setCategory($category);
$item->setBiddingEndOn($Enddate);
$item->setDesc($desc);
$item->setOwnerId($_SESSION['user']);
//($_SESSION['user']);
$item->setStatus("available");
$itemLogic = new ItemLogic();
$itemLogic->insertItem($item);
?>
<script type="text/javascript">
</script>
<div class="c">
<form id="abc" method="post">
<div id="file-uploader-demo1">
<noscript>
<p>Please enable JavaScript to use file uploader.</p>
示例8: testSetTitle
/**
* @covers Debril\RssAtomBundle\Protocol\Parser\Item::setTitle
*
* @todo Implement testSetTitle().
*/
public function testSetTitle()
{
$newTitle = 'A brand new title';
$this->object->setTitle($newTitle);
$this->assertEquals($newTitle, $this->object->getTitle());
}
示例9: getPostedItems
function getPostedItems($id)
{
global $database;
$itemsArr = array();
$this->query = "select * from items where ownerid={$id}";
$result = mysql_query($this->query);
if ($result) {
while ($row = mysql_fetch_array($result)) {
$item = new Item();
$item->setItemId($row["ItemID"]);
$item->setTitle($row["Title"]);
$item->setMinPrice($row["min_price"]);
$item->setCategory($row["Category"]);
$item->setOwnerId($row["OwnerID"]);
$ad = date("Y-m-d H:i:s", strtotime($row['addedOn']));
$item->setHighestBid($row["highest_bid"]);
$item->setAddedOn($ad);
$item->setBiddingEndOn($row["BidEndOn"]);
$item->setDesc($row["Description"]);
$item->setStatus($row["Status"]);
$this->query = "SELECT PicDate,PicPath FROM itempics WHERE OwnId = " . $item->ownerId . " AND PicDate = '" . $ad . "'";
$res = mysql_query($this->query);
$r = mysql_fetch_array($res);
$item->setPicPath($r['PicPath']);
array_push($itemsArr, $item);
}
return $itemsArr;
}
}
示例10: testComputeFingerPrint
public function testComputeFingerPrint()
{
$title = 'a';
$body = 'b';
$url = 'http://google.com';
$link = 'ho';
$item = new Item();
$item->setBody($body);
$item->setTitle($title);
$item->setUrl($url);
$item->setEnclosureLink($link);
$item->generateSearchIndex();
$this->assertEquals(md5($title . $url . $body . $link), $item->getFingerprint());
}