Risultati da 1 a 5 di 5

Discussione: plugin in forumhome_start

  1. #1
    Account disattivato
    Data Registrazione
    Oct 2009
    Messaggi
    3

    Arrow plugin in forumhome_start

    Un saluto a tutta la board,

    sto usando vbulletin 3.8.4

    plugin in questione : iB "Pro" Arcade Game Compatibility
    compreso nel pacchetto v3arcade 1.1.1

    devo inserire questo plugin in modo che entri in funzione
    solo quando viene aperta la home di v3arcade, oppure
    solo quando viene chiamata v3arcade,
    perchè mi va in conflitto con un'altro analogo plugin che chiama
    le stesse funzioni ma con 'Location:! diverse
    quindi trovandosi tutti e due in forumhome_start secondo l'Ordine di esecuzione che do ai 2 plugin
    chiaramente o funziona 1 o l'altra location, che singolarmente
    girano alla perfezione.
    chiaramente poi stessa cosa dovro' fare per l'altro prodotto.

    il codice del plugin è questo:
    Codice:
    if ($_REQUEST['do'] == 'newscore' && $_REQUEST['act'] == 'Arcade')
    {
         require_once(DIR . '/includes/functions_arcade.php');
         // Clean values
         $vbulletin->input->clean_array_gpc('p',
              array(
                   'gscore' => TYPE_UINT,
                   'gname' => TYPE_STR
              )
         );
     
         if (!$game = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "arcade_games AS arcade_games WHERE shortname='" . addslashes($vbulletin->GPC['gname']) . "'"))
         {
              exit;
         }
     
         // Create a session record.
         $db->query_write("INSERT INTO " . TABLE_PREFIX . "arcade_sessions (gameid,gamename,userid,start,sessiontype,challengeid,score,finish) VALUES ('" . $game['gameid'] . "', '" . addslashes($vbulletin->GPC['gname']) . "','" . $vbulletin->userinfo['userid'] . "', '" . TIMENOW . "', 1, 0, '" . $vbulletin->GPC['gscore'] . "', '" . TIMENOW . "')");
     
         // Fetch the ID number of the session we just inserted.
         $lastid = $db->insert_id();
     
         header('Location: arcade.php?sessdo=burn&id=' . $lastid . '&microone=' . getmicrotime());
         exit;
    }
    
    if ($_REQUEST['do'] == 'verifyscore' && $_REQUEST['autocom'] == 'arcade')
    {     
         // Get two random numbers to do our score verification
         $randomvar1 = rand(1, 25);
         $randomvar2 = rand(1, 25);
    
         // Bake a Cookie
         vbsetcookie('v3arcade_v32_cookie', $randomvar1 . ',' . $randomvar2, permanent); 
    
         // Return the values
         echo '&randchar=' . $randomvar1 . '&randchar2=' . $randomvar2 . '&savescore=1&blah=OK';
         
         exit();
    }
    
    if ($_REQUEST['do'] == 'savescore' && $_REQUEST['autocom'] == 'arcade')
    {
         require_once(DIR . '/includes/functions_arcade.php');
    
         $vbulletin->input->clean_array_gpc('p',
              array(
                   'gscore' => TYPE_UINT,
                   'arcadegid' => TYPE_NUM,
                   'enscore' => TYPE_NUM,
                   'gname' => TYPE_STR
              )
         );
    
         // Get a cookie from the jar
         $randomvars = explode(',',$_COOKIE[COOKIE_PREFIX . 'v3arcade_v32_cookie']);
    
         // If the checksum values do not match, display an error to the user.
         if( $vbulletin->GPC['enscore'] != ($vbulletin->GPC['gscore'] * $randomvars[0] ^ $randomvars[1]) )
         {
              print_no_permission(); 
         }
    
         // Check to see game name is one file
         if(!$game = $db->query_first("SELECT * FROM " . TABLE_PREFIX . "arcade_games AS arcade_games WHERE shortname='" . addslashes($vbulletin->GPC['gname']) . "'"))
         {
              exit;
         }
     // Create a session record.
         $db->query_write("INSERT INTO " . TABLE_PREFIX . "arcade_sessions (gameid,gamename,userid,start,sessiontype,challengeid,score,finish) VALUES ('" . $game['gameid'] . "', '" . addslashes($vbulletin->GPC['gname']) . "','" . $vbulletin->userinfo['userid'] . "', '" . TIMENOW . "', 1, 0, '" . $vbulletin->GPC['gscore'] . "', '" . TIMENOW . "')");
     
         // Fetch the ID number of the session we just inserted.
         $lastid = $db->insert_id();
     
    
         header('Location: arcade.php?sessdo=burn&id=' . $lastid . '&microone=' . getmicrotime());
          // Clear the cookie values
        vbsetcookie('v3arcade_v32_cookie', '');  
    
         exit;
    }
    spero di essermi spiegato


    Ringrazio anticipatamente
    Saluti
    Dott.New

    .

  2. #2
    Borg L'avatar di y2ksw
    Data Registrazione
    Nov 2004
    Località
    Bologna, Italia
    Età
    64
    Messaggi
    9,035
    Dovrai sostituire un po' di tutto per far funzionare due plugin con lo stesso nome interno sullo stesso forum. Con nomi identici non potranno mai funzionare, anche se cambi ordine di esecuzione.
    Giovanni
    http://www.trimelli.com/

    Per favore non mandatemi PM, ma scrivete sul forum. Vi sarà risposto prima.

  3. #3
    Account disattivato
    Data Registrazione
    Oct 2009
    Messaggi
    3
    si certo, ma io vorrei farlo attivare soltanto quando si apre l'arcade
    invece cosi è sempre attivo.
    Ho provato a spostarlo dalla forumhome_start ma ma non funziona,
    quindi mi chiedevo appunto se era possibile farlo attivare soltanto
    quando arriva la richiesta da arcade.php

  4. #4
    Borg L'avatar di y2ksw
    Data Registrazione
    Nov 2004
    Località
    Bologna, Italia
    Età
    64
    Messaggi
    9,035
    Solo se arcade.php abbia un suo hook, altrimenti la vedo molto difficile.
    Giovanni
    http://www.trimelli.com/

    Per favore non mandatemi PM, ma scrivete sul forum. Vi sarà risposto prima.

  5. #5
    Account disattivato
    Data Registrazione
    Oct 2009
    Messaggi
    3
    ok molte grazie per il grande aiuto ricevuto, 2 parole e si liquida il problema.


Discussioni Simili

  1. vBulletin 3.7.x plugin
    Di )AleX( nel forum VBulletin 3
    Risposte: 2
    Ultimo Messaggio: 03-10-2008, 16:56
  2. vBulletin 3.7.x [PlugIn] y2ksw
    Di wb08 nel forum VBulletin 3
    Risposte: 3
    Ultimo Messaggio: 09-09-2008, 23:12
  3. vBulletin 3.7.x ricerca plugin
    Di )AleX( nel forum VBulletin 3
    Risposte: 6
    Ultimo Messaggio: 05-05-2008, 21:07
  4. vBulletin 3.6.x Nuovo Plugin
    Di Kappaloris nel forum VBulletin 3
    Risposte: 1
    Ultimo Messaggio: 06-09-2007, 13:07
  5. vBulletin 3.6.x plugin youtube
    Di djmarvin nel forum VBulletin 3
    Risposte: 14
    Ultimo Messaggio: 27-11-2006, 10:50

Tag per Questa Discussione

Segnalibri

Permessi di Scrittura

  • Tu non puoi inviare nuove discussioni
  • Tu non puoi inviare risposte
  • Tu non puoi inviare allegati
  • Tu non puoi modificare i tuoi messaggi
  •