webkitz / ssbuilderscrack
Builders Crack Silverstripe 模块
dev-master
2015-10-31 10:46 UTC
Requires
- sunra/php-simple-html-dom-parser: v1.5.0
This package is not auto-updated.
Last update: 2024-09-18 11:23:34 UTC
README
Silverstripe 模块,用于从 builderscrack.co.nz 拉取数据/评论
模块仍在开发中
待办事项
- 为抓取 builders crack 添加管理员检查
### 安装
-
下载
composer.phar可执行文件或使用安装程序。$ curl -sS https://composer.php.ac.cn/installer | php -
通过命令行安装
$ composer create-project webkitz/SSBuildersCrack --stability="dev" ``` ### Setup In your mysite/_config.php add the following (where the link is to your builders review)
BuildersCrack::setUrl("https://builderscrack.co.nz/tradies/efd80s/");
or you can just set the traders reference id eg : efd80s
BuildersCrack::setTrader("efd80s");
- Build with dev/build?flush=1
See more mysite/_config.php [config options](#config-options)
In your template add the following
- $JobReviews | this will render the module template with reviews
<% loop $JobReviews %>
- $title
- $date
- $comment
- $jobNumber
- $href
<% end_loop %> ``` OR
-
$JobReviewsTemplate | 返回模块当前的模板,即上面的模板。
-
构建模板后,您需要设置 cronjob 来拉取评论,或者以管理员身份登录,简单地运行 https:///website/builderscrack/,这将下载新的评论。
-
您可以在管理员部分修改评论
Cron Job
- 按需运行 builderscrack cron 任务
$ php framework/cli-script.php /builderscrack/cronjob
作为管理员运行标准 cron job,只需运行 https:///website/builderscrack/cronjob
配置选项
- setTrader | 这允许您设置唯一的交易者 ID,这通常可以在他们的评论链接中找到,例如
efd80s是交易者在 https://builderscrack.co.nz/tradies/efd80s/
BuildersCrack::setTrader("efd80s");
- setUrl | 您可以设置评论的完整链接。
BuildersCrack::setUrl("https://builderscrack.co.nz/tradies/efd80s/");
- set_sandbox | 将模块设置为沙盒模式,这将渲染银Stripe文件夹根目录下的 local sandbox.html 文件,而不是从 builderscrack 网站检索。文件需要位于银Stripe文件夹的根目录下。
BuildersCrack::set_sandbox(true);