phpBB Italia chiude!
phpBB Italia ringrazia tutti gli utenti che hanno dato fiducia al nostro progetto per ben 9 anni, e che, grazie al grande lavoro fatto da tutto lo Staff (rigorosamente a titolo gratuito), hanno portato il portale a diventare il principale punto di riferimento italiano alla piattaforma phpBB.

Purtroppo, causa motivi personali, non ho più modo di gestirlo e portarlo avanti. Il forum viene ora posto in uno stato di sola lettura, nonché un archivio storico per permettere a chiunque di fruire di tutte le discussioni trattate.

Il nuovo portale di assistenza per l'Italia di phpBB diventa phpBB-Store.it, cui ringrazio per aver deciso di portare avanti questo grande progetto.

Grazie ancora,
Carlo - Amministratore di phpBB Italia

disinstallare estensione manualmente

Supporto generale estensioni.
maurence
Utente
Utente
Messaggi: 146
Iscritto il: 04/09/2013, 9:17
Sesso: Maschio
Versione: 3.1.10
Server: UNIX/Linux
PHP: 5.4.45
Database: MySQL 5.5.52-cll-lve

disinstallare estensione manualmente

Messaggio da maurence » 17/05/2016, 12:18

Ho installato un estensione che non mi permette più di accedere al PCA, praticamente mi da errore 500.

Quindi ora per ripristinare il tutto dovrei manualmente cancellare e riportare alla norma gli "event" fatti dall'estensione.

Principalmente il problema è sorto dopo aver installato l'estensione upload:

https://www.phpbb.com/customise/db/extension/upload/

e tramite questa ho installato Dysplay Last post

https://www.phpbb.com/customise/db/exte ... ylastpost/

ora nelle due estensioni tovo la cartella event, che da quello che ho capito sono le modifiche che hanno apportato al codice (se mi sbaglio correggetemi)

Partendo da questo file listener.php dell'estensione, in linea teorica se faccio tutto manualmente al contrario dovrei toglierne le tracce.

Codice: Seleziona tutto

<?php
/**
 *
 * Display Last Post extension for the phpBB Forum Software package.
 *
 * @copyright (c) 2013 phpBB Limited <https://www.phpbb.com>
 * @license GNU General Public License, version 2 (GPL-2.0)
 *
 */

namespace Aurelienazerty\DisplayLastPost\event;

/**
 * Event listener
 */
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class listener implements EventSubscriberInterface
{
	
	/** @var \phpbb\db\driver\driver_interface */
	protected $db;

	/** @var \phpbb\config\config */
	protected $config;

	/** @var \phpbb\user $user */
	protected $user;
	
	/** @var int */
	private $last_post_id;

	/**
	 * Constructor
	 *
	 * @param \phpbb\db\driver\driver_interface    $db               DBAL object
	 * @param \phpbb\config\config	$config	Config object
	 * @param \phpbb\user	$user	user object
	 * @return \Aurelienazerty\DisplayLastPost\event\listener
	 * @access public
	 */
	public function __construct(\phpbb\db\driver\driver_interface $db, \phpbb\config\config $config, \phpbb\user $user)
	{
		$this->user = $user;
		$this->config = $config;
		$this->db = $db;
	}

	/**
	 * Assign functions defined in this class to event listeners in the core
	 *
	 * @return array
	 * @static
	 * @access public
	 */
	static public function getSubscribedEvents()
	{
		return array(
			'core.viewtopic_get_post_data'		=> 'modify_viewtopic_post_list',
			'core.viewtopic_modify_post_row'	=> array('modify_first_post_of_the_topic', -2710),
			'core.acp_board_config_edit_add'	=> 'acp_board_post_config',
		);
	}
	
	/**
	 * Modify the firt post of the topic 
	 * (only if it's not the first page)
	 *
	 * @param object $event The event object
	 *
	 * @return null
	 * @access public
	 */
	public function modify_first_post_of_the_topic($event)
	{
		$start = $event['start'];
		if ($this->config['display_last_post_show'] && $start > 0 && $event["post_row"]["POST_ID"] == $this->last_post_id)
		{
			$this->user->add_lang_ext('Aurelienazerty/DisplayLastPost', 'display_last_post');
			$post_row = $event['post_row'];
			$post_row['MESSAGE'] = '<p style="font-weight: bold; font-size: 1em;">' . $this->user->lang['DISPLAY_LAST_POST_TEXT'] . $this->user->lang['COLON'] . '</p>' . $post_row['MESSAGE'];
			$event['post_row'] = $post_row;
		}
	}

	/**
	 * Modify the list of post, to add the previous post of the lastest page
	 * (only if it's not the first page)
	 *
	 * @param object $event The event object
	 *
	 * @return null
	 * @access public
	 */
	public function modify_viewtopic_post_list($event)
	{
		$topic_data = $event['topic_data'];
		$start = $event['start'];
		$sql_ary = $event['sql_ary'];
		$post_list = $event['post_list'];
		if ($this->config['display_last_post_show'] && $start > 0)
		{
			$posts_per_page = $this->config['posts_per_page'];
			$new_post_list = array();
			foreach ($post_list as $key => $value)
			{
				$new_post_list[$key+1] = $value;
			}
			$sql_array = array(
				'SELECT'	=> 'p.post_id',
				'FROM'		=> array(
					POSTS_TABLE	=> 'p',
				),
				'WHERE' => 'p.topic_id = ' . (int) $topic_data['topic_id'],
				'ORDER_BY'  => 'p.post_time'
			);
			$sql = $this->db->sql_build_query('SELECT', $sql_array);
			$result = $this->db->sql_query_limit($sql, 1, $start - 1);
			//Array dereferencing only for php >= 5.4
			$fetchrow = $this->db->sql_fetchrow($result);
			$this->last_post_id = $fetchrow['post_id'];
			$new_post_list[0] = $this->last_post_id; 
			$this->db->sql_freeresult($result);
			$event['post_list'] = $new_post_list;
			$sql_ary['WHERE'] = $this->db->sql_in_set('p.post_id', $new_post_list) . ' AND u.user_id = p.poster_id';
			$event['sql_ary'] = $sql_ary;
		}
	}

	/**
	 * ACP fonction : Adding radio in the post config to switch on/off "Display Last Post" feature
	 *
	 * @param object $event The event object
	 *
	 * @return null
	 * @access public
	 */
	public function acp_board_post_config($event)
	{
		if ($event['mode'] == 'post')
		{
			$display_vars = $event['display_vars'];
			$add_config_var = array(
				'display_last_post_show'	=> array(
					'lang' => 'DISPLAY_LAST_POST_SHOW',
					'validate' => 'bool',
					'type' => 'radio: yes_no',
					'explain' => true,
				)
			);
			$display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $add_config_var, array('after' =>'posts_per_page'));
			$event['display_vars'] = array('title' => $display_vars['title'], 'vars' => $display_vars['vars']);
		}
	}
}
E poi fare la stessa cosa con gli event dell'estensione upload:

Codice: Seleziona tutto

<?php
/**
*
* @package Upload Extensions
* @copyright (c) 2014 - 2015 Igor Lavrov (https://github.com/LavIgor) and John Peskens (http://ForumHulp.com)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*
*/

namespace boardtools\upload\event;

/**
* @ignore
*/
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
* Event listener
*/
class listener implements EventSubscriberInterface
{
	protected $user;

	/**
	* Constructor
	*
	* @param \phpbb\user $user User object
	*/
	public function __construct(\phpbb\user $user)
	{
		$this->user = $user;
	}

	static public function getSubscribedEvents()
	{
		return array(
			'core.acp_board_config_edit_add'	=> 'add_config',
		);
	}

	public function add_config($event)
	{
		if ($event['mode'] == 'server')
		{
			$this->user->add_lang_ext('boardtools/upload', 'upload');
			$display_vars = $event['display_vars'];
			$new_vars = array(
				'upload_ext_dir'	=> array('lang' => 'ACP_UPLOAD_EXT_DIR',	'validate' => 'path',	'type' => 'text:20:255', 'explain' => true),
			);
			$display_vars['vars'] = phpbb_insert_config_array($display_vars['vars'], $new_vars, array('after' => 'ranks_path'));
			$event['display_vars'] = $display_vars;
		}
	}
}
Sono sulla giusta linea o sbaglio totalmente?

Avatar utente
frank
Utente
Utente
Messaggi: 1908
Iscritto il: 25/11/2014, 8:02
Sesso: Maschio
Versione: 3.1.7-PL1
Server: UNIX/Linux
PHP: 5.5.29
Database: MySQL(i) 5.5.43-log

Re: disinstallare estensione manualmente

Messaggio da frank » 17/05/2016, 17:11

Se prima di installare l'estensione avevi un backup, ripristinalo e andrà tutto a posto.

maurence
Utente
Utente
Messaggi: 146
Iscritto il: 04/09/2013, 9:17
Sesso: Maschio
Versione: 3.1.10
Server: UNIX/Linux
PHP: 5.4.45
Database: MySQL 5.5.52-cll-lve

Re: disinstallare estensione manualmente

Messaggio da maurence » 17/05/2016, 18:51

frank ha scritto:Se prima di installare l'estensione avevi un backup, ripristinalo e andrà tutto a posto.
Purtroppo è andato bene per qualche giorno (o forse non sono entrato nel PCA)e l'ultimo backup che ho ha già il danno.

Avatar utente
frank
Utente
Utente
Messaggi: 1908
Iscritto il: 25/11/2014, 8:02
Sesso: Maschio
Versione: 3.1.7-PL1
Server: UNIX/Linux
PHP: 5.5.29
Database: MySQL(i) 5.5.43-log

Re: disinstallare estensione manualmente

Messaggio da frank » 17/05/2016, 18:53

Se il backup è precedente, non può avere il danno.

maurence
Utente
Utente
Messaggi: 146
Iscritto il: 04/09/2013, 9:17
Sesso: Maschio
Versione: 3.1.10
Server: UNIX/Linux
PHP: 5.4.45
Database: MySQL 5.5.52-cll-lve

Re: disinstallare estensione manualmente

Messaggio da maurence » 17/05/2016, 19:26

frank ha scritto:Se il backup è precedente, non può avere il danno.
L'ultimo backup che ho non è precedente al fatto, altrimenti avrei risolto :mrgreen:

Avatar utente
frank
Utente
Utente
Messaggi: 1908
Iscritto il: 25/11/2014, 8:02
Sesso: Maschio
Versione: 3.1.7-PL1
Server: UNIX/Linux
PHP: 5.5.29
Database: MySQL(i) 5.5.43-log

Re: disinstallare estensione manualmente

Messaggio da frank » 17/05/2016, 19:30

Mi sembra strano che installando l'estensione non ti fa entrare nel PCA, non è che magari ha toccato qualcosa?

maurence
Utente
Utente
Messaggi: 146
Iscritto il: 04/09/2013, 9:17
Sesso: Maschio
Versione: 3.1.10
Server: UNIX/Linux
PHP: 5.4.45
Database: MySQL 5.5.52-cll-lve

Re: disinstallare estensione manualmente

Messaggio da maurence » 17/05/2016, 19:33

frank ha scritto:Mi sembra strano che installando l'estensione non ti fa entrare nel PCA, non è che magari ha toccato qualcosa?
No, ha funzionato per qualche giorno, poi nulla errore 500 e non mi entra più, da allora le ho provate tutte, ho risolto per breve periodo, facendo backup database cancellando tutto e importando il database, ma poi le cose funzionavano male perché mancavano i file delle estensioni che ho caricato manualmente una alla volta, e se non le caricavo mi usciva la schermata che mancava quel file di quella estensione rimettendole tutte il forum funziona ma non mi accede al PCA.

Avatar utente
frank
Utente
Utente
Messaggi: 1908
Iscritto il: 25/11/2014, 8:02
Sesso: Maschio
Versione: 3.1.7-PL1
Server: UNIX/Linux
PHP: 5.5.29
Database: MySQL(i) 5.5.43-log

Re: disinstallare estensione manualmente

Messaggio da frank » 17/05/2016, 19:36

Tu riesci ad entrare nel database?

maurence
Utente
Utente
Messaggi: 146
Iscritto il: 04/09/2013, 9:17
Sesso: Maschio
Versione: 3.1.10
Server: UNIX/Linux
PHP: 5.4.45
Database: MySQL 5.5.52-cll-lve

Re: disinstallare estensione manualmente

Messaggio da maurence » 17/05/2016, 19:37

frank ha scritto:Tu riesci ad entrare nel database?
Sì certo

Avatar utente
frank
Utente
Utente
Messaggi: 1908
Iscritto il: 25/11/2014, 8:02
Sesso: Maschio
Versione: 3.1.7-PL1
Server: UNIX/Linux
PHP: 5.5.29
Database: MySQL(i) 5.5.43-log

Re: disinstallare estensione manualmente

Messaggio da frank » 17/05/2016, 20:09

Bene, entra nel db e seleziona il nome del database.
Schermata 2016-05-17 alle 20.04.09.png
Ora clicca su Cerca e anche qui Seleziona tutto e seleziona il boleano appropriato. Nel campo superiore scrivi il nome dell'estensione + Esegui.
Schermata 2016-05-17 alle 20.06.33.png
Apparirà una schermata con le tabelle che contengono quel nome, eliminali tutti. Poi verifica se entri nel PCA.
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.

Rispondi

Torna a “Supporto”

Chi c’è in linea

Visitano il forum: Nessuno e 58 ospiti