[phpBB Debug] PHP Warning: in file [ROOT]/ext/sniper/mobiledevice/event/listener.php on line 194: Trying to access array offset on value of type bool
[phpBB Debug] PHP Warning: in file [ROOT]/ext/sniper/mobiledevice/event/listener.php on line 199: Trying to access array offset on value of type bool
[phpBB Debug] PHP Warning: in file [ROOT]/ext/sniper/mobiledevice/event/listener.php on line 267: Trying to access array offset on value of type bool
Ocultar enlaces a los invitados - phpBBMexico
Ese foro es para snippets, pequeños mods, no suficiente grandes para ser Mods

Moderators: Carlos, Soporte en MODs, Soporte en phpBB

User avatar
By Carlos
#380
Bueno, esto nos permite que los invitados no pueden ver los links que hay en los temas:

hacemos esto:
[openfile]Abrir el archivo /language/es_mx/common.php[/openfile]
[findcode]OJO: hay que hacer este paso en los demas idiomas!
BUSCAR:
Code: Select all
	'BBCODE_GUIDE'	=> 'Guía BBCode',
DESPUÉS, AÑADIR:
Code: Select all
	   'BBCODE_GIZLI_LINK'         => '<strong><span style="color: red;">Debe registrarse para ver este enlace.</span> Gracias por su visita.</strong>',
(Aqui puedes cambiar el texto que deseas mostrar a los invitados...)[/findcode]

[openfile]Abrir el archivo /language/es/common.php [/openfile]

[findcode]BUSCAR:
Code: Select all
	'BBCODE_GUIDE'	=> 'Guía BBCode',
DESPUÉS, AÑADIR:
Code: Select all
	   'BBCODE_GIZLI_LINK'         => '<strong><span style="color: red;">Debe registrarse para ver este enlace.</span> Gracias por su visita.</strong>',
(Aqui puedes cambiar el texto que deseas mostrar a los invitados...)[/findcode]

[openfile]Abrir el archivo /includes/bbcode.php[/openfile]

[findcode]BUSCAR: (Linea 458 aprox.)
Code: Select all
function bbcode_tpl_replace($tpl_name, $tpl)
	{
		global $user;

		static $replacements = array(
			'quote_username_open'	=> array('{USERNAME}'	=> '$1'),
			'color'					=> array('{COLOR}'		=> '$1', '{TEXT}'			=> '$2'),
			'size'					=> array('{SIZE}'		=> '$1', '{TEXT}'			=> '$2'),
			'img'					=> array('{URL}'		=> '$1'),
			'flash'					=> array('{WIDTH}'		=> '$1', '{HEIGHT}'			=> '$2', '{URL}'	=> '$3'),
			'url'					=> array('{URL}'		=> '$1', '{DESCRIPTION}'	=> '$2'),
			'email'					=> array('{EMAIL}'		=> '$1', '{DESCRIPTION}'	=> '$2')
		);

		$tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $tpl);

		if (!empty($replacements[$tpl_name]))
		{
			$tpl = strtr($tpl, $replacements[$tpl_name]);
		}

		return trim($tpl);
	}
REEMPLAZAR POR:
Code: Select all
function bbcode_tpl_replace($tpl_name, $tpl)
   {
      global $user;

      static $replacements = array(
         'quote_username_open'   => array('{USERNAME}'   => '$1'),
         'color'               => array('{COLOR}'      => '$1', '{TEXT}'         => '$2'),
         'size'               => array('{SIZE}'      => '$1', '{TEXT}'         => '$2'),
         'img'               => array('{URL}'      => '$1'),
         'flash'               => array('{WIDTH}'      => '$1', '{HEIGHT}'         => '$2', '{URL}'   => '$3'),
         'url'               => array('{URL}'      => '$1', '{DESCRIPTION}'   => '$2'),
         'email'               => array('{EMAIL}'      => '$1', '{DESCRIPTION}'   => '$2')
      );

      static $replacements2 = array(
         'quote_username_open'   => array('{USERNAME}'   => '$1'),
         'color'               => array('{COLOR}'      => '$1', '{TEXT}'         => '$2'),
         'size'               => array('{SIZE}'      => '$1', '{TEXT}'         => '$2'),
         'img'               => array('{URL}'      => '$1'),
         'flash'               => array('{WIDTH}'      => '$1', '{HEIGHT}'         => '$2', '{URL}'   => '$3'),
         'url'               => array('{URL}'      => 'ucp.php?mode=register', '{DESCRIPTION}'   => 'warn_link'),
         'email'               => array('{EMAIL}'      => '$1', '{DESCRIPTION}'   => '$2')
      );

      $tpl = preg_replace('/{L_([A-Z_]+)}/e', "(!empty(\$user->lang['\$1'])) ? \$user->lang['\$1'] : ucwords(strtolower(str_replace('_', ' ', '\$1')))", $tpl);

      if ($user->data['user_id'] != ANONYMOUS)
      {
         if (!empty($replacements[$tpl_name]))
         {
            $tpl = strtr($tpl, $replacements[$tpl_name]);
         }
      }
      else
      {
         if (!empty($replacements2[$tpl_name]))
         {
            $tpl = strtr($tpl, $replacements2[$tpl_name]);
         }
         $tpl = str_replace("warn_link", $user->lang["BBCODE_GIZLI_LINK"], $tpl);
      }
      
      return trim($tpl);
   }
[/findcode]
[openfile]Abrir el archivo viewtopic.php[/openfile]

[findcode]BUSCAR:
Code: Select all
   $message = censor_text($row['post_text']);
DESPUÉS, AÑADIR:
Code: Select all
   if ($user->data['user_id'] == ANONYMOUS)
   {
   $message = preg_replace( '/<.*href="(.*?)">(.*?)(<\/a>)/', '<a href="ucp.php?mode=register">'.$user->lang["BBCODE_GIZLI_LINK"].'</a>', $message );
   }
[/findcode]
Duda sobre BBcode

ya preguntaste ahi? [ Post made via Sony Xperi[…]

[DUDA] Imagen en Foros

Hola, Puse imágenes propias como íc[…]

Hola! queria saber si existe un mod que te muestre[…]

Hola, me gustaria saber si es posible modificar al[…]