Разговоры обо всем > Форум, сайт

Реформация os-solaris.ru

(1/5) > >>

sCode:
Предлагаю переделать os-solaris.ru, так:

* Для начала убрать блог с главной страницы и написать главную страницу самому, выставив на неё преимущества OpenSolaris http://os-solaris.ru/preimushhestva-illumos-i-openindiana/
* Сделать редизайн форума (в зависимости от будущего дизайна главной страницы).
* Убрать Kirov OSUG с форума и сделать osug.os-solaris.ru, где будет список OSUG'ов разных городов, и сделать возможность создавать OSUG'и своих городов, например kirov.osug.os-solaris.ru, nnov.osug.os-solaris.ru, etc...
* Выставить на главную страницу ссылки на загрузку OpenSolaris, OpenIndiana, Nexenta.
* Создать wiki - wiki.os-solaris.ru

keremet:
Интересные предложения. LiveStalker в следующем месяце собирается поднять wiki. Раньше у нас тоже были wiki, но там начали регаться спамеры и писать всякую рекламу. Думаю, в этот раз надо бы сделать, чтобы редактировать могли только те, кто может написать полезные вещи.

Илья:
Настрогал WIKI для своего форума самостоятельно примитивно конечно, дизайнер бы конечно лучше сделал. Просто немного в веб-программировании понимаю больше склонен к этому чем к системному программированию. Давайте бесплатно настрогаю для вашего форума About Us и историю OpenSolaris у меня задумка есть только тескт давайте это каг бэ будет просто страница в вашем субдомене о форуме ИДЕТ?
P.S. Делаю бесплатно мне же нужно набираться опыта ;)

jSnake:
Так, давайте не будем путать. Вики это вики со своим, дурным, но языком разметки, своими правилами и нюансами. Отношение к HTML и веб-программированию сугубо косвенное. Что касается развития сайта, для начала удалите нафик div id="head". Будет гораздо лучше. После этого давайте как-то придумаем способ выкладывать новости и статьи на главной, а не на форуме.

P.S. Илья, там в файлике тот минимум, которым необходимо обладать, чтобы называться web-программистом PHP. Если нравится и хочется этим заниматься, советую изучить.

Илья:
Я не PHP - программист и не работаю чисто хобби
Спасибо приму к сведению по немногу осваиваю, самое главное не беру денег поэтому ни кого не обидел своим опытом
PHP - мне не интересен для моих одномоментных поделок если в плане того коротко сворганить страницу HTML тут как раз удобнее к примеру чтобы вставить изображение просто

--- Код: ---<img src="solaris.png" class="photo" title="Solaris" />
--- Конец кода ---
На PHP же надо целый рулон бумаги

--- Цитировать ---Класс для работы с изображениями class cms_imgФункции класса:
- Создание нового изображения с указанными размерами и цветом. или просто загружаем существующее.
--- Конец цитаты ---

--- Код: ---<?PHP
class cms_img {

public $coordinate=4; // 1-верхний, левый, 2-правый, верхний, 3-нижний, правый...
public $coord=array();
public $image_type=IMAGETYPE_PNG;

function coordinat($srcWidth, $srcHeight, $logoWidth, $logoHeight){
if($this->coordinate==1){
$this->coord[1]=0;
$this->coord[2]=0;
} elseif($this->coordinate==2){
$this->coord[1]=$srcWidth - $logoWidth;
$this->coord[2]=0;
} elseif($this->coordinate==3){
$this->coord[1]=$srcWidth - $logoWidth;
$this->coord[2]=$srcHeight - $logoHeight;
} else {
$this->coord[1]=0;
$this->coord[2]=$srcHeight - $logoHeight;
}
}

function load_img($filename) {
    $image_info = getimagesize($filename);
    $this->image_type=$image_info[2];
    if($this->image_type==IMAGETYPE_JPEG or $this->image_type==2 ) {
        return imagecreatefromjpeg($filename);
    } elseif($this->image_type == IMAGETYPE_GIF or $this->image_type==1 ) {
        return imagecreatefromgif($filename);
    } elseif($this->image_type == IMAGETYPE_PNG or $this->image_type==3 ) {
        return imagecreatefrompng($filename);
    }
}

function load($img){
    $this->namefile=$img;
    $this->srcImage = $this->load_img($this->namefile);
}

function fsave($img) {
    if($this->image_type == IMAGETYPE_JPEG ) {
        ImageJPEG($this->srcImage, $img, 100);
    } elseif($this->image_type == IMAGETYPE_GIF ) {
        ImageGIF($this->srcImage, $img);
    } elseif($this->image_type == IMAGETYPE_PNG ) {
        ImagePNG($this->srcImage, $img);
    } else {
        ImagePNG($this->srcImage, $img);
    }
}


function output(){
    if($this->image_type == IMAGETYPE_JPEG ) {
        header("Content-Type: image/jpg");
        ImageJPEG($this->srcImage);
    } elseif($this->image_type == IMAGETYPE_GIF ) {
        header("Content-Type: image/gif");
        ImageGIF($this->srcImage);
    } elseif($this->image_type == IMAGETYPE_PNG ) {
           header("Content-Type: image/png");
           ImagePNG($this->srcImage);
    } else {
        header("Content-Type: image/png");
        ImagePNG($this->srcImage);
    }
}

function save($namefile=false){
    $this->namefile=$namefile?$namefile:$this->namefile;
    $this->fsave($this->namefile);
}

function sxy(){
    $this->srcWidth  = ImageSX($this->srcImage);
    $this->srcHeight = ImageSY($this->srcImage);
    return  array("w"=>$this->srcWidth,"h"=>$this->srcHeight);
}


function setlogo($logosrc,$coordinate=false)
{
    $this->coordinate=$coordinate!=false&&preg_match("#^\d$#",$coordinate)?$coordinate:$this->coordinate;
    $logoImage = $this->load_img($logosrc);

    $srcWidth  = ImageSX($this->srcImage);
    $srcHeight = ImageSY($this->srcImage);

    $logoWidth  = ImageSX($logoImage);
    $logoHeight = ImageSY($logoImage);

    imageAlphaBlending($logoImage, false);
    imageSaveAlpha($logoImage, true);

    $trcolor = ImageColorAllocate($logoImage, 255, 255, 255);
    ImageColorTransparent($logoImage , $trcolor);

    $this->coordinat($srcWidth, $srcHeight, $logoWidth, $logoHeight);
    imagecopy($this->srcImage, $logoImage, $this->coord[1], $this->coord[2],0,0, $logoWidth, $logoHeight);

    unset($logoImage);
}

function resize($width,$height=false){

    $width=preg_match("#^\d+$#isU",$width)?$width:false;
    $height=preg_match("#^\d+$#isU",$height)?$height:false;

    if(($width!='100'&&$height==false) or ($width!=false&&$height!=false)){

    $w_src = ImageSX($this->srcImage);
    $h_src = ImageSY($this->srcImage);

     if($height==false){
    $height=($h_src/100)*$width;
    $width=($w_src/100)*$width;
     }

    $dest = imagecreatetruecolor($width,$height);

    if($height==$width){
    if ($w_src>$h_src) {
    imagecopyresized($dest, $this->srcImage, 0, 0, round((max($w_src,$h_src)-min($w_src,$h_src))/2), 0, $width, $height, min($w_src,$h_src), min($w_src,$h_src));
    } else {
    imagecopyresized($dest, $this->srcImage, 0, 0, 0, round((max($w_src,$h_src)-min($w_src,$h_src))/2), $width, $height, min($w_src,$h_src), min($w_src,$h_src));
    }} else {
    imagecopyresized($dest, $this->srcImage, 0, 0, 0, 0, $width, $height, $w_src, $h_src);
    }

    $this->srcImage=$dest;
    unset($dest);

}}

function destroy(){
    ImageDestroy($this->srcImage);
}

function text($text,$fontfile,$color='#000000',$size=20,$angle=0,$x=10,$y=10,$pr=0){
    $col=$this->htmltorgb($color);
    $color = imagecolorallocatealpha($this->srcImage, $col[0],$col[1], $col[2],$pr);
    imagettftext ($this->srcImage,$size,$angle,$x,$y,$color,$fontfile,$text);
}

function htmltorgb($color)
{
    if ($color[0] == '#')
        $color = substr($color, 1);

    if (strlen($color) == 6)
        list($r, $g, $b) = array($color[0].$color[1],
                                 $color[2].$color[3],
                                 $color[4].$color[5]);
    elseif (strlen($color) == 3)
        list($r, $g, $b) = array($color[0].$color[0], $color[1].$color[1], $color[2].$color[2]);
    else
        return false;

    $r = hexdec($r); $g = hexdec($g); $b = hexdec($b);

    return array($r, $g, $b);
}

function create($width,$height,$color='#ffffff') {
    $width=preg_match("#^\d+$#isU",$width)?$width:200;
    $height=preg_match("#^\d+$#isU",$height)?$height:200;
    $col=$this->htmltorgb($color);
    $this->srcImage = imagecreatetruecolor($width,$height);
    $color = imagecolorallocate($this->srcImage, $col[0],$col[1], $col[2]);
    imagefilledrectangle($this->srcImage, 0, 0, ($width-1), ($height-1), $color);
}

function returnimg(){
     return $this->srcImage;
}

function setimg($img){
    $this->srcImage=$img;
}

}
--- Конец кода ---

Теперь заметно где писать короче, но PHP более подходит для Веб-программирования HTML же язык верстальщиков

Навигация

[0] Главная страница сообщений

[#] Следующая страница

Перейти к полной версии