Exemplo n.º 1
0
 private function doUploadFile()
 {
     $model = '\\' . Config::get('jarboe::files.models.file');
     $html = '';
     $files = Input::file('files');
     foreach ($files as $file) {
         $entity = new $model();
         if (trim(Input::get('title'))) {
             $entity->title = trim(Input::get('title'));
         } else {
             $fileTitle = $file->getClientOriginalName();
             $fileTitle = str_replace(array($file->guessExtension(), '.'), array('', ''), $fileTitle);
             $entity->title = urlify($fileTitle);
         }
         $entity->save();
         $mimeType = $file->getMimeType();
         $extension = $file->guessExtension();
         $rawFileName = md5_file($file->getRealPath()) . '_' . time();
         $fileName = $rawFileName . '.' . $extension;
         $prefixPath = '/storage/j-files-storage/';
         //
         list($chunks, $postfixPath) = $this->getPathByID($entity->id);
         $tempPath = public_path() . $prefixPath;
         foreach ($chunks as $chunk) {
             $tempPath = $tempPath . $chunk;
             if (!file_exists($tempPath)) {
                 if (!mkdir($tempPath, 0755, true)) {
                     throw new \RuntimeException('Unable to create the directory [' . $tempPath . ']');
                 }
             }
             $tempPath = $tempPath . '/';
         }
         $destinationPath = $prefixPath . $postfixPath;
         $file->move(public_path() . $destinationPath, $fileName);
         $entity->source = $destinationPath . $fileName;
         $entity->size = $file->getSize();
         $entity->mime = $mimeType;
         $entity->extension = $extension;
         $entity->save();
         $html .= View::make('admin::tb.storage.file.file_row')->with('file', $entity)->render();
     }
     $data = array('status' => true, 'html' => $html);
     return Response::json($data);
 }
Exemplo n.º 2
0
    }
    //	$RDB->debug=true;
    $RDB->Execute("UPDATE lss_characters SET imie=?,nazwisko=? WHERE id=?", array($_POST['imie'], $_POST['nazwisko'], $cid));
    $cachetime = 0;
    //	print_r($_POST);
    //	exit;
}
$postac = $RDB->CacheGetRow($cachetime, "SELECT c.id,c.imie,c.nazwisko,c.rasa,c.data_urodzenia,c.skin,c.premiumskin,c.hp,c.ar,c.energy,c.stamina,c.dead,u.premium>NOW() premium,u.login from lss_characters c JOIN lss_users u ON u.id=c.userid WHERE c.id=?", array($cid));
$postac['original_skin'] = $postac['skin'];
if ($postac['premium'] > 0 && $postac['premiumskin'] > 0) {
    $postac['skin'] = $postac['premiumskin'];
}
if ($user->data['is_registered'] && strtolower($postac['login']) == strtolower($user->data['username_clean'])) {
    $postac['owncharacter'] = true;
}
$url = "/postacie/" . $cid . "," . urlify($postac['imie']) . "_" . urlify($postac['nazwisko']);
$szablon->add_bc($postac['imie'] . " " . $postac['nazwisko'], $url);
$szablon->assign('postac', $postac);
// czlonkowstwo we frakcjach
$frakcje = $RDB->CacheGetAll(3600, "SELECT f.name,fr.name rank_name,cf.faction_id,cf.jointime,cf.lastduty from lss_character_factions cf JOIN lss_faction f ON f.id=cf.faction_id JOIN lss_faction_ranks fr ON fr.faction_id=cf.faction_id AND fr.rank_id=cf.rank WHERE character_id=?", array($cid));
$szablon->assign('frakcje', $frakcje);
// osiagnieca
$osiagniecia = $RDB->CacheGetAll(3600, "select ah.ts,an.descr,ah.achname,ah.amount,ah.notes from lss_achievements_history ah JOIN lss_achievements_name an ON an.achname=ah.achname WHERE ah.character_id=?;", array($cid));
$szablon->assign('osiagniecia', $osiagniecia);
// dodatkowy wybor skinow dla premium
if ($postac['premium'] > 0) {
    if ($LSS->skinMeski($postac['original_skin'])) {
        $skiny_premium = $LSS->skiny_m_premium;
    } else {
        $skiny_premium = $LSS->skiny_f_premium;
    }
Exemplo n.º 3
0
     $fh = fopen($plikrss, "w");
     fwrite($fh, $chgtpl);
     fclose($fh);
     exit;
 case "onlineplayers":
     $plik = "/home/lbiegaj/lss-rp.pl/public_html/onlineplayerlist.txt";
     $gracze = $LSS->getOnlinePlayerList();
     $graczy = 0;
     //		print $uidy;
     //		print_r($gracze);
     $fh = fopen($plik, "w");
     fwrite($fh, "<ul class='onlineplayerlist'>");
     foreach ($gracze as $g) {
         // { tonumber(c.id), c.imie.." "..c.nazwisko, c.skin, getElementData(v,"auth:uid"), (getElementData(v,"premium") and 1 or 0) }
         fwrite($fh, "<li" . ($g[4] > 0 ? " class='premium'" : "") . ">");
         fwrite($fh, "<a href='http://lss-rp.pl/postacie/" . intval($g[0]) . "," . urlify($g[1]) . "'>");
         //		  fwrite($fh,"<img border='0' src='http://lss-rp.pl/i/skin-32/".intval($g[2]).".png' width='32' height='32' alt='");
         if ($g[4] > 0) {
             fwrite($fh, "<img border='0' src='" . $g['avatar'] . "' width='64' height='64' class='tip' title='" . htmlspecialchars($g[1]) . " (" . htmlspecialchars($g[5]) . ")' alt='");
         } else {
             fwrite($fh, "<img border='0' src='" . $g['avatar'] . "' width='32' height='32' class='tip' title='" . htmlspecialchars($g[1]) . " (" . htmlspecialchars($g[5]) . ")' alt='");
         }
         //			  fwrite($fh,"<img border='0' src='".$g['avatar']."' width='32' height='32' class='tip' title='".htmlspecialchars($g[5])."' alt='");
         //			  fwrite($fh,"<img border='0' src='http://www.gravatar.com/avatar/".$g['mailhash']."?s=32' width='32' height='32' alt='");
         fwrite($fh, htmlspecialchars($g[1]));
         fwrite($fh, "' />");
         fwrite($fh, "</a>");
         fwrite($fh, "</li>");
         $graczy++;
     }
     fwrite($fh, "</ul>");
Exemplo n.º 4
0
                $query = "DELETE FROM {$table_comments} WHERE id='{$id}' AND type = '{$type}' LIMIT 1";
                if (!mysql_query($query)) {
                    exit(mysql_error());
                }
                header("Location:" . $_SERVER['HTTP_REFERER']);
                exit;
            }
        }
    }
}
if (isset($_REQUEST['commenting'])) {
    if (isset($_REQUEST['id']) && isset($_REQUEST['type']) && !empty($_REQUEST['comment'])) {
        $p_id = $_REQUEST['id'];
        $author = text_in($_REQUEST['name']);
        $email = text_in($_REQUEST['url']);
        $comment = substr(urlify(text_in($_REQUEST['comment'])), 0, 1000);
        $type = $_REQUEST['type'];
        $ip = $_SERVER['REMOTE_ADDR'];
        $mask = gethostbyaddr($ip);
        if (empty($author)) {
            $author = "anonymous";
        }
        if (empty($email)) {
            $email = "no email";
        }
        insert_db("INSERT INTO {$table_comments} VALUES ('', '{$author}', '{$email}', '{$comment}', NOW() , '{$p_id}', '{$type}' , '{$ip}' , '{$mask}')");
        header("Location:" . $_SERVER['HTTP_REFERER']);
    } else {
        header("Location:" . $_SERVER['HTTP_REFERER']);
    }
    exit;
Exemplo n.º 5
0
    echo wordwrap($string, 79) . "\n";
}
if (!$cmd_line) {
    _echo('<pre>');
}
if ($version === 'master') {
    _echo('You are using a development version, I cannot check how up to date it is.');
    _echo('You can download the latest stable release from ' . urlify($DOWNLOAD_URL));
} else {
    _echo('Checking version...');
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $URL);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_USERAGENT, 'Luminous ' . LUMINOUS_VERSION . ' version check');
    $json = curl_exec($ch);
    curl_close($ch);
    if (!$json) {
        _echo('Remote request failed. Try again later or visit ' . urlify($DOWNLOAD_URL) . ' to see what the latest version is');
    } else {
        $data = json_decode($json, true);
        if ($data['release_number'] === $version || 'v' . $data['release_number'] === $version) {
            _echo('You are up to date!');
        } else {
            $output = "You are not up to date: your version is " . $version . " and the most recent release is " . $data['release_number'] . ", released " . $data['release_date'] . '. ' . ' Visit ' . urlify($DOWNLOAD_URL) . ' to upgrade';
            _echo($output);
        }
    }
}
if (!$cmd_line) {
    _echo('</pre>');
}
Exemplo n.º 6
0
<?php

global $szablon, $RDB;
$szablon->plik = 'm.frakcja.tpl';
$fid = intval($_REQUEST['fid']);
if (!$fid) {
    $szablon->blad_krytyczny("Nie odnaleziono podanej frakcji.");
    exit;
}
$frakcja = $RDB->CacheGetRow(3600, "SELECT * FROM lss_faction WHERE id=?", array($fid));
$url = "/frakcje/" . $fid . "," . urlify($frakcja['name']);
$szablon->add_bc($frakcja['name'], $url);
$szablon->assign('frakcja', $frakcja);
// rangi i czlonkowie
$rangi = $RDB->CacheGetAll(3600, "select rank_id,name from lss_faction_ranks where faction_id=? order by rank_id desc", array($fid));
$czlonkowie = $RDB->CacheGetAll(3600, "SELECT cf.character_id,c.imie,c.nazwisko,cf.rank,cf.jointime,cf.lastduty FROM lss_character_factions cf JOIN lss_characters c ON c.id=cf.character_id WHERE cf.faction_id=?", array($fid));
$szablon->assign('rangi', $rangi);
$szablon->assign('czlonkowie', $czlonkowie);
$szablon->wyswietl();
exit;
Exemplo n.º 7
0
            //	$user['photourl'] = '';
        }
        exit;
    case "jsconnect":
        // autoryzacja z forum vanilla
        require_once dirname(__FILE__) . '/libs/functions.jsconnect.php';
        $clientID = "85705927";
        $secret = "03be238d3cbd8069807c532788c0d6b1";
        $user = array();
        if ($_SESSION['auth'] == 1) {
            $user['uniqueid'] = $_SESSION['userid'];
            $user['name'] = $_SESSION['login'];
            $user['email'] = $_SESSION['email'];
            $user['photourl'] = '';
        }
        $secure = true;
        WriteJsConnect($user, $_GET, $clientID, $secret, $secure);
        exit;
        break;
    case "characters":
        $login = $_REQUEST['login'];
        $characters = $RDB->CacheGetAll(3600, "select c.id,c.imie,c.nazwisko from lss_characters c JOIN lss_users u ON c.userid=u.id WHERE c.dead IS NULL AND u.login=? ORDER BY c.lastseen DESC;", array($login));
        $linki = array();
        foreach ($characters as $c) {
            $linki[] = "<a href='http://lss-rp.pl/postacie/" . intval($c['id']) . "," . urlify($c['imie'] . " " . $c['nazwisko']) . "'>" . htmlspecialchars($c['imie'] . " " . $c['nazwisko']) . "</a>";
        }
        print join($linki, ", ");
        exit;
        break;
}
exit;
Exemplo n.º 8
0
        $baseUrl = percBaseUrl($source['source_url']);
        ?>
                                    <li><a target="_blank" href="<?php 
        echo $source['source_url'];
        ?>
" ><img src="<?php 
        echo $baseUrl . '/favicon.ico';
        ?>
" title="<?php 
        echo $source['source_subscription_title'];
        ?>
" alt="<?php 
        echo $source['source_subscription_title'];
        ?>
" /></a> <?php 
        echo urlify($source['source_entry_title']);
        ?>
</li>
                                <?php 
    }
    ?>
                                </ul>
                            </div>
                        </div>
                    </div>
    <?php 
}
?>
                </div>
            </div>
        </div>