本文整理汇总了PHP中requestIdParam函数的典型用法代码示例。如果您正苦于以下问题:PHP requestIdParam函数的具体用法?PHP requestIdParam怎么用?PHP requestIdParam使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了requestIdParam函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display_page_content
function display_page_content()
{
$array_name = requestIdParam();
$value = getRequestVarAtIndex(3);
$_SESSION['blaster'][$array_name] = $value;
print_r($_SESSION['blaster']);
}
示例2: display_page_content
function display_page_content()
{
$section_name = requestIdParam();
$section = Sections::FindByName($section_name);
$item_name = getRequestVarAtIndex(3);
$item = Items::FindByName($item_name);
$gallery = $item->getGallery();
?>
<h1><?php
echo $item->display_name;
?>
</h1>
<?php
$next_item = $item->findNext($section);
$prev_item = $item->findPrev($section);
if ($prev_item) {
echo "\t\t\t\t<a href=\"" . get_link("portfolio/item/{$section_name}/" . $prev_item->name) . "\">previous</a>\n";
}
if ($next_item) {
echo "\t\t\t\t<a href=\"" . get_link("portfolio/item/{$section_name}/" . $next_item->name) . "\">next</a>\n";
}
echo $item->content;
foreach ($gallery->get_photos() as $photo) {
echo "<img src=\"/" . $photo->getPublicUrl() . "\" /><br />";
}
}
示例3: display_page_content
function display_page_content()
{
$section_name = requestIdParam();
$section = Sections::FindByName($section_name);
$items = $section->findItems();
?>
<div id="right">
<h3>Item Thumbnail</h3>
</div>
<div id="center">
<h3>All the <?php
echo $section->display_name;
?>
</h3>
<?php
echo $section->content;
?>
<?php
echo "<ul>\r\n";
foreach ($items as $item) {
echo "\t\t\t<li><a href=\"" . get_link("portfolio/item/{$section_name}/" . $item->name) . "\">{$item->display_name}</a></li>\r\n";
}
echo "\t\t</ul>\r\n";
?>
</div>
<?php
}
示例4: display_page_content
function display_page_content()
{
$the_email = requestIdParam();
$the_list = getRequestVarAtIndex(3);
$list = NLLists::FindById($the_list);
$email = NLEmails::FindByEmail($the_email);
$email->detach($list);
}
示例5: display_page_content
function display_page_content()
{
if (!requestIdParam()) {
$documents = Documents::FindAll("DESC");
} else {
$documents = Documents::FindByFiletype(requestIdParam());
}
?>
<div id="edit-header" class="documentnav">
<div class="nav-left column">
<h1>Choose a Document to Edit</h1>
</div>
<div class="nav-right column">
<a href="<?php
echo get_link("admin/add_document");
?>
" class="hcd_button">Add a New Document</a>
</div>
<div class="clearleft"></div>
</div>
<p class="announce">Documents are defined as downloadable files or forms. PDFs, DOCs, and the like are acceptable. You may use this feature to make high resolution images downloadable as well. If the image is too large to upload, and you get an error, you may want to compress the image with StuffIt (.sit), WinZip (.zip), or ZipIt (.zip).</p>
<?php
if (count($documents) > 0) {
?>
<div id="table-header" class="documents">
<strong class="item-link">Document Name</strong>
<span class="item-filename">Filename</span>
<span class="item-viewlink">View file in new window</span>
</div>
<?php
//$filetypes = Documents::FindUniqueFiletypes();
if (isset($filetypes) && count($filetypes) > 1) {
echo "<ul class=\"menu tabs\">\n\t\t<li>Show Only: </li>\n";
foreach ($filetypes as $type) {
echo "\t\t<li><a href=\"" . get_link("admin/list_documents/" . $type->file_type) . "\">{$type->file_type}</a></li>\n";
}
echo "\t\t<li><a class=\"hcd_button\" href=\"" . get_link("admin/list_documents/") . "\">Show All</a></li>\n\t</ul>\n ";
}
?>
<ul id="listitems" class="managelist">
<?php
foreach ($documents as $document) {
echo "\t\t<li>\n\t\t\t<span class=\"item-link\"><a href=\"" . get_link("/admin/edit_document/{$document->id}") . "\">{$document->name} <small>EDIT</small></a></span>\n\t\t\t<span class=\"item-filename\">{$document->filename}</span>\n\t\t\t<span class=\"item-viewlink\"><a href=\"" . $document->getPublicUrl() . "\" target=\"_blank\">View file</a></span>\n\t\t</li>\n";
}
?>
</ul>
<?php
} else {
echo "\t\t<h3 class=\"empty-list\">There are no documents to edit. <a class=\"short\" href=\"" . get_link("admin/add_document") . "\">Add one if you like</a>.</h3>";
}
}
示例6: display_page_content
function display_page_content()
{
$accnt_id = requestIdParam();
$account = Paypal_Config::FindById($accnt_id);
?>
<script type="text/javascript">
$().ready(function() {
$("#edit_paypal").validate({
rules: {
email: { required: true, email: true }
},
messages: {
email: "Please enter a valid email address"
}
});
});
</script>
<form id="edit_paypal" method="POST">
<h1>Edit Account "<?php
echo $account->account_name;
?>
"</h1>
<p class="announce">There is one PayPal account associated with <a href="<?php
echo BASEHREF;
?>
admin/list_products">products</a> on your site. To change the email associated with products and your PayPal account, edit it here. If you need more than one account – say, for different types of products – then let us know, and we can add that functionality.</p>
<p> </p>
<p><label for="email">Email:</label>
<?php
textField("email", $account->email, "required: true");
?>
</p>
<p><label for="email">Success URL:</label>
<?php
textField("success_url", $account->success_url);
?>
<br />
<span class="hint">Optional address to send people to when they successfully complete a checkout</span></p>
<p><label for="email">Cancel URL:</label>
<?php
textField("cancel_url", $account->cancel_url);
?>
<br />
<span class="hint">Optional address to send people to when they decline or cancel a checkout</span></p>
<input type="submit" class="submitbutton" name="submit" value="Save" />
</form>
<?php
}
示例7: display_page_content
function display_page_content()
{
$array_name = requestIdParam();
if (strstr(getRequestVarAtIndex(3), ",")) {
$value = array_slice(explode(",", getRequestVarAtIndex(3)), 0, -1);
} else {
$value = getRequestVarAtIndex(3);
}
$_SESSION['blaster'][$array_name] = $value;
//print_r($_SESSION['blaster']);
}
示例8: display_page_content
function display_page_content()
{
$hash = requestIdParam();
$email = getRequestVarAtIndex(3);
$query = "SELECT * FROM mailblast WHERE hash = '{$hash}';";
if ($result = mysql_query($query, MyActiveRecord::Connection())) {
echo str_replace("{{-email-}}", $email, mysql_result($result, 0, 'content'));
} else {
redirect("/");
}
}
示例9: display_page_content
function display_page_content()
{
$item_id = requestIdParam();
$query = "SELECT thumbnail FROM items \n\t WHERE id = {$item_id}";
$result = mysql_Query($query, MyActiveRecord::Connection());
$data = @mysql_fetch_array($result);
if (!empty($data["thumbnail"])) {
// Output the MIME header
header("Content-Type: image/jpeg");
// Output the image
echo $data["thumbnail"];
}
}
示例10: display_page_content
function display_page_content()
{
$photo_id = requestIdParam();
$photo = Photos::FindById($photo_id);
$next_photo = $photo->get_next_photo();
$prev_photo = $photo->get_previous_photo();
if ($prev_photo->id != $photo->id) {
echo "<a href='" . get_link("/galleries/photo/{$prev_photo->id}") . "'>Previous</a>";
}
echo "<img src='{$photo->getPublicUrl()}' />";
if ($next_photo->id != $photo->id) {
echo "<a href='" . get_link("/galleries/photo/{$next_photo->id}") . "'>Next</a>";
}
}
示例11: display_page_content
function display_page_content()
{
$removed_id = requestIdParam();
$ongoing_events = $_SESSION['blaster']['ongoing_events'];
$new_array = array();
foreach ($ongoing_events as $event) {
if ($event != $removed_id) {
$new_array[] = $event;
}
}
if (count($new_array)) {
$_SESSION['blaster']['ongoing_events'] = $new_array;
} else {
$_SESSION['blaster']['ongoing_events'] = "";
}
print_r($_SESSION['blaster']);
}
示例12: display_page_content
function display_page_content()
{
if (requestIdParam() == "add") {
$chunk = $chunkslug = $chunkdescription = $chunkcontent = null;
$chunkhtml = 0;
} else {
$chunk_id = requestIdParam();
$chunk = Chunks::FindById($chunk_id);
$chunkslug = $chunk->slug;
$chunkdescription = $chunk->description;
$chunkhtml = $chunk->full_html;
$chunkcontent = $chunk->content;
}
$user = Users::GetCurrentUser();
?>
<script type="text/javascript">
$().ready(function() {
$("#edit_chunk").validate({
rules : {
slug: "required",
content: "required"
},
messages: {
slug: "Please enter a title for this video",
content: "Please enter some content for this chunk"
}
});
<?php
if ($chunkhtml) {
echo 'loadTinyMce("chunk_content");';
}
?>
});
</script>
<div id="edit-header" class="chunknav">
<h1>Edit Chunk</h1>
</div>
<form method="POST" id="edit_chunk">
<div class="column half">
<?php
if ($user->email == 'admin@highchairdesign.com') {
?>
<p class="display_name">
<label for="slug">Chunk Slug:</label>
<?php
textField("slug", $chunkslug, "required: true");
?>
</p>
<p>
<label for="full_html">Full Html?:</label> <?php
checkBoxField("full_html", $chunkhtml);
?>
<br>
<span class="hint">Do we need to allow full HTML capabilities on the content field? Checked for “Yes”, not checked for “No”.</span>
</p>
<p>
<label for="description">Chunk Description:</label>
<?php
textField("description", $chunkdescription);
?>
</p>
<?php
} else {
?>
<h2><?php
echo $chunkslug;
?>
</h2>
<p><strong><?php
echo $chunkdescription;
?>
</strong></p>
<?php
}
?>
<div class="clearit"></div>
</div>
<div class="column half last">
<p>
<label for="chunk_content">Content:</label>
<?php
textArea("chunk_content", $chunkcontent, 98, 18);
?>
</p>
</div>
//.........这里部分代码省略.........
示例13: display_page_content
function display_page_content()
{
echo "<hr />\r\n";
$upcoming_event_num = requestIdParam();
if ($upcoming_event_num) {
$upcoming = Events::FindUpcoming($upcoming_event_num);
$upcoming_csv = "";
?>
<p><span class="hint">Click the [<u>X</u>] to remove an event from list</span></p>
<h2>Upcoming Events that will be included in this email:</h2>
<table cellpadding="3" cellspacing="0" border="0">
<tbody>
<?php
foreach ($upcoming as $event) {
echo "<tr>\n\t\t\t\t\t<td>[<a href=\"javascript;:\" class=\"remove_uevent\" title=\"{$event->id}\">X</a>] </td>\n\t\t\t\t\t<td>" . $event->getDateStart("date") . " </td>\n\t\t\t\t\t<td><b>{$event->title}</b> </td>\n\t\t\t\t</tr>";
$upcoming_csv .= $event->id . ",";
}
}
?>
</tbody>
</table>
<?php
$ongoing_event_num = getRequestVarAtIndex(3);
if ($ongoing_event_num) {
$ongoing = Events::FindOngoing($ongoing_event_num);
$ongoing_csv = "";
?>
<h2 style="padding-top: 1em;">Ongoing Events that will be included in this email:</h2>
<table cellpadding="3" cellspacing="0" border="0">
<tbody>
<?php
foreach ($ongoing as $event) {
echo "<tr>\n\t\t\t\t\t<td>[<a href=\"javascript;:\" class=\"remove_oevent\" title=\"{$event->id}\">X</a>] </td>\n\t\t\t\t\t<td>" . $event->getDateStart("date") . " – " . $event->getDateEnd("date") . " </td>\n\t\t\t\t\t<td><b>{$event->title}</b> </td>\n\t\t\t\t</tr>";
$ongoing_csv .= $event->id . ",";
}
}
?>
</tbody>
</table>
<script type="text/javascript">
$().ready(function() {
$('#session_add').load('<?php
echo BASEHREF;
?>
blaster/session_add/upcoming_events/<?php
echo $upcoming_csv;
?>
', function() {
$('#session_add').load('<?php
echo BASEHREF;
?>
blaster/session_add/ongoing_events/<?php
echo $ongoing_csv;
?>
');
});
$("a.remove_uevent").click(function() {
var event_id = $(this).attr('title');
$("#session_add").load('<?php
echo BASEHREF;
?>
blaster/remove_uevent/'+event_id);
$(this).parent().parent().css({ "background-color" : "#999"});
return false;
});
$("a.remove_oevent").click(function() {
var event_id = $(this).attr('title');
$("#session_add").load('<?php
echo BASEHREF;
?>
blaster/remove_oevent/'+event_id);
$(this).parent().parent().css({ "background-color" : "#999"});
return false;
});
});
</script>
<?php
}
示例14: initialize_page
function initialize_page()
{
$image_id = requestIdParam();
$image = Images::FindById($image_id);
$post_action = isset($_POST['submit']) ? $_POST['submit'] : "";
if ($post_action == "Save Image" || $post_action == "Save and Return to List") {
$success = '';
if (isset($_POST['delete'])) {
$image->delete(true);
setFlash("<h3>Image deleted</h3>");
redirect("/admin/list_images");
} else {
$old_name = $image->name;
$image->title = cleanupSpecialChars($_POST['title']);
$image->description = cleanupSpecialChars($_POST['description']);
if (ALLOW_SHORT_PAGE_NAMES) {
$image->name = $_POST['name'] == "" ? slug($_POST['title']) : slug($_POST['name']);
} else {
$image->name = slug($_POST['title']);
}
//$image->save();
$updateQuery = "UPDATE images SET title='{$image->title}', name='{$image->name}', description='{$image->description}' WHERE id='{$image->id}';";
if (mysql_Query($updateQuery, MyActiveRecord::Connection())) {
if ($old_name != $image->name) {
Pages::UpdateImageReferences($old_name, $image->name);
}
$success .= "Image changes saved / ";
} else {
die($updateQuery);
setFlash("<h3>FAILURE – Please notify HCd of this error: " . mysql_error() . "</h3>");
}
// Replace an existing image with a new one
if (is_uploaded_file($_FILES["new_image"]["tmp_name"])) {
$mimeType = $_FILES["new_image"]["type"];
$filetype = getFileExtension($_FILES["new_image"]["name"]);
//list($width) = getimagesize($_FILES["new_image"]["tmp_name"]);
$max_width = 0;
$max_height = 0;
if (defined("MAX_IMAGE_WIDTH")) {
$max_width = MAX_IMAGE_WIDTH;
}
if (defined("MAX_IMAGE_HEIGHT")) {
$max_height = MAX_IMAGE_HEIGHT;
}
resizeToMultipleMaxDimensions($_FILES["new_image"]["tmp_name"], $max_width, $max_height, $filetype);
// Open the uploaded file
$file = fopen($_FILES["new_image"]["tmp_name"], "r");
// Read in the uploaded file
$fileContents = fread($file, filesize($_FILES["new_image"]["tmp_name"]));
// Escape special characters in the file
$fileContents = AddSlashes($fileContents);
$updateQuery2 = "UPDATE images SET original='{$fileContents}', mime_type='{$mimeType}' WHERE id='{$image->id}';";
if (mysql_Query($updateQuery2, MyActiveRecord::Connection())) {
$success .= "Image replaced / ";
} else {
setFlash("FAILURE – Please notify HCd of this error: " . mysql_error() . "</h3>");
//die( $updateQuery2 );
}
}
}
if ($post_action == "Save and Return to List") {
redirect("/admin/list_images");
}
setFlash("<h3>" . substr($success, 0, -3) . "</h3>");
}
}
示例15: display_page_content
function display_page_content()
{
$page_id = requestIdParam();
$page = Pages::FindById($page_id);
// get all the areas
$areas = Areas::FindAll();
$page_areas = $page->getAreas();
// I know MOST pages dont use the error_container anymore, but this one should! If the user uses any of the drop downs before they pick an Area, the page will not submit and the user will not be able to see the error.
?>
<script type="text/javascript">
//<![CDATA[
$().ready(function() {
$("#edit_page").validate({
errorLabelContainer: $("#error_container"),
<?php
if (SUB_PAGES) {
?>
rules: {
display_name: "required"
},
messages: {
display_name: "Please enter a display name for this page"
}
<?php
} else {
?>
rules: {
display_name: "required",
"selected_areas[]": "required"
},
messages: {
display_name: "Please enter a display name for this page",
"selected_areas[]": "You unchecked an area and forgot to choose a new one! Select at least one area to include the page in. If you need to hide it, make it not public."
}
<?php
}
?>
});
});
//]]>
</script>
<div id="edit-header" class="areanav">
<div class="nav-left column">
<h1>Edit Page : <a href="<?php
$page->the_url();
?>
" title="View <?php
$page->the_url();
?>
">View Page</a></h1>
</div>
<div class="nav-right column">
<?php
quick_link();
?>
</div>
<div class="clearleft"></div>
</div>
<form method="POST" id="edit_page">
<p><span class="hint">If a text box is underlined in red, it is a required field</span></p>
<p class="display_name">
<label for="display_name">Display Name:</label><span class="hint">This is the Proper Name of the page; how it will display in the navigation.</span><br />
<?php
textField("display_name", $page->display_name, "required: true");
?>
</p>
<?php
if (ALLOW_SHORT_PAGE_NAMES) {
?>
<p>
<label for="name">Short Name:</label><span class="hint">This is the short name of the page, which gets used in the link. No spaces, commas, or quotes please.</span><br />
<?php
textField("name", $page->name);
?>
</p>
<?php
} else {
hiddenField("name", $page->name);
?>
<p class="page-url">Page URL: <span class="page-url"><?php
echo 'http://' . SITE_URL . BASEHREF . "<mark>" . ltrim($page->get_url(), "/") . "</mark>";
?>
</span></p>
<?php
}
?>
<p>
<label for="name">Public:</label> <?php
checkBoxField("public", $page->public);
?>
//.........这里部分代码省略.........