[Scummvm-cvs-logs] CVS: web screenshots.js,1.1,1.2 screenshots.php,1.15,1.16 index.php,1.22,1.23

Max Horn fingolfin at users.sourceforge.net
Sun Jun 26 04:21:11 CEST 2005


Update of /cvsroot/scummvm/web
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15132

Modified Files:
	screenshots.js screenshots.php index.php 
Log Message:
Reorder some screenshot stuff; make it use the new jpg thumbs

Index: screenshots.js
===================================================================
RCS file: /cvsroot/scummvm/web/screenshots.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- screenshots.js	27 Jan 2004 22:05:25 -0000	1.1
+++ screenshots.js	26 Jun 2005 11:19:44 -0000	1.2
@@ -9,8 +9,8 @@
 
 var i_jn = 0;
 function scrshot_jn(x,n) {
-	if (n) i_jn++; else i_jn--;
-	if (i_jn > x) i_jn = 0;
-	if (i_jn < 0) i_jn = x;
-	document['img_jn'].src = "./screenshots/scummvm_" + i_jn + ".png";
+	i_jn += n;
+	if (i_jn >= x) i_jn = 0;
+	if (i_jn < 0) i_jn = x-1;
+	document['img_jn'].src = "./screenshots/scummvm_" + i_jn + ".jpg";
 }

Index: screenshots.php
===================================================================
RCS file: /cvsroot/scummvm/web/screenshots.php,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- screenshots.php	19 Mar 2004 17:50:06 -0000	1.15
+++ screenshots.php	26 Jun 2005 11:19:44 -0000	1.16
@@ -10,6 +10,7 @@
 
 // load libraries
 require($file_root."/include/"."incl.php");
+require($file_root."/include/"."screenshots.php");
 
 // start of html
 html_header("ScummVM :: Screenshots");
@@ -39,14 +40,14 @@
 		 html_frame_start("Screenshot Viewer","540",2,0,"color0"),
 	     html_frame_tr(
 				html_frame_td(
-					'<img src="'.$file_root.'/screenshots/big_scummvm_'.$view.'.png" '.
+					'<img src="'.screenshot_path($view).'" '.
 						'alt="Screenshot '.$view.'">',
 					'align=center class="color0" style="padding-top: 10px;"'
 				)
 			),
 	     html_frame_tr(
 				html_frame_td(
-					implode('', file($file_root.'/screenshots/scummvm_'.$view.'.txt')),
+					screenshot_caption($view),
 					'align=center class="color0" style="padding-bottom: 10px; font-style: italic;"'
 				)
 			),
@@ -62,26 +63,14 @@
 else
 {
 
-	// Grab list of images from screenshot dir
-	// and loop through them and add to $shots array
-	$shots = array();
-	$images = get_files($file_root."/screenshots","png");
-	while (list($key,$image) = each($images))
-	{
-		if (ereg("big",$image))
-		  continue;
-		array_push($shots,$image);
-	}
-
-	// counter vars
-	$total = count($shots);
-	$num = 0;
-	$where = 0;
+// counter vars
+$num = 0;
+$where = 0;
 
 	echo html_frame_start("Screenshot Gallery","540",2,0,"color0")."<tr>";
 
 	// loop and display images
-	while (list($c,$image) = each($shots))
+	while (list($c,$image) = each($screenshots))
 	{
 		// do not show images less than current pos
 		if ($offset > $c)
@@ -91,10 +80,10 @@
 		echo html_frame_td(
 				   '<table cellpadding="0" cellspacing="0"><tr><td align="center">'.
 				   '<a href="'.$PHP_SELF."?view=".$c.'&offset='.$offset.'">'.
-				   '<img src="'.$file_root.'/screenshots/scummvm_'.$c.'.png" '.
-				   'width=256 height=192 alt="Screenshot '.$c.'"></a>'.
+				   '<img src="'.screenshot_thumb_path($c).'" '.
+				   'width="'.$thumb_w.'" height="'.$thumb_h.'" alt="Screenshot '.$c.'"></a>'.
 				   '</td></tr><tr><td align="center">'.
-				   implode('', file($file_root.'/screenshots/scummvm_'.$c.'.txt')).
+				   screenshot_caption($c).
 				   '</td></tr></table>',
 				   'align=center class="color0" style="padding-top: 10px; font-style: italic;"'
 				  );
@@ -130,7 +119,7 @@
 	}
 
 	// display next link
-	if (($offset + 4) < $total)
+	if (($offset + 4) < $screenshots_count)
 	{
 		$next = $where + 1;
 		$nextLink = html_ahref("Next 4 Images >>",$PHP_SELF."?offset=".$next,"style='color: white;'");

Index: index.php
===================================================================
RCS file: /cvsroot/scummvm/web/index.php,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- index.php	10 May 2005 22:08:12 -0000	1.22
+++ index.php	26 Jun 2005 11:19:44 -0000	1.23
@@ -11,6 +11,7 @@
 
 // load libraries
 require($file_root."/include/"."incl.php");
+require($file_root."/include/"."screenshots.php");
 
 // start of html
 html_header("ScummVM", '<script src="'.$file_root.'/screenshots.js" type="text/javascript"></script>');
@@ -23,21 +24,9 @@
 if (!$shownews)
 {
 
-// Grab list of images from screenshot dir
-// and loop through them and add to $shots array
-$shots = array();
-$images = get_files($file_root."/screenshots","png");
-while (list($key,$image) = each($images))
-{
-        if (ereg("big",$image))
-          continue;
-        array_push($shots,$image);
-}
-
 // counter vars
-$total = (count($shots) - 1);
 srand((double) microtime() * 1000000);
-$randImg = rand(0,$total);
+$randImg = rand(0, screenshots_count - 1);
 
 echo html_round_frame_start("About ScummVM","");
 ?>
@@ -85,17 +74,17 @@
 			<a href="javascript:openWin('./screenshots/big_scummvm_'+i_jn+'.png','scummvm',640,483);"
 			onMouseOver="window.status='Click to View Full Size Image';return true;"
 			onMouseOut="window.status='';return true;"><img
-			src="./screenshots/scummvm_<?=$randImg?>.png" width=256 height=192
+			src="<?=screenshot_thumb_path($randImg)?>" width="<?=$thumb_w?>" height="<?=$thumb_h?>"
 			style="margin: 5px"
 			name="img_jn" alt="Click to view Full Size"></a>
 		</td></tr>
 		<tr>
 			<td align=left>
-			  <a href="javascript:scrshot_jn(<?=$total?>,0);"><< Previous</a>
+			  <a href="javascript:scrshot_jn(<?=$screenshots_count?>,-1);"><< Previous</a>
 			</td>
 			<td></td>
 			<td align=right>
-			  <a href="javascript:scrshot_jn(<?=$total?>,1);">Next >></a>
+			  <a href="javascript:scrshot_jn(<?=$screenshots_count?>,+1);">Next >></a>
 			</td>
 		</tr>
 		</table>





More information about the Scummvm-git-logs mailing list