Пример #1
0
function _newsBeforeShowItem($Item, $mode = NULL)
{
    if ($mode == NULL) {
        $mode = $_GET["mode"];
    }
    $month = array("", "январь", "февраль", "март", "апрель", "май", "июнь", "июль", "август", "сентябрь", "октябрь", "ноябрь", "декабрь");
    $mon = array("", "янв", "фев", "мар", "апр", "май", "июн", "июл", "авг", "сен", "окт", "ноя", "дек");
    $Item["day"] = $Item["d"] = date("d", strtotime($Item["date"]));
    $Item["m"] = date("m", strtotime($Item["date"]));
    $Item["y"] = date("Y", strtotime($Item["date"]));
    $Item["month"] = $month[$Item["m"] * 1];
    $Item["mon"] = $mon[$Item["m"] * 1];
    switch ($mode) {
        case "edit":
            if (!isset($Item["date"])) {
                $Item["date"] = date("Y-m-d");
            }
            $Item["date"] = date("Y-m-d", strtotime($Item["date"]));
            break;
        case "show":
            $Item = aikiAddItemGal($Item);
            break;
        case "list":
            $Item["datesort"] = $Item["date"];
            $Item["date"] = date("d.m.Y", strtotime($Item["date"]));
            $Item["text"] = getWords(strip_tags($Item["text"]), 50);
            break;
        default:
            $Item["date"] = date("d.m.Y", strtotime($Item["date"]));
            break;
    }
    return $Item;
}
Пример #2
0
function _commentsBeforeShowItem($Item, $mode = NULL)
{
    if ($mode == NULL) {
        $mode = $_GET["mode"];
    }
    switch ($mode) {
        case "edit":
            if (!isset($Item["date"]) or $Item["date"] == "") {
                $Item["date"] = date("Y-m-d");
            } else {
                $Item["date"] = date("Y-m-d", strtotime($Item["date"]));
            }
            break;
        case "list":
            $Item["date"] = date("d.m.Y", strtotime($Item["date"]));
            $Item["text"] = getWords(strip_tags($Item["text"]), 50);
            $Item["smalltext"] = getWords(strip_tags($Item["text"]), 10);
            if ($_SESSION["User"] != "Admin" && (!$Item["show"] == 1 or !$Item["show"] == "on")) {
                $Item = NULL;
            }
            break;
        default:
            $Item["date"] = date("d.m.Y", strtotime($Item["date"]));
            $Item["header"] = "";
            break;
    }
    return $Item;
}
Пример #3
0
function getWords($key, $ruzzle, $wordsList, $totalWords, $correctwords)
{
    global $correctwords;
    global $totalWords;
    global $opArray;
    global $dupArray;
    global $keyArray;
    global $str;
    global $points;
    //$str.=$ruzzle[$key]['later'];
    if (!in_array($key, $keyArray)) {
        $keyArray[$key] = $key;
    }
    $connectors = get_connecters($key);
    foreach ($connectors as $conKey => $conValue) {
        //$str=$ruzzle[$key]['later']."".$ruzzle[$conValue]['later'];
        //$str.=$ruzzle[$key]['later']."".$ruzzle[$conValue]['later'];
        if (!in_array($conValue, $keyArray)) {
            $keyArray[$conValue] = $conValue;
        }
        $str .= $ruzzle[$conValue]['later'];
        //echo "word ".$str ."<br />";
        if (in_array(strtolower($str), $wordsList)) {
            if (!in_array(strtolower($str), $dupArray)) {
                echo "match word " . $str . "<br />";
                $opArray[] = $str;
                $dupArray[] = strtolower($str);
                $correctwords++;
                //$str="";
                //if(!in_array($conValue, $keyArray))
                //{
                getWords($conValue, $ruzzle, $wordsList, $totalWords, $correctwords);
                //}
            }
        } else {
            //getWords($conValue,$ruzzle,$wordsList,$totalWords,$correctwords);
        }
        $totalWords++;
    }
    $resultArray['correctwords'] = $correctwords;
    $resultArray['totalWords'] = $totalWords;
    $resultArray['opArray'] = $opArray;
    return $resultArray;
}
Пример #4
0
if ($conn->connect_error) {
    die("Connection failed: " . $conn->connect_error);
}
$words = "";
global $flag_q;
if (isset($_GET["q"])) {
    //check for quotes
    if (mb_substr($_GET["q"], 0, 1) == '"' && mb_substr($_GET["q"], -1) == '"') {
        $flag_q = true;
    }
    $index = get_index();
    $results = search_words($_GET["q"], $index);
    if ($flag_q) {
        $_GET["q"] = substr($_GET["q"], 1, -1);
    }
    $words = getWords($_GET["q"]);
}
?>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Search</title>
        <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
        <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
        <style>
            body {
                padding: 0px;
                color: #444;
            }
Пример #5
0
    while ($latest_product = mysql_fetch_array($latest_products)) {
        ?>
            <div>
            <div class="col-lg-12">
              <div class="home-latest"> <img src="products/product_color/<?php 
        echo $latest_product['product_image'];
        ?>
" alt="" class="img-responsive"> </div>
              <h3><?php 
        echo $latest_product['product_name'];
        ?>
</h3>
              <p>
                  <?php 
        $mycontent = $latest_product['product_description'];
        echo getWords($mycontent, 3) . "...";
        ?>
                  </p>
              <div class="clearfix"></div>
              <a href="product-detail.php?id=<?php 
        echo $latest_product['product_id'];
        ?>
" class="for-more">For More</a> </div>
          </div>
         <?php 
    }
}
?>
        </div>
      </div>
    </div>
Пример #6
0
<?php

// delegated.php
function getWords()
{
    foreach (['tahi', 'rua', 'toru', 'wha', 'rima', 'ono', 'whitu', 'waru', 'iwa', 'tekau'] as $number) {
        (yield $number);
    }
    yield from getColours();
}
function getColours()
{
    foreach (['whero', 'karaka', 'kowhai', 'kakariki', 'kikorangi', 'poropango', 'papura'] as $colour) {
        (yield $colour);
    }
}
foreach (getWords() as $word) {
    echo "{$word}<br>";
}
Пример #7
0
<?php

require_once 'config.php';
$session->requireLoggedIn();
require 'design_head.php';
if (!empty($_GET['del'])) {
    deleteWord($_GET['del']);
}
if (empty($_GET['lang']) || !is_numeric($_GET['lang'])) {
    echo '<h2>Show words</h2>';
    echo 'Select language first<br/><br/>';
    $list = getCategories(CATEGORY_LANGUAGE);
    foreach ($list as $row) {
        echo '<a href="' . $_SERVER['PHP_SELF'] . '?lang=' . $row['categoryId'] . '">' . $row['categoryName'] . '</a> (' . getWordCount($row['categoryId']) . ' words)<br/>';
    }
} else {
    echo '<h2>Show words</h2>';
    $langId = $_GET['lang'];
    $list = getWords($langId);
    foreach ($list as $row) {
        coreButton('Delete', $_SERVER['PHP_SELF'] . '?lang=' . $langId . '&amp;del=' . $row['id']);
        echo $row['word'] . '<br/>';
    }
}
require 'design_foot.php';
Пример #8
0
</head>
<body> 



<img src="chews.png" alt="CHeWS Sample Image">
<h1>CHemical Element Word Solver (ChEWS)</h1>

<?php 
#######################
# Database Statistics
#######################
include 'database.php';
$stats = getStatistics();
$successWords = getWords(True);
$failWords = getWords(False);
echo "<h3> Database Contains " . $stats['success'] . " words with solutions</h3>";
$lastWord = "";
foreach ($successWords as $wordData) {
    if ($lastWord != "") {
        if (substr($lastWord, 0, 1) != substr($wordData[0], 0, 1)) {
            echo "<br/>";
        } else {
            echo ", ";
        }
    }
    echo $wordData[0] . " (" . $wordData[1] . ")";
    $lastWord = $wordData[0];
}
echo "<h3> Database Contains " . $stats['fail'] . " words without solutions</h3>";
$lastWord = "";
Пример #9
0
if ($posts) {
    ?>
<h2>Related Articles</h2>
<ul>
<?php 
    function getWords($text, $limit)
    {
        $array = explode(" ", $text, $limit + 1);
        if (count($array) > $limit) {
            unset($array[$limit]);
        }
        return implode(" ", $array);
    }
    foreach ($posts as $post) {
        $mycontent = strip_tags($post->post_content);
        $excerpt = getWords($mycontent, 15);
        $a_title = $excerpt . "...";
        ?>
<li><a href="<?php 
        the_permalink();
        ?>
" title="<?php 
        echo $a_title;
        ?>
">
<?php 
        if (get_the_title()) {
            the_title();
        } else {
            echo "Untitle";
        }
Пример #10
0
$yn_ad_metagen = JHTML::_('select.genericlist', $yesno, 'ad_metagen', 'class="inputbox"', 'value', 'text', $ad_metagen);
echo $yn_ad_metagen;
?>
      </td>
      <td><?php 
echo dgTip(JText::_('COM_DATSOGALLERY_META_GENERATOR_I'));
?>
</td>
    </tr>
    <tr>
      <td valign="top"><?php 
echo JText::_('COM_DATSOGALLERY_WORDS2IGNORE');
?>
</td>
      <td><?php 
echo getWords();
?>
</td>
      <td valign="top"><?php 
echo dgTip(JText::_('COM_DATSOGALLERY_WORDS2IGNORE_I'));
?>
</td>
    </tr>
    <tr>
      <td><?php 
echo JText::_('COM_DATSOGALLERY_BOOKMARKER');
?>
:</td>
      <td>
	  <?php 
$yn_ad_bookmarker = JHTML::_('select.genericlist', $yesno, 'ad_bookmarker', 'class="inputbox"', 'value', 'text', $ad_bookmarker);
Пример #11
0
                        <div class="slidebox">
                        <a href="maverick-game-<?php 
        echo $newgame['game_seo'];
        ?>
">
                        <img src="silverhat_games/game_slider/<?php 
        echo $newgame['game_slider'];
        ?>
" alt="">
                        <h4><?php 
        echo $newgame['game_name'];
        ?>
</h4>
                        <p><?php 
        $mycontents = $newgame['game_description'];
        echo getWords($mycontents, 10) . "...";
        ?>
</p>
         </a>
                        </div>
                        </li>  
                       
                        <?php 
    }
}
?>
                        
                        
                    </ul>
                </div>
<a href="#" class="jcarousel-control-prev"></a>
Пример #12
0
    if (ereg("(#|!)(.*)", $name, $matches)) {
        $cap = $matches[2];
        $cap = strtr($cap, "&amp;", "&");
        //$cap  = strtr($cap, ",", ",");
        $salt = substr($cap . "H.", 1, 2);
        $salt = ereg_replace("[^\\.-z]", ".", $salt);
        $salt = strtr($salt, ":;<=>?@[\\]^_`", "ABCDEFGabcdef");
        return substr(crypt($cap, $salt), -10) . "";
    }
}
function contains($str, $arr)
{
    foreach ($arr as $elem) {
        if (stripos($str, $elem) !== false) {
            // case-insensitive
            return true;
        }
    }
    return false;
}
getWords();
$usefulWords = file_get_contents("tripcode_words.txt");
$usefulWords = explode("\n", $usefulWords);
for ($i = 0;; $i++) {
    // watch out - infinite loop
    $trip = substr(crypt($i), -15);
    $code = tripcode("#" . $trip);
    if (contains($code, $usefulWords)) {
        echo "{$trip} : {$code} \n";
    }
}
Пример #13
0
?>
            </p>
        </div>
        <div id="header_left">
            <p id="startsession">
                <?php 
require_once "views/newSession.php";
?>
            </p>
            <p id="stats">
                <?php 
require_once "views/stats.php";
?>
            </p>
        </div>
    </div>
</div>
<?php 
require_once "model/word.php";
$words = getWords($_SESSION['userId']);
echo "<p class='username'>" . $_SESSION['username'] . ", you have " . count($words) . " words!" . "</p>";
?>
<div id="stat">
    <?php 
foreach ($words as $word) {
    echo "<p class='word'>" . $word[0] . "</p>";
    echo "<p class='priority'>" . $word[1] . "</p>";
}
?>
</div>
Пример #14
0
}
function hashs($a)
{
    $sumVal = 0;
    $b = str_split($a);
    foreach ($b as $key) {
        $sumVal += ord($key);
    }
    return $sumVal % 50;
}
if (isset($_FILES['cfile']) && isset($_FILES['rfile'])) {
    $rfile = $_FILES['rfile']['name'];
    $cfile = $_FILES['cfile']['name'];
    $matched = array();
    $words = getWords(fread(fopen($rfile, 'r'), filesize($rfile)));
    $words1 = getWords(fread(fopen($cfile, 'r'), filesize($cfile)));
    $x = 0;
    $per = 0;
    foreach ($words as $val) {
        foreach ($words1 as $val1) {
            if (hashs($val) === hashs($val1)) {
                if ($val === $val1) {
                    $x++;
                    array_push($matched, $val1);
                }
            }
        }
    }
    if ($x > 0) {
        $per = $x / count($words1) * 100;
    }