Whos_online nel footer

Questo forum è dedicato alle discussioni riguardanti le contribution per osCommerce

Moderatore: mod Generali

Rispondi
sakkiotto
membro Regular
membro Regular
Messaggi: 228
Iscritto il: 21/02/2005, 1:00
Località: Italia

Whos_online nel footer

Messaggio da sakkiotto »

Vorrei inserire il numero dei clienti online nel footer invice che in un box.

Avevo pensato ad aggiungere nel footer:

Codice: Seleziona tutto

require(DIR_WS_FUNCTIONS . 'whos_online.php');

<td align="right" class="footer">  <?php echo $whos_online  ?>  </td>[
ma non funge, dove sbaglio?

Grazie
boom
Avatar utente
itan80
membro Senior
membro Senior
Messaggi: 309
Iscritto il: 09/07/2004, 0:00
Località: Italia
Contatta:

Messaggio da itan80 »

prova con questo codice:
<?php

// Set expiration time, default is 900 secs (15 mins)
$xx_mins_ago = (time() - 900);

tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where time_last_click < '" . $xx_mins_ago . "'");

$whos_online_query = tep_db_query("select customer_id from " . TABLE_WHOS_ONLINE);
while ($whos_online = tep_db_fetch_array($whos_online_query)) {
if (!$whos_online['customer_id'] == 0) $n_members++;
if ($whos_online['customer_id'] == 0) $n_guests++;

$user_total = sprintf(tep_db_num_rows($whos_online_query)); }

if ($user_total == 1) {
$there_is_are = BOX_WHOS_ONLINE_THEREIS . ' ';
} else {
$there_is_are = BOX_WHOS_ONLINE_THEREARE . ' ';
}

if ($n_guests == 1) {
$word_guest = ' ' . BOX_WHOS_ONLINE_GUEST;
}else{
$word_guest = ' ' . BOX_WHOS_ONLINE_GUESTS;
}

if ($n_members == 1) {
$word_member = ' ' . BOX_WHOS_ONLINE_MEMBER;
}else{
$word_member = ' ' . BOX_WHOS_ONLINE_MEMBERS;
}


if (($n_guests >= 1) && ($n_members >= 1)) $word_and = ' ' . BOX_WHOS_ONLINE_AND . ' <br>';

$textstring = $there_is_are;
if ($n_guests >= 1) $textstring .= $n_guests . $word_guest;

$textstring .= $word_and;
if ($n_members >= 1) $textstring .= $n_members . $word_member;

$textstring .= ' online.' . ' <br>';

// if (tep_session_is_registered('customer_id')) {

// $textstring .= '<a href="online_list.php">' . BOX_VIEW_ONLINE_MEMBERS . '</a>';
// }

$info_box_contents2 = array();


$info_box_contents2 = array();
$info_box_contents2[] = array('align' => 'left',
'text' => $textstring
);
new infoBox($info_box_contents2);
?>

ciao
™ ÅñЮ€Å ™

www.mistertemplate.it - Template x osCommerce...
www.microdirect.it - Distribuzione Informatica
sakkiotto
membro Regular
membro Regular
Messaggi: 228
Iscritto il: 21/02/2005, 1:00
Località: Italia

Messaggio da sakkiotto »

Beh, quel codice crea un nuovo box, io invece vorrei inserirlo in quello già presente dove ho il numero totale di visite.

Codice: Seleziona tutto

?>
<div align="center">
  <table border="0" width="800" cellspacing="0" cellpadding="1">
    <tr class="footer">
      <td class="footer">  <?php echo strftime(DATE_FORMAT_LONG); ?>  </td>
      <td align="right" class="footer">  <?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted; ?>  </td>
    </tr>
  </table>
  <br>
  <table border="0" width="800" cellspacing="0" cellpadding="0">
    <tr>
      <td align="center" class="smallText">
  <?php
boom
Bass
membro Master
membro Master
Messaggi: 3593
Iscritto il: 18/04/2004, 0:00
Località: Varese
Contatta:

Messaggio da Bass »

sakkiotto ha scritto:Beh, quel codice crea un nuovo box, io invece vorrei inserirlo in quello già presente dove ho il numero totale di visite.
Elimina la parte finale, quella che chiama la classe infobox


Codice: Seleziona tutto

 $info_box_contents2 = array();


$info_box_contents2 = array();
$info_box_contents2[] = array('align' => 'left',
'text' => $textstring
);
new infoBox($info_box_contents2); 
E prova utilizzando la variabile $textstring

'iao

Sergio
http://www.oscomtemplate.com - E' disponibile il nuovo pacchetto free con forum di supporto

http://www.semilandia.it
sakkiotto
membro Regular
membro Regular
Messaggi: 228
Iscritto il: 21/02/2005, 1:00
Località: Italia

Messaggio da sakkiotto »

Grazie :lol:

Se può servire...

Codice: Seleziona tutto

<td align="right" class="footer"><?php echo $counter_now . ' ' . FOOTER_TEXT_REQUESTS_SINCE . ' ' . $counter_startdate_formatted ; ?>&nbsp&nbsp- <?php echo $textstring ; ?></td>
boom
Avatar utente
plume
membro Regular
membro Regular
Messaggi: 165
Iscritto il: 14/07/2005, 18:01
Località: Italia
Contatta:

Messaggio da plume »

carino.. lo uso pure io

Ciao
Plume
Il primo store online specializzato in parti di ricambio: www.autosterzi.com

Se avete qualsiasi tipo di problema con la vostra auto questo è il punto giusto dove chiedere: www.autosterzi.com/forum
Rispondi