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


PHP short函数代码示例

本文整理汇总了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";
    }
}
开发者ID:SandyS1,项目名称:presentations,代码行数:29,代码来源:file1.php

示例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}");
开发者ID:5haman,项目名称:Sendy,代码行数:31,代码来源:l.php

示例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);
}
开发者ID:rjsmelo,项目名称:tiki,代码行数:17,代码来源:svntools.php

示例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++) {
开发者ID:raku,项目名称:simitcms,代码行数:31,代码来源:customadmin.php

示例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)
开发者ID:ariestiyansyah,项目名称:nggadu,代码行数:31,代码来源:list.php

示例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);
 }
开发者ID:mathiasverraes,项目名称:classfunctions,代码行数:9,代码来源:ClassFunctions.php

示例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');
开发者ID:rjsmelo,项目名称:tiki,代码行数:31,代码来源:svnmerge.php

示例8: explode

    if ($custom_fields != '') {
        $custom_fields_array = explode('%s%', $custom_fields);
        foreach ($custom_fields_array as $cf) {
            $cf_array = explode(':', $cf);
            echo '
	&lt;br/&gt;
	&lt;label for=&quot;' . str_replace(' ', '', $cf_array[0]) . '&quot;&gt;' . $cf_array[0] . '&lt;/label&gt;&lt;br/&gt;
	&lt;input type=&quot;text&quot; name=&quot;' . str_replace(' ', '', $cf_array[0]) . '&quot; id=&quot;' . str_replace(' ', '', $cf_array[0]) . '&quot;/&gt;';
        }
    }
}
?>

	&lt;br/&gt;
	&lt;input type=&quot;hidden&quot; name=&quot;list&quot; value=&quot;<?php 
echo short($lid);
?>
&quot;/&gt;
	&lt;input type=&quot;submit&quot; name=&quot;submit&quot; id=&quot;submit&quot;/&gt;
&lt;/form&gt;</pre>

<script type="text/javascript">
	$(document).ready(function() {
		$("#form-code").click(function(){
			$(this).selectText();
		});
	});
</script>

            </div>
            <div class="modal-footer">
开发者ID:ariestiyansyah,项目名称:nggadu,代码行数:31,代码来源:subscribers.php

示例9: explode

    if ($custom_fields != '') {
        $custom_fields_array = explode('%s%', $custom_fields);
        foreach ($custom_fields_array as $cf) {
            $cf_array = explode(':', $cf);
            echo '
	&lt;br/&gt;
	&lt;label for=&quot;' . str_replace(' ', '', $cf_array[0]) . '&quot;&gt;' . $cf_array[0] . '&lt;/label&gt;&lt;br/&gt;
	&lt;input type=&quot;text&quot; name=&quot;' . str_replace(' ', '', $cf_array[0]) . '&quot; id=&quot;' . str_replace(' ', '', $cf_array[0]) . '&quot;/&gt;';
        }
    }
}
?>

	&lt;br/&gt;
	&lt;input type=&quot;hidden&quot; name=&quot;list&quot; value=&quot;<?php 
echo short($_GET['l']);
?>
&quot;/&gt;
	&lt;input type=&quot;submit&quot; name=&quot;submit&quot; id=&quot;submit&quot;/&gt;
&lt;/form&gt;</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 
开发者ID:narareddy,项目名称:sendy,代码行数:31,代码来源:subscribers.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 
开发者ID:narareddy,项目名称:sendy,代码行数:31,代码来源:autoresponders-emails.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;
开发者ID:narareddy,项目名称:sendy,代码行数:31,代码来源:w.php

示例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
开发者ID:ariestiyansyah,项目名称:nggadu,代码行数:31,代码来源:scheduled.php

示例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)) {
开发者ID:5haman,项目名称:Sendy,代码行数:31,代码来源:active-subscriber-count.php

示例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);
开发者ID:5haman,项目名称:Sendy,代码行数:31,代码来源:w.php

示例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!');
开发者ID:5haman,项目名称:Sendy,代码行数:31,代码来源:confirm.php


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