/** * Обработчик действия: Отдает форму редактирования поля. */ function getEditForm() { $form = new A_Form("module_feedback_edit.tpl"); $form->data = A::$DB->getRowById($_POST['id'], DOMAIN . "_fields"); $form->data['vars'] = getLists(); $form->data['name'] = $form->data['name_' . LANG]; $form->data['full'] = is_dir('plugins'); $this->RESULT['html'] = $form->getContent(); }
function displayLists($pid = 0, $selectid = 1) { $result = getLists($pid); $str = '<select>'; foreach ($result as $item) { $selected = ""; if ($selectid == $item['id']) { $selected = 'selected'; } $str .= '<option ' . $selected . '>' . $item['catename'] . '</option>'; } return $str .= '</select>'; }
function printLists() { $lists = getLists(); $out = ''; foreach ($lists as $ListID => $list) { $out .= '<h1 list="' . $ListID . '">' . $list['Title'] . '</h1>' . "\n"; $out .= '<ul list="' . $ListID . '">' . "\n"; if (count($list['Tasks'])) { foreach ($list['Tasks'] as $task) { $checked = $task['Done'] ? ' checked="checked"' : ''; $class = $task['Done'] ? ' class="done"' : ''; $text = preg_replace('/(@[^\\W]+)/', '<em>\\1</em>', $task['Text']); $out .= "\t" . '<li task="' . $task['TaskID'] . '"><input type="checkbox"' . $checked . '> <span' . $class . '>' . $text . '</span></li>' . "\n"; } } $out .= '</ul>' . "\n" . '<p class="actions" list="' . $ListID . '"><a class="newitem" list="' . $ListID . '" href="#">new item</a> - <a class="archiveDone" href="./action.php?archive=' . $ListID . '">archive done</a> - <span class="archive">archive entire list</span></p>' . "\n\n"; } print $out; }
// google.js redirect fail // $redirectString = ".location"; // $JSLinks = getJSLinks($source); // foreach ($JSLinks as $link) { // $jsCode = getSourceCode($link); // $pos = strpos($jsCode, $redirectString); // if ($pos !== false) // { // echo "js ".$link." redirect"; // return true; // } // } return false; } $site = "http://sibsr.ru"; $links = getLists($site, 15); // 0 - intralinks // 1 - css // 2 - js // foreach ($links[0] as $link) { // $statusCode[$link] = getStatusCode($link); // echo $statusCode[$link]."\tfor link:\t".$link."\n"; // } // foreach ($links[0] as $link) { // $info[$link] = getInfo($link); // echo $info[$link]["http_code"]."\tfor link:\t".$link."\n"; // } foreach ($links[0] as $link) { $redirected = checkRedirect($link); if ($redirected) { echo "link:\t" . $link . " redirected\n";
<?php include "getLinks.php"; $site = "http://sibsr.ru"; $counter = 3; $links = getLists($site, $counter); // 0 - intralinks // 1 - css links // 2 - js links foreach ($links[0] as $link) { $source = getSourceCode($link); $crcLink[$link] = crc32($source); } // foreach ($links[1] as $link) { // $source = getSourceCode($link); // $crcCSS[$link] = crc32($source); // } // foreach ($links[1] as $link) { // $source = getSourceCode($link); // $crcJS[$link] = crc32($source); // } foreach ($crcJS as $site => $crc) { echo "crc:\t" . $crc . "\t for site: {$site}\n"; }