Stefano Costantini 1 Posted July 31, 2020 Share Posted July 31, 2020 Ciao a tutti, avrei la necessità di modificare il template per aggiungere un bottone che faccia un POST con alcuni parametri presi dalla sessione: - id utente - id del gruppo di appartenenza Dite che è fattibile? Se sì mi date qualche dritta? Link to post Share on other sites
0 Admin Askancy 341 Posted August 1, 2020 Admin Share Posted August 1, 2020 Ciao Stefano, tutto è fattibile e credo proprio che questo plugin possa aiutarti nel creare un blocco con php: TXT & PHP Widget - Blocks and Widgets - Invision Community INVISIONCOMMUNITY.COM This mod will let you add Text, HTML and PHP widget IPS4s blocks. also you can disable PHP widget from Admin CP How To Install You just need install the plugin Admin CP System Site Features Plugins Install Questi dati dove andranno? via email a te, database o dove? Magari @BomAle può aiutarti maggiormente in queste cose Link to post Share on other sites
0 Stefano Costantini 1 Posted August 1, 2020 Author Share Posted August 1, 2020 Ottimo. Questi dati andranno postati su una pagina web. Ora che ho il plugin c'è un elenco delle variabili php definite in invision? Link to post Share on other sites
0 Admin Askancy 341 Posted August 1, 2020 Admin Share Posted August 1, 2020 8 minuti fa, Stefano Costantini ha scritto: Ora che ho il plugin c'è un elenco delle variabili php definite in invision? Ovviamente, ricordati di includere il file init.php però. Qui trovi una lista grezza: Working with members - Development - Invision Community INVISIONCOMMUNITY.COM If you are developing for 4.0 you will almost certainly need to interact with member accounts at some point. Thankfully, doing so is easy in 4.0. The primary member class in 4.0 is \IPS\Member. /* Get the... Per questo esempio: Cita - id utente Credo che la seguente stringa sia più che sufficiente: \IPS\Member::loggedIn()->member_id Link to post Share on other sites
0 Stefano Costantini 1 Posted August 1, 2020 Author Share Posted August 1, 2020 Quindi, se ho capito bene, una cosa di questo tipo? <?php include 'home/forum/init.php'; $prova = \IPS\Member::loggedIn(); echo "benvenuto ".$prova; ?> Non va: Cannot declare class IPS\IPS, because the name is already in use in home/forum/init.php on line 16 Link to post Share on other sites
0 Admin Askancy 341 Posted August 1, 2020 Admin Share Posted August 1, 2020 <?php include 'home/forum/init.php'; \IPS\Session\Front::i(); $prova = \IPS\Member::loggedIn()->name; echo "benvenuto ".$prova; ?> Link to post Share on other sites
0 Stefano Costantini 1 Posted August 1, 2020 Author Share Posted August 1, 2020 Stesso errore Fatal error: Cannot declare class IPS\IPS, because the name is already in use in ... Link to post Share on other sites
0 Admin Askancy 341 Posted August 1, 2020 Admin Share Posted August 1, 2020 22 minuti fa, Stefano Costantini ha scritto: Stesso errore Fatal error: Cannot declare class IPS\IPS, because the name is already in use in ... Strano, nel mio progetto uso così e funziona, prova con require_once('home/forum/init.php'); 1 Link to post Share on other sites
0 Stefano Costantini 1 Posted August 1, 2020 Author Share Posted August 1, 2020 (edited) Grande! Così funziona! Edited August 1, 2020 by Stefano Costantini Link to post Share on other sites
Question
Ciao a tutti, avrei la necessità di modificare il template per aggiungere un bottone che faccia un POST con alcuni parametri presi dalla sessione:
- id utente
- id del gruppo di appartenenza
Dite che è fattibile? Se sì mi date qualche dritta?
Link to post
Share on other sites
8 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now