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


PHP confirm_slash函数代码示例

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


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

示例1: print_books

function print_books($books, $is_large = false)
{
    echo '<ul class="book_icons">';
    foreach ($books as $row) {
        $uri = confirm_slash(base_url()) . $row->slug;
        $title = trim($row->title);
        $book_id = (int) $row->book_id;
        $thumbnail = !empty($row->thumbnail) ? confirm_slash($row->slug) . $row->thumbnail : null;
        $is_live = $row->display_in_index ? true : false;
        if (empty($thumbnail) || !file_exists($thumbnail)) {
            $thumbnail = path_from_file(__FILE__) . 'default_book_logo.png';
        }
        $authors = array();
        foreach ($row->users as $user) {
            if ($user->relationship != strtolower('author')) {
                continue;
            }
            if (!$user->list_in_index) {
                continue;
            }
            $authors[] = $user->fullname;
        }
        echo '<li><a href="' . $uri . '"><img class="book_icon' . ($is_large ? '' : ' small') . '" src="' . confirm_base($thumbnail) . '" /></a><h4><a href="' . $uri . '">' . $title . '</a></h4>';
        if (count($authors)) {
            echo implode(', ', $authors);
            echo "<br />";
        }
        echo '</li>';
    }
    echo '</ul>';
}
开发者ID:paulshannon,项目名称:scalar,代码行数:31,代码来源:book_list.php

示例2: __construct

 public function __construct()
 {
     require_once confirm_slash(FCPATH) . 'system/application/libraries/Image_IPTC/Image_IPTC.php';
     $CI =& get_instance();
     $namespaces = $CI->config->item('namespaces');
     $ontologies = $CI->config->item('ontologies');
     $this->iptc_uri = @$namespaces[$this->iptc_ns];
     $this->iptc = $ontologies[$this->iptc_ns];
 }
开发者ID:plusperturbatio,项目名称:scalar,代码行数:9,代码来源:Image_Metadata.php

示例3: abs_url

function abs_url($url, $prefix = '')
{
    if (empty($url)) {
        return null;
    }
    if (strstr($url, '://')) {
        return $url;
    }
    return confirm_slash($prefix) . $url;
}
开发者ID:paulshannon,项目名称:scalar,代码行数:10,代码来源:MY_url_helper.php

示例4: __construct

 public function __construct($data = array())
 {
     if (!empty($data['book'])) {
         $this->rdf_url_json = confirm_slash(base_url()) . $data['book']->slug . '/rdf/instancesof/content?format=json&rec=1&ref=1';
         $this->rdf_url_xml = confirm_slash(base_url()) . $data['book']->slug . '/rdf/instancesof/content?&rec=1&ref=1';
         $this->dest_url = confirm_slash(base_url()) . $data['book']->slug;
         $this->email = $data['login']->email;
         $this->source_url = isset($_REQUEST['source_url']) && !empty($_REQUEST['source_url']) ? $_REQUEST['source_url'] : '';
     }
 }
开发者ID:austinvernsonger,项目名称:scalar,代码行数:10,代码来源:transfer_pi.php

示例5: reset_password

 public function reset_password($email = '', $reset_string = '')
 {
     $this->CI->email->from('no-reply@' . $this->domain_name(), $this->install_name());
     $this->CI->email->reply_to($this->replyto_address(), $this->replyto_name());
     $this->CI->email->to($email);
     $this->CI->email->subject($this->CI->lang->line('email.forgot_password_subject'));
     $msg = $this->CI->lang->line('email.forgot_password_intro');
     $msg .= confirm_slash(base_url()) . 'system/create_password?key=' . $reset_string . "\n\n";
     $msg .= $this->CI->lang->line('email.forgot_password_outro');
     $this->CI->email->message($msg);
     if (!$this->CI->email->send()) {
         throw new Exception('Could not send email.  Please try again or contact an administrator.');
     }
     return true;
 }
开发者ID:paulshannon,项目名称:scalar,代码行数:15,代码来源:SendMail.php

示例6: __construct

 public function __construct($data = array())
 {
     $this->plugin_path = strtolower(get_class($this)) . '/index.html';
     $this->plugin_dir = dirname(__FILE__) . '/' . $this->plugin_path;
     if (file_exists($this->plugin_dir)) {
         $this->plugin_exists = true;
     }
     if (!empty($data['book'])) {
         $this->rdf_url_json = confirm_slash(base_url()) . $data['book']->slug . '/rdf/instancesof/content?format=json&rec=1&ref=1';
         $this->rdf_url_xml = confirm_slash(base_url()) . $data['book']->slug . '/rdf/instancesof/content?&rec=1&ref=1';
         $this->dest_url = confirm_slash(base_url()) . $data['book']->slug;
         $this->email = $data['login']->email;
         $this->source_url = isset($_REQUEST['source_url']) && !empty($_REQUEST['source_url']) ? $_REQUEST['source_url'] : '';
     }
 }
开发者ID:plusperturbatio,项目名称:scalar,代码行数:15,代码来源:transfer_pi.php

示例7: new_comment

 public function new_comment($book, $data = array(), $is_live = false)
 {
     $title = @trim($data['title']);
     $description = @trim($data['description']);
     $content = @trim($data['content']);
     $book_url = confirm_slash(base_url()) . $book->slug;
     $book_title = @strip_tags($book->title);
     $msg = '';
     $arr = array();
     if (!empty($title)) {
         $msg .= '<b>' . $title . '</b>' . "\n";
     }
     if (!empty($description)) {
         $msg .= $description . "\n";
     }
     if (!empty($content)) {
         $msg .= $content . "\n\n";
     }
     $author_emails = array();
     foreach ($book->contributors as $author) {
         if (strtolower($author->relationship) != 'author') {
             continue;
         }
         $author_emails[] = $author->email;
     }
     if (empty($author_emails)) {
         return false;
     }
     $arr['from'] = 'no-reply@' . $this->domain_name();
     $arr['fromName'] = $this->install_name();
     $arr['to'] = $author_emails;
     $arr['replyTo'] = $this->replyto_address();
     $arr['replyToName'] = $this->replyto_name();
     $arr['subject'] = sprintf($this->CI->lang->line('email.new_comment_subject'), $book_title);
     $arr['msg'] = sprintf($this->CI->lang->line('email.new_comment_intro'), $book_title) . "\n\n";
     $arr['msg'] .= $msg;
     $arr['msg'] .= $is_live ? $this->CI->lang->line('email.new_comment_outro') . "\n" : $this->CI->lang->line('email.new_comment_outro_moderated') . "\n";
     $arr['msg'] .= '<a href="' . $book_url . '">' . $book_url . '</a>' . "\n\n";
     $arr['msg'] .= $this->CI->lang->line('email.new_comment_footer');
     $this->send($arr);
     return true;
 }
开发者ID:austinvernsonger,项目名称:scalar,代码行数:42,代码来源:SendMail.php

示例8: create_directory_from_slug

 public function create_directory_from_slug($slug = '')
 {
     if (!mkdir($slug)) {
         throw new Exception('There was a problem creating the ' . $slug . ' folder on the filesystem.');
     }
     if (!mkdir(confirm_slash($slug) . 'media')) {
         echo 'Alert: could not create media folder for ' . $slug . '.';
     }
     chmod($slug, 0777);
     chmod(confirm_slash($slug) . 'media', 0777);
 }
开发者ID:austinvernsonger,项目名称:scalar,代码行数:11,代码来源:book_model.php

示例9: resize

 private function resize($targetFile, $width)
 {
     require confirm_slash(APPPATH) . 'libraries/wideimage/WideImage.php';
     WideImage::load($targetFile)->resize($width)->saveToFile($targetFile);
 }
开发者ID:austinvernsonger,项目名称:scalar,代码行数:5,代码来源:File_Upload.php

示例10: confirm_slash

					});
				});
			// Remove versions
			} else {
				var $next = $the_link.parent().parent().next();
				if ($next.hasClass('version_wrapper')) $next.remove();
				$the_link.html('View');
				$the_link.data('is_open',false);
				$the_link.blur();
			}
		}

		</script>

		<a href="<?php 
    echo confirm_slash(base_url()) . confirm_slash($book->slug);
    ?>
new.edit" style="float:right;font-size:11px !important;" class="generic_button">Create new page</a>

		<form style="float:left;" id="formSearch">
		<input type="text" name="sq" style="width:300px;float:left;margin-right:3px;" class="generic_text_input" value="Search for a page" onmousedown="if (this.value=='Search for a page') this.value='';" />
		<input type="submit" value="Go" class="generic_button" />&nbsp; <a href="javascript:;">clear</a>&nbsp;
		<?php 
    if (count($current_book_content)) {
        ?>
		&nbsp; <span class="prev"></span>&nbsp; <span class="pagination"></span> <b class="total"><?php 
        echo count($current_book_content);
        ?>
</b> page<?php 
        echo $current_book_content > 1 ? 's' : '';
        ?>
开发者ID:austinvernsonger,项目名称:scalar,代码行数:31,代码来源:pages.php

示例11: save

 public function save($array = array())
 {
     // Get ID
     $content_id = (int) $array['id'];
     if (empty($content_id)) {
         throw new Exception('Could not resolve content ID');
     }
     unset($array['id']);
     unset($array['section']);
     unset($array['ci_session']);
     if (isset($array['color']) && $array['color'] == '#ffffff') {
         $array['color'] = '';
     }
     // If the slug has changed...
     if (isset($array['slug'])) {
         // Get previous slug
         $this->db->select('slug');
         $this->db->from($this->pages_table);
         $this->db->where('content_id', $content_id);
         $query = $this->db->get();
         $result = $query->result();
         if (!isset($result[0])) {
             throw new Exception('Could not find book');
         }
         $slug = $result[0]->slug;
         // Get book slug
         $this->db->select($this->books_table . '.slug');
         $this->db->select($this->books_table . '.book_id');
         $this->db->from($this->pages_table);
         $this->db->join($this->books_table, $this->books_table . '.book_id=' . $this->pages_table . '.book_id');
         $this->db->where($this->pages_table . '.content_id', $content_id);
         $query = $this->db->get();
         $result = $query->result();
         if (!isset($result[0])) {
             throw new Exception('Could not find book');
         }
         $book_slug = $result[0]->slug;
         $book_id = (int) $result[0]->book_id;
         // Scrub slug
         if (!function_exists('safe_name')) {
             $ci = get_instance();
             $ci->load->helper('url');
         }
         $array['slug'] = safe_name($array['slug']);
         $array['slug'] = $this->safe_slug($array['slug'], $book_id, $content_id);
         // Rewrite URLs in book text content
         // This is most likely not to be completely trusted but if working properly provides a userful service to authors since linking is important in Scalar
         if ($array['slug'] != $slug) {
             // TODO: test for safety on the slug rename
             $this->db->select($this->versions_table . '.version_id');
             $this->db->from($this->versions_table);
             $this->db->join($this->pages_table, $this->versions_table . '.content_id=' . $this->pages_table . '.content_id');
             $this->db->join($this->books_table, $this->pages_table . '.book_id=' . $this->books_table . '.book_id');
             $this->db->where($this->books_table . '.book_id', $book_id);
             $query = $this->db->get();
             if ($query->num_rows()) {
                 $dbprefix = $this->db->dbprefix;
                 // Since we're using a custom MySQL query below
                 if (empty($dbprefix)) {
                     die('Could not resolve DB prefix. Nothing has been saved. Please try again');
                 }
                 $book_version_ids = array();
                 $result = $query->result();
                 foreach ($result as $row) {
                     $book_version_ids[] = $row->version_id;
                 }
                 if (!empty($book_version_ids)) {
                     // Update hard URLs in version contet
                     $old = confirm_slash(base_url()) . confirm_slash($book_slug) . $slug;
                     $new = confirm_slash(base_url()) . confirm_slash($book_slug) . $array['slug'];
                     $query = $this->db->query("UPDATE " . $dbprefix . $this->versions_table . " SET content = replace(content, '{$old}', '{$new}') WHERE version_id IN (" . implode(',', $book_version_ids) . ")");
                     // Update soft URLs in version contet - href
                     $old = 'href="' . $slug . '"';
                     $new = 'href="' . $array['slug'] . '"';
                     $query = $this->db->query("UPDATE " . $dbprefix . $this->versions_table . " SET content = replace(content, '" . addslashes($old) . "', '" . addslashes($new) . "') WHERE version_id IN (" . implode(',', $book_version_ids) . ")");
                     // Update soft URLs in version contet - resource
                     $old = 'resource="' . $slug . '"';
                     $new = 'resource="' . $array['slug'] . '"';
                     $query = $this->db->query("UPDATE " . $dbprefix . $this->versions_table . " SET content = replace(content, '" . addslashes($old) . "', '" . addslashes($new) . "') WHERE version_id IN (" . implode(',', $book_version_ids) . ")");
                 }
             }
         }
     }
     // isset $array['slug']
     // Save row
     $this->db->where('content_id', $content_id);
     $this->db->update($this->pages_table, $array);
     return $array;
 }
开发者ID:austinvernsonger,项目名称:scalar,代码行数:89,代码来源:page_model.php

示例12: confirm_slash

    ?>
" />	
		<input type="hidden" name="api_key" value="0" />
		<input type="hidden" name="child_urn" value="<?php 
    echo $book->urn;
    ?>
" />
		<input type="hidden" name="child_type" value="http://scalar.usc.edu/2012/01/scalar-ns#Book" />
		<input type="hidden" name="child_rel" value="page" />		
	</form>		
		
	<p id="loading"><img src="<?php 
    echo confirm_slash($app_root);
    ?>
views/melons/honeydew/images/loading.gif"" height="16" align="absmiddle" />&nbsp; Searching the archive (may take a moment)</p>
		
	<div id="results"></div>

	<div class="search_results_footer"><img src="<?php 
    echo confirm_slash($app_root);
    ?>
views/melons/honeydew/images/loading.gif"" height="16" align="absmiddle" />&nbsp; <a class="generic_button large default" href="javascript:;" onclick="search_archive_import();">Import selected media</a></div>

	<br clear="both" />
	
<?php 
}
?>

</div>
开发者ID:paulshannon,项目名称:scalar,代码行数:30,代码来源:import.php

示例13:

<?php

if (!file_exists(confirm_slash(APPPATH) . 'views/melons/honeydew/content/' . $view . '.php')) {
    show_404();
}
$this->template->add_css(path_from_file(__FILE__) . '../../modules/cover/login.css');
$this->template->add_css(path_from_file(__FILE__) . '../../modules/cover/title.css');
$this->template->add_css(path_from_file(__FILE__) . 'content.css');
if (isset($book->stylesheet) && !empty($book->stylesheet)) {
    $this->template->add_css(path_from_file(__FILE__) . 'themes/' . $book->stylesheet . '.css');
}
$this->template->add_js(path_from_file(__FILE__) . 'main.js');
$this->load->view('melons/honeydew/content/' . $view);
开发者ID:austinvernsonger,项目名称:scalar,代码行数:13,代码来源:content.php

示例14: confirm_slash

echo '<a href="' . confirm_slash(base_url()) . $book->slug . '">';
echo empty($title) ? htmlspecialchars('<title missing>') : $title;
echo '</a>';
if (isset($book->contributors)) {
    if (function_exists('sort_contributors')) {
        usort($book->contributors, 'sort_contributors');
    }
    $contribs = array();
    foreach ($book->contributors as $row) {
        if ('author' == $row->relationship && $row->list_in_index) {
            $contribs[] = $row->fullname;
        }
    }
    if (count($contribs)) {
        echo ' by ' . implode(' and ', $contribs);
    }
}
if (isset($book) && !empty($book)) {
    echo '.  <a href="' . confirm_slash(base_url()) . confirm_slash($book->slug) . 'help">Help reading this ' . $book->scope . '</a>.</span><br />' . "\n";
}
// Publisher and license
echo '<span class="poweredby">' . "\n";
if (!empty($book->publisher)) {
    echo 'Published by ' . $book->publisher . '. ';
}
echo 'Powered by <a href="http://scalar.usc.edu">Scalar</a>.<br /><a href="http://scalar.usc.edu/terms-of-service/">Terms of Service</a> | <a href="http://scalar.usc.edu/privacy-policy/">Privacy Policy</a> | <a href="http://scalar.usc.edu/contact/">Scalar Feedback</a>';
echo "</span>\n";
echo "</div>\n";
// logo wrapper
echo "</div>\n";
// footer_content
开发者ID:paulshannon,项目名称:scalar,代码行数:31,代码来源:footer.php

示例15: abs_url

  		</tr>
  		<tr class="styling_sub"><!-- color -->
  			<td>Color<br /><small>e.g., for path nav bar</small></td>
  			<td><input style="width:100%;" type="text" id="color_select" name="scalar:color" value="<?php 
echo !empty($page->color) ? $page->color : '#ffffff';
?>
" /></td>
  			<td class="styling_last">
  				 <a href="javascript:;" class="generic_button" onclick="$(this).next().toggle();">Choose</a>
  				<div style="display:none;margin-top:6px;"><div id="colorpicker"></div></div>
  			</td>
  		</tr>
  		<tr class="styling_sub"><!-- background image -->
  			<td>Background image</td>
  			<td><?php 
echo @(!empty($page->background)) ? '<img src="' . abs_url($page->background, confirm_slash(base_url()) . confirm_slash($book->slug)) . '" class="thumb_preview" />' : 'No background image has been set';
?>
</td>
  			<td class="styling_last"><select name="scalar:background"><option value="">Choose an uploaded image</option><?php 
$matched = false;
foreach ($book_images as $book_image_row) {
    if (@$page->background == $book_image_row->versions[$book_image_row->version_index]->url) {
        $matched = true;
    }
    $slug_version = get_slug_version($book_image_row->slug);
    echo '<option value="' . $book_image_row->versions[$book_image_row->version_index]->url . '" ' . (@$page->background == $book_image_row->versions[$book_image_row->version_index]->url ? 'selected' : '') . '>' . $book_image_row->versions[$book_image_row->version_index]->title . (!empty($slug_version) ? ' (' . $slug_version . ')' : '') . '</option>';
}
if (!$matched) {
    echo '<option value="' . @$page->background . '" selected>' . @$page->background . '</option>';
}
?>
开发者ID:plusperturbatio,项目名称:scalar,代码行数:31,代码来源:edit.php


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