Jump to content
php.lv forumi

Pentiums

Reģistrētie lietotāji
  • Posts

    617
  • Joined

  • Last visited

Posts posted by Pentiums

  1. ir tabulas

    forumi

    |id|sadalas_id|forums|utt..

     

    temas

    |id|foruma_id|tema|utt..

     

    ieraksti

    |id|temas_id|ieraksts|utt..

     

    Līdzīgi kā šī foruma sākumlapā, gribu izlaist visus forumus, katram saskaitīt tēmu un ierakstu skaitu.

    Uzrakstīju šādu SQL pieprasījumu

    SELECT forumi.*, COUNT(temas.id) as temas_skaits FROM forumi LEFT JOIN temas ON temas.fid=forumi.id
    WHERE forumi.sadalas_id = '$padodam_id' GROUP BY temas.id ORDER BY forumi.forums ASC

     

    Kā lai pieknibina klāt ierakstu skaitītāju? ieraksti grupējas pēc tēmas ID, tēmas grupējas pēc foruma ID

  2. uz php_ini() parāda ka memory limits ir uzlikts tik cik ar ini_set noraadu kautvai 128MB vai 256 utt.. bet tur blakus ir master_value un tas staav 12mb, kā lai izmaina master value? mož tas kko šakarē?

     

      function foto_mazizmers($filetype, $origfile, $thumbfile, $new_w, $new_h) {
    
    global $settings;
    
    if ($filetype == "image/gif" || $filetype == "image/x-gif") { $origimage = imagecreatefromgif($origfile); }
    elseif ($filetype == "image/jpeg" || $filetype == "image/pjpeg") { $origimage = imagecreatefromjpeg($origfile); }
    elseif ($filetype == "image/png" || $filetype == "image/x-png") { $origimage = imagecreatefrompng($origfile); }
    
    $old_x = imagesx($origimage);
    $old_y = imagesy($origimage);
    
    if ($old_x > $new_w || $old_y > $new_h) {
    	if ($old_x < $old_y) {
    		$thumb_w = round(($old_x * $new_h) / $old_y);
    		$thumb_h = $new_h;
    	} elseif ($old_x > $old_y) {
    		$thumb_w = $new_w;
    		$thumb_h = round(($old_y * $new_w) / $old_x);
    	} else {
    		$thumb_w = $new_w;
    		$thumb_h = $new_h;
    	}
    } else {
    	$thumb_w = $old_x;
    	$thumb_h = $old_y;
    }
    
    if ($settings['thumb_compression'] == "gd1") {
    	$thumbimage = imagecreate($thumb_w,$thumb_h);
    	$result = imagecopyresized($thumbimage, $origimage, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y);
    } else {
    	$thumbimage = imagecreatetruecolor($thumb_w,$thumb_h);
    	$result = imagecopyresampled($thumbimage, $origimage, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y);
    }
    
    touch($thumbfile);
    
    if ($filetype == "image/gif" || $filetype == "image/x-gif") { imagegif($thumbimage, $thumbfile); }
    elseif ($filetype == "image/jpeg" || $filetype == "image/pjpeg") { imagejpeg($thumbimage, $thumbfile); }
    elseif ($filetype == "image/png" || $filetype == "image/x-png") { imagepng($thumbimage, $thumbfile); }
    }

     

    RINDIŅA:

    	elseif ($filetype == "image/jpeg" || $filetype == "image/pjpeg") { $origimage = imagecreatefromjpeg($origfile); }[code]

    funkcija laba, lietoju jau sen, uzliekot uz cita servera uzreiz kakas spļauj ārā ar saviem memory_****

  3. Problēma ielādējot palielu bildi, lai to samazinātu thumbnailā

    Fatal error: Allowed memory size of 13631488 bytes exhausted (tried to allocate 29996 bytes) in neteikšu

     

    PHP konfigurācijā ir

    memory_limit = 128M

    NETICU ka ar 128mb nepietiek lai samazinātu 700x1000px bildīti......

     

    P.S uzliekot ar iniset fiju 12mb uzreiz tie 29996 baiti pamazinaajaas uz ~7000 bet iniset neļāva pielikt vairāk par 12mb :(

     

    kur varētu būt nolāpītā problēma?

×
×
  • Create New...