Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Diego Andrés

#616
Bueno como muchos saben, al instalar el MOD member awards: http://custom.simplemachines.org/mods/index.php?mod=475
Pues es excelente el MOD, tiene muy buenas funciones, pero se nos complica que cuando la edamos permisos a cierto grupo de usuarios, resulta que no pueden acceder aunque ya le dí los permisos y ya probé de todo y nada, no logran acceder ...

Yo logré que se visualizara, de tal forma que lograran acceder, lo que hice fue moverlo del menú de Configuración del foro a Controles de Temas y Diseño. Y de esta manera lograrán visualizar sin ningun problema los premios cuando se les asigne el permiso.

Abrimos ../Sources/Admin.php

Buscamos y eliminamos:

'awards' => array(
'label' => $txt['awards'],
'file' => 'ManageAwards.php',
'function' => 'Awards',
'icon' => 'awards.gif',
'permission' => array('manage_awards'),
'subsections' => array(
'main' => array($txt['awards_main']),
'modify' => array($txt['awards_modify']),
'assign' => array($txt['awards_assign']),
'categories' => array($txt['awards_categories']),
'settings' => array($txt['awards_settings']),
),
),


Una ves que lo eliminemos ...

Buscamos:

'manageattachments' => array(
'label' => $txt['attachments_avatars'],
'file' => 'ManageAttachments.php',
'function' => 'ManageAttachments',
'icon' => 'attachment.gif',
'permission' => array('manage_attachments'),
'subsections' => array(
'browse' => array($txt['attachment_manager_browse']),
'attachments' => array($txt['attachment_manager_settings']),
'avatars' => array($txt['attachment_manager_avatar_settings']),
'maintenance' => array($txt['attachment_manager_maintenance']),
),
),


Y agregamos después:

'awards' => array(
'label' => $txt['awards'],
'file' => 'ManageAwards.php',
'function' => 'Awards',
'icon' => 'awards.gif',
'permission' => array('manage_awards'),
'subsections' => array(
'main' => array($txt['awards_main']),
'modify' => array($txt['awards_modify']),
'assign' => array($txt['awards_assign']),
'categories' => array($txt['awards_categories']),
'settings' => array($txt['awards_settings']),
),
),


De esta forma lo cambiamos de menú, pero con la diferencia que de este lado los permisos funcionan correctamente.

Bueno eso es todo, espero que les haya servido este pequeño tip  ;)
#617
Hola amigos, hace un tiempo le ayudé a un usuario en SimpleMachines que preguntaba si se podía evitar que en un foro no se dieran créditos del MOD SMF Shop.
Bueno es muy fácil, tan solo hacemos lo siguiente ....




../Sources/Post.php

Buscamos:

// Begin SMFShop code

// New topic?
if ($newTopic)
$points = !empty($board_info['shop_pertopic']) ? $board_info['shop_pertopic'] : $modSettings['shopPointsPerTopic'];
else
$points = !empty($board_info['shop_perpost']) ? $board_info['shop_perpost'] : $modSettings['shopPointsPerPost'];

// Are bonuses allowed in this board?
// Strip out all BBCode
$plaintext = preg_replace('[\[(.*?)\]]', ' ', $_POST['message']);
// Convert all newlines into spaces
$plaintext = str_replace(array('<br />', "\r", "\n"), ' ', $plaintext);
// Convert multiple successive spaces into a single space
$plaintext = preg_replace('/\s+/', ' ', $plaintext);

// The bonus for each word...
$points += ($modSettings['shopPointsPerWord'] * str_word_count($plaintext));
// ...and bonus for each letter
$points += ($modSettings['shopPointsPerChar'] * strlen($plaintext));

// Is there a limit set, and are we over it?
if (isset($modSettings['shopPointsLimit']) && $modSettings['shopPointsLimit'] != 0 && $points > $modSettings['shopPointsLimit'])
// If so, set the number of points to the limit
$points = $modSettings['shopPointsLimit'];


Añadimos después:

if ($board == "ID DEL FORO EN EL QUE NO SE DARÁN COINS")
    $points = "0";


Tan solo cambiamos "ID DEL FORO EN EL QUE NO SE DARÁN COINS"  por la ID del foro.
¿Cómo se cuál es la ID del foro?

Muy fácil, accedes a un foro y en la URL verás esto: "index.php?board=8.0"
En este caso la ID sería 8

Y quedaría algo así:
if ($board == "8")
    $points = "0";


Bueno espero que les guste este pequeño tip  :D

Créditos: Cristian Ospina