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


PHP shortenText函数代码示例

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


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

示例1: mysql_query

            <input type=hidden name="confirmLandingURL" value="http://neobuxultimatestrategy.com/redirect.php?url=basics">
            </form>
            
            <br />
            <span class="note">We hate spam and will never sell your email address to others. </span>
        </td>
    </tr>
    </table>
</div>	
</center>

<?php 
$selP = 'SELECT * FROM posts WHERE status <> "I" ORDER BY postedOn DESC LIMIT 10';
$resP = mysql_query($selP, $conn) or die(mysql_error());
while ($p = mysql_fetch_assoc($resP)) {
    $recentPosts .= '<p align="left"><a href="./?p=' . $p['url'] . '">' . shortenText($p['subject'], 35) . '</a></p>';
}
?>
	

<p>&nbsp;</p>
	 
</td>
<td width="20px"></td>
<td align="center" id="rightCol">
<br />
<center>
<div class="optin" id="optin">
    <table width="310px" cellpadding="0">
        <tr>
            <td align="center">
开发者ID:TheJadeEmperor,项目名称:NeobuxUltimateStrategy,代码行数:31,代码来源:blogFooter.php

示例2: getFeed

function getFeed($feed_url, $type)
{
    // Type: Movie(0), TV(1), Animated(2)
    $content = file_get_contents($feed_url);
    $x = new SimpleXmlElement($content);
    $token = new \Tmdb\ApiToken('1e5387b55fe12efeb19db53ea9ca88a1');
    $client = new \Tmdb\Client($token);
    if ($type != 1) {
        $all_genres = $client->getGenresApi()->getGenres();
        $all_genres_ids = array();
        foreach ($all_genres['genres'] as $genre) {
            array_push($all_genres_ids, $genre['id']);
        }
        $current_ids = array();
        foreach ($x->channel->item as $entry) {
            /* @@ Modification for TMDB API @@ */
            $movie_title = $entry->title;
            $title = modifyTitle($movie_title);
            $result = $client->getSearchApi()->searchMovies($title);
            $movie = array_values($result)[1][0];
            /* @@ Check if result is found from TMDB API @@ */
            if (count($movie) > 0) {
                if (!in_array(intval($movie['id']), $current_ids)) {
                    array_push($current_ids, intval($movie['id']));
                } else {
                    continue;
                }
                /* @@ Title @@ */
                $original_title = shortenText($movie['original_title'], 40);
                /* @@ Plot (overview) @@ */
                $plot = shortenText($movie['overview'], 285);
                /* @@ Release year @@ */
                $released_year = substr($movie['release_date'], 0, 4);
                /* @@ Release year @@ */
                $genres = $movie['genre_ids'];
                $genre_string = getGenreString($genres, $all_genres_ids, $all_genres);
                $poster_url = "http://image.tmdb.org/t/p/w500/" . $movie['poster_path'];
                $backdrop_url = "http://image.tmdb.org/t/p/w500" . $movie['backdrop_path'];
                $content_url = "https://www.themoviedb.org/movie/" . $movie['id'];
                renderTable($original_title, $plot, $released_year, $genre_string, $poster_url, $backdrop_url, $content_url, $entry->link);
            } else {
                if ($type != 2) {
                    // Teiknimyndir eru oft á íslensku og þ.a.l. ekki á TMDB
                    $plot = "Ekki fundust upplýsingar um þessa mynd.<br>Titill hennar gæti verið stafsettur vitlaust.<br>Einnig gæti verið að þetta sé sjónvarsþáttur.";
                    renderTable($entry->title, $plot, null, null, null, null, null, $entry->link);
                }
            }
        }
    } else {
        // TV SHOWS
        foreach ($x->channel->item as $entry) {
            $tv_show_title = $entry->title;
            $tv_show_title = modifyTvShowTitle($tv_show_title);
            $result = $client->getSearchApi()->searchTv($tv_show_title);
            $tv_show = array_values($result)[1][0];
            if (count($tv_show) > 0) {
                $tv_show_title = $tv_show['name'];
                $tv_show_title .= ' ' . getEpisodeNumber($entry->title);
                $plot = shortenText($tv_show['overview'], 300);
                $released_year = substr($tv_show['first_air_date'], 0, 4);
                $genres = $tv_show['genre_ids'];
                $genre_string = getGenreString($genres, $all_genres_ids, $all_genres);
                $poster_url = "http://image.tmdb.org/t/p/w500/" . $tv_show['poster_path'];
                $backdrop_url = "http://image.tmdb.org/t/p/w500" . $tv_show['backdrop_path'];
                $content_url = "https://www.themoviedb.org/tv/" . $tv_show['id'];
                renderTable($tv_show_title, $plot, $released_year, $genre_string, $poster_url, $backdrop_url, $content_url, $entry->link);
            }
        }
    }
}
开发者ID:gunnartorfis,项目名称:plex_requests,代码行数:70,代码来源:process_feed.php

示例3: printPosts

 public function printPosts()
 {
     $html = "<h1>Nyheter</h1>\n";
     foreach ($this->posts as $post) {
         $title = htmlentities($post->title, null, 'UTF-8');
         $data = CTextFilter::doAllFilters(htmlentities($post->data, null, 'UTF-8'));
         $slug = htmlentities($post->slug, null, 'UTF-8');
         $published = htmlentities($post->published, null, 'UTF-8');
         $updated = htmlentities($post->updated, null, 'UTF-8');
         $publishedBy = htmlentities($post->publishedBy, null, 'UTF-8');
         $updatedBy = htmlentities($post->updatedBy, null, 'UTF-8');
         $category = htmlentities($post->category, null, 'UTF-8');
         // Shorten text in "alla" view
         if ($this->longText) {
             $data = shortenText($data, "news.php?slug={$slug}");
         }
         if ($this->shot1) {
             $html .= CDatabaseHandle::createBreadcrumb('Nyheter', 'slug', $title);
             if ($this->longText) {
                 $html .= $this->getCategorys();
             }
             $this->shot1 = false;
         }
         $html .= "<section class='blog-post'>\n";
         $html .= "<article>\n";
         $html .= "<header>\n";
         $html .= "<h2>" . ($this->longText ? "<a href='news.php?slug={$slug}'>{$title}</a>" : "{$title} <a title='Tillbaka till alla poster' href='news.php'>&#8617;</a>") . "</h2>\n";
         $html .= "</header>\n";
         $html .= "<p class='cat'>Kategori: " . (empty($category) ? "<a href='news.php?cat=ovrigt'>övrigt</a>" : "<a href='news.php?cat={$category}'>{$category}</a>") . "</p>\n";
         $html .= "<div " . ($this->longText ? null : "style='min-height: 200px;'") . ">\n";
         $html .= $data . "\n";
         $html .= "</div>\n";
         $html .= "<footer>\n";
         $html .= "<p>" . ($updated ? "Uppdaterad: {$updated} av {$updatedBy}<br>" : null) . "Publicerad: {$published} av {$publishedBy}</p>\n";
         $html .= "</footer>\n";
         $html .= "</article>\n";
         $html .= "</section>\n";
     }
     return $html;
 }
开发者ID:EmilSjunnesson,项目名称:rental,代码行数:40,代码来源:CBlog.php

示例4: str_replace

            $tbl .= $row1 . "<td colspan=" . $numfields . ">No results returned" . $cell2 . $row2;
        }
        if ($ck_bool) {
            $tbl = "<br><textarea cols=80 rows=20 name=\"txt\">" . $th . $tbl . "</textarea>";
        } else {
            $tbl = "<table colspan=100% border=1 cellpadding=10>" . $th . $tbl . "</table>";
        }
        $res = 'Query: ' . $_POST['sql'] . "<br>Tables: " . $table_name . "<hr>" . $tbl . $res_ct_lbl;
    }
}
//query history list
for ($i = sizeof($_SESSION['test_query'][$_GET['h']]) - 1; $i >= 0; $i--) {
    $thisQuery = $_SESSION['test_query'][$_GET['h']][$i];
    $dispQuery = str_replace("\"", "&quot;", $thisQuery);
    //replace quotes
    $dispQuery = shortenText($dispQuery, 50);
    //shorten the query
    if ($thisQuery != $_SESSION['test_query'][$_GET['h']][$i + 1]) {
        $history_opt .= "<option value=\"" . str_replace("\"", "&quot;", $thisQuery) . '">' . $dispQuery . '</option>';
    }
}
if (!$_POST[dbName]) {
    $_POST[dbName] = $dbList[0];
}
$selectT = 'show tables from ' . $_POST[dbName];
$queryT = mysql_query($selectT, $conn) or print mysql_error();
while ($t = mysql_fetch_assoc($queryT)) {
    foreach ($t as $table) {
        if ($_POST[tableName] == $table) {
            $pick = 'selected';
        } else {
开发者ID:TheJadeEmperor,项目名称:NeobuxUltimateStrategy,代码行数:31,代码来源:query.php

示例5: empty

        ?>
											<?php 
        echo empty($flora->latin_name) ? "" : "<span><b>" . $flora->latin_name . "</b> (Latijnse benaming)</span>";
        ?>
											<?php 
        echo empty($flora->family_name) ? "" : "<span><b>" . $flora->family_name . "</b> (Wetenschappelijke soortnaam)</span>";
        ?>
											<?php 
        echo empty($flora->cultivar_name) ? "" : "<span><b>" . $flora->cultivar_name . "</b> (Cultivarnaam)</span>";
        ?>
											<?php 
        echo empty($flora->origin) ? "" : "<span><b>" . $flora->origin . "</b> (Herkomst)</span>";
        ?>
										</td>
										<td><?php 
        echo shortenText($flora->description, 350);
        ?>
<a href="/flora-informatie/<?php 
        echo $flora->id;
        ?>
" title="Meer informatie over <?php 
        echo $flora->name;
        ?>
">Meer informatie &rarr;</a></td>
									</tr>
<?php 
    }
    ?>
								</tbody>
							</table>
						</div>
开发者ID:Braatan,项目名称:Engrave,代码行数:31,代码来源:flora-database.php

示例6: buildDailyDigest


//.........这里部分代码省略.........
        *				etc
        *			),
        *		1 => array(
        *				Name,
        *				Date,
        *				etc
        *			)
        *	)
        */
        while ($row = $dailyDigestStatsStmt->fetch(PDO::FETCH_ASSOC)) {
        }
        //Get just the server names to count them.
        $serverNamesStmt = $errorDbc->prepare("SELECT\n\tserverName AS 'serverName'\nFROM\n\terrorReporting\nWHERE\n\terrorDatetime BETWEEN ? AND ?");
        $serverNamesStmt->execute($params);
        while ($row = $serverNamesStmt->fetch(PDO::FETCH_ASSOC)) {
            if (!array_key_exists($row['serverName'], $serverNameArray)) {
                $serverNameArray[$row['serverName']] = 0;
            }
            $serverNameArray[$row['serverName']] = $serverNameArray[$row['serverName']] + 1;
        }
        $debug->printArray(array($serverNameArray), '$serverNameArray');
        $newServerNameArray = array();
        foreach ($serverNameArray as $key => $value) {
            $newServerNameArray[] = array($key, $value);
        }
        $generalStatsTitleRow = array('Server Name', '# of Records');
        $generalStatsCssWidths = array(20, 5);
        $generalStatsBuildRows = new Adrlist_BuildRows($generalStatsTitleRow, $newServerNameArray, $generalStatsCssWidths);
        $generalStats = '<div class="bold textCenter textLarge" style="margin-top:2em">General Statistics</div>
' . $generalStatsBuildRows->output();
        $dailyDigestStmt = $errorDbc->prepare($dailyDigestStmt);
        $dailyDigestStmt->execute(array($startDate, $endDate));
        //$pagination = new BuildPagination($itemCount,$offset,$limit,'dailyDigest');
        //$pagination->setPagesNumbersToDisplay(25);
        //$pagination = $pagination->output();
        //Column widths in em.
        $widthDatetime = 8;
        $widthServerName = '18';
        $widthHttpHost = 18;
        $widthHttpResponse = 8;
        $widthUserAgent = 15;
        $widthRequestUri = 18;
        $widthRemoteAddress = 8;
        $widthHttpReferrer = 20;
        $widthDebug = 8;
        $cssWidths = array(2, 8, 18, 18, 8, 15, 18, 8, 20, 8);
        $titleRow = array('', 'Datetime', 'Server Name', 'Http Host', 'HTTP Response Status Code', 'User Agent', 'Request URI', 'Remote Address', 'Http Referrer');
        $pagination = $pagination->output();
        $buildRows = new Adrlist_BuildRows($titleRow, '', $cssWidths);
        $table = $buildRows->outputTitleRow();
        $class = 'rowAlt';
        $x = $offset + 1;
        while ($row = $dailyDigestStmt->fetch(PDO::FETCH_ASSOC)) {
            if ($class == 'rowWhite') {
                $class = 'rowAlt';
            } else {
                $class = 'rowWhite';
            }
            $table .= '<div class="hand ' . $class . ' clear relative" style="overflow:hidden" id="errorTrigger' . $row['errorId'] . '" errorId="' . $row['errorId'] . '">
	<div class="row">' . $x . '</div>
	<div class="row" style="width:' . $widthDatetime . 'em;">' . $row['datetime'] . '</div>
	<div class="row" style="width:' . $widthServerName . 'em;">' . $row['serverName'] . '</div>
	<div class="row" style="width:' . $widthHttpHost . 'em;">
		<span id="httpHostShortShowHide' . $row['errorId'] . '">' . shortenText($row['httpHost'], $widthHttpHost, false, true, true) . '</span>
		<span class="hide" id="HttpHostLongShowHide' . $row['errorId'] . '">' . $row['httpHost'] . '</span>
	</div>
	<div class="row" style="width:' . $widthHttpResponse . 'em;">' . $row['httpResponseStatusCode'] . '</div>
	<div class="row" style="width:' . $widthUserAgent . 'em;">
		<span id="userAgentShortShowHide' . $row['errorId'] . '">' . shortenText($row['userAgent'], $widthUserAgent, false, true, true) . '</span>
		<span class="hide" id="userAgentLongShowHide' . $row['errorId'] . '">' . $row['userAgent'] . '</span>
	</div>
	<div class="row" style="width:' . $widthRequestUri . 'em;">
		<span id="requestUriShortShowHide' . $row['errorId'] . '">' . shortenText($row['requestUri'], $widthRequestUri, false, true, true) . '</span>
		<span class="hide" id="requestUriLongShowHide' . $row['errorId'] . '">' . urldecode($row['requestUri']) . '</span>
	</div>
	<div class="row" style="width:' . $widthRemoteAddress . 'em;">' . $row['remoteAddress'] . '</div>
	<div class="row" style="width:' . $widthHttpReferrer . 'em;">
		<span id="httpReferrerShortShowHide' . $row['errorId'] . '">' . shortenText($row['httpReferrer'], $widthHttpReferrer, false, true, true) . '</span>
		<span class="hide" id="httpReferrerLongShowHide' . $row['errorId'] . '">' . $row['httpReferrer'] . '</span>
	</div>
	<div class="break hide textLeft" id="debugShowHide' . $row['errorId'] . '">' . $row['debug'] . '</div>
</div>
';
            $x++;
        }
        $output .= 'Showing <input type="text" id="startDate" value="' . $startDate . '"> to <input type="text"  id="endDate" value="' . $endDate . '"> <span class="buttonBlueThin" id="dateRangeGo">Go</span>' . $generalStats . '<div class="hr3"></div><div class="bold textCenter textLarge" style="margin-top:1em">Errors</div>' . $pagination . $table . $pagination;
        if (MODE == 'buildDailyDigest') {
            $success = true;
            $returnThis['output'] = $output;
            $returnThis['container'] = 'dailyDigestHolder';
        }
    } catch (PDOException $e) {
        error(__LINE__, '', '<pre>' . $e . '</pre>');
    }
    if (MODE == 'buildDailyDigest') {
        returnData();
    } else {
        return $output;
    }
}
开发者ID:mark-orussa,项目名称:Adrlist,代码行数:101,代码来源:errorReportingMethods.php

示例7: date_format

<?php

include 'adminCode.php';
if ($_GET['id']) {
    $userID = $_GET['id'];
}
$selS = 'select *, date_format(purchased,"%m/%d/%y %h:%i %p") as 
purchasedDate from sales where affiliate="' . $userID . '" order by purchased';
$resS = mysql_query($selS, $conn) or die(mysql_error());
while ($s = mysql_fetch_assoc($resS)) {
    $displayEmail = shortenText($s[payerEmail], 25);
    $itemName = shortenText($s[itemName], 30);
    $amount = $s[amount];
    $salesTotal += $amount;
    $selU = 'select id, username, email from users where paypal="' . $s[payerEmail] . '" limit 1';
    $resU = mysql_query($selU, $conn) or die(mysql_error());
    $u = mysql_fetch_assoc($resU);
    $username = $u[username];
    $contactEmail = $u[email];
    $userID = $u[id];
    if (!isset($username)) {
        $username = 'N/A';
    }
    if (!isset($contactEmail)) {
        $contactEmail = 'N/A';
    }
    $salesContent .= '<tr>
    <td><a href="custView.php?id=' . $s[id] . '">' . $s[transID] . '</a></td>
    <td>' . $s[purchasedDate] . '</td>
    <td><a href="product/productNew.php?id=' . $s[productID] . '">' . $itemName . '</a></td>
    <td>
开发者ID:TheJadeEmperor,项目名称:NeobuxUltimateStrategy,代码行数:31,代码来源:affSales.php

示例8: dbInsert

        dbInsert($dbOptions);
    }
    $disUpd = 'disabled';
} else {
    if ($_POST[upd]) {
        $dbOptions = array('tableName' => 'links', 'dbFields' => array('name' => $_POST['name'], 'url' => $_POST['url']), 'cond' => 'where id="' . $_GET['id'] . '"');
        dbUpdate($dbOptions);
    }
}
$error = '<p><font color=red><b>' . $error . '</b></font></p>';
$selL = 'select * from links order by name';
$resL = mysql_query($selL, $conn) or die(mysql_error());
while ($l = mysql_fetch_assoc($resL)) {
    $id = $l['id'];
    $linkList .= '<tr><td><a href="?id=' . $id . '">' . $l['name'] . '</a></td>
    <td><a href="' . $l['url'] . '" target=_blank>' . shortenText($l['url'], 40) . '</a></td></tr>';
    if ($_GET[id] == $id) {
        $u = $l;
        $disAdd = 'disabled';
    }
}
?>
<div class=moduleBlue><h1>Add New Link</h1>
<div class="moduleBody">
<?php 
echo $error;
?>
<form method=post>
<table>
<tr>
	<td>Name</td><td><input type=text class=activeField name=name value="<?php 
开发者ID:TheJadeEmperor,项目名称:NeobuxUltimateStrategy,代码行数:31,代码来源:links.php

示例9: formatDate

        ?>
">
            <div class="caption">
              <h3><?php 
        echo $row['Name'];
        ?>
</h3>
              <h5><?php 
        echo formatDate($row['BirthDate']);
        ?>
 ~ <?php 
        echo formatDate($row['DeathDate']);
        ?>
</h5>
              <p><?php 
        echo shortenText($row['Obituary'], 150);
        ?>
</p>
          		<a class="readmore" href="obit.php?id=<?php 
        echo urlencode($row['id']);
        ?>
" role="button">Read More</a>
            </div>
          </div>
        </div>
      <?php 
    }
    ?>
    <?php 
} else {
    ?>
开发者ID:Owlnofeathers,项目名称:hansennorthforkranch.ajamesb.com,代码行数:31,代码来源:obits.php

示例10: mysql_query

<?php

$adir = '../';
include $adir . 'adminCode.php';
$sel = 'select * from products order by id desc';
$res = mysql_query($sel, $conn) or die(mysql_error());
while ($p = mysql_fetch_assoc($res)) {
    $id = $p['id'];
    $theList .= '<tr valign="top"><td><a href="productNew.php?id=' . $id . '">' . $id . '</a></td>
	<td><a href="productNew.php?id=' . $id . '">' . shortenText($p[itemName], 30) . '</a><br />
	>> <a href="../../' . $p['folder'] . '" target="_blank">Visit Sales Page</a></td>
	<td>' . $p['itemPrice'] . '</td>
	<td>' . $p['itemNumber'] . '</td>
	<td align="center">' . $p['affProgram'] . '</td>
	<td align="center"><a href="productEmailsList.php">Edit</a></td></tr>';
}
?>
<table class="moduleBlue" cellspacing=0 cellpadding=2>
<tr>
    <th>Product ID</th><th>Item Name</th><th>Item Price</th><th>Item #</th>
    <th>Affilate Program</th><th>Emails</th></tr>
	<tbody><?php 
echo $theList;
?>
</tbody>
</table>

<p>&nbsp; </p>


<?php 
开发者ID:TheJadeEmperor,项目名称:NeobuxUltimateStrategy,代码行数:31,代码来源:productAll.php

示例11: formatDate

$query = "SELECT * FROM `posts` WHERE id = {$id}";
$post = $db->select($query)->fetch_assoc();
// Create query & run SELECT query for categories
$query = "SELECT * FROM `categories`";
$categories = $db->select($query);
?>

<div class="blog-post">
  <h2 class="blog-post-title"><?php 
echo $post['title'];
?>
</h2>
  <p class="blog-post-meta"><?php 
echo formatDate($post['date']);
?>
 by <a href="#"><?php 
echo $post['author'];
?>
</a></p>
  <p><?php 
echo shortenText($post['body']);
?>
</p>
  <a class="readmore" href="post.php?id=<?php 
echo urldecode($post['id']);
?>
">Read More</a>
</div>

<?php 
include 'includes/footer.php';
开发者ID:skeltont,项目名称:udemyPHP,代码行数:31,代码来源:post.php

示例12: mysql_query

        <input type=hidden name=page value="' . $url . '">
        <input type=submit class="btn info" name=reset onclick="confirm(\'Are you sure you want to reset the views for this page to 0?\')">
        </form>
    </td>
    </tr>';
}
$selB = 'select url, subject from posts order by url';
$resB = mysql_query($selB) or die(mysql_error());
while ($b = mysql_fetch_assoc($resB)) {
    $url = $b['url'];
    $postURL = '/?p=' . $url;
    $uniqueViews = $views[$postURL][uniqueViews];
    $rawViews = $views[$postURL][rawViews];
    $blogViews .= '<tr>
    <td>' . shortenText($b[subject], 35) . '</td>
    <td><a href="../?p=' . $url . '" target=_blank>' . shortenText($postURL, 50) . '</a></td>
    <td>' . $uniqueViews . '</td>
    <td>' . $rawViews . '</td>
    <td>
        <form method=post>
        <input type=hidden name=page value="' . $postURL . '">
        <input type=submit class="btn info" name=reset onclick="confirm(\'Are you sure you want to reset the views for this page to 0?\')">
        </form>
    </td>    
    </tr>';
}
$selS = 'select url from memberpages order by url';
$resS = mysql_query($selS) or die(mysql_error());
while ($s = mysql_fetch_assoc($resS)) {
    $url = $s['url'];
    $page = '/?action=' . $url;
开发者ID:TheJadeEmperor,项目名称:NeobuxUltimateStrategy,代码行数:31,代码来源:pageviews.php

示例13: date

$oneDay = 60 * 60 * 24;
if ($_SESSION[before] == '') {
    $_SESSION[before] = date('Y-m-d', time() + $oneDay);
}
if ($_SESSION[after] == '') {
    $_SESSION[after] = $installDate;
}
$searchFor .= ' joinDate >= "' . $_SESSION[after] . ' 00:00:00" and joinDate <= "' . $_SESSION[before] . ' 23:59:59"';
$sel = 'select * from users where ' . $searchFor . ' ';
$res = mysql_query($sel, $conn) or die(mysql_error());
while ($u = mysql_fetch_assoc($res)) {
    $u = formatFields($u);
    $searchResults .= '<tr>
        <td><a href="updateProfile.php?id=' . $u[id] . '">' . $u[username] . '</a></td>
        <td><a href="updateProfile.php?id=' . $u[id] . '">' . shortenText($u[email], 30) . '</a></td>
        <td>' . shortenText($u[paypal], 30) . '</td>
        <td>' . $u[fname] . ' ' . $u[lname] . '</td>
        <td>' . $u[joinDate] . ' </td>
        </tr>';
}
?>
<form method=post>
    
<table>
<tr>
    <td>
        <div class="moduleBlue"><h1>Affiliate Search</h1>
        <div class="moduleBody">
            <p><?php 
echo $msg;
?>
开发者ID:TheJadeEmperor,项目名称:NeobuxUltimateStrategy,代码行数:31,代码来源:affSearch.php

示例14: foreach

            <p>Total: <b><?php 
echo $salesPickMonth;
?>
</b></p>
        </div>
        </div>
        
        <p>&nbsp;</p><br />
        
        <div class="moduleBlue"><h1>Breakdown by Product</h1>
        <div class="moduleBody">
            <table>
            <?php 
foreach ($product as $id => $amt) {
    $productTotal = '$' . number_format($amt[total], 2);
    $productName = shortenText($amt[itemName], 30);
    $productName = '<a href="product/productNew.php?id=' . $id . '">' . $productName . '</a>';
    echo '<tr>
                <td>' . $productName . '</td> 
                <td>' . $productTotal . '</td></tr>';
}
?>
            </table>
        </div>
        </div>
        
    </td>
</tr>
</table>
<?php 
include 'adminFooter.php';
开发者ID:TheJadeEmperor,项目名称:NeobuxUltimateStrategy,代码行数:31,代码来源:salesMonthly.php

示例15: buildCharacters

function buildCharacters($selectedcharId = false, $id = '', $tabIndex = 1)
{
    /*
    Returns a simple drop down list of characters.
    $selected = (optional) numeric charId to set the selected option.
    $id = (optional) id for the select tag.
    $tabIndex = (optional) tabindex.
    */
    global $debug, $message, $Dbc;
    $output = '';
    try {
        $selectCharactersQuery = "SELECT\n\tcharId AS 'charId',\n\tcharacters AS 'charName',\n\tcharColor AS 'charColor',\n\tdeleted AS 'deleted'\nFROM\n\tcharacters\nWHERE\n\tlistId = ?";
        $selectCharactersQuery .= "ORDER BY\n\tcharacters";
        //Select all characters that are not marked as deleted.
        $stmt = $Dbc->prepare($selectCharactersQuery);
        $params = array($_SESSION['listId']);
        $stmt->execute($params);
        $output .= '<div class="ui-field-contain">
		';
        $output .= empty($id) ? '<label for="characterSelect" class="select">Character</label><select name="characterSelect" id="characterSelect" data-mini="true" data-inline="true" tabindex="' . $tabIndex . '">' : '<label for="' . $id . '" class="select">Character</label><select name="' . $id . '" id="' . $id . '" data-mini="true" data-inline="true" tabindex="' . $tabIndex . '" data-wrapper-class="center textCenter"><optgroup label="Active Characters">';
        $deletedOption = '';
        $foundRows = false;
        while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
            $debug->printArray($row, '$row');
            $foundRows = true;
            if (!empty($selectedcharId) && is_numeric($selectedcharId) && $selectedcharId == $row['charId']) {
                $thisOption = '<option selected="selected" value="' . $row['charId'] . '" style="background-color:#' . $row['charColor'] . '">' . $row['charName'] . '</option>';
                if (empty($row['deleted'])) {
                    $output .= $thisOption;
                } else {
                    $deletedOption .= $thisOption;
                }
            } else {
                $thisOption = '<option value="' . $row['charId'] . '" style="background-color:#' . $row['charColor'] . '">' . shortenText($row['charName'], 15, false, true) . '</option>';
                if (empty($row['deleted'])) {
                    $output .= $thisOption;
                } else {
                    $deletedOption .= $thisOption;
                }
            }
        }
        $output .= '</optgroup>';
        $output .= !empty($deletedOption) ? '<optgroup label="Deleted Characters" style="background-color:#' . COLORLIGHTRED . '">' . $deletedOption . '</optgroup>' : '';
        $output .= '</select></div>';
        if (!$foundRows) {
            $message .= 'No characters were found.';
            pdoError(__LINE__, $stmt, $params, true);
        }
        $output .= '</select>';
    } catch (PDOException $e) {
        error(__LINE__, '', '<pre>' . $e . '</pre>');
    }
    return $output;
}
开发者ID:mark-orussa,项目名称:Adrlist,代码行数:54,代码来源:editListMethodsOld.php


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