Vai al contenuto
  • 0

profilo song


trattore

Domanda

mi chiedevo se si può modificare questo plugin, vorrei mettere i link di youtube al posto di caricare file mp3 ecc, è possibile?

<?xml version="1.0" encoding="UTF-8"?>
<plugin name="Profile Songs" version_long="10000" version_human="1.0.0" author="Luca" website="http://devunit.org" update_check=""><hooks><hook type="S" class="\IPS\Theme\class_core_front_profile"><![CDATA[//<?php

class hook23 extends _HOOK_CLASS_
{

/* !Hook Data - DO NOT REMOVE */
public static function hookData() {
 return array_merge_recursive( array (
  'profileHeader' => 
  array (
    0 =>
    array (
      'selector' => '#elEditProfile',
      'type' => 'add_inside_end',
      'content' => '{template="ps_menu" group="plugins" location="global" app="core" params="$member" }',
    ),
  ),
  'profile' => 
  array (
    0 => 
    array (
      'selector' => '#elProfileInfoColumn > div.ipsAreaBackground_light.ipsPad',
      'type' => 'add_inside_end',
      'content' => '{template="ps_display" group="plugins" location="global" app="core" params="$member"}',
    ),
  ),
), parent::hookData() );
}
/* End Hook Data */










}]]></hook><hook type="C" class="\IPS\Member"><![CDATA[//<?php

class hook24 extends _HOOK_CLASS_
{

    /**
	 * Profile Song
	 *
	 * @return \IPS\Helpers\CoverPhoto
	 */
	public function profileSong()
	{
		try
		{
			$song = new \IPS\Helpers\CoverPhoto();
	
	    if ($this->kuzi_song_path)
			{
				$song->file = \IPS\File::get('core_Profile', $this->kuzi_song_path);
			}
	
			$song->editable = ( \IPS\Member::loggedIn()->modPermission('can_modify_profiles') or ( \IPS\Member::loggedIn()->member_id == $this->member_id and $this->group['g_edit_profile'] ) );
			$song->maxSize		= $this->group['g_max_bgimg_upload'];
			$song->object		= $this;
	
			return $song;
		}
		catch ( \RuntimeException $e )
		{
			if ( method_exists( get_parent_class(), __FUNCTION__ ) )
			{
				return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() );
			}
			else
			{
				throw $e;
			}
		}
	}
}]]></hook><hook type="C" class="\IPS\Helpers\CoverPhoto\Controller"><![CDATA[//<?php

abstract class hook25 extends _HOOK_CLASS_
{
  /**
	 * Upload Profile Song
	 *
	 * @return	void
	 */
	protected function profileSongUpload()
	{
		try
		{
			$song = $this->_profileSongGet();
			if (!$song->editable)
			{
				\IPS\Output::i()->error( 'no_module_permission', '2S216/1', 403, '' );
			}
	
			$form = new \IPS\Helpers\Form('profileSong');
			$form->class = 'ipsForm_vertical ipsForm_noLabels';
			$form->add( new \IPS\Helpers\Form\Upload('profile_song', NULL, TRUE, array( 'image' => NULL, 'minimize' => FALSE, 'maxFileSize' => ($song->maxSize and $song->maxSize != -1) ? $song->maxSize / 1024 : NULL, 'storageExtension' => $this->_coverPhotoStorageExtension(),
	      'allowedFileTypes' => array('mp3', 'ogg', 'wav')
	    ) ) );
			if ($values = $form->values())
			{
				try
				{
					$song->delete();
				}
				catch ( \Exception $e ) { }
	
				$this->_profileSongSet( new \IPS\Helpers\CoverPhoto($values['profile_song'], 0 ));
				\IPS\Output::i()->redirect($_SERVER['HTTP_REFERER']);
			}
	
			\IPS\Output::i()->output = $form->customTemplate( array( call_user_func_array( array( \IPS\Theme::i(), 'getTemplate' ), array( 'forms', 'core' ) ), 'popupTemplate' ) );
		}
		catch ( \RuntimeException $e )
		{
			if ( method_exists( get_parent_class(), __FUNCTION__ ) )
			{
				return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() );
			}
			else
			{
				throw $e;
			}
		}
	}

	/**
	 * Remove Profile Song
	 *
	 * @return	void
	 */
	protected function profileSongRemove()
	{
		try
		{
			\IPS\Session::i()->csrfCheck();
			$song = $this->_profileSongGet();
			if (!$song->editable)
			{
				\IPS\Output::i()->error( 'no_module_permission', '2S216/2', 403, '' );
			}
	
			try
			{
				$song->delete();
			}
			catch ( \Exception $e ) { }
	
			$this->_profileSongSet( new \IPS\Helpers\CoverPhoto( NULL, 0 ) );
			if ( \IPS\Request::i()->isAjax() )
			{
				\IPS\Output::i()->json( 'OK' );
			}
			else
			{
				\IPS\Output::i()->redirect( $_SERVER['HTTP_REFERER'] );
			}
		}
		catch ( \RuntimeException $e )
		{
			if ( method_exists( get_parent_class(), __FUNCTION__ ) )
			{
				return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() );
			}
			else
			{
				throw $e;
			}
		}
	}

	protected function _profileSongSet( \IPS\Helpers\CoverPhoto $song ) {
		try
		{
			$this->member->kuzi_song_path = (string) $song->file;
			$this->member->save();
		}
		catch ( \RuntimeException $e )
		{
			if ( method_exists( get_parent_class(), __FUNCTION__ ) )
			{
				return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() );
			}
			else
			{
				throw $e;
			}
		}
	}

	protected function _profileSongGet() {
		try
		{
			return $this->member->profileSong();
		}
		catch ( \RuntimeException $e )
		{
			if ( method_exists( get_parent_class(), __FUNCTION__ ) )
			{
				return call_user_func_array( 'parent::' . __FUNCTION__, func_get_args() );
			}
			else
			{
				throw $e;
			}
		}
	}
}
]]></hook></hooks><htmlFiles><html filename="ps_display.phtml">PGlwczp0ZW1wbGF0ZSBwYXJhbWV0ZXJzPSIkbWVtYmVyIiAvPgp7eyRwcm9maWxlU29uZyA9ICRtZW1iZXItPnByb2ZpbGVTb25nKCk7fX0Ke3tpZiAkcHJvZmlsZVNvbmctPmZpbGV9fQogIDxkaXYgY2xhc3M9J2NQcm9maWxlU2lkZWJhckJsb2NrIGlwc1BhZCBpcHNCb3ggaXBzU3BhY2VyX2JvdHRvbSc+CiAgICA8aDIgY2xhc3M9J2lwc1R5cGVfc2VjdGlvbkhlYWQgaXBzVHlwZV9yZXNldCc+UHJvZmlsZSBTb25nPC9oMj4KCiAgICA8ZGl2IGNsYXNzPSdpcHNUeXBlX2NlbnRlcic+CiAgICAgIDxwPgogICAgICAgIDxhdWRpbyBhdXRvcGxheT0iIiBjb250cm9scz0iIiBsb29wPSIiIHByZWxvYWQ9IiIgY2xhc3M9InBzX2F1ZGlvIj4KICAgICAgICAgIDxzb3VyY2Ugc3JjPSJ7JHByb2ZpbGVTb25nLT5maWxlLT51cmx9Ij48L3NvdXJjZT4KICAgICAgICA8L2F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XJsKCktPnNldFF1ZXJ5U3RyaW5nKCAnZG8nLCAncHJvZmlsZVNvbmdVcGxvYWQnICl9JyBkYXRhLWlwc0RpYWxvZyBkYXRhLWlwc0RpYWxvZy10aXRsZT0iVXBsb2FkIFNvbmciPlVwbG9hZCBTb25nPC9hPgogICAgPC9saT4KICA8L3VsPgo8L2xpPgo=</html></htmlFiles><cssFiles><css filename="ps_style.css">LnBzX2F1ZGlvIHsKICB3aWR0aDogMTAwJTsKfQoKLnBzX2F1ZGlvOjotd2Via2l0LW1lZGlhLWNvbnRyb2xzLXBhbmVsIHsKICBiYWNrZ3JvdW5kOiAjN0I3QjdCOwogIGJvcmRlcjogMXB4IHNvbGlkICNCNUI1QjU7CiAgYm9yZGVyLXJhZGl1czogMDsKfQo=</css></cssFiles><jsFiles/><resourcesFiles/><lang/><versions><version long="10000" human="1.0.0"><![CDATA[//<?php


/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
	exit;
}

/**
 * Install Code
 */
class ips_plugins_setup_install
{
	/**
	 * ...
	 *
	 * @return	array	If returns TRUE, upgrader will proceed to next step. If it returns any other value, it will set this as the value of the 'extra' GET parameter and rerun this step (useful for loops)
	 */
	public function step1()
	{
		\IPS\Db::i()->addColumn('core_members', array(
			'name'		=> 'kuzi_song_path',
			'type'		=> 'VARCHAR',
			'length'	=> 255,
			'null'		=> FALSE,
			'default'	=> '',
			'comment'	=> 'Profile song path.'
		));

		return TRUE;
	}

	// You can create as many additional methods (step2, step3, etc.) as is necessary.
	// Each step will be executed in a new HTTP request
}
]]></version></versions></plugin>

 

Link al commento
Condividi su altri siti

0 risposte a questa domanda

Messaggi raccomandati

Non ci sono ancora state risposte a questa domanda

Crea un account o accedi per lasciare un commento

Devi essere un membro per lasciare un commento

Crea un account

Iscriviti per un nuovo account nella nostra community. È facile!

Registra un nuovo account

Accedi

Sei già registrato? Accedi qui.

Accedi Ora
  • Chi sta navigando   0 utenti

    • Nessun utente registrato visualizza questa pagina.
×
×
  • Crea Nuovo...

Informazioni importanti

Abbiamo inserito dei cookies nel tuo dispositivo per aiutarti a migliorare la tua esperienza su questo sito. Puoi modificare le impostazioni dei cookie, altrimenti puoi accettarli cliccando su continua. to insert a cookie message.