Commit 0d3e6cb9 authored by Davide Aprea's avatar Davide Aprea
Browse files

added javascript awareness

parent b9850bfe
......@@ -245,11 +245,11 @@ class MetaGerSearch extends Controller
$newResults = 0;
foreach ($metager->getResults() as $index => $resultTmp) {
if ($resultTmp->new || $resultTmp->adgoalChanged) {
if ($resultTmp->new || $resultTmp->changed) {
if ($metager->getFokus() !== "bilder") {
$view = View::make('layouts.result', ['index' => $index, 'result' => $resultTmp, 'metager' => $metager]);
$html = $view->render();
if (!$resultTmp->new && $resultTmp->adgoalChanged) {
if (!$resultTmp->new && $resultTmp->changed) {
$result['changedResults'][$index] = $html;
} else {
$result['newResults'][$index] = $html;
......@@ -258,7 +258,7 @@ class MetaGerSearch extends Controller
} else {
$view = View::make('layouts.image_result', ['index' => $index, 'result' => $resultTmp, 'metager' => $metager]);
$html = $view->render();
if (!$resultTmp->new && $resultTmp->adgoalChanged) {
if (!$resultTmp->new && $resultTmp->changed) {
$result['changedResults'][$index] = $html;
} else {
$result['newResults'][$index] = $html;
......
......@@ -431,6 +431,9 @@ class MetaGer
$arr[$link]->gefVonLink[] = $this->results[$i]->gefVonLink[0];
array_splice($this->results, $i, 1);
$i--;
if($arr[$link]->new === true || $this->results[$i]->new === true){
$arr[$link]->changed = true;
}
}else{
$arr[$link] = &$this->results[$i];
}
......@@ -543,7 +546,7 @@ class MetaGer
$newLink = "https://api.smartredirect.de/api_v2/ClickGate.php?p=" . urlencode($publicKey) . "&k=" . urlencode($gateHash) . "&url=" . urlencode($targetUrl) . "&q=" . urlencode($query);
$result->link = $newLink;
$result->partnershop = true;
$result->adgoalChanged = true;
$result->changed = true;
}
}
}
......
......@@ -31,7 +31,7 @@ class Result
public $strippedLinkAnzeige; # Der Link in Form "foo.bar.de/test"
public $rank; # Das Ranking für das Ergebnis
public $new = true;
public $adgoalChanged = false;
public $changed = false;
# Erstellt ein neues Ergebnis
public function __construct($provider, $titel, $link, $anzeigeLink, $descr, $gefVon, $gefVonLink, $sourceRank, $additionalInformation = [])
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment