我在我正在开发的网站的一部分中使用Expression Engine,而其他部分只是使用我自己的PHP.我的问题是如何判断用户是否在非EE页面上登录?我可以访问EE cookie和EE数据库,但无法找到使用这些值来确定用户是谁的方法.我在以下网址列出了所有Cookie键/值:http://andrewgjohnson.com/cookies.html
我有一个Expression Engine插件,它有一个文件参数,例如:
{exp:my_plugin file='/css/css.js'}
Run Code Online (Sandbox Code Playgroud)
我可以使用插件获取参数
$file = $this->EE->TMPL->fetch_param('file');
Run Code Online (Sandbox Code Playgroud)
有没有办法处理$file替换任何标签,即全局变量和片段,以便我可以做类似的事情:
{exp:my_plugin file='{global_path}/css.js'}
Run Code Online (Sandbox Code Playgroud)
并且已{global_path}被全球路径的价值所取代?
只是一个简单的问题,我知道你没有.为什么会这样,有没有办法?你为什么这样?
我只是在学习 MYSQL 查询的来龙去脉,但我遇到了一个项目的障碍,我很感激一些帮助达成解决方案。
我有两个表,第一个包含对条目(entry_id)和相关修改(mod_id)的引用以及它所指的修改类别(mod_name)
表 1:exp_store_product_options
mod_id entry_id mod_name
3 2919 COLOR
4 2311 SIZE
5 2311 COLOR
6 3301 COLOR
Run Code Online (Sandbox Code Playgroud)
第二个表包含两个相关字段,mod_id 和 opt_name
表 2:exp_store_product_modifiers
mod_id opt_name
3 BLACK
4 EU 44
5 BROWN
6 BROWN
Run Code Online (Sandbox Code Playgroud)
我想要实现的是列出所有 DISTINCT opt_name 字段(通过 mod_id 上的连接)对应于我想作为一个整体传入的 entry_ids。
这是到目前为止我想出的代码,我相信除了要求我遍历每个条目 id 的查询之外,它还会做我需要的事情,并且在 DISTINCT 要求上失败,因为对于每次迭代,一切都是不同的. ({sale_products} 标签来自 ExpressionEngine,将在解析过程中循环,为我提供与此页面相关的 entry_id 结果列表
SELECT DISTINCT opt_name
FROM exp_store_product_options
INNER JOIN exp_store_product_modifiers
ON exp_store_product_options.product_mod_id=exp_store_product_modifiers.product_mod_id
{sale_products parse='inward'}entry_id = '{entry_id}' OR{/sale_products}
AND mod_name = 'SIZE'
Run Code Online (Sandbox Code Playgroud)
================================================== ==
以防万一其他人试图在 ExpressionEngine 的 expresso …
我有一些关于fabretail EE2插件的问题.
1)点击后可以不将客户重定向到购物车:添加到购物车"?我右侧有一个小型推车.我只是想让它更新数量.
2)我怎样才能有qty输入字段而不是select字段?我希望客户输入他们想要的产品数量.我输入了输入字段,但只放了1个项目.
{if {type_id} != 6 AND {type_id} != 7}
<label for="qty"> qty </label>
<input name="qty" class="qty" type="text" value="1">
Run Code Online (Sandbox Code Playgroud)
3)如果购物车中满足39美元的要求,如何禁用结账按钮?
步骤1. 在CSS中为您的按钮创建2个类:active_checkout和inactive_checkout(如果您愿意,可以使它们变为颜色) 步骤2 使用此代码
{if ‘{exp:brilliant_retail:cart_items}’ == ‘0’ OR ‘{exp:brilliant_retail:cart_total}’ <= ‘$39’}
<button class=“inactive_checkout”>Checkout</button>
{if:else}
<button class=“active_checkout”>{exp:brilliant_retail:checkout_buttons}</button>
{/if}
Run Code Online (Sandbox Code Playgroud)
第3步将 39美元更改为您希望的最低金额!
希望这是一个简单的解决方案.我很确定我很亲密.所以这里......
代码优先.
{exp:channel:entries channel="client" url_title="{embed:client_name}"}
<tr>
{exp:playa:parents channel="project"}
<td>
{proj_name}
</td>
<td>
{proj_job_number}
{job_number}
{/proj_job_number}
</td>
<td>
{entry_date format="%m/%d/%Y"}
</td>
<td>
{proj_producer}
{producer_name}
{/proj_producer}
</td>
<td>
{proj_vendor}
{vendor_name}
{/proj_vendor}
</td>
<td>
<a href="{proj_folder_zip}"><i class="icon-download"></i></a>
</td>
{/exp:playa:parents}
</tr>
{/exp:channel:entries}
Run Code Online (Sandbox Code Playgroud)
这是我正在使用的嵌入式模板中的代码.我试图从项目频道条目返回每个项目频道条目以及其他playa字段值.我能够正确地返回结果但是我试图将返回的值格式化为html表.所以最后我的问题是......对于标记/标记/条件,我需要做什么,所以每个html表行可以显示一个Project通道条目.现在,playa字段的所有条目都显示在一个表格单元格中,最后一行包含所有表格单元格.如果需要,我可以发布更多代码,或澄清我遗漏的任何内容.非常感谢您对此问题的任何帮助.
干杯!
Expression Engine变量传入模板时遇到一些麻烦.
有一些代码:
//查询:
{exp:channel:entries
channel="static"
}
Run Code Online (Sandbox Code Playgroud)
//在循环中重复字段
{content_matrix}
<div>
{text_cell}
</div>
{image}
{/content_matrix}
Run Code Online (Sandbox Code Playgroud)
//
{/exp:channel:entries}
Run Code Online (Sandbox Code Playgroud)
我想将content_matrix字段与大内部HTML(示例较短)sctructure一起移动到单独的嵌入模板中,以便在其他模板中重用.
试图构建这样的嵌入但它不起作用:
{embed="incl/content_matrix" matrix="{content_matrix}"}
Run Code Online (Sandbox Code Playgroud)
和小模板的身体:
{embed:matrix}
<div>
{text_cell}
</div>
{image}
{/embed:matrix}
Run Code Online (Sandbox Code Playgroud)
通过这种方式,如果您传递单个元素(如ID),但不能传递mupltiple元素.也许它需要通过整个条目.
怎么做?
谢谢.
我正在尝试将外部库加载到ExpressionEngine插件中,但我得到:
消息:未定义属性:Detector :: $ EE
在插件本身我有:
public function __construct()
{
$this->EE->load->library('detector');
$this->EE =& get_instance();
}
Run Code Online (Sandbox Code Playgroud)
我的文件夹设置如下:
检测器
-libraries
--Detector.php
-pi.detector.php
我究竟做错了什么?
移过加载库错误后,我现在使用以下代码收到"未定义变量"错误:
public function detector()
{
return $ua->ua;
}
public function user_agent()
{
return $ua->ua;
}
Run Code Online (Sandbox Code Playgroud)
如果我的模板中有{exp:detector:user_agent},那就是这样.如果我{exp:detector}我没有输出.
客户要求我更新他们的EE网站.在主页上,有一个显示文本数据的小滑块.对于每张幻灯片,网站的原始创建者都会创建条目,并在滑块中将所有这些条目显示为名为footerstats的通道.页脚模板引用此通道.
我去了每个条目,更改了信息,保存了.然后我更新了页脚模板和通道,只是为了它.我甚至清除了所有缓存.尽管如此,旧信息仍然出现在主页上.有小费吗?我是EE的新手.
非常简单的PHP脚本我在我个人设置的Ubuntu Web服务器上的EE模板中运行.
我知道它与权限有关,我已经改变了我正在尝试编写的目录的所有者作为Apache用户.
<?php
$dir = 'export';
$drop =' {exp:ajw_export
sql="SELECT member_id, screen_name, email FROM exp_members"
format="xml"
} ';
echo $dir;
file_put_contents($dir, $drop);
?>
Run Code Online (Sandbox Code Playgroud)
我得到的错误是:
遇到PHP错误
严重性:警告
消息:file_put_contents(导出):无法打开流:是目录
文件名:libraries/Functions.php(689):eval()'d代码
行号:16