I have hack function displaygreeting to have different message or it doesn't work
I have i my message some javascript
here is code of my function and my javascript files
Code
function smarty_function_displaygreeting($params, &$smarty)
{
extract($params);
unset($params);
// set some defaults
if (isset($class)) {
$class = ' class="'.$class.'"';
} else {
$class = '';
}
// Get the db connection
$dbconn =& pnDBGetConn(true);
$pntable =& pnDBGetTables();
// Turn on message display if not explicitly set or set true, or Display All is set
$displayMsgs = !isset($displayMsgs) || $displayMsgs || isset($displayAllMsgs) ? true : false;
$displayAllMsgs = isset($displayAllMsgs) && $displayAllMsgs ? true : false;
$multiline = isset($multiline) && $multiline ? true : false;
$unameclickable = isset($unameclickable) && $unameclickable ? true : false;
if (pnUserLoggedIn()) {
$username = pnUserGetVar('uname');
$loggedin = _HELLO." ".$username;
// connexion
$tt = time();
$mois = date("m",$tt);
$jour = date("d",$tt);
// Gather Users unread messages
$query = "SELECT fete
FROM $pntable[fetes]
WHERE mois=$mois And jour=$jour";
$result =& $dbconn->Execute($query);
if ($dbconn->ErrorNo() == 0) {
if (!$result->EOF) {
$result->Close();
$userfete = $result->PO_RecordCount();
$greting = print(" ".$row[0]."<br>");
}
}
$greeting = $loggedin."".$messages."\n";
return $greeting;
}
if (pnUserLoggedIn()) {
$greeting = '<span' . $class . '>';
if ($unameclickable) {
$profileModule = pnConfigGetVar('profilemodule', '');
if (!empty($profileModule) && pnModAvailable($profileModule)) {
$greeting .= '<span'.$class.'>'._THEME_WISH."</span>\n";
$greeting .= '<!--[modulejavascript script=periode.js ]-->';
$greeting .= '<span'.$class.'>'._THEME_TO."</span>\n";
$greeting .= '<span'.$class.'>'._THEME_WELCOMEUSER."</span>\n";
$greeting .= '<span'.$class.'>'._THEME_TODAY."</span>\n";
$greeting .='<!--[modulejavascript script=date.js onload="jourcourant()" ]-->';
$greeting .= '<span'.$class.'>'._THEME_TIME."</span>\n";
$greeting .='<!--[modulejavascript script=time.js onload="loadclock()"]-->';
$greeting .= '<span'.$class.'>'._THEME_HOLIDAYS."</span>\n";
$pntables = pnDBGetTables();
$onecolumns = $pntables['fetes_one_column'];
$columns = DBUtil::expandColumnsWithJoinInfo($onecolumns, $joinInfo);
$where = 'mois=$mois And jour=$jour]';
$result = DBUtil::selectExpandedObjectArray('table_one', $joinInfo, $where);
$greeting .= print(" ".$row[0]."<br>");
return $greeting;
$greeting .= pnML('_THEME_WISH', array('username' => '<a href="' . pnModURL($profileModule) . '">' . pnUserGetVar('uname') . '</a>'), true);
} else {
$greeting .= pnML('_THEME_WELCOMEUSER', array('username' => pnUserGetVar('uname')));
}
} else {
$greeting .= pnML('_THEME_WELCOMEUSER', array('username' => pnUserGetVar('uname')));
}
$msgmodule = pnConfigGetVar('messagemodule', '');
if (pnModAvailable($msgmodule) && ($displayMsgs || $displayAllMsgs)) {
$messages = pnModAPIFunc($msgmodule, 'user', 'getmessagecount');
$inboxurl = DataUtil::formatForDisplay(pnModURL($msgmodule, 'user', 'inbox'));
if ($multiline) {
$greeting .= "<br />\n";
} else {
$greeting .= ' ';
}
if ($displayAllMsgs) {
if ($messages['totalin'] > 0) {
$greeting .= pnML('_THEME_YOUHAVEXPRIVATEMESSAGES', array('x' => $messages['totalin'], 'u' => $messages['unread'], 'url' => $inboxurl), true);
} else {
$greeting .= pnML('_THEME_YOUHAVENOPRIVATEMESSAGES', array('url' => $inboxurl), true);
}
} else {
if ($messages['unread'] > 0) {
$greeting .= pnML('_THEME_YOUHAVEXNEWPRIVATEMESSAGES', array('x' => $messages['unread'], 'url' => $inboxurl), true);
} else {
$greeting .= pnML('_THEME_YOUHAVENONEWPRIVATEMESSAGES', array('url' => $inboxurl), true);
}
}
}
$greeting .="</span>\n";
} else { // If not logged in, show login link, ask them to register
$greeting .= '<span'.$class.'>'._THEME_WISH."</span>\n";
$greeting .= '<!--[modulejavascript script=periode.js ]-->';
$greeting .= '<span'.$class.'>'._THEME_TO."</span>\n";
$greeting .= '<span'.$class.'>'._THEME_WELCOMEGUEST."</span>\n";
$greeting .= '<span'.$class.'>'._THEME_TODAY."</span>\n";
$greeting .='<!--[modulejavascript script=date.js onload="jourcourant()" ]-->';
$greeting .= '<span'.$class.'>'._THEME_TIME."</span>\n";
$greeting .='<!--[modulejavascript script=time.js onload="loadclock()"]-->';
$greeting .= '<span'.$class.'>'._THEME_HOLIDAYS."</span>\n";
} // end login and private messages
return $greeting;
}
{
extract($params);
unset($params);
// set some defaults
if (isset($class)) {
$class = ' class="'.$class.'"';
} else {
$class = '';
}
// Get the db connection
$dbconn =& pnDBGetConn(true);
$pntable =& pnDBGetTables();
// Turn on message display if not explicitly set or set true, or Display All is set
$displayMsgs = !isset($displayMsgs) || $displayMsgs || isset($displayAllMsgs) ? true : false;
$displayAllMsgs = isset($displayAllMsgs) && $displayAllMsgs ? true : false;
$multiline = isset($multiline) && $multiline ? true : false;
$unameclickable = isset($unameclickable) && $unameclickable ? true : false;
if (pnUserLoggedIn()) {
$username = pnUserGetVar('uname');
$loggedin = _HELLO." ".$username;
// connexion
$tt = time();
$mois = date("m",$tt);
$jour = date("d",$tt);
// Gather Users unread messages
$query = "SELECT fete
FROM $pntable[fetes]
WHERE mois=$mois And jour=$jour";
$result =& $dbconn->Execute($query);
if ($dbconn->ErrorNo() == 0) {
if (!$result->EOF) {
$result->Close();
$userfete = $result->PO_RecordCount();
$greting = print(" ".$row[0]."<br>");
}
}
$greeting = $loggedin."".$messages."\n";
return $greeting;
}
if (pnUserLoggedIn()) {
$greeting = '<span' . $class . '>';
if ($unameclickable) {
$profileModule = pnConfigGetVar('profilemodule', '');
if (!empty($profileModule) && pnModAvailable($profileModule)) {
$greeting .= '<span'.$class.'>'._THEME_WISH."</span>\n";
$greeting .= '<!--[modulejavascript script=periode.js ]-->';
$greeting .= '<span'.$class.'>'._THEME_TO."</span>\n";
$greeting .= '<span'.$class.'>'._THEME_WELCOMEUSER."</span>\n";
$greeting .= '<span'.$class.'>'._THEME_TODAY."</span>\n";
$greeting .='<!--[modulejavascript script=date.js onload="jourcourant()" ]-->';
$greeting .= '<span'.$class.'>'._THEME_TIME."</span>\n";
$greeting .='<!--[modulejavascript script=time.js onload="loadclock()"]-->';
$greeting .= '<span'.$class.'>'._THEME_HOLIDAYS."</span>\n";
$pntables = pnDBGetTables();
$onecolumns = $pntables['fetes_one_column'];
$columns = DBUtil::expandColumnsWithJoinInfo($onecolumns, $joinInfo);
$where = 'mois=$mois And jour=$jour]';
$result = DBUtil::selectExpandedObjectArray('table_one', $joinInfo, $where);
$greeting .= print(" ".$row[0]."<br>");
return $greeting;
$greeting .= pnML('_THEME_WISH', array('username' => '<a href="' . pnModURL($profileModule) . '">' . pnUserGetVar('uname') . '</a>'), true);
} else {
$greeting .= pnML('_THEME_WELCOMEUSER', array('username' => pnUserGetVar('uname')));
}
} else {
$greeting .= pnML('_THEME_WELCOMEUSER', array('username' => pnUserGetVar('uname')));
}
$msgmodule = pnConfigGetVar('messagemodule', '');
if (pnModAvailable($msgmodule) && ($displayMsgs || $displayAllMsgs)) {
$messages = pnModAPIFunc($msgmodule, 'user', 'getmessagecount');
$inboxurl = DataUtil::formatForDisplay(pnModURL($msgmodule, 'user', 'inbox'));
if ($multiline) {
$greeting .= "<br />\n";
} else {
$greeting .= ' ';
}
if ($displayAllMsgs) {
if ($messages['totalin'] > 0) {
$greeting .= pnML('_THEME_YOUHAVEXPRIVATEMESSAGES', array('x' => $messages['totalin'], 'u' => $messages['unread'], 'url' => $inboxurl), true);
} else {
$greeting .= pnML('_THEME_YOUHAVENOPRIVATEMESSAGES', array('url' => $inboxurl), true);
}
} else {
if ($messages['unread'] > 0) {
$greeting .= pnML('_THEME_YOUHAVEXNEWPRIVATEMESSAGES', array('x' => $messages['unread'], 'url' => $inboxurl), true);
} else {
$greeting .= pnML('_THEME_YOUHAVENONEWPRIVATEMESSAGES', array('url' => $inboxurl), true);
}
}
}
$greeting .="</span>\n";
} else { // If not logged in, show login link, ask them to register
$greeting .= '<span'.$class.'>'._THEME_WISH."</span>\n";
$greeting .= '<!--[modulejavascript script=periode.js ]-->';
$greeting .= '<span'.$class.'>'._THEME_TO."</span>\n";
$greeting .= '<span'.$class.'>'._THEME_WELCOMEGUEST."</span>\n";
$greeting .= '<span'.$class.'>'._THEME_TODAY."</span>\n";
$greeting .='<!--[modulejavascript script=date.js onload="jourcourant()" ]-->';
$greeting .= '<span'.$class.'>'._THEME_TIME."</span>\n";
$greeting .='<!--[modulejavascript script=time.js onload="loadclock()"]-->';
$greeting .= '<span'.$class.'>'._THEME_HOLIDAYS."</span>\n";
} // end login and private messages
return $greeting;
}
date
Code
if (self != top) top.location.replace(self.location);
function show_props(obj,obj_name){
var result="";
for(var i in obj) result+= obj_name+"."+i+" = "+obj[i]+"\n";
return result;
}
function Semaine(){
this[0] = "dimanche";
this[1] = "lundi";
this[2] = "mardi";
this[3] = "mercredi";
this[4] = "jeudi";
this[5] = "vendredi";
this[6] = "samedi";
}
function Mois(){
this[0] = "Janvier";
this[1] = "Février";
this[2] = "Mars";
this[3] = "Avril";
this[4] = "Mai";
this[5] = "Juin";
this[6] = "Juillet";
this[7] = "Aout";
this[8] = "Septembre";
this[9] = "Octobre";
this[10] = "Novembre";
this[11] = "Décembre";
}
function jourcourant(){
var semaine = new Semaine();
var mois = new Mois();
var myDate = new date();
var nav = navigator.appName.charAt(0);
if (nav=="N") {
document.writeln(semaine[myDate.getDay()]+" "+myDate.getdate()+" "+mois[myDate.getMonth()]+" "+(1900+myDate.getYear()));
} else {
document.writeln(semaine[myDate.getDay()]+" "+myDate.getdate()+" "+mois[myDate.getMonth()]+" "+(myDate.getYear()));
}
}
function efface(form,name)
{
eval ( that = document.forms[0] [name]);
if ( name == 'email' && that.value == 'Votre e-mail' )
{
that.value = '';
}
else return false;
}
function show_props(obj,obj_name){
var result="";
for(var i in obj) result+= obj_name+"."+i+" = "+obj[i]+"\n";
return result;
}
function Semaine(){
this[0] = "dimanche";
this[1] = "lundi";
this[2] = "mardi";
this[3] = "mercredi";
this[4] = "jeudi";
this[5] = "vendredi";
this[6] = "samedi";
}
function Mois(){
this[0] = "Janvier";
this[1] = "Février";
this[2] = "Mars";
this[3] = "Avril";
this[4] = "Mai";
this[5] = "Juin";
this[6] = "Juillet";
this[7] = "Aout";
this[8] = "Septembre";
this[9] = "Octobre";
this[10] = "Novembre";
this[11] = "Décembre";
}
function jourcourant(){
var semaine = new Semaine();
var mois = new Mois();
var myDate = new date();
var nav = navigator.appName.charAt(0);
if (nav=="N") {
document.writeln(semaine[myDate.getDay()]+" "+myDate.getdate()+" "+mois[myDate.getMonth()]+" "+(1900+myDate.getYear()));
} else {
document.writeln(semaine[myDate.getDay()]+" "+myDate.getdate()+" "+mois[myDate.getMonth()]+" "+(myDate.getYear()));
}
}
function efface(form,name)
{
eval ( that = document.forms[0] [name]);
if ( name == 'email' && that.value == 'Votre e-mail' )
{
that.value = '';
}
else return false;
}
time
Code
// JavaScript Document
<!--
function show2(){
var Digital=new date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
if (hours<10)
hours="0"+hours
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var ctime="<b>"+hours+" H "+minutes+" M "+seconds+" S</b>"
if (!document.all)
document.write(ctime)
else
tick2.innerHTML=ctime
}
function loadclock(){
if (document.all)
setInterval("show2()",1000)
}
if (!document.all)
show2()
//-->
<!--
function show2(){
var Digital=new date()
var hours=Digital.getHours()
var minutes=Digital.getMinutes()
var seconds=Digital.getSeconds()
if (hours<10)
hours="0"+hours
if (minutes<=9)
minutes="0"+minutes
if (seconds<=9)
seconds="0"+seconds
var ctime="<b>"+hours+" H "+minutes+" M "+seconds+" S</b>"
if (!document.all)
document.write(ctime)
else
tick2.innerHTML=ctime
}
function loadclock(){
if (document.all)
setInterval("show2()",1000)
}
if (!document.all)
show2()
//-->
and periode
Code
// JavaScript Document
<!-- Begin
document.write("<b>")
day = new date()
hr = day.getHours()
if ((hr == 23) || (hr == 0) || (hr == 1) || (hr == 2) || (hr == 3) || (hr == 4))
document.write("Bonne nuit !, ")
if ((hr == 5) || (hr == 6))
document.write("Bonne matinée, le café est pret, ")
if ((hr == 7) || (hr == 8) || (hr == 9) || (hr == 10) || (hr == 11))
document.write("Bonne journée,")
if ((hr == 12) || (hr == 13) || (hr == 14) || (hr == 15) || (hr == 16))
document.write("Bon après-midi,")
if ((hr == 17) || (hr == 18) || (hr == 19) || (hr == 20) || (hr == 21) || (hr == 22))
document.write("Bonne soirée,")
document.write(" ")
// End -->
<!-- Begin
document.write("<b>")
day = new date()
hr = day.getHours()
if ((hr == 23) || (hr == 0) || (hr == 1) || (hr == 2) || (hr == 3) || (hr == 4))
document.write("Bonne nuit !, ")
if ((hr == 5) || (hr == 6))
document.write("Bonne matinée, le café est pret, ")
if ((hr == 7) || (hr == 8) || (hr == 9) || (hr == 10) || (hr == 11))
document.write("Bonne journée,")
if ((hr == 12) || (hr == 13) || (hr == 14) || (hr == 15) || (hr == 16))
document.write("Bon après-midi,")
if ((hr == 17) || (hr == 18) || (hr == 19) || (hr == 20) || (hr == 21) || (hr == 22))
document.write("Bonne soirée,")
document.write(" ")
// End -->
before my message works but when i try to put in zikula not
