Initial commit
This commit is contained in:
commit
43ad32700c
7085 changed files with 447606 additions and 0 deletions
6
forumplugins/plugins/achivements/extensions/index.html
Normal file
6
forumplugins/plugins/achivements/extensions/index.html
Normal file
|
@ -0,0 +1,6 @@
|
|||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: Forumrequirements.lang.php 2012-04-22 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
$l['forumrequiements'] = "Forum Requirements";
|
||||
$l['plugdes'] = "Allows access to X forums when you get the required achievements.";
|
||||
|
||||
$l['enable'] = "Enable extension?";
|
||||
$l['enabledes'] = "Enable this extension in order to hide the forums.";
|
||||
$l['message'] = "Error message";
|
||||
$l['messagedes'] = "Write the error message appears when they can not see a forum because they have not met the required achievements. You can use <b>HTML</b>";
|
||||
$l['valuemessage'] = "To view this forum need to gather the following achievements: <br />{achivements}";
|
||||
|
||||
//admin
|
||||
$l['forums'] = "Forums";
|
||||
$l['noforumexists'] = "The forum you selected does not exist.";
|
||||
$l['achivementsrequestposts'] = "Achievements for Posts";
|
||||
$l['achivementsrequestthreads'] = "Achievements for Threads";
|
||||
$l['achivementsrequestreputations'] = "Achievements for Reputation";
|
||||
$l['achivementsrequesttimeonline'] = "Achievements for Time Online";
|
||||
$l['achivementsrequestregdate'] = "Achievements for Time Registered";
|
||||
$l['achivementsrequestcustom'] = "Custom Achievements";
|
||||
$l['achivementsrequestpostsdes'] = "Select the achievements of posts that users need to view this forum.";
|
||||
$l['achivementsrequestthreadsdes'] = "Select the achievements of threads that users need to view this forum.";
|
||||
$l['achivementsrequestreputationsdes'] = "Select the achievements of reputation that users need to view this forum.";
|
||||
$l['achivementsrequesttimeonlinedes'] = "Select the achievements of time online that users need to view this forum.";
|
||||
$l['achivementsrequestregdatedes'] = "Select the achievements of time registered that users need to view this forum.";
|
||||
$l['achivementsrequestcustomdes'] = "Select Custom achievements users need to view this forum.";
|
||||
$l['none'] = "None";
|
||||
$l['success_update'] = "The forum has been updated successfully.";
|
||||
$l['save'] = "Save";
|
||||
|
||||
?>
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: hello_world.lang.php 2012-04-22 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
$l['hello_world'] = "Hello World";
|
||||
$l['hello_world_extension_description'] = "A sample extension that prints hello world and prepends the content of each post to 'Hello world!'";
|
||||
|
||||
?>
|
|
@ -0,0 +1,6 @@
|
|||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: ranks.lang.php 2012-04-29 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
$l['ranks'] = "Ranks";
|
||||
$l['ranks_plug_description'] = "Add ranges for users to get certain achievements.";
|
||||
$l['ranks_tab_des'] = "List of ranges. ranges shown by level up or down according to your configure it.";
|
||||
|
||||
//new rank
|
||||
$l['newrank'] = "New Rank";
|
||||
$l['newrank_tab_des'] = "Add a new range of achievements. achievements will be shown here created (posts achievements, issues, reputation, time online and time of registration, not custom achievements).";
|
||||
$l['save'] = "Save";
|
||||
$l['none'] = "None";
|
||||
|
||||
$l['nameofrank'] = "Name of rank";
|
||||
$l['nameofrankdes'] = "Enter the name of the rank.";
|
||||
$l['descriptionofrank'] = "Description";
|
||||
$l['descriptionofrankdes'] = "Enter a description of this rank.";
|
||||
$l['newrankpostsdes'] = "Select the achievement of posts that should be the user.";
|
||||
$l['newrankthreadsdes'] = "Select the achievement of threads that should be the user.";
|
||||
$l['newrankreputationdes'] = "Select the achievement of reputation that should be the user.";
|
||||
$l['newranktimeonlinedes'] = "Select the achievement of time online that should be the user.";
|
||||
$l['newrankregdatedes'] = "Select the achievement of time registered that should be the user.";
|
||||
|
||||
$l['imagedesnewrank'] = "Select the image you will be given as a range from your computer.";
|
||||
$l['level'] = "Level";
|
||||
$l['levelnewrank'] = "Enter the level you will have this range (the level can not be at zero level or be repeated).";
|
||||
|
||||
//validate and process rank
|
||||
$l['notname'] = "You did not enter a rank name.";
|
||||
$l['notdescription'] = "You must enter a description of the rank.";
|
||||
$l['notlevel'] = "The level of the rank must be greater than zero.";
|
||||
$l['notimage'] = "You have not selected an image from your computer.";
|
||||
$l['repeatlevel'] = "The rank {1} already has the level {2}.";
|
||||
$l['successnewrank'] = "The rank has been created successfully.";
|
||||
$l['notcopyimage'] = "Unable to copy the image of the rank.";
|
||||
$l['extnotvalidateimg'] = "Extension of the image is not valid.";
|
||||
$l['notloadingimage'] = "Unable to load the image.";
|
||||
|
||||
|
||||
//home ranks
|
||||
$l['namedescription'] = "Name/Description";
|
||||
$l['emptyranks'] = "There is no established range.";
|
||||
$l['deletsuccessrank'] = "The rank was successfully deleted.";
|
||||
$l['confirmdeleterankpoop'] = "Want to delete the range {1}?";
|
||||
$l['successorderascdesc'] = "The ranges are shown by level of form {1}";
|
||||
$l['asc'] = "ascendant";
|
||||
$l['desc'] = "descending";
|
||||
$l['showdesctable'] = "Display in descending order";
|
||||
$l['showasctable'] = "View in ascending order";
|
||||
|
||||
//edit rank
|
||||
$l['notexistrankedit'] = "There is no range selected.";
|
||||
$l['imageactual'] = "Current picture";
|
||||
$l['imageactualdes'] = "If you do not want to change this picture leaves the empty field below to maintain this image.";
|
||||
$l['successeditrank'] = "The range has been edited successfully.";
|
||||
$l['editrank'] = "Edit Rank";
|
||||
$l['editrank_tab_des'] = "Edit the range changing its configuration. Run the task again to remove this range who do not bundle the achievements.";
|
||||
|
||||
|
||||
|
||||
?>
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: threadbump.lang.php 2012-04-22 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
$l['threadbump'] = "Thread Bump";
|
||||
$l['threadbumpplugdes'] = "Allows bump threads every 24 hours.";
|
||||
|
||||
$l['enable'] = "Enable Extension?";
|
||||
$l['enabledes'] = "Selects whether the extension will be activated to make bumps in threads.";
|
||||
|
||||
$l['message'] = "Error message from achievements";
|
||||
$l['messagedes'] = "Write the error message appear when they bump can not do because they lack the required achievements. You can use <b>HTML</b>";
|
||||
$l['valuemessage'] = "Bump need to make together the following achievements: <br />{achivements}";
|
||||
|
||||
$l['messagetime'] = "Time error message";
|
||||
$l['messagetimedes'] = "Write the error message appears when they can not do because I did bump within 24 hours. You can use <b>HTML</b>";
|
||||
$l['notbumpthread_time'] = "You can not bump into 2 or more items within 24 hours, waiting for the day {datetime} to bump.";
|
||||
|
||||
|
||||
$l['achivementsrequestposts'] = "Achievements for Posts";
|
||||
$l['achivementsrequestthreads'] = "Achievements for Threads";
|
||||
$l['achivementsrequestreputations'] = "Achievements for Reputation";
|
||||
$l['achivementsrequesttimeonline'] = "Achievements for Time Online";
|
||||
$l['achivementsrequestregdate'] = "Achievements for Time Registered";
|
||||
$l['achivementsrequestpostsdes'] = "Select the achievements of posts that users need to make bump.";
|
||||
$l['achivementsrequestthreadsdes'] = "Select the achievements of threads that users need to make bump.";
|
||||
$l['achivementsrequestreputationsdes'] = "Select the achievements of reputation that users need to make bump.";
|
||||
$l['achivementsrequesttimeonlinedes'] = "Select the achievements of time online that users need to make bump.";
|
||||
$l['achivementsrequestregdatedes'] = "Select the achievements of time registered that users need to make bump.";
|
||||
$l['none'] = "None";
|
||||
$l['save'] = "Save";
|
||||
|
||||
$l['success_update'] = "Data saved successfully.";
|
||||
|
||||
$l['bumpsuccess'] = "The issue has properly bump.";
|
||||
?>
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: hello_world.lang.php 2012-04-22 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
$l['hello_global'] = "Hello World!<br />This is a sample Extensions (which can be disabled!) that displays this message on all pages.";
|
||||
$l['hello_postbit'] = "Hello world!";
|
||||
|
||||
?>
|
|
@ -0,0 +1,6 @@
|
|||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: ranks.lang.php 2012-04-12 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
$l['rank'] = "Rank";
|
||||
$l['listranks'] = "List of ranks";
|
||||
$l['image'] = "Image";
|
||||
$l['namedes'] = "Name\Description";
|
||||
$l['posts'] = "Posts";
|
||||
$l['threads'] = "Threads";
|
||||
$l['reputation'] = "Reputation";
|
||||
$l['timeonline'] = "Time Online";
|
||||
$l['regdate'] = "Registered time";
|
||||
$l['level'] = "Level";
|
||||
$l['none'] = "None";
|
||||
$l['rankby'] = "Rank of {1}";
|
||||
$l['emptyranks'] = "There is no created range.";
|
||||
|
||||
$l['hours'] = "Hours";
|
||||
$l['hour'] = "Hour";
|
||||
$l['days'] = "Days";
|
||||
$l['day'] = "Day";
|
||||
$l['weeks'] = "Weeks";
|
||||
$l['week'] = "Week";
|
||||
$l['years'] = "Years";
|
||||
$l['year'] = "Year";
|
||||
$l['save'] = "Save";
|
||||
?>
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: Forumrequirements.lang.php 2012-04-22 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
$l['forumrequiements'] = "Forum Requirements";
|
||||
$l['plugdes'] = "Permite el acceso a X foros cuando obtengas los logros requeridos.";
|
||||
|
||||
$l['enable'] = "Activar extension?";
|
||||
$l['enabledes'] = "Activa esta extension para que se oculten los foros.";
|
||||
$l['message'] = "Mensaje de error";
|
||||
$l['messagedes'] = "Escribe el mensaje de error que les aparecera cuando no puedan ver un foro porque no han cumplido con los logros requeridos. Puedes usar <b>HTML</b>";
|
||||
$l['valuemessage'] = "Para poder ver este foro necesitas juntar los siguientes logros: <br />{achivements}";
|
||||
|
||||
//admin
|
||||
$l['forums'] = "Foros";
|
||||
$l['noforumexists'] = "El foro seleccionado no existe.";
|
||||
$l['achivementsrequestposts'] = "Logros por Posts";
|
||||
$l['achivementsrequestthreads'] = "Logros por Temas";
|
||||
$l['achivementsrequestreputations'] = "Logros por Reputación";
|
||||
$l['achivementsrequesttimeonline'] = "Logros por Tiempo en linea";
|
||||
$l['achivementsrequestregdate'] = "Logros por Tiempo de registrado";
|
||||
$l['achivementsrequestcustom'] = "Logros Personalizados";
|
||||
$l['achivementsrequestpostsdes'] = "Selecciona los logros por posts que necesitan los usuarios para ver este foro.";
|
||||
$l['achivementsrequestthreadsdes'] = "Selecciona los logros por temas que necesitan los usuarios para ver este foro.";
|
||||
$l['achivementsrequestreputationsdes'] = "Selecciona los logros por reputación que necesitan los usuarios para ver este foro.";
|
||||
$l['achivementsrequesttimeonlinedes'] = "Selecciona los logros por tiempo en linea que necesitan los usuarios para ver este foro.";
|
||||
$l['achivementsrequestregdatedes'] = "Selecciona los logros por tiempo de registrado que necesitan los usuarios para ver este foro.";
|
||||
$l['achivementsrequestcustomdes'] = "Selecciona los logros personalizados que necesitan los usuarios para ver este foro.";
|
||||
$l['none'] = "Ninguno";
|
||||
$l['success_update'] = "El foro se ha actualizado correctamente.";
|
||||
$l['save'] = "Guardar";
|
||||
|
||||
?>
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: hello_world.lang.php 2012-04-22 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
$l['hello_world'] = "Hello World";
|
||||
$l['hello_world_extension_description'] = "A sample extension that prints hello world and prepends the content of each post to 'Hello world!'";
|
||||
|
||||
?>
|
|
@ -0,0 +1,6 @@
|
|||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: ranks.lang.php 2012-04-29 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
$l['ranks'] = "Rangos";
|
||||
$l['ranks_plug_description'] = "Agrega rangos a los usuarios al obtener ciertos logros.";
|
||||
$l['ranks_tab_des'] = "Lista de rangos. los rangos se muestra por nivel de forma ascendente o descendente segun tu lo configures.";
|
||||
|
||||
//new rank
|
||||
$l['newrank'] = "Nuevo Rango";
|
||||
$l['newrank_tab_des'] = "Agrega un nuevo rango por logros. aqui se mostraran los logros creados (logros por posts, temas, reputacion, tiempo en linea y tiempo de registrado, no por logros personalizados).";
|
||||
$l['save'] = "Guardar";
|
||||
$l['none'] = "Ninguno";
|
||||
|
||||
$l['nameofrank'] = "Nombre del rango";
|
||||
$l['nameofrankdes'] = "Ingresa el nombre del rango.";
|
||||
$l['descriptionofrank'] = "Descripcion";
|
||||
$l['descriptionofrankdes'] = "Ingresa la descripcion de este rango.";
|
||||
$l['newrankpostsdes'] = "Selecciona el logro por posts que debe tener el usuario.";
|
||||
$l['newrankthreadsdes'] = "Selecciona el logro por posts que debe tener el usuario.";
|
||||
$l['newrankreputationdes'] = "Selecciona el logro por reputacion que debe tener el usuario.";
|
||||
$l['newranktimeonlinedes'] = "Selecciona el logro por tiempo en linea que debe tener el usuario.";
|
||||
$l['newrankregdatedes'] = "Selecciona el logro por tiempo de registrado que debe tener el usuario.";
|
||||
|
||||
$l['imagedesnewrank'] = "Selecciona la imagen que se les dara como rango desde tu ordenador.";
|
||||
$l['level'] = "Nivel";
|
||||
$l['levelnewrank'] = "Ingresa el nivel que tendra este rango (El nivel no puede quedar en cero ni ser un nivel repetido).";
|
||||
|
||||
//validate and process rank
|
||||
$l['notname'] = "No has escrito un nombre del rango.";
|
||||
$l['notdescription'] = "Debes escribir una descripcion del rango.";
|
||||
$l['notlevel'] = "El nivel del rango debe ser mayor a cero.";
|
||||
$l['notimage'] = "No has seleccionado una imagen de tu ordenador.";
|
||||
$l['repeatlevel'] = "El rango {1} ya tiene el nivel {2}.";
|
||||
$l['successnewrank'] = "El rango se ha creado correctamente.";
|
||||
$l['notcopyimage'] = "No se ha podido copiar la imagen del rango.";
|
||||
$l['extnotvalidateimg'] = "Extension de la imagen no es valida.";
|
||||
$l['notloadingimage'] = "No se ha podido cargar la imagen.";
|
||||
|
||||
|
||||
//home ranks
|
||||
$l['namedescription'] = "Nombre/Descripcion";
|
||||
$l['emptyranks'] = "No hay ningun rango creado.";
|
||||
$l['deletsuccessrank'] = "El rango se ha eliminado correctamente.";
|
||||
$l['confirmdeleterankpoop'] = "Quieres eliminar el rango {1}?";
|
||||
$l['successorderascdesc'] = "Los rangos se muestran por nivel de forma {1}";
|
||||
$l['asc'] = "ascendente";
|
||||
$l['desc'] = "descendente";
|
||||
$l['showdesctable'] = "Mostrar en orden descendente";
|
||||
$l['showasctable'] = "Mostrar en orden ascendente";
|
||||
|
||||
//edit rank
|
||||
$l['notexistrankedit'] = "No existe el rango seleccionado.";
|
||||
$l['imageactual'] = "Imagen Actual";
|
||||
$l['imageactualdes'] = "Si no quieres cambiar esta imagen deja el campo de abajo vacio para mantener esta imagen.";
|
||||
$l['successeditrank'] = "El rango se ha editado correctamente.";
|
||||
$l['editrank'] = "Editar Rango";
|
||||
$l['editrank_tab_des'] = "Edita el rango cambiando su configuracion. Ejecuta de nuevo la tarea para quitar este rango a quien no junte los logros.";
|
||||
|
||||
|
||||
|
||||
?>
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: threadbump.lang.php 2012-04-22 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
$l['threadbump'] = "Thread Bump";
|
||||
$l['threadbumpplugdes'] = "Permite bumpear temas cada 24 horas.";
|
||||
|
||||
$l['enable'] = "Activar extension";
|
||||
$l['enabledes'] = "Selecciona si la extension estara activara para bumpear temas.";
|
||||
|
||||
$l['message'] = "Mensaje de error de logros";
|
||||
$l['messagedes'] = "Escribe el mensaje de error que les aparecera cuando no puedan bumpear porque no tienen los logros requeridos. Puedes usar <b>HTML</b>";
|
||||
$l['valuemessage'] = "Para poder bumpear necesitas juntar los siguientes logros: <br />{achivements}";
|
||||
|
||||
$l['messagetime'] = "Mensaje de error de tiempo";
|
||||
$l['messagetimedes'] = "Escribe el mensaje de error que les aparecera cuando no puedan bumpear porque ya bumpearon antes de 24 horas. Puedes usar <b>HTML</b>";
|
||||
$l['notbumpthread_time'] = "No puedes bumpear 2 temas en menos de 24 horas, espera al dia {datetime} para bumpear.";
|
||||
|
||||
|
||||
$l['achivementsrequestposts'] = "Logros por Posts";
|
||||
$l['achivementsrequestthreads'] = "Logros por Temas";
|
||||
$l['achivementsrequestreputations'] = "Logros por Reputación";
|
||||
$l['achivementsrequesttimeonline'] = "Logros por Tiempo en linea";
|
||||
$l['achivementsrequestregdate'] = "Logros por Tiempo de registrado";
|
||||
$l['achivementsrequestpostsdes'] = "Selecciona los logros por posts que necesitan los usuarios para poder bumpear.";
|
||||
$l['achivementsrequestthreadsdes'] = "Selecciona los logros por temas que necesitan los usuarios para poder bumpear.";
|
||||
$l['achivementsrequestreputationsdes'] = "Selecciona los logros por reputación que necesitan los usuarios para poder bumpear.";
|
||||
$l['achivementsrequesttimeonlinedes'] = "Selecciona los logros por tiempo en linea que necesitan los usuarios para poder bumpear.";
|
||||
$l['achivementsrequestregdatedes'] = "Selecciona los logros por tiempo de registrado que necesitan los usuarios para poder bumpear.";
|
||||
$l['none'] = "Ninguno";
|
||||
$l['save'] = "Guardar";
|
||||
|
||||
$l['success_update'] = "Datos guardados correctamente.";
|
||||
|
||||
$l['bumpsuccess'] = "El tema se a bumpeado correctamente.";
|
||||
?>
|
|
@ -0,0 +1,15 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: hello_world.lang.php 2012-04-22 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
$l['hello_global'] = "Hello World!<br />This is a sample Extensions (which can be disabled!) that displays this message on all pages.";
|
||||
$l['hello_postbit'] = "Hello world!";
|
||||
|
||||
?>
|
|
@ -0,0 +1,6 @@
|
|||
<html>
|
||||
<head>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: ranks.lang.php 2012-04-12 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
$l['rank'] = "Rango";
|
||||
$l['listranks'] = "Lista de rangos";
|
||||
$l['image'] = "Imagen";
|
||||
$l['namedes'] = "Nombre\Descripción";
|
||||
$l['posts'] = "Posts";
|
||||
$l['threads'] = "Temas";
|
||||
$l['reputation'] = "Reputación";
|
||||
$l['timeonline'] = "Tiempo en linea";
|
||||
$l['regdate'] = "Tiempo Registrado";
|
||||
$l['level'] = "Nivel";
|
||||
$l['none'] = "Ninguno";
|
||||
$l['rankby'] = "Rango de {1}";
|
||||
$l['emptyranks'] = "No hay ningun rango creado.";
|
||||
|
||||
$l['hours'] = "Horas";
|
||||
$l['hour'] = "Hora";
|
||||
$l['days'] = "Días";
|
||||
$l['day'] = "Día";
|
||||
$l['weeks'] = "Semanas";
|
||||
$l['week'] = "Semana";
|
||||
$l['years'] = "Años";
|
||||
$l['year'] = "Año";
|
||||
$l['save'] = "Guardar";
|
||||
?>
|
153
forumplugins/plugins/achivements/extensions/ranks/admin.php
Normal file
153
forumplugins/plugins/achivements/extensions/ranks/admin.php
Normal file
|
@ -0,0 +1,153 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: admin.php 2012-04-29 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
// Disallow direct access to this file for security reasons
|
||||
|
||||
if(!defined("IN_MYBB"))
|
||||
{
|
||||
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
|
||||
}
|
||||
function admin_load_rank()
|
||||
{
|
||||
global $lang, $cache, $mybb, $page, $db;
|
||||
require_once MYBB_ROOT."inc/plugins/achivements/extensions/ranks/class_ranks.php";
|
||||
require_once MYBB_ROOT."inc/plugins/achivements/extensions/ranks/forms.php";
|
||||
$rankhandler = new class_extension_ranks;
|
||||
if($mybb->input['action'] == "new")
|
||||
{
|
||||
$rankhandler->tabs('new');
|
||||
if($mybb->request_method == "post")
|
||||
{
|
||||
$rank = array(
|
||||
"name" => $db->escape_string($mybb->input['name']),
|
||||
"description" => $db->escape_string($mybb->input['description']),
|
||||
"apid" => intval($mybb->input['posts']),
|
||||
"atid" => intval($mybb->input['threads']),
|
||||
"arid" => intval($mybb->input['reputation']),
|
||||
"toid" => intval($mybb->input['timeonline']),
|
||||
"rgid" => intval($mybb->input['regdate']),
|
||||
"image" => $_FILES['image'],
|
||||
"level" => intval($mybb->input['level'])
|
||||
);
|
||||
$rankhandler->set_data($rank);
|
||||
if(!$rankhandler->validate_rank())
|
||||
{
|
||||
$errors = $rankhandler->get_friendly_errors();
|
||||
}
|
||||
if(!$errors)
|
||||
{
|
||||
$rankhandler->insert_rank();
|
||||
flash_message($lang->successnewrank, 'success');
|
||||
admin_redirect("index.php?module=achivements-ranks");
|
||||
}
|
||||
}
|
||||
if($errors)
|
||||
{
|
||||
$page->output_inline_error($errors);
|
||||
}
|
||||
form_new_rank();
|
||||
}
|
||||
elseif($mybb->input['action'] == "edit")
|
||||
{
|
||||
$rank = get_rank($mybb->input['rid']);
|
||||
if(!$rank['rid'])
|
||||
{
|
||||
flash_message($lang->notexistrankedit, 'error');
|
||||
admin_redirect("index.php?module=achivements-ranks");
|
||||
}
|
||||
if($mybb->request_method == "post")
|
||||
{
|
||||
$rank = array(
|
||||
"rid" => intval($mybb->input['rid']),
|
||||
"name" => $db->escape_string($mybb->input['name']),
|
||||
"description" => $db->escape_string($mybb->input['description']),
|
||||
"apid" => intval($mybb->input['posts']),
|
||||
"atid" => intval($mybb->input['threads']),
|
||||
"arid" => intval($mybb->input['reputation']),
|
||||
"toid" => intval($mybb->input['timeonline']),
|
||||
"rgid" => intval($mybb->input['regdate']),
|
||||
"image" => $_FILES['image'],
|
||||
"imageactual" => $mybb->input['imageactual'],
|
||||
"level" => intval($mybb->input['level']),
|
||||
"edit" => true
|
||||
);
|
||||
$rankhandler->set_data($rank);
|
||||
if(!$rankhandler->validate_rank())
|
||||
{
|
||||
$errors = $rankhandler->get_friendly_errors();
|
||||
}
|
||||
if(!$errors)
|
||||
{
|
||||
$rankhandler->insert_rank();
|
||||
flash_message($lang->successeditrank, 'success');
|
||||
admin_redirect("index.php?module=achivements-ranks");
|
||||
}
|
||||
}
|
||||
if($errors)
|
||||
{
|
||||
$page->output_inline_error($errors);
|
||||
}
|
||||
$rankhandler->tabs('edit', array('rid' => $rank['rid']));
|
||||
form_edit_rank($rank['rid']);
|
||||
}
|
||||
elseif($mybb->input['action'] == "delete")
|
||||
{
|
||||
$rank = get_rank($mybb->input['rid']);
|
||||
if(!$rank['rid'])
|
||||
{
|
||||
flash_message($lang->notexistrankedit, 'error');
|
||||
admin_redirect("index.php?module=achivements-ranks");
|
||||
}
|
||||
@unlink(MYBB_ROOT.$rank['image']);
|
||||
$db->query("DELETE FROM ".TABLE_PREFIX."ranks WHERE rid='$rank[rid]'");
|
||||
flash_message($lang->deletsuccessrank, 'success');
|
||||
admin_redirect("index.php?module=achivements-ranks");
|
||||
}
|
||||
elseif($mybb->input['order'])
|
||||
{
|
||||
if($mybb->input['order'] != 'asc' && $mybb->input['order'] != 'desc')
|
||||
{
|
||||
$mybb->input['order'] = 'asc';
|
||||
}
|
||||
|
||||
$insertcache = array(
|
||||
'order_dir' => $mybb->input['order']
|
||||
);
|
||||
$cache->update("ranks", $insertcache);
|
||||
|
||||
if($mybb->input['order'] == 'asc')
|
||||
{
|
||||
$ascdesc = $lang->asc;
|
||||
}
|
||||
elseif($mybb->input['order'] == 'desc')
|
||||
{
|
||||
$ascdesc = $lang->desc;
|
||||
}
|
||||
$lang->successorderascdesc = $lang->sprintf($lang->successorderascdesc, $ascdesc);
|
||||
flash_message($lang->successorderascdesc, 'success');
|
||||
admin_redirect("index.php?module=achivements-ranks");
|
||||
}
|
||||
else
|
||||
{
|
||||
$orderdir = $cache->read('ranks');
|
||||
if(!$orderdir['order_dir'])
|
||||
{
|
||||
$insertcache = array(
|
||||
'order_dir' => 'asc'
|
||||
);
|
||||
$cache->update("ranks", $insertcache);
|
||||
}
|
||||
$rankhandler->tabs();
|
||||
home_ranks();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
|
@ -0,0 +1,204 @@
|
|||
<?php
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: class_ranks.php 2012-04-15 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
if(!defined("IN_MYBB"))
|
||||
{
|
||||
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
|
||||
}
|
||||
|
||||
class class_extension_ranks extends DataHandler
|
||||
{
|
||||
public $tabs;
|
||||
|
||||
public function tabs($location='home', $options=array())
|
||||
{
|
||||
global $page, $lang;
|
||||
//die(var_dump($location))
|
||||
$tabs["home"] = array(
|
||||
'title' => $lang->ranks,
|
||||
'link' => "index.php?module=achivements-ranks",
|
||||
'description' => $lang->ranks_tab_des
|
||||
);
|
||||
$tabs["new"] = array(
|
||||
'title' => $lang->newrank,
|
||||
'link' => "index.php?module=achivements-ranks&action=new",
|
||||
'description' => $lang->newrank_tab_des
|
||||
);
|
||||
if($location == "edit")
|
||||
{
|
||||
$tabs["edit"] = array(
|
||||
'title' => $lang->editrank,
|
||||
'link' => "index.php?module=achivements-ranks&action=edit&rid=$options[rid]",
|
||||
'description' => $lang->editrank_tab_des
|
||||
);
|
||||
}
|
||||
$page->output_nav_tabs($tabs, $location);
|
||||
}
|
||||
|
||||
public function validate_rank()
|
||||
{
|
||||
global $lang, $db;
|
||||
$rank = &$this->data;
|
||||
if(empty($rank['name']))
|
||||
{
|
||||
$this->set_error($lang->notname);
|
||||
}
|
||||
if(empty($rank['description']))
|
||||
{
|
||||
$this->set_error($lang->notdescription);
|
||||
}
|
||||
if(empty($rank['level']))
|
||||
{
|
||||
$this->set_error($lang->notlevel);
|
||||
}
|
||||
if(empty($rank['image']) && $rank['edit'] == false)
|
||||
{
|
||||
$this->set_error($lang->notimage);
|
||||
}
|
||||
$query = $db->simple_select("ranks", "*", "level='{$rank['level']}'");
|
||||
$level = $db->fetch_array($query);
|
||||
if($level['rid'] && $rank['edit'] == false)
|
||||
{
|
||||
$lang->repeatlevel = $lang->sprintf($lang->repeatlevel, $level['name'], $rank['level']);
|
||||
$this->set_error($lang->repeatlevel);
|
||||
return false;
|
||||
}
|
||||
if($rank['edit'] == true && $level['rid'] != $rank['rid'] && !is_null($level['rid']))
|
||||
{
|
||||
$lang->repeatlevel = $lang->sprintf($lang->repeatlevel, $level['name'], $rank['level']);
|
||||
$this->set_error($lang->repeatlevel);
|
||||
return false;
|
||||
}
|
||||
$db->free_result($query);
|
||||
if(count($this->get_errors()) < 1)
|
||||
{
|
||||
$this->validate_image();
|
||||
}
|
||||
$this->set_validated(true);
|
||||
if(count($this->get_errors()) > 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public function validate_image()
|
||||
{
|
||||
global $lang;
|
||||
$rank = &$this->data;
|
||||
if(!$imagen['name'] || !$imagen['tmp_name'])
|
||||
{
|
||||
$imagen = $rank['image'];
|
||||
}
|
||||
if($rank['imageactual'] && $imagen['error'] > 0)
|
||||
{
|
||||
$rank['image'] = $rank['imageactual'];
|
||||
$this->set_data($rank);
|
||||
return false;
|
||||
}
|
||||
if(!is_uploaded_file($imagen['tmp_name']))
|
||||
{
|
||||
$this->set_error($lang->notcopyimage);
|
||||
return false;
|
||||
}
|
||||
$ext = get_extension(my_strtolower($imagen['name']));
|
||||
if(!preg_match("#^(gif|jpg|jpeg|jpe|bmp|png)$#i", $ext))
|
||||
{
|
||||
$this->set_error($lang->extnotvalidateimg);
|
||||
return false;
|
||||
}
|
||||
$path = MYBB_ROOT."inc/plugins/achivements/extensions/ranks/upload";
|
||||
$filename = "rank_".date('d_m_y_g_i_s').'.'.$ext;
|
||||
$moved = @move_uploaded_file($imagen['tmp_name'], $path."/".$filename);
|
||||
if(!$moved)
|
||||
{
|
||||
$this->set_error($lang->notcopyimage);
|
||||
return false;
|
||||
}
|
||||
@my_chmod($path."/".$filename, '0644');
|
||||
if($imagen['error'])
|
||||
{
|
||||
@unlink($path."/".$filename);
|
||||
$this->set_error($lang->notloadingimage);
|
||||
return false;
|
||||
}
|
||||
switch(my_strtolower($imagen['type']))
|
||||
{
|
||||
case "image/gif":
|
||||
$img_type = 1;
|
||||
break;
|
||||
case "image/jpeg":
|
||||
case "image/x-jpg":
|
||||
case "image/x-jpeg":
|
||||
case "image/pjpeg":
|
||||
case "image/jpg":
|
||||
$img_type = 2;
|
||||
break;
|
||||
case "image/png":
|
||||
case "image/x-png":
|
||||
$img_type = 3;
|
||||
break;
|
||||
default:
|
||||
$img_type = 0;
|
||||
}
|
||||
if($img_type == 0)
|
||||
{
|
||||
@unlink($path."/".$filename);
|
||||
$this->set_error($lang->extnotvalidateimg);
|
||||
return false;
|
||||
}
|
||||
@unlink(MYBB_ROOT.$rank['imageactual']);
|
||||
$rank['image'] = "inc/plugins/achivements/extensions/ranks/upload/".$filename;
|
||||
$this->set_data($rank);
|
||||
return true;
|
||||
}
|
||||
|
||||
public function insert_rank()
|
||||
{
|
||||
global $lang, $db;
|
||||
if(!$this->get_validated())
|
||||
{
|
||||
die($lang->not_validate);
|
||||
}
|
||||
if(count($this->get_errors()) > 0)
|
||||
{
|
||||
die($lang->infonotvalid);
|
||||
}
|
||||
$rank = &$this->data;
|
||||
$insert = array(
|
||||
"name" => $rank['name'],
|
||||
"description" => $rank['description'],
|
||||
"apid" => $rank['apid'],
|
||||
"atid" => $rank['atid'],
|
||||
"arid" => $rank['arid'],
|
||||
"toid" => $rank['toid'],
|
||||
"rgid" => $rank['rgid'],
|
||||
"image" => $rank['image'],
|
||||
"level" => $rank['level']
|
||||
);
|
||||
if($rank['edit'] == true)
|
||||
{
|
||||
$db->update_query("ranks", $insert, "rid=".$rank['rid']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$rid = $db->insert_id();
|
||||
$insert['rid'] = $rid;
|
||||
$db->insert_query("ranks", $insert);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
225
forumplugins/plugins/achivements/extensions/ranks/forms.php
Normal file
225
forumplugins/plugins/achivements/extensions/ranks/forms.php
Normal file
|
@ -0,0 +1,225 @@
|
|||
<?php
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: forms.php 2012-04-15 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
if(!defined("IN_MYBB"))
|
||||
{
|
||||
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
|
||||
}
|
||||
|
||||
function home_ranks()
|
||||
{
|
||||
global $db, $lang, $mybb, $cache;
|
||||
$query = $db->simple_select('ranks', 'COUNT(rid) AS rids', '', array('limit' => 1));
|
||||
$quantity = $db->fetch_field($query, "rids");
|
||||
$pagina = intval($mybb->input['page']);
|
||||
$perpage = 10;
|
||||
if($pagina > 0)
|
||||
{
|
||||
$start = ($pagina - 1) * $perpage;
|
||||
$pages = $quantity / $perpage;
|
||||
$pages = ceil($pages);
|
||||
if($pagina > $pages || $pagina <= 0)
|
||||
{
|
||||
$start = 0;
|
||||
$pagina = 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$start = 0;
|
||||
$pagina = 1;
|
||||
}
|
||||
$pageurl = "index.php?module=achivements-ranks";
|
||||
$table = new Table;
|
||||
$table->construct_header($lang->image, array("width" => "5%","class" => "align_center"));
|
||||
$table->construct_header($lang->namedescription);
|
||||
$table->construct_header($lang->achivements, array("width" => "20%","class" => "align_center"));
|
||||
$table->construct_header($lang->options, array("width" => "10%","class" => "align_center"));
|
||||
$table->construct_row();
|
||||
$orderdir = $cache->read("ranks");
|
||||
$query = $db->simple_select("ranks", '*', '', array('order_by' => 'level', 'order_dir' => $orderdir['order_dir'], 'limit' => $start.", ".$perpage));
|
||||
while($rank = $db->fetch_array($query))
|
||||
{
|
||||
$achivements = achivements_get();
|
||||
$lang->confirmdeleterank = $lang->sprintf($lang->confirmdeleterankpoop, $rank['name']);
|
||||
|
||||
if(!empty($achivements['apid'][$rank['apid']]['apid']))
|
||||
{
|
||||
$logros .= "<img src=\"../".$achivements['apid'][$rank['apid']]['image']."\" title=\"".$achivements['apid'][$rank['apid']]['name']."\" /> ";
|
||||
}
|
||||
if(!empty($achivements['atid'][$rank['atid']]['atid']))
|
||||
{
|
||||
$logros .= "<img src=\"../".$achivements['atid'][$rank['atid']]['image']."\" title=\"".$achivements['atid'][$rank['atid']]['name']."\"/> ";
|
||||
}
|
||||
if(!empty($achivements['arid'][$rank['arid']]['arid']))
|
||||
{
|
||||
$logros .= "<img src=\"../".$achivements['arid'][$rank['arid']]['image']."\" title=\"".$achivements['arid'][$rank['arid']]['name']."\"/> ";
|
||||
}
|
||||
if(!empty($achivements['toid'][$rank['toid']]['toid']))
|
||||
{
|
||||
$logros .= "<img src=\"../".$achivements['toid'][$rank['toid']]['image']."\" title=\"".$achivements['toid'][$rank['toid']]['name']."\"/> ";
|
||||
}
|
||||
if(!empty($achivements['rgid'][$rank['rgid']]['rgid']))
|
||||
{
|
||||
$logros .= "<img src=\"../".$achivements['rgid'][$rank['rgid']]['image']."\" title=\"".$achivements['rgid'][$rank['rgid']]['name']."\"/> ";
|
||||
}
|
||||
if(!$logros)
|
||||
{
|
||||
$logros = $lang->none;
|
||||
}
|
||||
$table->construct_cell("<img src=\"../$rank[image]\" title=\"$rank[name]\">",array("class" => "align_center"));
|
||||
$table->construct_cell("<strong><a href=\"index.php?module=achivements-ranks&action=edit&rid=$rank[rid]\" />$rank[name]</a></strong><br /><small>$rank[description]</small>");
|
||||
$table->construct_cell($logros ,array("class" => "align_center"));
|
||||
$popup = new PopupMenu("rid_$rank[rid]", $lang->options);
|
||||
$popup->add_item($lang->edit, "index.php?module=achivements-ranks&action=edit&rid=$rank[rid]");
|
||||
$popup->add_item($lang->delete, "index.php?module=achivements-ranks&action=delete&rid={$rank['rid']}&my_post_key={$mybb->post_code}\" target=\"_self\" onclick=\"return AdminCP.deleteConfirmation(this, '{$lang->confirmdeleterank}')");
|
||||
$Popuss = $popup->fetch();
|
||||
$table->construct_cell($Popuss, array('class' => 'align_center'));
|
||||
$table->construct_row();
|
||||
unset($logros);
|
||||
}
|
||||
if($table->num_rows() == 1)
|
||||
{
|
||||
$table->construct_cell($lang->emptyranks, array('colspan' => 4, 'class' => 'align_center'));
|
||||
$table->construct_row();
|
||||
}
|
||||
|
||||
if($orderdir['order_dir'] == 'asc')
|
||||
{
|
||||
$show = "<a href=\"index.php?module=achivements-ranks&order=desc\" />{$lang->showdesctable}</a>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$show = "<a href=\"index.php?module=achivements-ranks&order=asc\" />{$lang->showasctable}</a>";
|
||||
}
|
||||
$table->output("<div style=\"float:right;\">$show</div>".$lang->ranks);
|
||||
echo multipage($quantity, (int)$perpage, (int)$pagina, $pageurl);
|
||||
}
|
||||
|
||||
function form_new_rank()
|
||||
{
|
||||
global $mybb, $page, $lang, $db;
|
||||
|
||||
$achivements = achivements_get();
|
||||
$posts = array();
|
||||
$threads = array();
|
||||
$reputation = array();
|
||||
$timeonline = array();
|
||||
$regdate = array();
|
||||
|
||||
$posts[0] = $lang->none;
|
||||
$threads[0] = $lang->none;
|
||||
$reputation[0] = $lang->none;
|
||||
$timeonline[0] = $lang->none;
|
||||
$regdate[0] = $lang->none;
|
||||
|
||||
if($achivements)
|
||||
{
|
||||
foreach($achivements['apid'] as $apid => $achivement)
|
||||
{
|
||||
$posts[$achivement['apid']] = $achivement['name'];
|
||||
}
|
||||
foreach($achivements['atid'] as $atid => $achivement)
|
||||
{
|
||||
$threads[$achivement['atid']] = $achivement['name'];
|
||||
}
|
||||
foreach($achivements['arid'] as $arid => $achivement)
|
||||
{
|
||||
$reputation[$achivement['arid']] = $achivement['name'];
|
||||
}
|
||||
foreach($achivements['toid'] as $toid => $achivement)
|
||||
{
|
||||
$timeonline[$achivement['toid']] = $achivement['name'];
|
||||
}
|
||||
foreach($achivements['rgid'] as $rgid => $achivement)
|
||||
{
|
||||
$regdate[$achivement['rgid']] = $achivement['name'];
|
||||
}
|
||||
}
|
||||
$form = new Form("index.php?module=achivements-ranks&action=new", "post", "save",1);
|
||||
$form_container = new FormContainer($lang->newrank);
|
||||
$form_container->output_row($lang->nameofrank."<em>*</em>", $lang->nameofrankdes, $form->generate_text_box('name', $mybb->input['name'], array('id' => 'name')), 'name');
|
||||
$form_container->output_row($lang->descriptionofrank."<em>*</em>", $lang->descriptionofrankdes, $form->generate_text_area('description', $mybb->input['description'], array('id' => 'description')), 'description');
|
||||
$form_container->output_row($lang->posts."<em>*</em>", $lang->newrankpostsdes, $form->generate_select_box("posts", $posts, $mybb->input['posts'], array('id' => 'posts')), 'posts');
|
||||
$form_container->output_row($lang->threads."<em>*</em>", $lang->newrankthreadsdes, $form->generate_select_box("threads", $threads, $mybb->input['threads'], array('id' => 'threads')), 'threads');
|
||||
$form_container->output_row($lang->reputation."<em>*</em>", $lang->newrankreputationdes, $form->generate_select_box("reputation", $reputation, $mybb->input['reputation'], array('id' => 'reputation')), 'reputation');
|
||||
$form_container->output_row($lang->timeonline."<em>*</em>", $lang->newranktimeonlinedes, $form->generate_select_box("timeonline", $timeonline, $mybb->input['timeonline'], array('id' => 'timeonline')), 'timeonline');
|
||||
$form_container->output_row($lang->regdate."<em>*</em>", $lang->newrankregdatedes, $form->generate_select_box("regdate", $regdate, $mybb->input['regdate'], array('id' => 'regdate')), 'regdate');
|
||||
$form_container->output_row($lang->image,$lang->imagedesnewrank, $form->generate_file_upload_box("image", array('style' => 'width: 310px;')), 'file');
|
||||
$form_container->output_row($lang->level."<em>*</em>", $lang->levelnewrank, $form->generate_text_box('level', $mybb->input['level'], array('id' => 'level')), 'level');
|
||||
$form_container->end();
|
||||
|
||||
$buttons[] = $form->generate_submit_button($lang->save, array('name' => 'save'));
|
||||
$form->output_submit_wrapper($buttons);
|
||||
$form->end();
|
||||
$page->output_footer();
|
||||
}
|
||||
|
||||
function form_edit_rank($id)
|
||||
{
|
||||
global $mybb, $page, $lang, $db;
|
||||
$rank = get_rank($id);
|
||||
$achivements = achivements_get();
|
||||
$posts = array();
|
||||
$threads = array();
|
||||
$reputation = array();
|
||||
$timeonline = array();
|
||||
$regdate = array();
|
||||
|
||||
$posts[0] = $lang->none;
|
||||
$threads[0] = $lang->none;
|
||||
$reputation[0] = $lang->none;
|
||||
$timeonline[0] = $lang->none;
|
||||
$regdate[0] = $lang->none;
|
||||
|
||||
foreach($achivements['apid'] as $apid => $achivement)
|
||||
{
|
||||
$posts[$achivement['apid']] = $achivement['name'];
|
||||
}
|
||||
foreach($achivements['atid'] as $atid => $achivement)
|
||||
{
|
||||
$threads[$achivement['atid']] = $achivement['name'];
|
||||
}
|
||||
foreach($achivements['arid'] as $arid => $achivement)
|
||||
{
|
||||
$reputation[$achivement['arid']] = $achivement['name'];
|
||||
}
|
||||
foreach($achivements['toid'] as $toid => $achivement)
|
||||
{
|
||||
$timeonline[$achivement['toid']] = $achivement['name'];
|
||||
}
|
||||
foreach($achivements['rgid'] as $rgid => $achivement)
|
||||
{
|
||||
$regdate[$achivement['rgid']] = $achivement['name'];
|
||||
}
|
||||
$form = new Form("index.php?module=achivements-ranks&action=edit&rid=$rank[rid]", "post", "save",1);
|
||||
$form_container = new FormContainer($lang->newrank);
|
||||
echo $form->generate_hidden_field("rid", $rank['rid']);
|
||||
echo $form->generate_hidden_field("imageactual", $rank['image']);
|
||||
$form_container->output_row($lang->nameofrank."<em>*</em>", $lang->nameofrankdes, $form->generate_text_box('name', $rank['name'], array('id' => 'name')), 'name');
|
||||
$form_container->output_row($lang->descriptionofrank."<em>*</em>", $lang->descriptionofrankdes, $form->generate_text_area('description', $rank['description'], array('id' => 'description')), 'description');
|
||||
$form_container->output_row($lang->posts."<em>*</em>", $lang->newrankpostsdes, $form->generate_select_box("posts", $posts, $rank['apid'], array('id' => 'posts')), 'posts');
|
||||
$form_container->output_row($lang->threads."<em>*</em>", $lang->newrankthreadsdes, $form->generate_select_box("threads", $threads, $rank['atid'], array('id' => 'threads')), 'threads');
|
||||
$form_container->output_row($lang->reputation."<em>*</em>", $lang->newrankreputationdes, $form->generate_select_box("reputation", $reputation, $rank['arid'], array('id' => 'reputation')), 'reputation');
|
||||
$form_container->output_row($lang->timeonline."<em>*</em>", $lang->newranktimeonlinedes, $form->generate_select_box("timeonline", $timeonline, $rank['toid'], array('id' => 'timeonline')), 'timeonline');
|
||||
$form_container->output_row($lang->regdate."<em>*</em>", $lang->newrankregdatedes, $form->generate_select_box("regdate", $regdate, $rank['rgid'], array('id' => 'regdate')), 'regdate');
|
||||
$form_container->output_row($lang->imageactual,$lang->imageactualdes, "<img src='../".$rank['image']."' />", 'imageactual_des');
|
||||
$form_container->output_row($lang->image,$lang->imagedesnewrank, $form->generate_file_upload_box("image", array('style' => 'width: 310px;')), 'file');
|
||||
$form_container->output_row($lang->level."<em>*</em>", $lang->levelnewrank, $form->generate_text_box('level', $rank['level'], array('id' => 'level')), 'level');
|
||||
$form_container->end();
|
||||
|
||||
$buttons[] = $form->generate_submit_button($lang->save, array('name' => 'save'));
|
||||
$form->output_submit_wrapper($buttons);
|
||||
$form->end();
|
||||
$page->output_footer();
|
||||
}
|
||||
|
||||
|
||||
?>
|
41
forumplugins/plugins/achivements/extensions/ranks/hooks.php
Normal file
41
forumplugins/plugins/achivements/extensions/ranks/hooks.php
Normal file
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: hooks.php 2012-04-29 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
// Disallow direct access to this file for security reasons
|
||||
|
||||
if(!defined("IN_MYBB"))
|
||||
{
|
||||
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
|
||||
}
|
||||
|
||||
$plugins->add_hook("postbit", "postbit_extension_rank");
|
||||
$plugins->add_hook("member_profile_end", "profile_extension_rank");
|
||||
|
||||
function postbit_extension_rank(&$post)
|
||||
{
|
||||
global $db, $templates, $lang;
|
||||
extensions_lang('ranks');
|
||||
$query = $db->simple_select("ranks", '*', "rid='".$post['rank']."'");
|
||||
$rank = $db->fetch_array($query);
|
||||
eval("\$post['rankpostbit'] = \"".$templates->get("ranks_postbit")."\";");
|
||||
}
|
||||
|
||||
function profile_extension_rank()
|
||||
{
|
||||
global $mybb, $templates, $rankprofile, $theme, $memprofile, $db, $lang;
|
||||
extensions_lang('ranks');
|
||||
$lang->rankby = $lang->sprintf($lang->rankby, $memprofile['username']);
|
||||
$query = $db->simple_select("ranks", '*', "rid='".$memprofile['rank']."'");
|
||||
$rank = $db->fetch_array($query);
|
||||
eval("\$rankprofile = \"".$templates->get("ranks_profile")."\";");
|
||||
}
|
||||
|
||||
?>
|
160
forumplugins/plugins/achivements/extensions/ranks/plugin.php
Normal file
160
forumplugins/plugins/achivements/extensions/ranks/plugin.php
Normal file
|
@ -0,0 +1,160 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: plugin.php 2012-04-29 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
// Disallow direct access to this file for security reasons
|
||||
|
||||
if(!defined("IN_MYBB"))
|
||||
{
|
||||
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
|
||||
}
|
||||
|
||||
function information_extension_rank()
|
||||
{
|
||||
global $lang;
|
||||
|
||||
extensions_lang('ranks');
|
||||
|
||||
return array(
|
||||
'name' => 'Ranks',
|
||||
'description' => $lang->ranks_plug_description,
|
||||
'version' => '1.0',
|
||||
'website' => 'http://www.mybb-es.com/',
|
||||
'author' => 'Edson Ordaz',
|
||||
'authorsite' => 'http://www.mybb-es.com/',
|
||||
'achivements' => '*',
|
||||
'admin_icon' => 'inc/plugins/achivements/extensions/ranks/ranks.png'
|
||||
);
|
||||
}
|
||||
|
||||
function active_extension_rank()
|
||||
{
|
||||
global $db, $lang;
|
||||
extensions_lang('ranks');
|
||||
$collation = $db->build_create_table_collation();
|
||||
if(!$db->table_exists('ranks'))
|
||||
{
|
||||
$db->query("CREATE TABLE IF NOT EXISTS `".TABLE_PREFIX."ranks` (
|
||||
`rid` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(50) NOT NULL DEFAULT '',
|
||||
`description` TEXT NOT NULL,
|
||||
`apid` int(10) NOT NULL DEFAULT 0,
|
||||
`atid` int(10) NOT NULL DEFAULT 0,
|
||||
`arid` int(10) NOT NULL DEFAULT 0,
|
||||
`toid` int(10) NOT NULL DEFAULT 0,
|
||||
`rgid` int(10) NOT NULL DEFAULT 0,
|
||||
`image` varchar(250) NOT NULL DEFAULT '',
|
||||
`level` int(10) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`rid`)
|
||||
) ENGINE=MyISAM{$collation}");
|
||||
}
|
||||
if(!$db->field_exists("rank", "users"))
|
||||
{
|
||||
$db->add_column("users", "rank", "int(10) unsigned NOT NULL default '0'");
|
||||
}
|
||||
|
||||
require_once MYBB_ROOT."inc/plugins/achivements/extensions/ranks/task.php";
|
||||
if(!file_exists(MYBB_ROOT."inc/tasks/ranks.php"))
|
||||
{
|
||||
create_task();
|
||||
}else{
|
||||
create_task_tools();
|
||||
}
|
||||
|
||||
extensions_add_template('ranks', '<html>
|
||||
<head>
|
||||
<title>{$mybb->settings[\'bbname\']} - {$lang->listranks}</title>
|
||||
{$headerinclude}
|
||||
</head>
|
||||
<body>
|
||||
{$header}
|
||||
<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
|
||||
<tr>
|
||||
<td class="thead" colspan="8">
|
||||
<strong>{$lang->listranks}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tcat" width="5%" align="center"><strong>{$lang->image}</strong></td>
|
||||
<td class="tcat"><strong>{$lang->namedes}</strong></td>
|
||||
<td class="tcat" width="5%" align="center"><strong>{$lang->posts}</strong></td>
|
||||
<td class="tcat" width="5%" align="center"><strong>{$lang->threads}</strong></td>
|
||||
<td class="tcat" width="5%" align="center"><strong>{$lang->reputation}</strong></td>
|
||||
<td class="tcat" width="15%" align="center"><strong>{$lang->timeonline}</strong></td>
|
||||
<td class="tcat" width="15%" align="center"><strong>{$lang->regdate}</strong></td>
|
||||
<td class="tcat" width="5%" align="center"><strong>{$lang->level}</strong></td>
|
||||
</tr>
|
||||
{$ranks}
|
||||
</table>
|
||||
{$footer}
|
||||
</body>
|
||||
</html>');
|
||||
extensions_add_template('ranks_list', '<tr>
|
||||
<td class="{$trow}" align="center"><img src="{$rank[\'image\']}" /></td>
|
||||
<td class="{$trow}"><strong>{$rank[\'name\']}</strong><br /><span class="smalltext">{$rank[\'description\']}</span></td>
|
||||
<td class="{$trow}" align="center">{$rank[\'posts\']}</td>
|
||||
<td class="{$trow}" align="center">{$rank[\'threads\']}</td>
|
||||
<td class="{$trow}" align="center">{$rank[\'reputation\']}</td>
|
||||
<td class="{$trow}" align="center">{$timeonline}</td>
|
||||
<td class="{$trow}" align="center">{$regdate}</td>
|
||||
<td class="{$trow}" align="center">{$rank[\'level\']}</td>
|
||||
</tr>');
|
||||
extensions_add_template('ranks_postbit', '<br />{$lang->rank}: <img src="{$rank[\'image\']}" alt="{$rank[\'name\']}" title="{$rank[\'name\']}" /><br />');
|
||||
extensions_add_template('ranks_profile', '<br />
|
||||
<table id="achivements" border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
|
||||
<tr>
|
||||
<td class="thead" colspan="2"><strong>{$lang->rankby}</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="trow1" width="10%">
|
||||
<img src="{$rank[\'image\']}" alt="{$rank[\'name\']}" title="{$rank[\'name\']}" />
|
||||
</td>
|
||||
<td class="trow1" valign="top" align="left">
|
||||
<strong>{$rank[\'name\']}</strong><br /><span class="smalltext">{$rank[\'description\']}</span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>');
|
||||
|
||||
require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
|
||||
find_replace_templatesets('member_profile', '#{\$profilefields}#', '{\$profilefields}<!-- profile_rank -->{\$rankprofile}<!-- /profile_rank -->');
|
||||
find_replace_templatesets('postbit', '#'.preg_quote('{$post[\'user_details\']}').'#', "{\$post['user_details']}<!-- postbit_rank -->{\$post['rankpostbit']}<!-- /postbit_rank -->");
|
||||
find_replace_templatesets('postbit_classic', '#'.preg_quote('{$post[\'user_details\']}').'#', "{\$post['user_details']}<!-- postbit_rank -->{\$post['rankpostbit']}<!-- /postbit_rank -->");
|
||||
}
|
||||
|
||||
function deactivate_rank_extension()
|
||||
{
|
||||
global $db;
|
||||
$query = $db->simple_select('ranks');
|
||||
while($ranks = $db->fetch_array($query))
|
||||
{
|
||||
$delete_images = @unlink(MYBB_ROOT.$ranks['image']);
|
||||
}
|
||||
if($db->table_exists('ranks'))
|
||||
{
|
||||
$db->drop_table('ranks');
|
||||
}
|
||||
if($db->field_exists("rank", "users"))
|
||||
{
|
||||
$db->drop_column("users", "rank");
|
||||
}
|
||||
$db->delete_query("datacache", "title='ranks'");
|
||||
extensions_remove_templates("'ranks', 'ranks_list', 'ranks_postbit', 'ranks_profile'");
|
||||
|
||||
$db->delete_query('tasks', 'file=\'ranks\'');
|
||||
if(file_exists(MYBB_ROOT."inc/tasks/ranks.php"))
|
||||
{
|
||||
@unlink(MYBB_ROOT.'inc/tasks/ranks.php');
|
||||
}
|
||||
|
||||
require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
|
||||
find_replace_templatesets('member_profile', '#\<!--\sprofile_rank\s--\>(.+)\<!--\s/profile_rank\s--\>#is', '', 0);
|
||||
find_replace_templatesets('postbit', '#\<!--\spostbit_rank\s--\>(.+)\<!--\s/postbit_rank\s--\>#is', '', 0);
|
||||
find_replace_templatesets('postbit_classic', '#\<!--\spostbit_rank\s--\>(.+)\<!--\s/postbit_rank\s--\>#is', '', 0);
|
||||
}
|
||||
?>
|
BIN
forumplugins/plugins/achivements/extensions/ranks/ranks.png
Normal file
BIN
forumplugins/plugins/achivements/extensions/ranks/ranks.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 868 B |
135
forumplugins/plugins/achivements/extensions/ranks/task.php
Normal file
135
forumplugins/plugins/achivements/extensions/ranks/task.php
Normal file
|
@ -0,0 +1,135 @@
|
|||
<?php
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: task.php 2012-04-15 10:58Z EdsonOrdaz $
|
||||
*/
|
||||
|
||||
if(!defined("IN_MYBB"))
|
||||
{
|
||||
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
|
||||
}
|
||||
|
||||
function create_task()
|
||||
{
|
||||
$file = fopen(MYBB_ROOT."inc/tasks/ranks.php", 'w');
|
||||
fwrite($file, task());
|
||||
fclose($file);
|
||||
}
|
||||
|
||||
function create_task_tools()
|
||||
{
|
||||
global $db, $lang;
|
||||
$lang->load('ranks');
|
||||
$new_task_ranks = array(
|
||||
"title" => "Ranks",
|
||||
"description" => $lang->ranks_plug_description,
|
||||
"file" => "ranks",
|
||||
"minute" => '0',
|
||||
"hour" => '0',
|
||||
"day" => '*',
|
||||
"month" => '*',
|
||||
"weekday" => '*',
|
||||
"nextrun" => TIME_NOW + (1*24*60*60),
|
||||
"enabled" => '1',
|
||||
"logging" => '1'
|
||||
);
|
||||
$db->insert_query("tasks", $new_task_ranks);
|
||||
}
|
||||
|
||||
function task()
|
||||
{
|
||||
$task = <<<TASK_RANKS
|
||||
<?php
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 Edson Ordaz, All Rights Reserved
|
||||
*
|
||||
* Email: nicedo_eeos@hotmail.com
|
||||
* WebSite: http://www.mybb-es.com
|
||||
*
|
||||
* \$Id: ranks.php 2012-05-16Z Edson Ordaz \$
|
||||
*/
|
||||
|
||||
function task_ranks(\$task)
|
||||
{
|
||||
global \$db, \$mybb, \$lang;
|
||||
require_once MYBB_ROOT."inc/plugins/achivements.php";
|
||||
\$ranks = array();
|
||||
\$query = \$db->simple_select("ranks", '*', '', array('order_by' => 'level', 'order_dir' => 'desc'));
|
||||
while(\$rank = \$db->fetch_array(\$query))
|
||||
{
|
||||
\$ranks[\$rank['rid']] = \$rank;
|
||||
}
|
||||
\$db->free_result(\$query);
|
||||
|
||||
\$users = array();
|
||||
\$taskusersoffline = '';
|
||||
if(\$mybb->settings['achivements_taskuseroffline'] == 0)
|
||||
{
|
||||
\$taskusersoffline = "lastactive >= '{\$task['lastrun']}'";
|
||||
}
|
||||
\$query = \$db->simple_select("users", "*", \$taskusersoffline);
|
||||
while(\$user = \$db->fetch_array(\$query))
|
||||
{
|
||||
\$users[\$user['uid']] = \$user;
|
||||
}
|
||||
\$countusers = 0;
|
||||
\$achivements = achivements_get();
|
||||
foreach(\$users as \$uid => \$user)
|
||||
{
|
||||
\$logros = @unserialize(\$user['achivements']);
|
||||
\$error = 0;
|
||||
\$rid = 0;
|
||||
foreach(\$ranks as \$rank)
|
||||
{
|
||||
if(\$logros['apid'][\$rank['apid']]['apid'] != \$achivements['apid'][\$rank['apid']]['apid'])
|
||||
{
|
||||
++\$error;
|
||||
}
|
||||
if(\$logros['atid'][\$rank['atid']]['atid'] != \$achivements['atid'][\$rank['atid']]['atid'])
|
||||
{
|
||||
++\$error;
|
||||
}
|
||||
if(\$logros['arid'][\$rank['arid']]['arid'] != \$achivements['arid'][\$rank['arid']]['arid'])
|
||||
{
|
||||
++\$error;
|
||||
}
|
||||
if(\$logros['toid'][\$rank['toid']]['toid'] != \$achivements['toid'][\$rank['toid']]['toid'])
|
||||
{
|
||||
++\$error;
|
||||
}
|
||||
if(\$logros['rgid'][\$rank['rgid']]['rgid'] != \$achivements['rgid'][\$rank['rgid']]['rgid'])
|
||||
{
|
||||
++\$error;
|
||||
}
|
||||
if(\$error == 0)
|
||||
{
|
||||
\$rid = intval(\$rank['rid']);
|
||||
break;
|
||||
}
|
||||
elseif(\$error > 0)
|
||||
{
|
||||
\$error = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if(\$error == 0)
|
||||
{
|
||||
\$db->update_query('users', array('rank' => \$rid), 'uid=\''.\$uid.'\'');
|
||||
++\$countusers;
|
||||
}
|
||||
}
|
||||
\$lang->tasklogranks = \$lang->sprintf('have been changed to {1} users range', \$countusers);
|
||||
add_task_log(\$task, \$lang->tasklogranks);
|
||||
}
|
||||
?>
|
||||
TASK_RANKS;
|
||||
create_task_tools();
|
||||
return $task;
|
||||
}
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue