Visualizzazione risultati 1 fino 13 di 13

Discussione: Qualcuno sa modificare questo smplice block?

  1. #1
    Guest

    Question Qualcuno sa modificare questo semplice block?

    Ho une block tipo chat in php,però quado lo meto sul potale viene aperto come popup

    Codice HTML:
    <?php
    /************************************************************************/
    /* Instant Messaging System                                             */
    /* ========================                                             */
    /************************************************************************/
    if (!defined('CPG_NUKE')) { exit; }
    
    $content = '';
    
    if (!is_active('IM')) {
        $content = 'ERROR';
        return trigger_error('IM module is inactive', E_USER_WARNING);
    }
    
    //$active = 0; #  1 = Turn On and 0 = Turn Off the Instant Messaging
    
    global $db, $prefix, $user_prefix, $userinfo;
    
    get_lang('IM');
    
    $username = $userinfo['username'];
    
    $result = $db->sql_query("select user_id from ".$user_prefix."_users where username='$username'");
    list($user_id) = $db->sql_fetchrow($result);
    
    $result2 = $db->sql_query("select user_im_enable from ".$user_prefix."_users where user_id='$user_id'");
    list($user_im_enable) = $db->sql_fetchrow($result2);
    
    $active = $user_im_enable;
    
    if (!$active) {
            if (is_user()) {
            $content .= "<hr><center><b>"._IMTITLE."</b>";
            $content .= "<br>"._YOURIMDISABLED."</center>";
            $content .= "<center><font class=\"tiny\"><a href=\"".getlink("IM&amp;action=enable&amp;user_id=$user_id")."\">"._ENABLEYOURIM."</a></font></center>";
    	}
    } else {
    	[B]# Java Scripts for IM #
    	#######################
        	if (is_user()) {
    	    	$content .= "<script type=\"text/javascript\">\n";
    	    	$content .= "<!--\n\n";
    
    $content .= "window.open('index.php?name=IM&action=Check+IM', 'legend', 'menubar=yes,location=no,resizable=yes,scrollbars=yes,status=no,width=200,height=340')\n";
    
        	$content .= "//-->\n";
    	$content .= "</script>\n";[/B]
            $content .= "<hr><center><b>"._IMTITLE."</b>";
            $content .= "<br>"._YOURIMACTIVE."</center>";
            $content .= "<center><font class=\"tiny\"><a href=\"".getlink("IM&amp;action=disable&amp;user_id=$user_id")."\">"._DISABLEYOURIM."</a></font></center>";
    	}
    }
    
    $db->sql_freeresult($result);
    $db->sql_freeresult($result2);

    qualcuno sa modificarlo che venga apperto come semplice block e non come un popup

    Roni
    Ultima modifica di roni : 28-12-2005 alle ore 02.39.56

  2. #2
    Guest

    Predefinito

    potreesti provare a creare un iframe che punti a
    index.php?name=IM&action=Check+IM
    ma nn sn sicuro che funzioni.....

  3. #3
    L'avatar di funcool
    funcool non è connesso Utente storico
    Data registrazione
    05-02-2004
    Residenza
    Qui... Non lì, qui!
    Messaggi
    15,433

    Predefinito

    Prova a sostituire il codice come te l'ho scritto qui sotto:
    Codice PHP:
    <?php
    /************************************************** **********************/
    /* Instant Messaging System */
    /* ======================== */
    /************************************************** **********************/
    if (!defined('CPG_NUKE')) { exit; }

    $content = '';

    if (!
    is_active('IM')) {
    $content = 'ERROR';
    return
    trigger_error('IM module is inactive', E_USER_WARNING);
    }

    //$active = 0; # 1 = Turn On and 0 = Turn Off the Instant Messaging

    global $db, $prefix, $user_prefix, $userinfo;

    get_lang('IM');

    $username = $userinfo['username'];

    $result = $db->sql_query("select user_id from ".$user_prefix."_users where username='$username'");
    list(
    $user_id) = $db->sql_fetchrow($result);

    $result2 = $db->sql_query("select user_im_enable from ".$user_prefix."_users where user_id='$user_id'");
    list(
    $user_im_enable) = $db->sql_fetchrow($result2);

    $active = $user_im_enable;

    if (!
    $active) {
    if (
    is_user()) {
    $content .= "<hr><center><b>"._IMTITLE."</b>";
    $content .= "<br>"._YOURIMDISABLED."</center>";
    $content .= "<center><font class=\"tiny\"><a href=\"".getlink("IM&amp;action=enable&amp;user_id=$user_id")."\">"._ENABLEYOURIM."</a></font></center>";
    }
    } else {
    [
    B]# Java Scripts for IM #
    #######################
    if (is_user()) {
    $content .= "<iframe src=\"index.php?name=IM&action=Check+IM\" name=\"legend\" id=\"legend\" width=200 height=340>";[/B]
    $content .= "<hr><center><b>"._IMTITLE."</b>";
    $content .= "<br>"._YOURIMACTIVE."</center>";
    $content .= "<center><font class=\"tiny\"><a href=\"".getlink("IM&amp;action=disable&amp;user_id=$user_id")."\">"._DISABLEYOURIM."</a></font></center>";
    }
    }

    $db->sql_freeresult($result);
    $db->sql_freeresult($result2);
    Mattia vi manda a FunCool - Matriz - Directory Gogol - Sfondo rosso per la Birmania
    «Tu mi dai fastidio perché ti credi tanto un Dio!» «Bè, dovrò pur prendere un modello a cui ispirarmi, no?» Woody Allen

  4. #4
    Guest

    Predefinito

    ci siamo cuasi..
    Ultima modifica di roni : 28-12-2005 alle ore 14.21.44

  5. #5
    Guest

    Predefinito

    Funzia o no?

    Comunque si scrive "quasi"...

  6. #6
    Ospite Guest

    Predefinito

    ci siamo quasi..
    ??? Inserisci uno screenshot...

  7. #7
    Guest

    Predefinito

    non so come si fano screenshot :(

    Con qualche modifica funziona perfetamente,i mesaggi si mandano con un popup, e si ricevono come un popup in tempo reale(cioè senza fare aggiornamenti ).Se il messaggio ti interesa lo puoi salvare in InBoxse se no lo cancelli...tipo messenger.Sul mio sito la vecchia vesione ha avuto un grande sucesso..

    però i utenti vengono fati logout fra un x tempo(circa 2-3 min)

    $expire = time()-900;

    $db->sql_query("DELETE FROM $prefix"._im." WHERE time < $expire");
    $sql = $db->sql_query("SELECT * FROM $prefix"._im." WHERE username_to = '$userinfo[username]'");

    if ($row = $db->sql_numrows($sql)) {
    while ($im = $db->sql_fetchrow($sql)) {
    echo "<SCRIPT type=\"text/javascript\">\n";
    echo "<!--\n";
    echo "var telwin = null;\n";
    echo "telwin = open('index.php?name=IM&action=read&IMID=$im[IMID]','$im[time]','menubar=yes,location=no,resizeable=yes,scrollba rs=yes,status=no,width=360,height=375');\n";
    echo "//-->\n";
    echo "</SCRIPT>\n\n";
    }
    Ultima modifica di roni : 28-12-2005 alle ore 15.49.43

  8. #8
    Ospite Guest

    Predefinito

    Ora hai messo il codice, comunque gli screenshot si fanno con il tasto Stamp della tastiera. Quando hai premuto Stamp incolli su Pant e salvi... ecco fatto!

  9. #9
    Guest

    Predefinito


  10. #10
    L'avatar di pietrovischia
    pietrovischia non è connesso Utente attivo
    Data registrazione
    16-10-2005
    Residenza
    Padova
    Messaggi
    351

    Predefinito

    Hem... non è per rompere, ma perché se lo fanno tutti allora lo faccio pure io invece di farmi il mazzo a far il sito bilingue... Se metti dei contenuti in lingua diversa dall'italiano (come tutto il tuo sito) devi mettere anche una traduzione esatta in italiano (non mi sembra che ci sia), da regolamento di AV...

    Per il problema del logout degli utenti, prova a cambiare i parametri di

    Codice PHP:
    $expire = time()-900;

  11. #11
    Guest

    Predefinito

    esato,ho pagato multe in Ac. Allora meglio pagare che sofrire o fare il mazzo :)

    $expire = time()-900;

    Che devo mettere?

  12. #12
    Guest

    Predefinito

    aumenta il 900, no? (è il tempo in secondi).

  13. #13
    Guest

    Predefinito

    Una curiosità:
    Ma perche ma messo -900 ? invece di mettere +900

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •