rendered paste body<?php//optymalizacja SEO - prosze nie usuwac! class Titles { var $actView; function Titles($actView) { $this -> actView = $actView; } //jako parametry nalezy podac tablice ze slowami oraz dlugosc tytulu, ktory ma sie wygenerowac function generateTitle($words, $titleLenght) { srand($this -> actView); shuffle($words); //oblicz dlugosc title $wordsOut = array_slice($words, count($wordsOut) -$titleLenght); foreach($wordsOut as $key => $phrase) { echo ucfirst($phrase); if($key < count($wordsOut) - 1) { echo ' '; } } } function showTitles($array1) { $this -> generateTitle($array1, 3); return true; } } $titles1 = array('maszyny do metali', 'nagrzewnice', 'kompresory', 'obróbka metalu', 'agregaty prądotwórcze'); if(!empty($_GET['cPath'])) { if(is_numeric($_GET['cPath'])) { $myTitles = new Titles($_GET['cPath']); } else { $number = explode("_",$_GET['cPath']); $myTitles = new Titles($number[1]); } echo '<title>'; $myTitles -> showTitles($titles1); echo ' - Centromet</title>'; } else { echo '<title>Agregaty prądotwórcze Kompresory Nagrzewnice - Centromet'; }?>