-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7723618
commit 9f1ef5b
Showing
11 changed files
with
123 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Big_Cake | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# google-adsense | ||
|
||
A plugin for Blessing Skin Server that can let you display Google Ads with Google AdSense in the website. | ||
|
||
## Usage | ||
|
||
Enable this plugin. | ||
|
||
Copy your client-id (ca-pub-xxxxxxxxxxxxxx) and save it in the settings of the plugin. | ||
|
||
## License | ||
|
||
MIT License | ||
|
||
Copyright ©️ Big_Cake, All Rights Reserved. | ||
|
||
[Google AdSense](https://www.google.com/adsense) is a registered trademark of Google LLC. | ||
|
||
# Google AdSense(谷歌广告) | ||
|
||
这个插件能让你在你的皮肤站内投放谷歌广告。 | ||
|
||
## 用法 | ||
|
||
启用该插件,并将你在 AdSense 页面获取的 client-id 填入配置页面。 | ||
|
||
保存,这时查看页面源代码,就可以看到谷歌广告的 script 标签了。 | ||
|
||
## 开源协议 | ||
|
||
MIT License | ||
|
||
Copyright ©️ Big_Cake, All Rights Reserved. | ||
|
||
[Google AdSense](https://www.google.com/adsense) 是 Google LLC 的注册商标。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
use App\Events\RenderingHeader; | ||
use Illuminate\Contracts\Events\Dispatcher; | ||
|
||
return function (Dispatcher $events) { | ||
$events->listen(RenderingHeader::class, function ($event) { | ||
$html = view('BigCake\googleadsense::snippet', [ | ||
'client_id' => option('client_id'), | ||
])->render(); | ||
$event->addContent($html); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
client_id: ID of the Google AdSense |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
description: Insert your Google AdSense ID to the site. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
client_id: Google Adsense ID(ca-pub-xxxxxxxxxx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
description: 为站点加入 Google Adsense 代码来投放广告。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"name": "google-adsense", | ||
"title": "Google Adsense", | ||
"version": "0.0.1", | ||
"description": "BigCake\\googleadsense::general.description", | ||
"author": "Big_Cake", | ||
"url": "https://bigcake.cakemc.top/", | ||
"namespace": "BigCake\\googleadsense", | ||
"require": { | ||
"blessing-skin-server": "^5|^6" | ||
}, | ||
"enchants": { | ||
"config": "Configuration", | ||
"icon": { | ||
"fa": "google", | ||
"faType": "fab", | ||
"bg": "success" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace BigCake\googleadsense; | ||
|
||
use App\Services\OptionForm; | ||
use Option; | ||
|
||
class Configuration | ||
{ | ||
public function render() | ||
{ | ||
$form = Option::form('Google Adsense', 'client_id', function (OptionForm $form) { | ||
$form->text('client_id', trans('BigCake\googleadsense::config.client_id')); | ||
})->handle(); | ||
|
||
return view('BigCake\googleadsense::config', ['form' => $form]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{% extends 'admin.base' %} | ||
|
||
{% block title %}Google Adsense{% endblock %} | ||
|
||
{% block content %} | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
{{ form|raw }} | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<script data-ad-client="{{ client_id }}" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> |