Forum pragmaMx France 25 Mai 2012 à 02:51:39 *
Bienvenue, Invité. Veuillez vous connecter ou vous inscrire.


Connexion avec identifiant et mot de passe
 
Accueil Aide Rechercher
Pages: [1]   Bas de page
Imprimer
Auteur Fil de discussion: [Résolu] Accélérer défilement block-Calendar_centerlist_scroll  (Lu 3417 fois)
HollowMac
Membre Senior Mx
****
Hors ligne Hors ligne

Messages: 256



« le: 10 Décembre 2009 à 16:56:25 »

Bonjour,

J'utilise ce block pour afficher les évènements de mon calendrier sur ma page d'accueil (visible uniquement pour les membres enregistrés). Lorsqu'il y a 1 ou 2 évènements, alors ce block affiche les évènements sous forme de tableau ; mais quand il y en a plus, il les fait défiler sur une "seule ligne". Mais je trouve que le défilement est assez lent : j'ai regardé le code, et je ne vois pas où est-ce que je pourrais modifier ça.

Si quelqu'un sait comment faire, je lui en serai grès ! Clin d'oeil

Cordialement,
Merci.
« Dernière édition: 12 Décembre 2009 à 19:13:31 par HollowMac » Journalisée

Youkoulélé !
GravuTrad
Membre Senior Mx
****
Hors ligne Hors ligne

Messages: 407



« Répondre #1 le: 10 Décembre 2009 à 20:00:43 »

bloc dispo où?
Journalisée
HollowMac
Membre Senior Mx
****
Hors ligne Hors ligne

Messages: 256



« Répondre #2 le: 10 Décembre 2009 à 23:55:53 »

Dispo avec le module Kalender Mx Clin d'oeil

Mais en voici le code source : respect (à télécharger ici aussi : block-Calendar_centerlist_scroll.php.zip car ça fait un peu long là ^^ )

Code:
<?php
/**
 * KalenderMx v1.4
 * Copyright (c) 2004 by A.Ellsel (kalender@pragmamx.org)
 * http://www.pragmamx.org & http://www.shiba-design.de
 * 
 * KalenderMx was based on EventCalendar 2.0
 * Copyright (c) 2001 Originally by Rob Sutton
 * 
 * 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/dev-Kalender/html/blocks/block-Calendar_centerlist_scroll.php,v $
 * $Revision: 1.8 $
 * $Author: Andreas Ellsel $
 * $Date: 2006/07/21 13:24:09 $
 */

// // !!!! don't change this 3 lines !!!! ////////////////////////////////////////
$thisfile basename(__file__);
if (
eregi($thisfile$_SERVER["PHP_SELF"])) die ("You can't access this file directly...");
global 
$bgcolor1$bgcolor2$bgcolor3$bgcolor4$bgcolor5$textcolor1$textcolor2$dbi;
// ///////////////////////////////////////////////////////////////////////////////////////////

$mxblockcache false;

// // Einstellungen fuer den Block ////////////////////////////////////////
// CHANGE THIS IF YOU CHANGE THE CALENDAR-MODULES FOLDER NAME
if (!defined("CAL_MODULE_NAME")) define("CAL_MODULE_NAME""Kalender");

// /////////////////////////////////////////////////////////////////////////////
// verschiedene Einstellungen
$sort "asc";       // Sortierung der Liste:  asc =aufsteigend / desc =absteigend
$scrolling 1;       // Eintraege seitlich scrollen
$scrolltype "scroll";       // Art des Scrollens: scroll / alternate
$scrolldelay 1;       // Scrollgeschwindigkeit
$scrollamount 1;       // Scrollgeschwindigkeit
$listcount 10;       // Anzahl der Termine im Block
$listStarttime 0;       // Startzeit des Termins anzeigen: 0=nein / 1=ja
$listEnddate2 0;       // Enddatum anzeigen, wenn gleich dem Startdatum: 0=nein / 1=ja
$listEndtime 0;       // Ende-Zeit des Termins anzeigen: 0=nein / 1=ja
$listtimebreak 0;       // Start/Endezeit nach Datum umbrechen:  0=nein / 1=ja   (erhoeht die Zeile!)
$eventwidth 200;       // Breite des einzelnen Events bei scrolling
$showTitle 0;       // Blockueberschrift anzeigen: 0=nein / 1=ja
$scrolltopmargin = -2;       // Abstand des scrollenden Teils von oben: beliebiger integer Wert in px 
$showHeader 0;       // Tabellenkopf anzeigen: 0=nein / 1=ja
$showLegend 0;       // Farblegende anzeigen: 0=nein / 1=ja
$showNewlink 0;       // Link 'Termin vorschlagen'  anzeigen: 0=nein / 1=ja
$showalldot 0;       // Link (stern) fuer alle Ereignisse 0=nein / 1=ja
$legendCols 0;       // Anzahl der Spalten in der Kategorieliste. 0, wenn Kalendereinstellung verwendet werden soll

// // Definition der Farben und Rahmen ///////////////////////////////////////////////////////
$listheadbgcolor $bgcolor2;       // Hintergrund Listen-Kopf
$listheadtxtcolor $textcolor2;       // Text Listen-Kopf
$listbgcolor1 $bgcolor1;       // Hintergrund erste Zeile
$listtxtcolor1 $textcolor1;       // Text erste Zeile
$listbgcolor2 $bgcolor2;       // Hintergrund naechste Zeile
$listtxtcolor2 $textcolor2;       // Text naechste Zeile
$listbordercolor $bgcolor2;       // Rahmenfarbe um Liste
$scrollbgcolor $bgcolor1;       // Hintergrundfarbe des Marquee-Tags (Zwischenraum Scrollinhalte)
$listtableborder 0;       // html Rahmen um Liste
$listtablecellspacing 1;       // abstand zwischen Events (auch Rahmenbreite)
$listtablecellpadding 2;       // Freiraum innerhalb der Tabellenspalten der einzelnen Termindaten
$listheadbold 1;       // Ueberschriften der Liste in Fettschrift: 0=nein / 1=ja

// // Ende der Einstellungen, ab hier nichts veraendern !! ///////////////////////////////////
// ///////////////////////////////////////////////////////////////////////////////////////////
$listheadbold1 = ($listheadbold) ? "<b>" "";
$listheadbold2 = ($listheadbold) ? "</b>" "";
$timebreak = ($listtimebreak && !$scrolling) ? "<br>\n" "";

$conftest = @include("modules/" CAL_MODULE_NAME "/config/config.php");
if (!
$conftest) {
    
$content "<b>Error!</b><br>You must change the constant '\"CAL_MODULE_NAME\"' in file: <br>" __file__ "";
    return;

if (!empty(
$legendCols)) {
    
$calconf['catListCols'] = $legendCols;

get_lang(CAL_MODULE_NAME);
if (!
defined("CAL_MODULE_PATH")) define("CAL_MODULE_PATH""modules/" CAL_MODULE_NAME "/");
if (!
defined("CAL_TABLE_EVENTS")) @include_once(CAL_MODULE_PATH "includes/functions.php");

$showNewlink = (calIsPostAllowed() && $showNewlink) ? 0;

if (!
calDetectGoodBrowser ()) {
    
$scrolling 0;

$whereoption " categorie in(" calGetSqlEventpoints() . ") AND activ=1";
$d date("d");
$m date("n");
$y date("Y");
$qrydate "$y-$m-$d";
$qry "SELECT count(eid) FROM " CAL_TABLE_EVENTS 
WHERE (startDate>= '
$qrydate' or endDate>= '$qrydate') 
and (
$whereoption)";
list(
$icount) = sql_fetch_row(sql_query($qry$dbi), $dbi);
if (
$icount $listcount$icount $listcount;
$content "\n<!-- $thisfile output start -->\n";
$i 0;
if (
$icount) {
    
setlocale (LC_TIME_CALLOCALE);
    
$imgprops "align=\"middle\" hspace=\"6\" vspace=\"4\" width=\"9\" height=\"9\" border=\"0\" alt=\"\"";
    
$fontstyle = ($listStarttime) ? "tiny" "boxcontent";
    if (
$icount 3) {
        
$scrolling 0;
    } 
    if (
$scrolling) {
        
srand((double)microtime() * 1000000);
        
$randmarq 'm' md5(uniqid(rand(), 1));
        
$content .= "<div style=\"position: relative; top: $scrolltopmargin;\">
<marquee id='" 
$randmarq "' behavior='$scrolltype' direction='left' hspace='0' vspace='0' scrollamount='$scrollamount' scrolldelay='$scrolldelay' loop='0' dir='ltr' onMouseOver='this.stop()' onMouseOut='this.start()'>
<table cellspacing=\"
$listtablecellspacing\" cellpadding=\"$listtablecellpadding\" style=\"background-color: $listbordercolor; border: ${listtableborder}px solid $listbordercolor;\" border=\"$listtableborder\">
<tr>"
;
    } else {
        
$content .= "<table width=\"100%\" border=\"$listtableborder\" cellspacing=\"$listtablecellspacing\" cellpadding=\"$listtablecellpadding\" style=\"background-color: $listbordercolor; border: ${listtableborder}px solid $listbordercolor;\">";
        if (
$showHeader) {
            
$content .= "<tr style=\"background-color: $listheadbgcolor;\"><td colspan=\"3\" width=\"25%\"><span style=\"color: $listheadtxtcolor;\" class=\"boxcontent\">$listheadbold1_CALEVENTDATETEXT "$listheadbold2</span></td>\n<td width=\"75%\"><span style=\"color: $listheadtxtcolor;\" class=\"boxcontent\">$listheadbold1_CALSUBTITLE "$listheadbold2</span></td>\n</tr>\n";
        } 
        
// $content.="<tr style=\"background-color: $listbgcolor2;\"><td width=\"10%\" height=\"1\"></td><td width=\"5%\"></td><td width=\"10%\"></td><td width=\"75%\"></td></tr>\n";
    

    
$content .= "";
    
$qry "SELECT eid, title, hometext, posteddate, topic, informant, year(startDate), month(startDate), dayofmonth(startDate), hour(startTime), minute(startTime), year(endDate), month(endDate), dayofmonth(endDate), hour(endTime), minute(endTime), alldayevent, categorie FROM " CAL_TABLE_EVENTS 
WHERE (startDate>= '
$qrydate' or endDate>= '$qrydate') 
and (
$whereoption
order by startDate 
$sort, endDate $sort 
limit 0,
$icount";
    
$result sql_query($qry$dbi);
    while (list(
$eid$title$hometext$posteddate$topic$informant$y1$m1$d1$h1$mi1$y2$m2$d2$h2$mi2$alldayevent$categorie) = sql_fetch_row($result$dbi)) {
        
$bgcolornew = ($i == 0) ? $listbgcolor1 $listbgcolor2;
        
$txtcolornew = ($i == 0) ? $listtxtcolor1 $listtxtcolor2;
        
$listrange "";
        
$i = ($i == 0) ? 0;
        
$title htmlspecialchars(strip_tags(stripslashes($title)), ENT_QUOTES);
        
$dateStart calStrftime(_CALSHORTDATEFORMAT, @mktime(000$m1$d1$y1));
        if (
$listStarttime && !$alldayevent) {
            
$dateStart .= $timebreak ' ' calStrftime(_CALTIMEFORMAT, @mktime($h1$mi10$m1$d1$y1));
        } 
        if (!
$listEnddate2 && $m1 == $m2 && $d1 == $d2 && $y1 == $y2) {
            
$dateEnd = ($scrolling) ? '' '&nbsp;';
            
$listrange "<span class=\"$fontstyle\">&nbsp;</span><br>";
        } else {
            
$dateEnd calStrftime(_CALSHORTDATEFORMAT, @mktime(000$m2$d2$y2));
        } 
        if (
$listEndtime && !$alldayevent) {
            
$dateEnd .= $timebreak ' ' calStrftime(_CALTIMEFORMAT, @mktime($h2$mi20$m2$d2$y2));
        } 
        if (
$scrolling) {
            
$scrolldate = (empty($dateEnd) || $dateStart == $dateEnd) ? $dateStart "$dateStart " _CALLISTRANGE $dateEnd";
            
$content .= "<td style=\"background-color: $bgcolornew;\" nowrap width=\"$eventwidth\" align=\"center\"><span style=\"color: $txtcolornew;\" class=\"tiny\">
<img src=\"" 
calGetBarImage("ball"$categorie) . "\" $imgprops>" $scrolldate "</span><br>\n
<span style=\"color: 
$txtcolornew;\" class=\"boxcontent\">&nbsp;<a href=\"" CAL_MODULE_LINK "&amp;op=view&amp;eid=$eid\">$title</a></span></td>\n";
        } else {
            
$alttext = ($hometext) ? substr(htmlentities(strip_tags(stripslashes($hometext))), 070) . '...' "";
            
$content .= "
<tr style=\"background-color: 
$bgcolornew;\">";
            if (
$dateEnd == '&nbsp;' && $alldayevent) {
                
$content .= "
<td width=\"25%\" colspan=\"3\" nowrap><span style=\"color: 
$txtcolornew;\" class=\"$fontstyle\">$dateStart</span></td>\n";
            } else {
                
$content .= "
<td width=\"10%\" nowrap><span style=\"color: 
$txtcolornew;\" class=\"$fontstyle\">$dateStart</span></td>\n
<td width=\"5%\" align=\"center\">" 
$listrange "<span style=\"color: $txtcolornew;\" class=\"tiny\">" _CALLISTRANGE "</span></td>\n
<td width=\"10%\" nowrap><span style=\"color: 
$txtcolornew;\" class=\"$fontstyle\">$dateEnd</span></td>\n
"
;
            } 
            
$content .= "
<td width=\"75%\"><span style=\"color: 
$txtcolornew;\" class=\"boxcontent\"><img src=\"" calGetBarImage("ball"$categorie) . "\" $imgprops>&nbsp;<a href=\"" CAL_MODULE_LINK "&amp;op=view&amp;eid=$eid\" title=\"$alttext\">$title</a></span></td>\n
</tr>\n"
;
        } 
    } 
    if (
$scrolling) {
        
// / Mozilla macht Probleme beim scrollen, deshalb hier explizit starten
        
$content .= "</tr>\n</table></marquee></div>
<script language='JavaScript1.2'>
<!--
if (document.getElementById) { document.getElementById('" 
$randmarq "').start(); }
//-->
</script>
"
;
    } else {
        
$content .= "</table>";
    } 
    
setlocale (LC_TIME$GLOBALS["locale"]);
} else {
    
$content .= "<span class=\"tiny\">" _CAL0EVENTSBLOCK "<br></span>\n";

if (
$showLegend) {
    
$link CAL_MODULE_LINK "&amp;op=list";
    
$content .= calBuildColorLegend("centerblock"$showalldot$showNewlink);


$content .= "\n<!-- $thisfile output end -->\n<!-- KalenderMx &#169; by shiba-design.de -->\n";
$content ereg_replace("\t"""$content);
// / Der Blocktitel wird &#252;ber die Sprachdatei des Kalenders gesteuert,
// / soll statt dessen die Einstellung des Adminmen&#252;s verwendet werden,
// / einfach die folgenden Zeilen l&#246;schen oder auskommentieren
$blockfiletitle = ($showTitle) ? "" _CALLISTDESCRIPTION1 $icount " _CALLISTDESCRIPTION2 "." "";

?>

« Dernière édition: 11 Décembre 2009 à 00:02:54 par HollowMac » Journalisée

Youkoulélé !
GravuTrad
Membre Senior Mx
****
Hors ligne Hors ligne

Messages: 407



« Répondre #3 le: 11 Décembre 2009 à 12:47:47 »

joue sur $scrolling et $scrolldelay.
Journalisée
Diabolo
Administrateur
Ultra membre Mx
******
Hors ligne Hors ligne

Messages: 5480



« Répondre #4 le: 12 Décembre 2009 à 12:15:15 »

Slt,
Oui les options de configuration (et y en a beaucoup ;-))sont à modifier directement dans le code du bloc

Code:
// /////////////////////////////////////////////////////////////////////////////
// verschiedene Einstellungen
$sort = "asc";       // Sortierung der Liste:  asc =aufsteigend / desc =absteigend
$scrolling = 1;       // Eintraege seitlich scrollen
$scrolltype = "scroll";       // Art des Scrollens: scroll / alternate
$scrolldelay = 1;       // Scrollgeschwindigkeit
$scrollamount = 1;       // Scrollgeschwindigkeit
$listcount = 10;       // Anzahl der Termine im Block
$listStarttime = 0;       // Startzeit des Termins anzeigen: 0=nein / 1=ja
$listEnddate2 = 0;       // Enddatum anzeigen, wenn gleich dem Startdatum: 0=nein / 1=ja
$listEndtime = 0;       // Ende-Zeit des Termins anzeigen: 0=nein / 1=ja
$listtimebreak = 0;       // Start/Endezeit nach Datum umbrechen:  0=nein / 1=ja   (erhoeht die Zeile!)
$eventwidth = 200;       // Breite des einzelnen Events bei scrolling
$showTitle = 0;       // Blockueberschrift anzeigen: 0=nein / 1=ja
$scrolltopmargin = -2;       // Abstand des scrollenden Teils von oben: beliebiger integer Wert in px
$showHeader = 0;       // Tabellenkopf anzeigen: 0=nein / 1=ja
$showLegend = 0;       // Farblegende anzeigen: 0=nein / 1=ja
$showNewlink = 0;       // Link 'Termin vorschlagen'  anzeigen: 0=nein / 1=ja
$showalldot = 0;       // Link (stern) fuer alle Ereignisse 0=nein / 1=ja
$legendCols = 0;       // Anzahl der Spalten in der Kategorieliste. 0, wenn Kalendereinstellung verwendet werden soll

// // Definition der Farben und Rahmen ///////////////////////////////////////////////////////
$listheadbgcolor = $bgcolor2;       // Hintergrund Listen-Kopf
$listheadtxtcolor = $textcolor2;       // Text Listen-Kopf
$listbgcolor1 = $bgcolor1;       // Hintergrund erste Zeile
$listtxtcolor1 = $textcolor1;       // Text erste Zeile
$listbgcolor2 = $bgcolor2;       // Hintergrund naechste Zeile
$listtxtcolor2 = $textcolor2;       // Text naechste Zeile
$listbordercolor = $bgcolor2;       // Rahmenfarbe um Liste
$scrollbgcolor = $bgcolor1;       // Hintergrundfarbe des Marquee-Tags (Zwischenraum Scrollinhalte)
$listtableborder = 0;       // html Rahmen um Liste
$listtablecellspacing = 1;       // abstand zwischen Events (auch Rahmenbreite)
$listtablecellpadding = 2;       // Freiraum innerhalb der Tabellenspalten der einzelnen Termindaten
$listheadbold = 1;       // Ueberschriften der Liste in Fettschrift: 0=nein / 1=ja

// // Ende der Einstellungen, ab hier nichts veraendern !! ///////////////////////////////////
Journalisée

..:: Veuillez consulter les règles du forum ::..- Avez-vous consulté notre documentation avant de poser votre question ?-Pas de support en MP ou par courriel, le forum est là pour ça !Nouvelle question=Nouveau Sujet
HollowMac
Membre Senior Mx
****
Hors ligne Hors ligne

Messages: 256



« Répondre #5 le: 12 Décembre 2009 à 19:13:13 »

Alors en effet, c'était bien dans la foule d'options, mais ce n'était ni $scrolling ni $scrolldelay Sourire Il s'agissait de.............$scrollamount !!! ^^

Mais ce scroll saccade à mort, alors j'ai décidé de mettre $scrolling à 0, pour qu'il ne scroll plus ; il y a bien un bloc pour le calendrier sans scroll, mais le design me plait moins que la version scroll qui scroll pas ^^

Merci beaucoup à vous pour votre aide Clin d'oeil bien joué
Journalisée

Youkoulélé !
Pages: [1]   Haut de page
Imprimer
Forum pragmaMx France  |  Modules spécifiques & Blocs  |  Autres modules dédiés à PragmaMx  |  Kalender-Mx (Modérateurs: Diabolo, kroms, phi56360)  |  Fil de discussion: [Résolu] Accélérer défilement block-Calendar_centerlist_scroll
 
Aller à:  

Powered by SMF 1.1.15 | SMF © 2006-2009, Simple Machines

Plus