block-Gallery-center-Random_pictures.php laufen schneller machen

Begonnen von vitalik_1984, 06 Februar 2006, 16:57:28

⏪ vorheriges - nächstes ⏩

0 Mitglieder und 1 Gast betrachten dieses Thema.

vitalik_1984

Hallo leute ich nutze diesen block um bilder auf meiner Seite von rechts nach links laufen zu lassen. Leider ist es zu langsam. Kann ich das irgendwie verändern das die Bilder schneller laufen.
Vielleicht muss man das auch wo anders ändern
Hier ist der Quelltext von dieser datei:



<?php // $Id: block-Gallery-center-Random_pictures.php,v 1.1 2005/12/01 22:24:05 Andreas Ellsel Exp $
/************************************
pragmaMx  Content Management System
Copyright (c) 2005 pragmaMx Dev Team - http://pragmamx.org
***********************************
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
***********************************
$Source: D:\CVS/CoppermineMx/html/blocks/block-Gallery-center-Random_pictures.php,v $
$Revision: 1.1 $
$Author: Andreas Ellsel $
$Date: 2005/12/01 22:24:05 $
***********************************
this file based on:
Coppermine Photo Gallery
Copyright (c) 2003-2005 Coppermine Dev Team
v1.1 originaly written by Gregory DEMAR
required version: >= 1.4.1
************************************/

if (!defined("mxMainFileLoaded")) die ("You can't access this file directly...");
# error_reporting(E_ALL); $GLOBALS['mxSqlErrorDebug'] = true;
global $CONFIG, $cpg_name, $lang_get_pic_data;

///  Beginn Blockkonfiguration  ////////////////////////////
$cpg_name     = 'Gallery';  // der Name/Pfad des Gallerymoduls
$limit        = 16;          // Anzahl der Thumbnails
$title_length = 15;         // Länge des Bildtitels unter dem Bild
///  Ende Blockkonfiguration  //////////////////////////////

if (@file_exists('modules/'.$cpg_name.'/blocks.inc.php')) {
   include('modules/'.$cpg_name.'/blocks.inc.php');
   }
else {
   if (mxIsAdmin()) {
      $content = 'The module "'.$cpg_name.'" doesn\'t exist or is not correctly installed. Please install this module or change the Variable $cpg_name in file blocks/'.basename(__file__).'.';
      }
   return;
   }

$result = sql_query("
SELECT COUNT(*)
FROM $CONFIG[TABLE_PICTURES] AS p INNER JOIN $CONFIG[TABLE_ALBUMS] AS a ON (p.aid = a.aid)
WHERE p.approved='YES' AND ".$vis_groups."
GROUP BY p.pid");

$nbEnr = sql_fetch_row($result);
$pic_count = $nbEnr[0];
// if we have more than 1000 pictures, we limit the number of picture returned
// by the SELECT statement as ORDER BY RAND() is time consuming
if ($pic_count > 1000) {
   $result = sql_query("SELECT COUNT(*) from $CONFIG[TABLE_PICTURES] WHERE approved = 'YES'");
   $nbEnr = sql_fetch_row($result);
   $total_count = $nbEnr[0];
   $granularity = floor($total_count / 1000);
   $cor_gran = ceil($total_count / $pic_count);
   srand(time());
   for ($i = 0; $i <= $cor_gran; $i++) {
      $random_num_set = rand(100, $granularity) . ', ';
      }
   $random_num_set = substr($random_num_set, 0, -2);
   $result = sql_query("
   SELECT p.pid, p.url_prefix, p.filepath, p.filename, p.aid, p.title
   FROM $CONFIG[TABLE_PICTURES] AS p INNER JOIN $CONFIG[TABLE_ALBUMS] AS a ON (p.aid = a.aid)
   WHERE randpos IN ($random_num_set) AND p.approved='YES' AND ".$vis_groups."
   ORDER BY RAND() DESC
   LIMIT $limit");
   }
else {
   $result = sql_query("
   SELECT p.pid, p.url_prefix, p.filepath, p.filename, p.aid, p.title
   FROM $CONFIG[TABLE_PICTURES] AS p INNER JOIN $CONFIG[TABLE_ALBUMS] AS a ON (p.aid = a.aid)
   WHERE p.approved='YES' AND ".$vis_groups."
   ORDER BY RAND() DESC
   LIMIT $limit");
   }

$output = '';
while ($row = sql_fetch_array($result)) {
   $row['title'] = strip_tags(empty($row['title']) ? substr($row['filename'], 0, -4) : $row['title']);
   $output .= '<td align="center" valign="baseline"><a href="modules.php?name='.$cpg_name.'&amp;act=displayimage&amp;album='.$row['aid'].'&amp;pos=-' . $row["pid"] . '"><img src="' . get_pic_url($row, 'thumb') . '" border="0" alt="' . $row['title'] . '" title="' . $row['title'] . '"><br />' . mxCutString($row['title'], $title_length) . '</a></td>';
   }

if ($output) {
   $content = '<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center"><tr>'
   .$output.
   '</tr>
   <tr align="center">
   <td colspan="' . $limit . '" valign="baseline"><a href="modules.php?name='.$cpg_name.'">' . $CONFIG['gallery_name'] . '</a></td>
   </tr>
   </table>';
   }

?>


Andi

Hi :)

zum Quellcode:
http://www.pragmamx.org/Content-pa-showpage-pid-48.html#brule_8
Den Quellcode des Blocks hat jeder von uns auf dem Rechner liegen ;)

Ich denke es dreht sich um diesen Block block-Gallery-center-scroll-Random_pictures.php.
Hier findest du ab Zeile ~#84 den <marquee> Tag.
Info's dazu findest du dann hier:
http://de.selfhtml.org/html/text/proprietaer.htm#marquee
Stichwort scrollamount und scrolldelay
schön´s Grüssle, Andi