Help - Search - Member List - Calendar
Full Version: [2.0 Portal] [Bloc]Avatar Clock
IPBR-FR > Entraide > Forums dédiés aux mods majeures > Portal
Fantome
Nom de fichier :: [Bloc]Avatar Clock
Auteur :: Fantome
Catégorie :: 2.0 Portal
Description ::
Affiche l'heure (dynamique) et la date avec en fond, les avatars des membres choisis de manière aléatoire.
Paramétre dans l'admin : Activation du bloc

Pour avoir les instruction avec une mise en page plus jolie aller voir le second post du sujet de support


Voir le fichier
Fantome
Bloc Avatar Clock pour IPB Portal

Affiche l'heure (dynamique) et la date avec en fond, les avatars des membres choisis de manière aléatoire.

Ce bloc a était addapté depuis un bloc pour MyIbPortal créé par Simous.


Etape 1 : Ouvrir lang/**/lang_portal.php (Répéter l'opération pour chaque répertoire de fichier langue)
Chercher
CODE

);
?>
Ajouter au-dessus
CODE
'avatar_clock_title' => "Avatar Clock",

Enregistrer et Fermer lang/**/lang_portal.php


Etape 2 : Ouvrir sources/ipbportal.php
Chercher
CODE
    $this->site_bits['affiliates']     = $this->_show_affiliates();
Ajouter en-dessous
CODE
    $this->site_bits['avatar_clock']   = $this->_show_avatar_clock();


Chercher
CODE
}

?>
Ajouter au-dessus
CODE
/*-------------------------------------------------------------------------*/
// Bloc Avatar clock
/*-------------------------------------------------------------------------*/

function _show_avatar_clock()
{
global $ibforums, $DB, $std, $print;

if ( ! $ibforums->vars['csite_avatar_clock_show'] )
{
return;
}

$DB->simple_construct( array( 'select' => 'avatar_size, avatar_location, avatar_type',
'from' => 'member_extra',
'where' => "avatar_location <> ''",
'order' => 'RAND()',
'limit' => '1' ) );
$DB->simple_exec();

$member = $DB->fetch_row();

$dim_avatar = explode("x",$member['avatar_size']);
$davatar_dims = explode( "x", $ibforums->vars['avatar_dims'] );
if (!$dim_avatar[0])
{
$width = $davatar_dims[0];
}
else
{
$width = $dim_avatar[0];
}

$avatar = $std->get_avatar( $member['avatar_location'], 1, $member['avatar_size'], $member['avatar_type'] );

return $this->html->tmpl_avatar_clock($width."px", date("d/m/y"), $avatar);
}


Enregistrer et Fermer sources/ipbportal.php


Etape 3 : Aller dans l'ACP de votre forum
Etape 3.1 : Dans System Settings > View All General Setting > Import an XML settings file
Puis Puis importer les settings contenue dans le fichier ipb_settings_avatar_clock.xml (dans le zip)
Configuré les options du bloc dans les paramétres du portail.

Etape 3.2 :Dans Skins & Templates > Skin Manager > IPB Default Skin > Edit Root Skin Template HTML
Puis IPB Portal > csite_skeleton_template
Ajouter
CODE
<!--CS.TEMPLATE.AVATAR_CLOCK-->
Entre <!--Main Content--> et <!--End Main Content-->
Valider en cliquant sur Save Template Bit(s)

Etape 3.3 :Puis toujours dans IPB Portal cliquer sur Add Template Bit
QUOTE
New Template Bit Name : tmpl_avatar_clock
New Template Bit Incoming Data Variables : $width, $date, $avatar
Add New Template Bit :
CODE
<br />
<!-- Clock Part 1 - Put Anywhere Before Part 2 -->

<script language="JavaScript">
// Clock Script Generated By Maxx Blade's Clock v2.0
// http://www.maxxblade.co.uk/clock

function tS(){ x=new Date(); x.setTime(x.getTime()); return x; }
function lZ(x){ return (x>9)?x:'0'+x; }
function dT(){ if(fr==0){ fr=1; document.write('<font size=1 color="white" face=verdana><span id="tP">'+eval(oT)+'</span></font>'); } document.getElementById("tP").innerHTML=eval(oT); setTimeout('dT()',1000); }
var fr=0,oT="lZ(tS().getHours())+':'+lZ(tS().getMinutes())+':'+lZ(tS().getSeconds())+' '";

</script>

<!-- Clock Part 1 - Ends Here  -->
<div class="borderwrap">
<div class="maintitle"><{CAT_IMG}>&nbsp;{ipb.lang['avatar_clock_title']}</div>
<div class="tablepad">
  <center>
   <div style="background-color:#000;border:1px solid #fff; width:$width; font-color:#fff">
    <center>
     <div style="height:20px;padding-top:5px">
      <font size=1 face=verdana color="#ffffff">
       $date
      </font>
     </div>
     $avatar
     <div style="height:20px;padding-top:5px">

<!-- Clock Part 2 - This Starts/Displays Your Clock -->

<script language="JavaScript">
dT();
</script>

<!-- Clock Part 2 - Ends Here -->
     </div>
    </center>
   </div>
  </center>
</div>
</div>
Valider en cliquant sur Save Template Bit(s)

FIN
Alexandre7610
Quand j'essaie d'impoter le fichier ipb_settings_avatar_clock.xml on me dit qu'il y a une erreur :

mySQL query error: SELECT count(*) as count FROM ibf_conf_settings WHERE conf_group=

mySQL error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
mySQL error code:
Date: Monday 13th of June 2005 09:18:59 PM
Alexandre7610
C'est bon j'ai trouvé un moyen pour résoudre ce problème il suffit juste d'entrer les informations que contient ce fichier xml à partir de la SQL dans conf_settings
Merci pour cette mod wink.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.