I am nobody

Status
Not open for further replies.

Jung

???
Premium
14,202
2,465
637
I'm bored too, here's a pointless post.

PHP:
<?
    // set config file 
    if(is_file('config.cfg.php'))
	require 'config.cfg.php';
    else
	die('Error, no config file');
    
    //image directory
    if(!is_dir($_images_dir_))
	die('Error, no image directory');

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-2">
<title>/justinb.us/gallery/</title>
<meta NAME="Author" CONTENT="JustinB">

<link href="gallery2.css" rel="stylesheet" type="text/css">
</head>
<body>

<?
    $time_start = microtime(true);
    

    //specify image type (jpg i gif)
    $noimage = 0;
    
    if ($dh = opendir($_images_dir_)) {
    while (($f = readdir($dh)) !== false) {
	if((substr(strtolower($f),-3) == 'jpg') || (substr(strtolower($f),-3) == 'jpg'))
	{
	    $imageinfo = getimagesize($_images_dir_.$f);
	    $width = $imageinfo[0];
	    $height = $imageinfo[1];
	    $size = round(filesize($_images_dir_.$f)/1024,1).' KB';
	    $noimage++;
    	    $images[] = array('filename' => $f, 'width' => $width, 'height' => $height, 'size' => $size);
	    array_multisort($images, $_sort_, SORT_REGULAR);
	}
    }
    closedir($dh);
    }	


    if($noimage)
    {

	if($_GET["img"] != '')
	{
	    echo '<p class="title">'.$images[$_GET["img"]][filename].'</p>';
	    if($images[$_GET["img"]][filename] != '')
	    {
	    
		if($_GET["img"])
		    $_no_ = ceil(($_GET["img"]+1)/$_no_pics_per_page_);
		else
		    $_no_ = 1;
		
		if($_GET["img"] == 0)
		    $side = '<p class="link"><a href="'.$_SERVER["PHP_SELF"].'?no='.$_no_.'" class="link">UP</a>&nbsp;<a href="'.$_SERVER["PHP_SELF"].'?img='.($_GET["img"]+1).'" class="link">NEXT >></a></p>';
		elseif($_GET["img"] == ($noimage-1))
		    $side = '<p class="link"><a href="'.$_SERVER["PHP_SELF"].'?img='.($_GET["img"]-1).'" class="link"><< PREV</a>&nbsp;<a href="'.$_SERVER["PHP_SELF"].'?no='.$_no_.'" class="link">UP</a></p>';
		else
		    $side = '<p class="link"><a href="'.$_SERVER["PHP_SELF"].'?img='.($_GET["img"]-1).'" class="link"><< PREV</a>&nbsp;<a href="'.$_SERVER["PHP_SELF"].'?no='.$_no_.'" class="link">UP</a>&nbsp;<a href="'.$_SERVER["PHP_SELF"].'?img='.($_GET["img"]+1).'" class="link">NEXT >></a></p>';
		echo $side.'<p align="center"><img  class= "link" src="picture.php?img='.$images[$_GET["img"]][filename].'&show=full" border="'.$_border_.'" hspace="'.$_hspace_.'" vspace="'.$_vspace_.'" alt="'.$images[$_GET["img"]][filename].'" title="'.$images[$_GET["img"]][filename].', '.$images[$_GET["img"]][width].'x'.$images[$_GET["img"]][height].', '.$images[$_GET["img"]][size].'" ></p>'.$side;
	    }
	}
	else
	{
    	echo '<p class="title">'.$_page_title_.'</p>';

//	echo $noimage.'<br>'.print_r($images);
	if($noimage > $_no_pics_per_page_)
	    $norows = ceil($_no_pics_per_page_/$_no_cols_);
	else
	    $norows = ceil($noimage/$_no_cols_);
	
	$nopos = ceil($noimage/$_no_pics_per_page_);
	
//	echo $nopos;
	echo '<table border="0" align="center" cellpadding="0" cellspacing="0">
	';
	
	if($_GET["no"] == "")
	    $no = 1;
	else
	    $no = $_GET["no"];
	    
	
	$index=abs($no-1)*$_no_pics_per_page_;
	if(($noimage-$index)<$_no_pics_per_page_)
	    $norows= ceil(($noimage-$index)/$_no_cols_);

	for($a = 1;$a<=$norows;$a++)
	{
	    echo '
	    <tr>
	    ';
		for($b = 1;$b<=$_no_cols_;$b++)
		{
		    if($images[$index][filename] != '')
		    {
			echo '<td width="'.(2*$_vspace_+$_width_min_).'" valign="top" align="center"><a href="'.$_SERVER["PHP_SELF"].'?img='.$index.'" ><img  class="link"src="picture.php?img='.$images[$index][filename].'" border="'.$_border_.'" hspace="'.$_hspace_.'" vspace="'.$_vspace_.'" alt="'.$images[$index][filename].'" title="'.$images[$index][filename].', '.$images[$index][width].'x'.$images[$index][height].', '.$images[$index][size].'"></a>
			';
			if($_filename_)
			    echo '<span class="name">'.$images[$index][filename].'</span><br><br>';
	
			echo '</td>';
			$index++;
		    }
		    else
			echo '<td width="'.(2*$_vspace_+$_width_min_).'">&nbsp;</td>';
		}	
	    echo '</tr>
	    ';
	}
	
	echo '
	</table>
	';
	
	if($nopos>1)
	{
	    echo '<p class="stopka">';
    	    for($i=1;$i<=$nopos;$i++)
	    {
	        if($i == $no)
	            echo '<font class="stopka_select">'.$i.'</font>&nbsp;';
	        else
	            echo '<a href="'.$_SERVER["PHP_SELF"].'?no='.$i.'" class="stopka">'.$i.'</a>&nbsp;';
	    }
	    echo '</p>';
	}	

	}



    }
    else
	die('No images in directory');


    $time_end = microtime(true);
    $time = $time_end - $time_start;
    echo '<p class="exe"><br>All images in gallery : '.count($images).'</p>';

?>

<p align="center">
     <span style="button">
	 <a href="http://validator.w3.org/check?uri=http%3A%2F%2Fwww.justinb.us%2Fgallery%2F;ss=1;sp=1"><img border="0"
          src="html.png"
          alt="Valid HTML 4.01!" height="16" width="80"></a>&nbsp;
     <a href="http://jigsaw.w3.org/css-validator/validator?uri=http://www.justinb.us/gallery/gallery2.css"><img border="0"
          src="css.png" 
          alt="Valid CSS!" height="16" width="80"></a>
		 </span>
		
    </p>
</body>
</html>
 

Woodreaux

Original Dicksman
2,429
1
0
Okay, here's some more non relevant code:
PHP:
// begin irrelevant non-PHP code
void MJ_Tile::Render_FrontFace()const{
	if(this->selected){		glColor3f(1.0,0.0,0.0);
	}else{					glColor3f(.95,.95,.6);   	}
	if(this->hint){			glColor3f(0.0,1.0,0.0);	}
	glBindTexture( GL_TEXTURE_2D, this->face_texture);
	glBegin(GL_QUADS);
		glTexCoord2f( 0.0f, 0.0f );
		glVertex3f(pos_x-TILE_V_DX,pos_y+TILE_V_DY,pos_z+TILE_V_DZ);
		glTexCoord2f( 1.0f, 0.0f );
			 glVertex3f(pos_x+TILE_V_DX,pos_y+TILE_V_DY,pos_z+TILE_V_DZ);
		glTexCoord2f( 1.0f, 1.0f );
		glVertex3f(pos_x+TILE_V_DX,pos_y-TILE_V_DY,pos_z+TILE_V_DZ);
		glTexCoord2f( 0.0f, 1.0f );
		glVertex3f(pos_x-TILE_V_DX,pos_y-TILE_V_DY,pos_z+TILE_V_DZ);
	glEnd();
 

Captain 151

Seeped in a dry Merlot
4,261
4
0
Unforgiven said:
i know nothing of code.

so why the hell did i just read all of that?
What is this code that you speak of?

I took a preliminary C programming computer science class here, passed with a B+, but never understand a single word he said, so i helped him drink his wine.
 

Woodreaux

Original Dicksman
2,429
1
0
That's some C++ code using OpenGL It's not a complete program, merely a tiny part of the graphics rendering of game I'm making. All that function does is draw a rectangle and stick a texture on it.
 

skylinec

Somewhere in the Between
3,192
0
36
Though it is very sad when a thread starting off about how dead and nOOBish this place is then with one post turns into a coding contest. Damn Computers and their hard to understand languages!
 

NaughtyGirl21

Formally Cuddles
2,197
0
0
LOL....I may know how to put a computer together and its parts, but coding is not for me. I don't understand it, nor will I ever...lol.
 

Jung

???
Premium
14,202
2,465
637
Unforgiven said:
the only computer language i know is html... and even with that, very little.
HTML isn't really that hard. Aside from XML or Perl, it's probably the easiest language out there. You should check out www.w3schools.com, they have tutorials on how to write semantic, standards compliant code. :thumbsup: You should check out XHTML (and CSS) too, HTML is going to be phased out sometime in the future. In many cases, it's actually already considerd depreciated.
 
Status
Not open for further replies.