我在我的网站上使用CKEditor作为后端编辑器.它驱使我绕过弯道,因为它似乎想要在我按下源按钮时将代码更改为它看起来如何合适.例如,如果我点击源并创建一个<div>...
<div class="myclass">some content</div>
Run Code Online (Sandbox Code Playgroud)
然后没有明显的理由剥离类<div>,所以当我再次点击源它已被改为...
<div>some content</div>
Run Code Online (Sandbox Code Playgroud)
我认为这种恼人的行为可以在关闭config.js,但我一直在挖掘,无法在文档中找到任何东西来关闭它.
嗨,我在joomla的一些CSS课程有问题.我在一个模块中有两个div,一个是wrapper class ="wrapper",另一个是content class ="content".内容是封装内部.我想要做的是在内容类上定位css样式.通常我会在样式表中放入.content {my style info},但问题是这个类在整个页面中被多次使用.所以在后端,你可以为模块分配一个类名,所以我称之为.testimonials.
所以我不改变页面上的所有其他内容类,我试图通过这样做来定位它:
.testimonials .content {my style info I am trying to apply}
Run Code Online (Sandbox Code Playgroud)
但它不起作用,我知道你可以用div做到这一点,所以
#testimonials .content {my style info I am trying to apply}
Run Code Online (Sandbox Code Playgroud)
但我的问题是这可以通过类完成吗?,如果因为我试图使用以下内容出错了:
.testimonials .content {font-size:12px; width:300px !important;}
Run Code Online (Sandbox Code Playgroud)
由于某种原因,内容没有包装,只是在段落末尾的页面上消失了,所以我试图确保内容所在的第一级课程没有重叠,奇怪的是即使我修复了内容所在的div类到50px它仍然不会包装文本,所以我不确定我是否正确定位它?
编辑>>>>>>>>>> ..
html Joomla创建基本上看起来像这样>>
<div class="wrapper">
<div class="content">SOME CONTENT</div
</div>
Run Code Online (Sandbox Code Playgroud)
然后它被包含在一百万个其他div中,以古老的Joomla风格.
我给了模块一类推荐书,所以它最终看起来像:
<div class="testimonials">
<div class="wrapper">
<div class="content">SOME CONTENT</div
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
编辑3 >>>>>>>好的,这就是吐出的东西
<div class="testimonials">
<div class="key4-block">
<div class="module-title"><h2 class="title">Client Testimonials</h2></div>
<div class="key4-module-inner">
<div class="module-content">
<script type="text/javascript">
RokStoriesImage['rokstories-184'].push('');
RokStoriesImage['rokstories-184'].push('');
RokStoriesImage['rokstories-184'].push('');
</script>
<div id="rokstories-184" …Run Code Online (Sandbox Code Playgroud) 我使用以下脚本来处理表单以向我的网站添加信息.我遇到的问题是,当我提交表单时,没有任何内容被提交到数据库,并且没有错误.如何向查询添加错误报告?
<?php
if (isset($_POST['itemdescription'])) {$itemdescription = $_POST['itemdescription'];}else {$itemdescription = '';}
if (isset($_POST['itemnumber'])) {$itemnumber = $_POST['itemnumber'];}else {$itemnumber = '';}
if (isset($_POST['sellerid'])) {$sellerid = $_POST['sellerid'];}else {$sellerid = '';}
if (isset($_POST['purchasedate'])) {$purchasedatepre = $_POST['purchasedate'];$date = DateTime::createFromFormat("D F d, Y", $purchasedatepre);$purchasedate = date('Y-m-d',strtotime($purchasedatepre));}else {$purchasedatepre = ''; $purchasedate = '';}
if (isset($_POST['otherinfo'])) {$otherinfo = $_POST['otherinfo'];}else {$otherinfo = '';}
if (isset($_POST['numberofitems'])) {$numberofitems = $_POST['numberofitems'];}else {$numberofitems = '';}
if (isset($_POST['numberofitemsused'])) {$numberofitemsused = $_POST['numberofitemsused'];}else {$numberofitemsused = '';}
if (isset($_POST['isitdelivered'])) {$isitdelivered = $_POST['isitdelivered'];}else {$isitdelivered = '';}
if (isset($_POST['price'])) {$price …Run Code Online (Sandbox Code Playgroud) 我使用以下脚本从mysql数据库中提取日历信息并将其显示在页面上.我试图从标准的Mysql日期格式重新格式化日期,但是当从数据库中检索它时,我收到以下错误:
Warning: date_format() expects parameter 1 to be DateTime, string given in C:\easyphp\www\twinfocus\managecalendar.php on line 24
Warning: date_format() expects parameter 1 to be DateTime, string given in C:\easyphp\www\twinfocus\managecalendar.php on line 24
Warning: date_format() expects parameter 1 to be DateTime, string given in C:\easyphp\www\twinfocus\managecalendar.php on line 24
Warning: date_format() expects parameter 1 to be DateTime, string given in C:\easyphp\www\twinfocus\managecalendar.php on line 24
Run Code Online (Sandbox Code Playgroud)
数据库(如您所见,日期存储正确):

剧本 :
<?php
$sql2 = <<<SQL
SELECT *
FROM `calendar`
SQL;
if(!$result2 = $db->query($sql2)){ die('There was an error …Run Code Online (Sandbox Code Playgroud) 我有一个问题是让jQuery Datatables库在我的Joomla网站表上正确显示. http://datatables.net
脚本是我的表的一半样式,然后放弃(我得到表头颜色更改和文本颜色,但没有数据表控件等).
Firebug也抛出以下错误:
TypeError: oColumn is undefined
Run Code Online (Sandbox Code Playgroud)
在我的Joomla模板index.php中我有以下内容<head>:
<script src="./datatables/js/jquery.js" type="text/javascript"></script>
<script src="./datatables/js/jquery.dataTables.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function() {
jQuery('#staff_table').dataTable({
"bLengthChange": true,
"bFilter": true,
"bSort": true,
"bInfo": true,
"bAutoWidth": true
} );
} );
</script>
Run Code Online (Sandbox Code Playgroud)
HTML/PHP看起来像这样:
<h3>Members of Staff</h3>
<p>If you're looking for a member of staff at Tower Road Academy, you'll find their details here.</p>
<table class="staff_table" id="staff_table">
<tr class="staff_table_head">
<th>Name</th>
<th>Job Title</th>
<th>Email Address</th>
</tr>
<?php
$result = mysql_query("SELECT * FROM itsnb_chronoforms_data_addstaffmember");
while($row = …Run Code Online (Sandbox Code Playgroud) 我想阻止搜索引擎抓取我的整个网站.
我有一个公司成员使用的Web应用程序.它托管在Web服务器上,以便公司的员工可以访问它.没有其他人(公众)需要它或发现它有用.
因此,我希望添加另一层安全性(理论上),以通过完全取消所有搜索引擎机器人/抓取工具对其的访问来尝试防止未经授权的访问.让谷歌索引我们的网站以使其可搜索从商业角度来看是没有意义的,只是为黑客添加了另一种方式来首先找到网站来尝试破解它.
我知道robots.txt你可以告诉搜索引擎不要抓取某些目录.
是否有可能告诉机器人不要抓取整个网站而不必列出所有不爬网的目录?
最好robots.txt用.htaccess或其他方法完成或最好吗?
好吧,这是我对阿贾克斯的第一次尝试,它让我疯狂,因为我真的无法理解它.我想要做的是从数据库填充客户的第一个框,然后使用customerID从select.php脚本中选择数据库中的所有vehicleID.正在发生的事情是客户框正在被选中,但是当选择客户时没有任何事情发生.
这是我的Test.php文件:
<?php include 'connectmysqli.php'; ?>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>Select test</title>
<script src="./js/jquery/jquery.js"></script>
<script type="text/javascript" charset="utf-8">
$$('#customer')
.on('change', function () {
$.getJSON('select.php', { customerId: $(this)
.val() }, function (data) {
var options = '';
for (var x = 0; x < data.length; x++) {
options += '<option value="' + data[x][
'id'] + '">' + data[x]['reg'] +
'</option>';
}
$('#vehicle')
.html(options);
});
});
</script>
</head>
<body>
<select id="customer">
<?php
$sql = <<<SQL
SELECT *
FROM `customers`
SQL;
if(!$result …Run Code Online (Sandbox Code Playgroud) 我使用以下内容尝试以如下格式输出我的月度总计:
January
Quoted Total : £678
Parts Total : £432
Profit Total : £244
February
Quoted Total : £650
Parts Total : £345
Profit Total : £123
Run Code Online (Sandbox Code Playgroud)
等等..........
// Work Complete Totals
$query = $db->query("SELECT SUM(pricequoted) AS pricequotedtotal,
SUM(partprice) AS partpricetotal,
SUM(profit) profittotal,
DATE_FORMAT('%Y-%m', completeddate) AS month
FROM `jobdetails`
WHERE jobstatus='complete'
GROUP BY DATE_FORMAT('%Y-%m', completeddate)");
echo '<div style="float:right; padding-right:10px;">';
echo '<strong>Work Complete Totals</strong>';
while($result = $query->fetch_object()) {
$pricequoted = number_format($result->pricequotedtotal, 2, '.', '');
$partprice = number_format($result->partpricetotal, 2, '.', '');
$profit …Run Code Online (Sandbox Code Playgroud) 我将如何在jQuery中使用php值?我正在做的是使用php从数据库中提取增值税,如下所示并存储在$ vatrate中:
$sqlv = <<<SQL
SELECT *
FROM `vatrate`
WHERE id='1'
SQL;
if(!$resultv = $db->query($sqlv)){
die('There was an error running the query [' . $db->error . ']');
}
while($rowv = $resultv->fetch_assoc()){
$vatrate = $rowv['vatrate'];
} ?>
Run Code Online (Sandbox Code Playgroud)
然后我有我的jQuery脚本,它将所有行总数加在一起并将其放入一个范围内.
<script>
$(document).ready(function() {
$('input').on('keyup', function() {
var rawValue, grandtotal = 0;
$('span[id^="linetotal"]').each(function(i, elem) {
rawValue = $.trim($(this).text());
if (rawValue == '') rawValue = 0;
grandtotal += parseFloat(rawValue);
});
$('#grandtotal').text(grandtotal);
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
但是现在我不确定如何在jQuery中引用php中声明的$ vatrate值,这样我就能得到价格+增值税.增值税是不在英国的任何人的销售税:).
我试图在php中创建一个单词过滤器,我遇到了一个先前的Stackoverlow帖子,它提到了以下内容以检查字符串是否包含某些单词.我想要做的是调整它,以便一次检查各种不同的单词,而不必一遍又一遍地重复代码.
$a = 'How are you ?';
if (strpos($a,'are') !== false) {
echo 'true';
}
Run Code Online (Sandbox Code Playgroud)
如果我将代码修改为以下内容,它会起作用吗?......
$a = 'How are you ?';
if (strpos($a,'are' OR $a,'you' OR $a,'How') !== false) {
echo 'true';
}
Run Code Online (Sandbox Code Playgroud)
添加多个单词进行检查的正确方法是什么?
php ×7
html ×4
jquery ×3
mysql ×2
.htaccess ×1
ajax ×1
ckeditor ×1
class ×1
css ×1
datatables ×1
date ×1
group-by ×1
html-table ×1
if-statement ×1
javascript ×1
joomla ×1
module ×1
mysqli ×1
robots.txt ×1
security ×1
sql ×1
string ×1
strpos ×1
variables ×1