Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
4b1eebfc
Commit
4b1eebfc
authored
Jun 10, 2016
by
Dominik Hebeler
Browse files
Clicklog eingebaut
parent
7cadc449
Changes
4
Show whitespace changes
Inline
Side-by-side
app/Http/Controllers/LogController.php
0 → 100644
View file @
4b1eebfc
<?php
namespace
App\Http\Controllers
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Http\Request
;
use
Redis
;
class
LogController
extends
Controller
{
function
clicklog
(
Request
$request
)
{
$redis
=
Redis
::
connection
(
'redisLogs'
);
if
(
$redis
)
{
$logEntry
=
""
;
$logEntry
.
=
"["
.
date
(
DATE_RFC822
,
mktime
(
date
(
"H"
),
date
(
"i"
),
date
(
"s"
),
date
(
"m"
),
date
(
"d"
),
date
(
"Y"
)))
.
"]"
;
$logEntry
.
=
" "
.
$request
->
input
(
'i'
);
$logEntry
.
=
" "
.
$request
->
input
(
's'
);
$logEntry
.
=
" "
.
$request
->
input
(
'q'
);
$logEntry
.
=
" "
.
$request
->
input
(
'p'
);
$logEntry
.
=
" "
.
$request
->
input
(
'url'
);
$redis
->
rpush
(
'logs.clicks'
,
$logEntry
);
}
return
''
;
}
}
\ No newline at end of file
app/Http/routes.php
View file @
4b1eebfc
...
...
@@ -98,6 +98,7 @@
Route
::
get
(
'meta/meta.ger3'
,
'MetaGerSearch@search'
);
Route
::
get
(
'meta/picture'
,
'Pictureproxy@get'
);
Route
::
get
(
'clickstats'
,
'LogController@clicklog'
);
Route
::
get
(
'qt'
,
'MetaGerSearch@quicktips'
);
Route
::
get
(
'tips'
,
'MetaGerSearch@tips'
);
...
...
public/js/scriptResultPage.js
View file @
4b1eebfc
...
...
@@ -61,9 +61,9 @@ function theme(){
}
function
clickLog
(){
$
(
"
.result
.link a
, .result
.title
a
"
).
off
();
$
(
"
.result
.link a
, .result
.title
a
"
).
click
(
function
(){
$
.
get
(
"
/
meta/
clickstats
.pl
"
,
{
i
:
$
(
"
meta[name=p]
"
).
attr
(
"
content
"
),
s
:
$
(
this
).
attr
(
"
data-hoster
"
),
q
:
$
(
"
meta[name=q]
"
).
attr
(
"
content
"
),
p
:
$
(
this
).
attr
(
"
data-count
"
),
url
:
$
(
this
).
attr
(
"
href
"
)});
$
(
"
.result
a.title
, .result
div.link-link
a
"
).
off
();
$
(
"
.result
a.title
, .result
div.link-link
a
"
).
click
(
function
(){
$
.
get
(
"
/clickstats
"
,
{
i
:
$
(
"
meta[name=p]
"
).
attr
(
"
content
"
),
s
:
$
(
this
).
attr
(
"
data-hoster
"
),
q
:
$
(
"
meta[name=q]
"
).
attr
(
"
content
"
),
p
:
$
(
this
).
attr
(
"
data-count
"
),
url
:
$
(
this
).
attr
(
"
href
"
)});
});
}
...
...
resources/views/layouts/result.blade.php
View file @
4b1eebfc
...
...
@@ -10,14 +10,14 @@
@endif
<div
class=
"resultInformation col-xs-10 col-sm-10"
>
<p
class=
"title"
>
<a
class=
"title"
href=
"{{ $result->link }}"
target=
"{{ $metager->getTab() }}"
data-hoster=
"{{ $result->gefVon }}"
data-count=
"{{ $result->number }}"
>
<a
class=
"title"
href=
"{{ $result->link }}"
target=
"{{ $metager->getTab() }}"
data-hoster=
"{{
strip_tags(
$result->gefVon
)
}}"
data-count=
"{{ $result->number }}"
>
{{ $result->titel }}
</a>
</p>
<div
class=
"link"
>
<div>
<div
class=
"link-link"
>
<a
href=
"{{ $result->link }}"
target=
"{{ $metager->getTab() }}"
data-hoster=
"{{ $result->gefVon }}"
data-count=
"{{ $result->number }}"
>
<a
href=
"{{ $result->link }}"
target=
"{{ $metager->getTab() }}"
data-hoster=
"{{
strip_tags(
$result->gefVon
)
}}"
data-count=
"{{ $result->number }}"
>
{{ $result->anzeigeLink }}
</a>
</div>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment