本文整理汇总了PHP中short函数的典型用法代码示例。如果您正苦于以下问题:PHP short函数的具体用法?PHP short怎么用?PHP short使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了short函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: myErrorHandler
function myErrorHandler($errno, $errstr, $errfile, $errline)
{
echo "{$errno}: {$errstr} in " . short($errfile) . " at line {$errline}<br />\n";
echo "Backtrace<br />\n";
$trace = debug_backtrace();
foreach ($trace as $ent) {
if (isset($ent['file'])) {
$ent['file'] . ':';
}
if (isset($ent['function'])) {
echo $ent['function'] . '(';
if (isset($ent['args'])) {
$args = '';
foreach ($ent['args'] as $arg) {
$args .= $arg . ',';
}
echo rtrim(short($args), ',');
}
echo ') ';
}
if (isset($ent['line'])) {
echo 'at line ' . $ent['line'] . ' ';
}
if (isset($ent['file'])) {
echo 'in ' . short($ent['file']);
}
echo "<br />\n";
}
}
示例2: str_replace
//if custom field is of 'Date' type, format the date
if ($cf_array[1] == 'Date') {
$link = str_replace($tag, strftime("%a, %b %d, %Y", $custom_values_array[$j]), $link);
} else {
$link = str_replace($tag, $custom_values_array[$j], $link);
}
}
} else {
$k++;
}
}
if ($k == $cf_count) {
$link = str_replace($tag, $fallback, $link);
}
}
}
}
}
//Email tag
$link = str_replace('[Email]', $email, $link);
//webversion and unsubscribe tags
if ($ares_emails_id == '') {
$link = str_replace('[webversion]', APP_PATH . '/w/' . short($userID) . '/' . short($list_id) . '/' . short($campaign_id), $link);
$link = str_replace('[unsubscribe]', APP_PATH . '/unsubscribe/' . short($email) . '/' . short($list_id) . '/' . short($campaign_id), $link);
} else {
$link = str_replace('[webversion]', APP_PATH . '/w/' . short($userID) . '/' . short($list_id) . '/' . short($campaign_id) . '/a', $link);
$link = str_replace('[unsubscribe]', APP_PATH . '/unsubscribe/' . short($email) . '/' . short($list_id) . '/' . short($campaign_id) . '/a', $link);
}
//redirect to link
$link = substr($link, 0, 4) != 'http' ? 'http://' . $link : $link;
header("Location: {$link}");
示例3: branch
/**
* @param $source
* @param $branch
* @param $revision
* @return bool
*/
function branch($source, $branch, $revision)
{
$short = short($branch);
$file = escapeshellarg("{$branch}/tiki-index.php");
$source = escapeshellarg($source);
$branch = escapeshellarg($branch);
$message = escapeshellarg("[BRANCH] Creation, {$short} 0 to {$revision}");
`svn copy {$source} {$branch} -m {$message}`;
$f = @simplexml_load_string(`svn info --xml {$file}`);
return isset($f->entry);
}
示例4: mysql_query
$ic .= '<th class="' . $vartype[$i] . '"><p>' . $field[$i]['comment'] . '</p></th>';
}
$ic .= '<th></th></tr>';
$ask = mysql_query("SELECT * FROM {$table} {$sq} ORDER BY `{$i}` DESC LIMIT" . $pag->sqlcode());
while ($b = mysql_fetch_assoc($ask)) {
$ic .= "<tr>";
$ic .= "<td><input type='checkbox' name='" . $b[$ai] . "'></td>";
for ($i = 0; $i < $column; $i++) {
if ($vartype[$i] == 'date') {
$ic .= "<td class='date'>" . htmlentities($b[$field[$i]['name']], ENT_QUOTES, "UTF-8") . '</td>';
} elseif ($vartype[$i] == 'image') {
$ic .= "<td class='image'> <a href='" . $b[$field[$i]['name']] . "' id='effect' alt='das'><img src='" . $b[$field[$i]['name']] . "' class='thumb' onerror='this.src=\"images/picture_error.png\"'></a></td>";
} elseif ($vartype[$i] == 'text') {
$ic .= "<td>" . short(100, strip_tags($b[$field[$i]['name']])) . '</td>';
} elseif ($vartype[$i] == 'textarea') {
$ic .= "<td>" . short(100, strip_tags($b[$field[$i]['name']])) . '</td>';
} else {
$ic .= "<td>" . htmlentities($b[$field[$i]], ENT_QUOTES, "UTF-8") . '</td>';
}
}
$ic .= "<td>\n<a href='?c=" . $cid . "&edit=" . $b[$ai] . "'><img src='images/plugin_edit.png'></a>\n<a href='?c=" . $cid . "&delete=" . $b[$ai] . "' onclick=\"return confirm('Bu girdi geri dönüşümsüz biçimde silinecek, emin misiniz?');\"><img src='images/plugin_delete.png'></a></td></tr>";
}
$ic .= '</table>';
$ic .= $pag->write();
}
// Start New Entry
if (isset($_GET["new"])) {
if (isset($_POST["var0"])) {
$dbcolumn = NULL;
$var = NULL;
for ($i = 0; $i < $column; $i++) {
示例5: while
if ($r && mysqli_num_rows($r) > 0) {
while ($row = mysqli_fetch_array($r)) {
$id = $row['id'];
$name = stripslashes($row['name']);
$subscribers_count = get_subscribers_count($id);
$unsubscribers_count = get_unsubscribers_count($id);
$bounces_count = get_bounced_count($id);
if (strlen(short($id)) > 5) {
$listid = substr(short($id), 0, 5) . '..';
} else {
$listid = short($id);
}
echo '
<tr id="' . $id . '">
<td><span class="label" id="list' . $id . '">' . $listid . '</span><span class="label encrypted-list-id" id="list' . $id . '-encrypted" style="display:none;">' . short($id) . '</span></td>
<td><a href="' . get_app_info('path') . '/subscribers?i=' . get_app_info('app') . '&l=' . $id . '" title="">' . $name . '</a></td>
<td id="progress' . $id . '">' . $subscribers_count . '</td>
<td><span class="label">' . get_unsubscribers_percentage($subscribers_count, $unsubscribers_count) . '%</span> ' . $unsubscribers_count . ' ' . _('users') . '</td>
<td><span class="label">' . get_bounced_percentage($bounces_count, $subscribers_count) . '%</span> ' . $bounces_count . ' ' . _('users') . '</td>
<td><a href="edit-list?i=' . get_app_info('app') . '&l=' . $id . '" title=""><i class="icon icon-pencil"></i></a></td>
<td><a href="javascript:void(0)" title="' . _('Delete') . ' ' . $name . '?" id="delete-btn-' . $id . '" class="delete-list"><i class="icon icon-trash"></i></a></td>
<script type="text/javascript">
$("#delete-btn-' . $id . '").click(function(e){
e.preventDefault();
c = confirm("' . _('All subscribers, custom fields and autoresponders in this list will also be permanently deleted. Confirm delete') . ' ' . $name . '?");
if(c)
{
$.post("includes/list/delete.php", { list_id: ' . $id . ' },
function(data) {
if(data)
示例6: short
/**
* The class name of an object, without the namespace
* @param object|string $object
* @return string
*/
public static function short($object)
{
return short($object);
}
示例7: error
}
$destination = $local->entry->url;
if (!is_trunk($destination)) {
error("This script is likely not to be appropriate for this working copy. This script can be used in:\n\ttrunk");
}
$source = full($_SERVER['argv'][1]);
if (!is_experimental($source)) {
error("The provided source cannot be used to update this working copy. Only experimental branches can be used.");
}
if (has_uncommited_changes('.')) {
error("Working copy has uncommited changes. Revert or commit them before merging a branch.");
}
$revision = (int) get_info($destination)->entry->commit['revision'];
$last = find_last_merge($source, $destination);
$sDest = short($destination);
$sSource = short($source);
if ($last !== $revision) {
error("You must branchupdate {$sSource} from {$sDest} before merging.");
}
// Proceed to update
info("Updating...");
update_working_copy('.');
// Do merge
info("Merging...");
incorporate($destination, $source);
important("After verifications, commit using a meaningful message for this feature.");
$conflicts = get_conflicts('.');
if ($conflicts->length > 0) {
$message = "Conflicts occurred during the merge. Fix the conflicts and start again.";
foreach ($conflicts as $path) {
$path = $path->parentNode->getAttribute('path');
示例8: explode
if ($custom_fields != '') {
$custom_fields_array = explode('%s%', $custom_fields);
foreach ($custom_fields_array as $cf) {
$cf_array = explode(':', $cf);
echo '
<br/>
<label for="' . str_replace(' ', '', $cf_array[0]) . '">' . $cf_array[0] . '</label><br/>
<input type="text" name="' . str_replace(' ', '', $cf_array[0]) . '" id="' . str_replace(' ', '', $cf_array[0]) . '"/>';
}
}
}
?>
<br/>
<input type="hidden" name="list" value="<?php
echo short($lid);
?>
"/>
<input type="submit" name="submit" id="submit"/>
</form></pre>
<script type="text/javascript">
$(document).ready(function() {
$("#form-code").click(function(){
$(this).selectText();
});
});
</script>
</div>
<div class="modal-footer">
示例9: explode
if ($custom_fields != '') {
$custom_fields_array = explode('%s%', $custom_fields);
foreach ($custom_fields_array as $cf) {
$cf_array = explode(':', $cf);
echo '
<br/>
<label for="' . str_replace(' ', '', $cf_array[0]) . '">' . $cf_array[0] . '</label><br/>
<input type="text" name="' . str_replace(' ', '', $cf_array[0]) . '" id="' . str_replace(' ', '', $cf_array[0]) . '"/>';
}
}
}
?>
<br/>
<input type="hidden" name="list" value="<?php
echo short($_GET['l']);
?>
"/>
<input type="submit" name="submit" id="submit"/>
</form></pre>
</div>
<div class="modal-footer">
<a href="#" class="btn btn-inverse" data-dismiss="modal"><i class="icon icon-ok-sign"></i> <?php
echo _('Okay');
?>
</a>
</div>
</div>
<?php
示例10: _
?>
&a=<?php
echo $_GET['a'];
?>
&ae=<?php
echo $ares_email_id;
?>
" title=""><?php
echo _('Edit');
?>
</a></li>
<li><a href="<?php
echo get_app_info('path');
?>
/w/<?php
echo short($ares_email_id);
?>
/a?<?php
echo time();
?>
" title="" class="iframe-preview"><?php
echo _('Preview');
?>
</a></li>
<li><a href="javascript:void(0)" title="" id="delete-<?php
echo $ares_email_id;
?>
" data-id="<?php
echo $ares_email_id;
?>
"><?php
示例11: str_replace
$k++;
}
}
if ($k == $cf_count) {
$html = str_replace($tag, $fallback, $html);
}
}
}
}
//Email tag
$html = str_replace('[Email]', $email, $html);
//set web version links
$html = str_replace('<webversion', '<a href="' . APP_PATH . '/w/' . short($subscriber_id) . '/' . short($subscriber_list) . '/' . short($campaign_id) . '" ', $html);
$html = str_replace('</webversion>', '</a>', $html);
//set unsubscribe links
$html = str_replace('<unsubscribe', '<a href="' . APP_PATH . '/unsubscribe/' . short($email) . '/' . short($subscriber_list) . '/' . short($campaign_id) . '" ', $html);
$html = str_replace('</unsubscribe>', '</a>', $html);
//Update click count
//if this is an autoresponder web version,
if (count($i_array) == 4 && $i_array[3] == 'a') {
$q = 'SELECT clicks, link FROM links WHERE link = "' . APP_PATH . '/w/' . $i_array[2] . '/a"';
} else {
$q = 'SELECT clicks, link FROM links WHERE link = "' . APP_PATH . '/w/' . $i_array[2] . '"';
}
$r = mysqli_query($mysqli, $q);
if ($r && mysqli_num_rows($r) > 0) {
while ($row = mysqli_fetch_array($r)) {
$clicks = $row['clicks'];
$link = $row['link'];
if ($clicks == '') {
$val = $subscriber_id;
示例12: short
$mail->Host = $smtp_host;
$mail->Port = $smtp_port;
$mail->Username = $smtp_username;
$mail->Password = $smtp_password;
}
}
$mail->Timezone = $user_timezone;
$mail->CharSet = "UTF-8";
$mail->From = $from_email;
$mail->FromName = $from_name;
$mail->Subject = $title_treated;
$mail->AltBody = $plain_treated;
$mail->MsgHTML($html_treated);
$mail->AddAddress($email, $name);
$mail->AddReplyTo($reply_to, $from_name);
$mail->AddCustomHeader('List-Unsubscribe: <' . APP_PATH . '/unsubscribe/' . short($email) . '/' . short($subscriber_list) . '/' . short($campaign_id) . '>');
//check if attachments are available for this campaign to attach
if (file_exists($server_path . 'uploads/attachments/' . $campaign_id)) {
foreach (glob($server_path . 'uploads/attachments/' . $campaign_id . '/*') as $attachment) {
if (file_exists($attachment)) {
$mail->AddAttachment($attachment);
}
}
}
$mail->Send();
//increment recipient count if not using AWS or SMTP
if ($s3_key == '' && $s3_secret == '') {
//increment recipients number in campaigns table
$q5 = 'UPDATE campaigns SET recipients = recipients+1 WHERE id = ' . $campaign_id;
mysqli_query($mysqli, $q5);
//update last_campaign
示例13: array
include '../_connect.php';
include '../../includes/helpers/short.php';
//-------------------------- ERRORS -------------------------//
$error_core = array('No data passed', 'API key not passed', 'Invalid API key');
$error_passed = array('List ID not passed', 'List does not exist');
//-----------------------------------------------------------//
//--------------------------- POST --------------------------//
//api_key
if (isset($_POST['api_key'])) {
$api_key = mysqli_real_escape_string($mysqli, $_POST['api_key']);
} else {
$api_key = null;
}
//list_id
if (isset($_POST['list_id'])) {
$list_id = short(mysqli_real_escape_string($mysqli, $_POST['list_id']), true);
} else {
$list_id = null;
}
//-----------------------------------------------------------//
//----------------------- VERIFICATION ----------------------//
//Core data
if ($api_key == null && $list_id == null) {
echo $error_core[0];
exit;
}
if ($api_key == null) {
echo $error_core[1];
exit;
} else {
if (!verify_api_key($api_key)) {
示例14: str_replace
if ($k == $cf_count) {
$html = str_replace($tag, $fallback, $html);
}
}
}
}
//Email tag
$html = str_replace('[Email]', $email, $html);
//set web version links
$html = str_replace('<webversion', '<a href="' . APP_PATH . '/w/' . short($subscriber_id) . '/' . short($subscriber_list) . '/' . short($campaign_id) . '" ', $html);
$html = str_replace('</webversion>', '</a>', $html);
$html = str_replace('[webversion]', APP_PATH . '/w/' . short($subscriber_id) . '/' . short($subscriber_list) . '/' . short($campaign_id), $html);
//set unsubscribe links
$html = str_replace('<unsubscribe', '<a href="' . APP_PATH . '/unsubscribe/' . short($email) . '/' . short($subscriber_list) . '/' . short($campaign_id) . '" ', $html);
$html = str_replace('</unsubscribe>', '</a>', $html);
$html = str_replace('[unsubscribe]', APP_PATH . '/unsubscribe/' . short($email) . '/' . short($subscriber_list) . '/' . short($campaign_id), $html);
//convert date tags
convert_date_tags();
//convert date tags
function convert_date_tags()
{
global $timezone;
global $html;
global $sent;
global $send_date;
if ($timezone != '') {
date_default_timezone_set($timezone);
}
$today = $sent == '' ? time() : $sent;
$today = $send_date != '' && $send_date != 0 ? $send_date : $today;
$currentdaynumber = strftime('%d', $today);
示例15: mysqli_query
$mail->AltBody = '';
$mail->MsgHTML($thankyou_message);
$mail->AddAddress($email, '');
$mail->AddReplyTo($reply_to, $from_name);
$mail->Send();
//Update quota if a monthly limit was set
if ($allocated_quota != -1) {
//if so, update quota
$q4 = 'UPDATE apps SET current_quota = current_quota+1 WHERE id = ' . $app;
mysqli_query($mysqli, $q4);
}
}
//if user sets a redirection URL
if ($confirm_url != '') {
$confirm_url = str_replace('%e', $email, $confirm_url);
$confirm_url = str_replace('%l', short($list_id), $confirm_url);
header("Location: " . $subscribed_url);
header("Location: " . $confirm_url);
} else {
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="Shortcut Icon" type="image/ico" href="<?php
echo APP_PATH;
?>
/img/favicon.png">
<title><?php
echo _('You\'re subscribed!');