public function remove() { $pID = $this->request->getParsedBody()['projectID']; if ($pID > 0) { $this->db->where('projectID', $pID); if (!$this->db->delete('projects')) { $this->error = 1; } else { $reorderKeywords = new \App\ReorderKeywords($this->db); $reorderKeywords->start(); } } $this->checkProjectData(); $this->finish(); }
public function add() { $this->extractKeywords(); if ($this->currentProjectsParentID > 0) { $this->loadCompetitors(); $this->saveKeywords(); $reorderKeywords = new \App\ReorderKeywords($this->db); $reorderKeywords->start(); $this->message = '<strong>Super!</strong> Alle Keywords wurden dem gewählten Projekt hinzugefügt und sollten nach einem Neuladen der Projektübersicht angezeigt werden.'; } else { $this->error = 1; $this->message = '<strong>Mist!</strong> Da scheint sich ein Fehler eingeschlichen zu haben. Vermutlich ist kein Projekt aktiv gesetzt. Schau da am besten nochmal nach!'; } $this->finish(); }
private function updateSettings() { $this->checkTiming(); $this->checkPause(); $this->checkProject(); $this->db->where('optionName', 'cronjobHours'); $this->db->update('settings', ['value' => $this->postArray['timing']]); $reorderKeywords = new \App\ReorderKeywords($this->db, $this->postArray['timing']); $reorderKeywords->start(); $this->db->where('optionName', 'pauseStatic'); $this->db->update('settings', ['value' => $this->postArray['pause_static']]); $this->db->where('optionName', 'pauseVariable'); $this->db->update('settings', ['value' => $this->postArray['pause_variable']]); $this->updateProjects(); $this->db->where('projectID', $this->postArray['defaultProject']); $this->db->update('projects', ['projectDefault' => 1]); $this->message = '<strong>Sehr gut!</strong> Einstellungen wurden aktualisiert.'; }
$days = 45; while ($days >= 0) { foreach ($projectsOne as $projectsID) { foreach ($keywordsOne as $kwID => $kwText) { $mockPosition = rand(0, 108); if ($mockPosition == 0) { $mockPosition = NULL; } $this->db->insert('rankings', ['keywordID' => $kwID, 'projectID' => $projectsID, 'rankingPosition' => $mockPosition, 'rankingURL' => 'http://www.' . $kwID . '-' . $mockPosition . '-' . $projectsID . '-1.de/', 'rankingAdded' => date('Y-m-d G:i:s', strtotime('-' . $days . ' day')), 'rankingAddedDay' => date('Y-m-d', strtotime('-' . $days . ' day'))]); } } $days--; } foreach ($projectsOne as $projectID) { $backlinks = rand(20, 40); while ($backlinks > 0) { $commentR = rand(0, 1); $comment = 'Langer Kommentar voller Einfallslosigkeit für Projekt ID ' . $projectID . ' Zufall: ' . rand(100, 200); if ($commentR > 0) { $comment = ''; } $data = ['backlinkSource' => 'http://beispiel-quelle-' . $projectID . rand(100, 200) . '.de', 'backlinkTarget' => 'http://beispiel-ziel-' . $projectID . rand(100, 200) . '.de', 'backlinkCategory' => rand(1, 6), 'backlinkSourceCategory' => rand(1, 6), 'backlinkRelation' => rand(1, 2), 'backlinkLinkText' => 'Linktext ' . $projectID . rand(100, 200), 'backlinkProject' => $projectID, 'backlinkComment' => $comment]; $this->db->insert('backlinks', $data); $backlinks--; } } $c = new \App\ReorderKeywords($this->db, '0,1,2,3,4,5,6,7,8,9'); $c->start(); echo 'Done'; echo '<br />'; })->add(new App\CheckAuth());