本文整理汇总了PHP中tsl函数的典型用法代码示例。如果您正苦于以下问题:PHP tsl函数的具体用法?PHP tsl怎么用?PHP tsl使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tsl函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: copy
// create components.xml page
$init = $relative . "data/other/components.xml";
$temp = "inc/tmp/tmp-components.xml";
if (!file_exists($init)) {
copy($temp, $init);
}
// create 404.xml page
$init = $relative . "data/other/404.xml";
$temp = "inc/tmp/tmp-404.xml";
if (!file_exists($init)) {
copy($temp, $init);
}
// create root .htaccess page
$init = $relative . ".htaccess";
$temp_data = file_get_contents("inc/tmp/tmp.htaccess");
$temp_data = str_replace('**REPLACE**', tsl($path_parts), $temp_data);
$fp = fopen($init, 'w');
fwrite($fp, $temp_data);
fclose($fp);
// create gsconfig.php if it doesn't exist yet.
$init = $relative . "gsconfig.php";
$temp = $relative . "temp.gsconfig.php";
if (file_exists($init)) {
unlink($temp);
} else {
rename($temp, $init);
}
// send email to new administrator
$subject = $site_full_name . ' ' . $i18n['EMAIL_COMPLETE'];
$message .= $i18n['EMAIL_USERNAME'] . ': ' . stripslashes($_POST['user']);
$message .= '<br>' . $i18n['EMAIL_PASSWORD'] . ': ' . $random;
示例2: json_encode
// init gs namespace and i18n
var GS = {};
GS.i18n = <?php
echo json_encode($jsi18n);
?>
;
GS.debug = <?php
echo isDebug() === true ? 'true' : 'false';
?>
;
GS.siteurl = '<?php
echo $SITEURL;
?>
';
GS.uploads = '<?php
echo tsl($SITEURL) . getRelPath(GSDATAUPLOADPATH);
?>
';
var uploadSession = '<?php
echo $SESSIONHASH;
?>
';
var uploadPath = '<?php
echo isset($_GET['path']) ? $_GET['path'] : "";
?>
';
var maxFileSize = '<?php
echo toBytesShorthand(getMaxUploadSize(), 'M');
?>
';
示例3: tsl
// $GS_script_assets = array(
// 'jquery' => array(
// 'cdn' => array(
// 'url' => '//ajax.googleapis.com/ajax/libs/jquery/'.$jquery_ver.'/jquery.min.js',
// 'ver' => $jquery_ver
// ),
// 'local' => array(
// 'url' => $ASSETURL.$GSADMIN.'/template/js/jquery/jquery-'.$jquery_ver.'.min.js',
// 'ver' => $jquery_ver
// )
// )
// )
/**
* Core assets
*/
$ASSETPATH = $ASSETURL . tsl(getRelPath(GSADMINTPLPATH));
// core
$GS_script_assets['getsimple']['local']['url'] = $ASSETPATH . 'js/jquery.getsimple.js';
$GS_script_assets['getsimple']['local']['ver'] = $getsimple_ver;
// lazyload (lazy loading assets js/css)
$GS_script_assets['lazyload']['local']['url'] = $ASSETPATH . 'js/lazyload.js';
$GS_script_assets['lazyload']['local']['ver'] = $getsimple_ver;
// gstree (collpaseble heirarchy table tree)
$GS_script_assets['gstree']['local']['url'] = $ASSETPATH . 'js/jquery-gstree.js';
$GS_script_assets['gstree']['local']['ver'] = $getsimple_ver;
// spin (ajax spinners)
$GS_script_assets['spin']['local']['url'] = $ASSETPATH . 'js/spin.js';
$GS_script_assets['spin']['local']['ver'] = $getsimple_ver;
// dropzone (ajax/html uploader w drag and drop)
$GS_script_assets['dropzone']['local']['url'] = $ASSETPATH . 'js/dropzone.js';
$GS_script_assets['dropzone']['local']['ver'] = $getsimple_ver;
示例4: login_cookie_check
// Setup inclusions
$load['plugin'] = true;
include 'inc/common.php';
login_cookie_check();
$dirsSorted = null;
$filesSorted = null;
$foldercount = null;
if (isset($_GET['path']) && !empty($_GET['path'])) {
$path = str_replace('../', '', $_GET['path']);
$path = tsl("../data/uploads/" . $path);
// die if path is outside of uploads
if (!path_is_safe($path, GSDATAUPLOADPATH)) {
die;
}
$subPath = str_replace('../', '', $_GET['path']);
$subFolder = tsl($subPath);
} else {
$path = "../data/uploads/";
$subPath = '';
$subFolder = '';
}
// check if host uses Linux (used for displaying permissions
$isUnixHost = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN' ? false : true;
// if a file was uploaded
if (isset($_FILES['file'])) {
$uploadsCount = count($_FILES['file']['name']);
if ($uploadsCount > 0) {
$errors = array();
$messages = array();
for ($i = 0; $i < $uploadsCount; $i++) {
if ($_FILES["file"]["error"][$i] > 0) {
示例5: get_root_path
/**
* Get Root Install Path
*
* Gets the path of the root installation directory
*
* @since 1.0
*
* @return string
*/
function get_root_path()
{
$pos = strrpos(dirname(__FILE__), DIRECTORY_SEPARATOR . 'inc');
$adm = substr(dirname(__FILE__), 0, $pos);
$pos2 = strrpos($adm, DIRECTORY_SEPARATOR);
return tsl(substr(__FILE__, 0, $pos2));
}
示例6: find_url
/**
* Creates Standard URL for Pages
*
* Default function to create the correct url structure for each front-end page
*
* @since 2.0
* @uses $PRETTYURLS
* @uses $SITEURL
* @uses $PERMALINK
* @uses tsl
*
* @param string $slug
* @param string $parent
* @param string $type Default is 'full', alternative is 'relative'
* @return string
*/
function find_url($slug, $parent, $type = 'full')
{
global $PRETTYURLS;
global $SITEURL;
global $PERMALINK;
if ($type == 'full') {
$full = $SITEURL;
} elseif ($type == 'relative') {
$s = pathinfo(htmlentities(getScriptFile(), ENT_QUOTES));
$full = $s['dirname'] . '/';
$full = str_replace('//', '/', $full);
} else {
$full = '/';
}
if ($parent != '') {
$parent = tsl($parent);
}
if ($PRETTYURLS == '1') {
if ($slug != 'index') {
$url = $full . $parent . $slug . '/';
} else {
$url = $full;
}
} else {
if ($slug != 'index') {
$url = $full . 'index.php?id=' . $slug;
} else {
$url = $full;
}
}
if (trim($PERMALINK) != '' && $slug != 'index') {
$plink = str_replace('%parent%/', $parent, $PERMALINK);
$plink = str_replace('%parent%', $parent, $plink);
$plink = str_replace('%slug%', $slug, $plink);
$url = $full . $plink;
}
return (string) $url;
}
示例7: tsl
" class="gs_image gs_thumb" height="<?php
echo $thheight;
?>
" width="<?php
echo $thwidth;
?>
" alt=""></p>
<p id="code-thumb-link"><?php
echo tsl($SITEURL) . 'data/thumbs/' . $subPath . 'thumbnail.' . rawurlencode($src);
?>
</p>
<p id="code-imgthumb-html"><a href="<?php
echo tsl($SITEURL) . 'data/uploads/' . $subPath . rawurlencode($src);
?>
" class="gs_image_link" ><img src="<?php
echo tsl($SITEURL) . 'data/thumbs/' . $subPath . 'thumbnail.' . rawurlencode($src);
?>
" class="gs_thumb" height="<?php
echo $thheight;
?>
" width="<?php
echo $thwidth;
?>
" alt="" /></a></p>
</div>
</div>
<div id="jcrop_open" class="main">
<img src="<?php
echo $src_folder . $subPath . rawurlencode($src);
示例8: getFiles
}
}
$path = '../backups/other';
$data = getFiles($path);
sort($data);
foreach ($data as $file) {
if (isFile($file, $path)) {
echo '<tr><td>' . tsl($path) . $file . '</td><td>' . @valid_xml(tsl($path) . $file) . '</td></tr>';
}
}
$path = '../backups/pages';
$data = getFiles($path);
sort($data);
foreach ($data as $file) {
if (isFile($file, $path)) {
echo '<tr><td>' . tsl($path) . $file . '</td><td>' . @valid_xml(tsl($path) . $file) . '</td></tr>';
}
}
?>
</table>
<h3><?php
echo $i18n['DIR_PERMISSIONS'];
?>
</h3>
<table class="highlight healthcheck">
<tr><td style="width:345px;" >../data/pages/</td><td><?php
if (check_perms("../data/pages/") >= '0755') {
echo '<span class="OKmsg" >' . check_perms("../data/pages/") . ' ' . $i18n['WRITABLE'] . ' - ' . $i18n['OK'] . '</span>';
} else {
echo '<span class="ERRmsg" >' . check_perms("../data/pages/") . ' ' . $i18n['NOT_WRITABLE'] . ' - ' . $i18n['ERROR'] . '!</span>';
示例9: nm_generate_htaccess
function nm_generate_htaccess()
{
global $NMPAGEURL, $PERMALINK;
$path = tsl(suggest_site_path(true));
$prefix = '';
$page = '';
# format prefix and page directions
if ($NMPAGEURL != 'index') {
if (nm_get_parent() != '' && ($PERMALINK == '' || strpos($PERMALINK, '%parent%') !== false)) {
$prefix = nm_get_parent() . '/' . $NMPAGEURL . '/';
} else {
$prefix = $NMPAGEURL . '/';
}
$page = 'id=' . $NMPAGEURL . '&';
}
# generate .htaccess contents
$htaccess = file_get_contents(GSPLUGINPATH . 'news_manager/temp.htaccess');
$htaccess = str_replace('**PATH**', $path, $htaccess);
$htaccess = str_replace('**PREFIX**', $prefix, $htaccess);
$htaccess = str_replace('**PAGE**', $page, $htaccess);
$htaccess = htmlentities($htaccess, ENT_QUOTES, 'UTF-8');
# show .htaccess
include NMTEMPLATEPATH . 'htaccess.php';
}
示例10: foreach
}
}
if (count($filesSorted) != 0) {
foreach ($filesSorted as $upload) {
$upload['name'] = rawurlencode($upload['name']);
$thumb = null;
$thumbnailLink = null;
$subDir = $subPath == '' ? '' : $subPath . '/';
$selectLink = 'title="' . i18n_r('SELECT_FILE') . ': ' . htmlspecialchars($upload['name']) . '" href="javascript:void(0)" onclick="submitLink(' . $CKEditorFuncNum . ',\'' . $fullPath . $subDir . $upload['name'] . '\')"';
if ($type == 'images') {
if ($upload['type'] == i18n_r('IMAGES') . ' Images') {
# get internal thumbnail to show beside link in table
$thumb = '<td class="imgthumb" style="display:table-cell" >';
$thumbLink = $urlPath . 'thumbsm.' . $upload['name'];
if (file_exists(GSTHUMBNAILPATH . $thumbLink . 'a')) {
$imgSrc = '<img src="' . tsl($SITEURL) . getRelPath(GSTHUMBNAILPATH) . $thumbLink . '" />';
} else {
$imgSrc = '<img src="inc/thumb.php?src=' . $urlPath . $upload['name'] . '&dest=' . $thumbLink . '&x=65&f=1" />';
}
$thumb .= '<a ' . $selectLink . ' >' . $imgSrc . '</a>';
$thumb .= '</td>';
# get external thumbnail link
$thumbLinkExternal = $urlPath . 'thumbnail.' . $upload['name'];
if (file_exists(GSTHUMBNAILPATH . $thumbLinkExternal)) {
$thumbnailLink = '<span> – </span><a href="javascript:void(0)" onclick="submitLink(' . $CKEditorFuncNum . ',\'' . $sitepath . getRelPath(GSTHUMBNAILPATH) . $thumbLinkExternal . '\')">' . i18n_r('THUMBNAIL') . '</a>';
}
} else {
continue;
}
}
$counter++;
示例11: login_cookie_check
/****************************************************
*
* @File: upload.php
* @Package: GetSimple
* @Action: Displays and uploads files to the website
*
*****************************************************/
// Setup inclusions
$load['plugin'] = true;
// Relative
$relative = '../';
// Include common.php
include 'inc/common.php';
// Variable settings
login_cookie_check();
$path = tsl("../data/uploads/");
// if a file was uploaded
if (isset($_FILES["file"])) {
if ($_FILES["file"]["error"] > 0) {
$error = $i18n['ERROR_UPLOAD'];
} else {
//set variables
$count = '1';
$file_loc = $path . clean_img_name($_FILES["file"]["name"]);
$base = $_FILES["file"]["name"];
//prevent overwriting
while (file_exists($file_loc)) {
$file_loc = $path . $count . '-' . clean_img_name($_FILES["file"]["name"]);
$base = $count . '-' . clean_img_name($_FILES["file"]["name"]);
$count++;
}
示例12: user_note
$Err_found = true;
} else {
if (isset($update) && $update) {
user_note('设置文件已更新。', 2);
} else {
user_note('已新建设置文件。', 2);
}
}
echo '</div>';
flushNow();
// Remove old files
if ($old_version == '1.5') {
$removeOldFile = array('lightbox/fancy_close.png', 'lightbox/fancy_loading.png', 'lightbox/fancy_nav_left.png', 'lightbox/fancy_nav_right.png', 'lightbox/fancy_shadow_s.png', 'lightbox/fancy_shadow_e.png', 'lightbox/fancy_shadow_n.png', 'lightbox/fancy_shadow_ne.png', 'lightbox/fancy_shadow_nw.png', 'lightbox/fancy_shadow_se.png', 'lightbox/fancy_shadow_sw.png', 'lightbox/fancy_shadow_w.png', 'lightbox/fancy_title_left.png', 'lightbox/fancy_title_main.png', 'lightbox/fancy_title_over.png', 'lightbox/fancy_title_right.png', 'lightbox/fancybox.png', 'lightbox/fancybox-x.png', 'lightbox/fancybox-y.png', 'lightbox/jquery.fancybox-1.3.4.css', 'lightbox/jquery.fancybox-1.3.4.pack.js', 'img/reset.png', 'img/textback.png', 'lib/dupeimage.class.php', 'lib/remoteImage.class.php', 'lib/resize.class.php');
}
if (isset($removeOldFile)) {
echo '<div class="ibox"><h2>删除旧版文件</h2>';
foreach ($removeOldFile as $oldFile) {
if (@unlink(CFROOTPATH . $oldFile)) {
user_note('已删除:<b>' . $oldFile . '</b><br/>', 2);
}
}
echo '</div>';
}
// install done
if (!$Err_found) {
echo '<div class="ibox"><h2>安装/更新完成</h2>';
user_note('程序安装完成,您现在可以删除 install 目录,然后打开<a href="' . tsl($content['SET_SITEURL']) . 'admin.php">管理员界面</a>,使用下面的用户名与密码登陆后台,对程序进行设置。<br/><br/>
用户:admin<br/>
密码:password', 3);
echo '</div>';
}
示例13: undo
function undo($file, $filepath, $bakpath)
{
$old_file = $filepath . $file;
$new_file = tsl($bakpath) . $file . ".bak";
$tmp_file = tsl($bakpath) . $file . ".tmp";
copy($old_file, $tmp_file);
copy($new_file, $old_file);
copy($tmp_file, $new_file);
unlink($tmp_file);
if (file_exists($tmp_file)) {
return false;
} else {
return true;
}
}
示例14: rawurlencode
$cclass = '';
}
echo '<tr class="All ' . $upload['type'] . ' ' . $cclass . '" >';
echo '<td class="imgthumb" >';
if ($upload['type'] == i18n_r('IMAGES') . ' Images') {
$gallery = 'rel=" facybox_i"';
$pathlink = 'image.php?i=' . rawurlencode($upload['name']) . '&path=' . $subPath;
$thumbLink = $urlPath . 'thumbsm.' . $upload['name'];
$thumbLinkEncoded = $urlPath . 'thumbsm.' . rawurlencode($upload['name']);
if (file_exists(GSTHUMBNAILPATH . $thumbLink)) {
$imgSrc = '<img src="' . tsl($SITEURL) . getRelPath(GSTHUMBNAILPATH) . $thumbLinkEncoded . '" />';
} else {
$imgSrc = '<img src="inc/thumb.php?src=' . $urlPath . rawurlencode($upload['name']) . '&dest=' . $thumbLinkEncoded . '&f=1" />';
}
// thumbnail link lightbox
echo '<a href="' . tsl($SITEURL) . getRelPath($path) . rawurlencode($upload['name']) . '" title="' . rawurlencode($upload['name']) . '" rel=" facybox_i" >' . $imgSrc . '</a>';
} else {
$gallery = '';
$controlpanel = '';
$pathlink = $path . $upload['name'];
}
// name column linked
echo '</td><td><a title="' . i18n_r('VIEW_FILE') . ': ' . htmlspecialchars($upload['name']) . '" href="' . $pathlink . '" class="primarylink">' . htmlspecialchars($upload['name']) . '</a></td>';
// size column
echo '<td style="width:80px;text-align:right;" ><span>' . $upload['size'] . '</span></td>';
// get the file permissions.
if ($isUnixHost && isDebug() && function_exists('posix_getpwuid')) {
$filePerms = substr(sprintf('%o', fileperms($path . $upload['name'])), -4);
$fileOwner = posix_getpwuid(fileowner($path . $upload['name']));
echo '<td style="width:70px;text-align:right;"><span>' . $fileOwner['name'] . '/' . $filePerms . '</span></td>';
}
示例15: get_nonce
echo $TEMPLATE;
?>
&f=<?php
echo $TEMPLATE_FILE;
?>
" method="post" >
<input id="nonce" name="nonce" type="hidden" value="<?php
echo get_nonce("save");
?>
" />
<p><textarea name="content" id="codetext" ><?php
echo htmlentities($content, ENT_QUOTES, 'UTF-8');
?>
</textarea></p>
<input type="hidden" value="<?php
echo tsl($TEMPLATE) . $TEMPLATE_FILE;
?>
" name="edited_file" />
<?php
exec_action('theme-edit-extras');
?>
<p><input class="submit" type="submit" name="submitsave" value="<?php
echo $i18n['BTN_SAVECHANGES'];
?>
" /> <?php
echo $i18n['OR'];
?>
<a class="cancel" href="theme-edit.php?cancel"><?php
echo $i18n['CANCEL'];
?>
</a></p>