Initial commit
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
|
@ -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
|
@ -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
|
@ -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
|
@ -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
After Width: | Height: | Size: 868 B |
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;
|
||||
}
|
||||
|
||||
?>
|
425
forumplugins/plugins/achivements/include/hooks.php
Normal file
|
@ -0,0 +1,425 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: hooks.php 2013-08-20 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.");
|
||||
}
|
||||
|
||||
$plugins->add_hook("member_profile_end", "profile_achivements");
|
||||
$plugins->add_hook("postbit", "postbit_achivements");
|
||||
$plugins->add_hook("usercp_start", "usercp_achivements");
|
||||
$plugins->add_hook("modcp_start", "modcp_achivements");
|
||||
|
||||
function postbit_achivements(&$post)
|
||||
{
|
||||
global $templates, $mybb, $lang;
|
||||
$lang->load("achivements", false, true);
|
||||
static $static_achievements;
|
||||
$post['achivements'] = getarchivements($post['uid']);
|
||||
if (!$post['achivements'])
|
||||
{
|
||||
$achivements = $lang->notachivements;
|
||||
}
|
||||
else
|
||||
{
|
||||
$num_achiviements = 0;
|
||||
foreach($post['achivements'] as $column => $logro)
|
||||
{
|
||||
if($logro['showpostbit'] == 1)
|
||||
{
|
||||
++$num_achiviements;
|
||||
$achivements .= "<img src=\"".htmlspecialchars_uni($logro['image'])."\" title=\"".htmlspecialchars_uni($logro['name'])."\" /> ";
|
||||
if ($num_achiviements >= $mybb->settings['achivements_maxpostbit'])
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($num_achiviements >= $mybb->settings['achivements_maxpostbit'])
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
if(!$achivements)
|
||||
{
|
||||
$achivements = $lang->achshide;
|
||||
}
|
||||
}
|
||||
if($mybb->settings['achivements_showachvpostbit'] == 1)
|
||||
{
|
||||
eval("\$post['achivementspostbit'] = \"".$templates->get("achivements_postbit")."\";");
|
||||
}
|
||||
}
|
||||
|
||||
function profile_achivements()
|
||||
{
|
||||
global $mybb, $memprofile, $templates, $lang, $theme, $achivements, $achivementsprofile;
|
||||
$lang->load("achivements", false, true);
|
||||
$memprofile['achivements'] = getarchivements($memprofile['uid']);
|
||||
|
||||
if(!$memprofile['achivements'])
|
||||
{
|
||||
$lang->achisemptytableprofile = $lang->sprintf($lang->achisemptytableprofile, $memprofile['username']);
|
||||
$achivements = $lang->achisemptytableprofile;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
foreach($memprofile['achivements'] as $archivement)
|
||||
{
|
||||
if($archivement['showprofile'] == 1)
|
||||
{
|
||||
$achivements .= "<img src=\"".htmlspecialchars_uni($archivement['image'])."\" title=\"".htmlspecialchars_uni($archivement['name'])."\" /> ";
|
||||
}
|
||||
}
|
||||
if(!$achivements)
|
||||
{
|
||||
$lang->achishidetableprofile = $lang->sprintf($lang->achishidetableprofile, $memprofile['username']);
|
||||
$achivements = $lang->achishidetableprofile;
|
||||
}
|
||||
}
|
||||
$lang->achsmemprofile = $lang->sprintf($lang->achsmemprofile, $memprofile['username']);
|
||||
if($mybb->settings['achivements_showachvprofile'] == 1)
|
||||
{
|
||||
eval("\$achivementsprofile = \"".$templates->get("achivements_profile")."\";");
|
||||
}
|
||||
}
|
||||
|
||||
function usercp_achivements()
|
||||
{
|
||||
global $mybb,$db,$templates,$theme,$lang,$headerinclude,$header,$footer,$usercpnav;
|
||||
if($mybb->input['action'] != "achivements" && $mybb->input['action'] != "do_achivements")
|
||||
{
|
||||
return;
|
||||
}
|
||||
if($mybb->input['action'] == "do_achivements" && $mybb->request_method == "post")
|
||||
{
|
||||
verify_post_check($mybb->input['my_post_key']);
|
||||
$mybb->user['achivements'] = getarchivements($mybb->user['uid']);
|
||||
if($mybb->input['profile'])
|
||||
{
|
||||
$db->update_query('user_achivements', array('showprofile' => 0), '`uid`='.$mybb->user['uid']);
|
||||
if($mybb->input['showachivement'])
|
||||
{
|
||||
foreach($mybb->input['showachivement'] as $achs)
|
||||
{
|
||||
$db->update_query('user_achivements', array('showprofile' => 1), '`uid`='.$mybb->user['uid'].' AND `aid`='.$achs);
|
||||
}
|
||||
}
|
||||
}
|
||||
if($mybb->input['postbit'])
|
||||
{
|
||||
$db->update_query('user_achivements', array('showpostbit' => 0), '`uid`='.$mybb->user['uid']);
|
||||
if($mybb->input['showachivement'])
|
||||
{
|
||||
$count = 0;
|
||||
foreach($mybb->input['showachivement'] as $achs)
|
||||
{
|
||||
$db->update_query('user_achivements', array('showpostbit' => 1), '`uid`='.$mybb->user['uid'].' AND `aid`='.$achs);
|
||||
++$count;
|
||||
if($count >= $mybb->settings['achivements_maxpostbit'])
|
||||
break;
|
||||
else
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
redirect("usercp.php", $lang->redirect_profileupdated);
|
||||
}
|
||||
if($errors)
|
||||
{
|
||||
$errors = inline_error($errors);
|
||||
}
|
||||
$lang->load("achivements", false, true);
|
||||
add_breadcrumb($lang->nav_usercp, "usercp.php");
|
||||
add_breadcrumb($lang->achivements, "usercp.php");
|
||||
|
||||
static $static_achievements;
|
||||
$mybb->user['achivements'] = getarchivements($mybb->user['uid']);
|
||||
|
||||
if(!$mybb->user['achivements'])
|
||||
{
|
||||
$achivements = "<span class='smalltext'>{$lang->achisemptytableprofileusercp}</span>";
|
||||
$currentachivements = "<span class='smalltext'>{$lang->achisemptytableprofileusercp}</span>";
|
||||
$currentachivementspostbit = "<span class='smalltext'>{$lang->achisemptytableprofileusercp}</span>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$intshow = 0;
|
||||
$intshowpostbit = 0;
|
||||
$currentachivements = "<small>{$lang->achivementsshowprofilecurrent}</small><br />";
|
||||
$lang->achivementsshowpostbitcurrent = $lang->sprintf($lang->achivementsshowpostbitcurrent, $mybb->settings['achivements_maxpostbit']);
|
||||
$currentachivementspostbit = "<small>{$lang->achivementsshowpostbitcurrent}</small><br />";
|
||||
|
||||
|
||||
$countachs = 1;
|
||||
$postbit = 0;
|
||||
//die(var_dump($mybb->user['achivements']));
|
||||
foreach($mybb->user['achivements'] as $archivement)
|
||||
{
|
||||
if($archivement['showprofile'] == 1)
|
||||
{
|
||||
$intshow = 1;
|
||||
$currentachivements .= "<img src=\"".htmlspecialchars_uni($archivement['image'])."\" title=\"".htmlspecialchars_uni($archivement['name'])."\" /> ";
|
||||
}
|
||||
if($archivement['showpostbit'] == 1 && $postbit == 0)
|
||||
{
|
||||
$intshowpostbit = 1;
|
||||
$currentachivementspostbit .= "<img src=\"".htmlspecialchars_uni($archivement['image'])."\" title=\"".htmlspecialchars_uni($archivement['name'])."\" /> ";
|
||||
if($countachs >= intval($mybb->settings['achivements_maxpostbit']))
|
||||
{
|
||||
$postbit = 1;
|
||||
}else{
|
||||
$postbit = 0;
|
||||
}
|
||||
++$countachs;
|
||||
}
|
||||
}
|
||||
|
||||
if($intshowpostbit == 0)
|
||||
{
|
||||
$currentachivementspostbit = "<small>{$lang->notachshowpostbit}</small>";
|
||||
}
|
||||
if($intshow == 0)
|
||||
{
|
||||
$currentachivements = "<small>{$lang->notachshowprofile}</small>";
|
||||
}
|
||||
foreach($mybb->user['achivements'] as $ach)
|
||||
{
|
||||
$achivement .= "<img src=\"".htmlspecialchars_uni($ach['image'])."\" title=\"".htmlspecialchars_uni($ach['name'])."\" /> ";
|
||||
eval("\$achivements .= \"".$templates->get("achivements_usercp_all")."\";");
|
||||
unset($achivement);
|
||||
}
|
||||
}
|
||||
eval("\$achivementsusercp = \"".$templates->get("achivements_usercp")."\";");
|
||||
output_page($achivementsusercp);
|
||||
}
|
||||
|
||||
function modcp_achivements()
|
||||
{
|
||||
global $templates, $modcp_nav, $lang, $mybb, $db;
|
||||
global $headerinclude, $header, $errors, $theme, $cache, $footer;
|
||||
$lang->load("achivements", false, true);
|
||||
$lang->load("admin/achivements", false, true);
|
||||
|
||||
if($mybb->settings['achivements_modcp'] == 1)
|
||||
{
|
||||
eval("\$nav_achivements = \"".$templates->get("achivements_modcp_nav")."\";");
|
||||
$modcp_nav = str_replace('<!--modcp_achivements-->', $nav_achivements, $modcp_nav);
|
||||
}
|
||||
|
||||
if($mybb->input['action'] == "achivements" && $mybb->usergroup['canmodcp'] == 1 && $mybb->settings['achivements_modcp'] == 1)
|
||||
{
|
||||
add_breadcrumb($lang->nav_modcp, "modcp.php");
|
||||
add_breadcrumb($lang->achivements, 'modcp.php?action=achivements');
|
||||
if($mybb->input['mod'] == "give")
|
||||
{
|
||||
$query = $db->simple_select('achivements_custom', '*', "acid='".intval($mybb->input['acid'])."'");
|
||||
$custom = $db->fetch_array($query);
|
||||
if(!$custom['acid'])
|
||||
{
|
||||
error_no_permission();
|
||||
}
|
||||
if($custom['modcp'] == 0)
|
||||
{
|
||||
error_no_permission();
|
||||
}
|
||||
if($mybb->request_method == "post")
|
||||
{
|
||||
$query = $db->simple_select("users", '*', "username='".$db->escape_string($mybb->input['username'])."'");
|
||||
$user = $db->fetch_array($query);
|
||||
if(!$user['uid'])
|
||||
{
|
||||
error_no_permission();
|
||||
}
|
||||
$achivements = unserialize($user['achivements']);
|
||||
$acid = intval($custom['acid']);
|
||||
|
||||
if(!empty($achivements['acid'][$acid]['acid']))
|
||||
{
|
||||
$lang->repeatcustom = $lang->sprintf($lang->repeatcustom, $user['username'], $custom['name']);
|
||||
redirect("modcp.php?action=achivements", $lang->repeatcustom);
|
||||
}
|
||||
|
||||
$achivements['acid'][$acid] = array('acid' => $acid, 'name' => $db->escape_string($custom['name']), 'image' => $db->escape_string($custom['image']), 'showprofile' => 1, 'showpostbit' => 0);
|
||||
|
||||
$updateuser = array(
|
||||
'achivements' => serialize($achivements)
|
||||
);
|
||||
|
||||
$lang->successachcustom = $lang->sprintf($lang->successachcustom, $custom['name'], $user['username']);
|
||||
$db->update_query("users", $updateuser,"uid=".$user['uid']);
|
||||
|
||||
$add = array(
|
||||
'user' => $mybb->user['uid'],
|
||||
'give' => $user['uid'],
|
||||
'dateline' => TIME_NOW,
|
||||
'log' => 'give',
|
||||
'acid' => $custom['acid'],
|
||||
'ipaddress' => get_ip()
|
||||
);
|
||||
$add = serialize($add);
|
||||
add_log_custom_modcp($add);
|
||||
|
||||
require_once MYBB_ROOT."inc/plugins/achivements/include/mp.php";
|
||||
$sendmp = unserialize($mybb->settings['achivements_sendmp']);
|
||||
if($sendmp['custom'] == 1)
|
||||
{
|
||||
send_mp_achivement_new($user['uid'], 'custom', $custom['acid']);
|
||||
}
|
||||
|
||||
redirect("modcp.php?action=achivements", $lang->successachcustom);
|
||||
exit;
|
||||
}
|
||||
$lang->giveuserform = $lang->sprintf($lang->giveuserform, $custom['name']);
|
||||
eval("\$give = \"".$templates->get("achivements_modcp_give")."\";");
|
||||
output_page($give);
|
||||
exit;
|
||||
}
|
||||
elseif($mybb->input['mod'] == "quit")
|
||||
{
|
||||
$query = $db->simple_select('achivements_custom', '*', "acid='".intval($mybb->input['acid'])."'");
|
||||
$custom = $db->fetch_array($query);
|
||||
if(!$custom['acid'])
|
||||
{
|
||||
error_no_permission();
|
||||
}
|
||||
if($custom['modcp'] == 0)
|
||||
{
|
||||
error_no_permission();
|
||||
}
|
||||
if($mybb->request_method == "post")
|
||||
{
|
||||
$query = $db->simple_select("users", '*', "username='".$db->escape_string($mybb->input['username'])."'");
|
||||
$user = $db->fetch_array($query);
|
||||
if(!$user['uid'])
|
||||
{
|
||||
error_no_permission();
|
||||
}
|
||||
$achivements = unserialize($user['achivements']);
|
||||
$acid = intval($custom['acid']);
|
||||
|
||||
if(empty($achivements['acid'][$acid]['acid']))
|
||||
{
|
||||
$lang->notcustomuser = $lang->sprintf($lang->notcustomuser, $user['username'], $custom['name']);
|
||||
redirect("modcp.php?action=achivements", $lang->notcustomuser);
|
||||
}
|
||||
|
||||
unset($achivements['acid'][$acid]);
|
||||
if(empty($achivements['acid']))
|
||||
{
|
||||
unset($achivements['acid']);
|
||||
}
|
||||
|
||||
$updateuser = array(
|
||||
'achivements' => serialize($achivements)
|
||||
);
|
||||
$db->update_query("users", $updateuser,"uid=".$user['uid']);
|
||||
|
||||
$add = array(
|
||||
'user' => $mybb->user['uid'],
|
||||
'revoke' => $user['uid'],
|
||||
'dateline' => TIME_NOW,
|
||||
'log' => 'revoke',
|
||||
'acid' => $custom['acid'],
|
||||
'ipaddress' => get_ip()
|
||||
);
|
||||
$add = serialize($add);
|
||||
add_log_custom_modcp($add);
|
||||
|
||||
$lang->successachivementcustomdelete = $lang->sprintf($lang->successachivementcustomdelete, $user['username'], $custom['name']);
|
||||
redirect("modcp.php?action=achivements", $lang->successachivementcustomdelete);
|
||||
exit;
|
||||
}
|
||||
$lang->quitcustom = $lang->sprintf($lang->quitcustom, $custom['name']);
|
||||
eval("\$quit = \"".$templates->get("achivements_modcp_quit")."\";");
|
||||
output_page($quit);
|
||||
exit;
|
||||
}
|
||||
|
||||
$query = $db->simple_select('achivements_custom', '*', 'modcp="1"', array('order_by' => 'acid', 'order_dir' => 'DESC'));
|
||||
while($custom = $db->fetch_array($query))
|
||||
{
|
||||
$trow = alt_trow();
|
||||
eval("\$custom_achivements .= \"".$templates->get("achivements_modcp_list")."\";");
|
||||
}
|
||||
if(empty($custom_achivements))
|
||||
{
|
||||
$custom_achivements = "<tr><td class=\"trow1\" align=\"center\" colspan=\"10\">{$lang->emptycustom_modules}</td></tr>";
|
||||
}
|
||||
eval("\$modcpachivements = \"".$templates->get("achivements_modcp")."\";");
|
||||
output_page($modcpachivements);
|
||||
}
|
||||
}
|
||||
|
||||
function add_log_custom_modcp($log)
|
||||
{
|
||||
global $db, $lang;
|
||||
$log = unserialize($log);
|
||||
$user = get_user(intval($log['user']));
|
||||
//$custom = getcustom($log['acid']);
|
||||
|
||||
if($log['log'] == 'add')
|
||||
{
|
||||
$lang->logadd = $lang->sprintf($lang->logadd, $custom['name']);
|
||||
$loginsert = $lang->logadd;
|
||||
}
|
||||
elseif($log['log'] == 'quit')
|
||||
{
|
||||
$lang->logdelete = $lang->sprintf($lang->logdelete, $custom['name']);
|
||||
$loginsert = $lang->logdelete;
|
||||
}
|
||||
elseif($log['log'] == 'give')
|
||||
{
|
||||
$give = get_user($log['give']);
|
||||
$username = format_name($give['username'], $give['usergroup'], $give['displaygroup']);
|
||||
$profilelink = build_profile_link($username, $give['uid'], "_blank");
|
||||
$lang->loggive = $lang->sprintf($lang->loggive, $custom['name'], $profilelink);
|
||||
$loginsert = $lang->loggive;
|
||||
}
|
||||
elseif($log['log'] == 'revoke')
|
||||
{
|
||||
$revoke = get_user($log['revoke']);
|
||||
$username = format_name($revoke['username'], $revoke['usergroup'], $revoke['displaygroup']);
|
||||
$profilelink = build_profile_link($username, $revoke['uid'], "_blank");
|
||||
$lang->logrevoke = $lang->sprintf($lang->logrevoke, $custom['name'], $profilelink);
|
||||
$loginsert = $lang->logrevoke;
|
||||
}
|
||||
elseif($log['log'] == 'truncate')
|
||||
{
|
||||
$db->query("truncate ".TABLE_PREFIX."achivements_customlog");
|
||||
$loginsert = $lang->logtruncate;
|
||||
}
|
||||
|
||||
$lid = $db->insert_id();
|
||||
$updatelog = array(
|
||||
"lid" => $lid,
|
||||
"user" => intval($log['user']),
|
||||
"log" => $loginsert,
|
||||
"dateline" => intval($log['dateline']),
|
||||
"ipaddress" => $log['ipaddress']
|
||||
);
|
||||
$db->insert_query("achivements_customlog", $updatelog);
|
||||
}
|
||||
|
||||
function getarchivements($uid)
|
||||
{
|
||||
global $db;
|
||||
$query = $db->query("SELECT * FROM `".TABLE_PREFIX."achivements` a LEFT JOIN `".TABLE_PREFIX."user_achivements` ua ON ua.`aid`=a.`id` WHERE ua.uid='".intval($uid)."'");
|
||||
while($row = $db->fetch_array($query)){
|
||||
$custom[] = $row;
|
||||
}
|
||||
$db->free_result($query);
|
||||
return $custom;
|
||||
}
|
||||
?>
|
BIN
forumplugins/plugins/achivements/include/images/achivements.png
Normal file
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 607 B |
BIN
forumplugins/plugins/achivements/include/images/custom.png
Normal file
After Width: | Height: | Size: 690 B |
BIN
forumplugins/plugins/achivements/include/images/extensions.png
Normal file
After Width: | Height: | Size: 591 B |
BIN
forumplugins/plugins/achivements/include/images/modcp.png
Normal file
After Width: | Height: | Size: 690 B |
BIN
forumplugins/plugins/achivements/include/images/posts.png
Normal file
After Width: | Height: | Size: 647 B |
BIN
forumplugins/plugins/achivements/include/images/regdate.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
BIN
forumplugins/plugins/achivements/include/images/reputation.png
Normal file
After Width: | Height: | Size: 669 B |
BIN
forumplugins/plugins/achivements/include/images/threads.png
Normal file
After Width: | Height: | Size: 709 B |
BIN
forumplugins/plugins/achivements/include/images/timeonline.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
592
forumplugins/plugins/achivements/include/install.php
Normal file
|
@ -0,0 +1,592 @@
|
|||
<?php
|
||||
|
||||
if(!defined("IN_MYBB"))
|
||||
{
|
||||
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
|
||||
}
|
||||
|
||||
function delete_images_unlink()
|
||||
{
|
||||
global $db;
|
||||
$query = $db->simple_select('achivements');
|
||||
$delete_images = array();
|
||||
while($achivement_img = $db->fetch_array($query))
|
||||
{
|
||||
$delete_images[] = @unlink(MYBB_ROOT.$achivement_img['image']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$tables[] = array('name' => 'achivements', 'insert' => "CREATE TABLE IF NOT EXISTS `".TABLE_PREFIX."achivements` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(50) NOT NULL DEFAULT '',
|
||||
`description` varchar(200) NOT NULL DEFAULT '',
|
||||
`type` enum('post','threads','rep','time','regdate','custom','archivements'),
|
||||
`requirement` int(11) NOT NULL DEFAULT 0,
|
||||
`requirement_unit` varchar(20) NOT NULL DEFAULT 0,
|
||||
`required_achivements` TEXT NOT NULL DEFAULT '',
|
||||
`requirement_text` TEXT NOT NULL DEFAULT '',
|
||||
`modcp` tinyint(1) NOT NULL DEFAULT 0,
|
||||
`image` varchar(250) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM");
|
||||
|
||||
$tables[] = array('name' => 'user_achivements', 'insert' => "CREATE TABLE IF NOT EXISTS `".TABLE_PREFIX."user_achivements` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`uid` int(11) unsigned NOT NULL,
|
||||
`aid` int(11) unsigned NOT NULL,
|
||||
`showprofile` tinyint(1) unsigned NOT NULL DEFAULT 0,
|
||||
`showpostbit` tinyint(1) unsigned NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `uid` (`uid`),
|
||||
KEY `aid` (`aid`)
|
||||
) ENGINE=MyISAM");
|
||||
|
||||
$templates[] = array(
|
||||
"title" => 'achivements',
|
||||
"template" => $db->escape_string('<html>
|
||||
<head>
|
||||
<title>{$mybb->settings[\'bbname\']} - {$lang->achivements}</title>
|
||||
{$headerinclude}
|
||||
</head>
|
||||
<body>
|
||||
{$header}
|
||||
<table width="100%" border="0" align="center">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
|
||||
<tr>
|
||||
<td class="thead" colspan="4">
|
||||
<strong>{$lang->achivementsbyposts}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tcat" width="10%" align="center"><strong>{$lang->image}</strong></td>
|
||||
<td class="tcat" width="10%" align="center"><strong>{$lang->posts}</strong></td>
|
||||
<td class="tcat" width="20%"><strong>{$lang->name}</strong></td>
|
||||
<td class="tcat"><strong>{$lang->description}</strong></td>
|
||||
</tr>
|
||||
{$posts}
|
||||
</table>
|
||||
<br />
|
||||
<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
|
||||
<tr>
|
||||
<td class="thead" colspan="4">
|
||||
<strong>{$lang->achivementsbythreads}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tcat" width="10%" align="center"><strong>{$lang->image}</strong></td>
|
||||
<td class="tcat" width="10%" align="center"><strong>{$lang->threads}</strong></td>
|
||||
<td class="tcat" width="20%"><strong>{$lang->name}</strong></td>
|
||||
<td class="tcat"><strong>{$lang->description}</strong></td>
|
||||
</tr>
|
||||
{$threads}
|
||||
</table>
|
||||
<br />
|
||||
<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
|
||||
<tr>
|
||||
<td class="thead" colspan="4">
|
||||
<strong>{$lang->achivementsbyreputation}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tcat" width="10%" align="center"><strong>{$lang->image}</strong></td>
|
||||
<td class="tcat" width="10%" align="center"><strong>{$lang->reputation}</strong></td>
|
||||
<td class="tcat" width="20%"><strong>{$lang->name}</strong></td>
|
||||
<td class="tcat"><strong>{$lang->description}</strong></td>
|
||||
</tr>
|
||||
{$reputation}
|
||||
</table>
|
||||
<br />
|
||||
<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
|
||||
<tr>
|
||||
<td class="thead" colspan="4">
|
||||
<strong>{$lang->achivementsbytimeonline}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tcat" width="10%" align="center"><strong>{$lang->image}</strong></td>
|
||||
<td class="tcat" width="15%" align="center"><strong>{$lang->timeonline}</strong></td>
|
||||
<td class="tcat" width="20%"><strong>{$lang->name}</strong></td>
|
||||
<td class="tcat"><strong>{$lang->description}</strong></td>
|
||||
</tr>
|
||||
{$timeonline}
|
||||
</table>
|
||||
<br />
|
||||
<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
|
||||
<tr>
|
||||
<td class="thead" colspan="4">
|
||||
<strong>{$lang->achivementsbyregdate}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tcat" width="10%" align="center"><strong>{$lang->image}</strong></td>
|
||||
<td class="tcat" width="15%" align="center"><strong>{$lang->regdate}</strong></td>
|
||||
<td class="tcat" width="20%"><strong>{$lang->name}</strong></td>
|
||||
<td class="tcat"><strong>{$lang->description}</strong></td>
|
||||
</tr>
|
||||
{$regdate}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
|
||||
<tr>
|
||||
<td class="thead" colspan="4">
|
||||
<strong>{$lang->achivementscustom}</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tcat" width="10%" align="center"><strong>{$lang->image}</strong></td>
|
||||
<td class="tcat" width="15%" align="center"><strong>{$lang->requirement}</strong></td>
|
||||
<td class="tcat" width="20%"><strong>{$lang->name}</strong></td>
|
||||
<td class="tcat"><strong>{$lang->description}</strong></td>
|
||||
</tr>
|
||||
{$custom}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{$footer}
|
||||
</body>
|
||||
</html>'),
|
||||
"sid" => -1,
|
||||
"version" => 1604,
|
||||
"dateline" => TIME_NOW,
|
||||
);
|
||||
|
||||
$templates[] = array(
|
||||
"title" => 'achivements_empty',
|
||||
"template" => $db->escape_string('<tr><td class="trow1" colspan="4" align="center">{$lang->achiviementstableempty}</td></tr>'),
|
||||
"sid" => -1,
|
||||
"version" => 1604,
|
||||
"dateline" => TIME_NOW,
|
||||
);
|
||||
|
||||
$templates[] = array(
|
||||
"title" => 'achivements_list',
|
||||
"template" => $db->escape_string('<tr>
|
||||
<td class="{$color}" width="10%" align="center"><img src="{$achivements[\'image\']}" /></td>
|
||||
<td class="{$color}" width="10%" align="center">{$achivements[\'value\']}</td>
|
||||
<td class="{$color}" width="20%">{$achivements[\'name\']}</td>
|
||||
<td class="{$color}">{$achivements[\'description\']}</td>
|
||||
</tr>'),
|
||||
"sid" => -1,
|
||||
"version" => 1604,
|
||||
"dateline" => TIME_NOW,
|
||||
);
|
||||
|
||||
$templates[] = array(
|
||||
"title" => 'achivements_profile',
|
||||
"template" => $db->escape_string('<br />
|
||||
<table id="achivements" border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
|
||||
<tr>
|
||||
<td class="thead"><strong>{$lang->achsmemprofile}</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="trow1">
|
||||
{$achivements}
|
||||
</td>
|
||||
</tr>
|
||||
</table>'),
|
||||
"sid" => -1,
|
||||
"version" => 1604,
|
||||
"dateline" => TIME_NOW,
|
||||
);
|
||||
|
||||
$templates[] = array(
|
||||
"title" => 'achivements_postbit',
|
||||
"template" => $db->escape_string('{$lang->achivements}: {$achivements}'),
|
||||
"sid" => -1,
|
||||
"version" => 1604,
|
||||
"dateline" => TIME_NOW,
|
||||
);
|
||||
|
||||
//add templates v2.1
|
||||
$templates[] = array(
|
||||
"title" => 'achivements_usercp',
|
||||
"template" => $db->escape_string('<html>
|
||||
<head>
|
||||
<title>{$mybb->settings[\'bbname\']} - {$lang->achivements}</title>
|
||||
{$headerinclude}
|
||||
|
||||
<script languaje="javascript">
|
||||
function select_all_achivements(){
|
||||
for (i=0;i<document.achivements_form.elements.length;i++)
|
||||
if(document.achivements_form.elements[i].type == "checkbox")
|
||||
document.achivements_form.elements[i].checked=1
|
||||
}
|
||||
function unselect_all_achivements(){
|
||||
for (i=0;i<document.achivements_form.elements.length;i++)
|
||||
if(document.achivements_form.elements[i].type == "checkbox")
|
||||
document.achivements_form.elements[i].checked=0
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
{$header}
|
||||
<form method="post" name="achivements_form" enctype="multipart/form-data" action="usercp.php">
|
||||
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
|
||||
<table width="100%" border="0" align="center">
|
||||
<tr>
|
||||
{$usercpnav}
|
||||
<td valign="top">
|
||||
{$errors}
|
||||
<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
|
||||
<tr>
|
||||
<td class="thead"><strong>{$lang->achivements}</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tcat"><strong>{$lang->achivementscurrentprofile}</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="trow1">{$currentachivements}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tcat"><strong>{$lang->achivementscurrentpostbit}</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="trow1">{$currentachivementspostbit}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tcat"><strong>{$lang->myachivements}</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="trow2">
|
||||
<a href="javascript:select_all_achivements()"><small>{$lang->markall}</small></a> |
|
||||
<a href="javascript:unselect_all_achivements()"><small>{$lang->marknone}</small></a><br />
|
||||
{$achivements}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
<div align="center">
|
||||
<input type="hidden" name="action" value="do_achivements" />
|
||||
<input type="submit" class="button" name="profile" value="{$lang->showinprofile}" />
|
||||
<input type="submit" class="button" name="postbit" value="{$lang->showinpostbit}" />
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
{$footer}
|
||||
</body>
|
||||
</html>'),
|
||||
"sid" => -1,
|
||||
"version" => 1604,
|
||||
"dateline" => TIME_NOW,
|
||||
);
|
||||
|
||||
$templates[] = array(
|
||||
"title" => 'achivements_usercp_all',
|
||||
"template" => $db->escape_string('<label for="{$ach[\'name\']}"><input type="checkbox" name="showachivement[]" value="{$ach[\'id\']}" /> {$achivement}</label>'),
|
||||
"sid" => -1,
|
||||
"version" => 1604,
|
||||
"dateline" => TIME_NOW,
|
||||
);
|
||||
|
||||
$templates[] = array(
|
||||
"title" => 'achivements_modcp',
|
||||
"template" => $db->escape_string('<html>
|
||||
<head>
|
||||
<title>{$mybb->settings[\'bbname\']} - {$lang->achivements}</title>
|
||||
{$headerinclude}
|
||||
</head>
|
||||
<body>
|
||||
{$header}
|
||||
<table width="100%" border="0" align="center">
|
||||
<tr>
|
||||
{$modcp_nav}
|
||||
<td valign="top">
|
||||
<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
|
||||
<tr>
|
||||
<td class="thead" colspan="4"><strong>{$lang->custom_modules}</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tcat" width="10%" align="center"><span class="smalltext"><strong>{$lang->image}</strong></span>
|
||||
<td class="tcat"><span class="smalltext"><strong>{$lang->namedescription}</strong></span>
|
||||
<td class="tcat" width="20%" align="center" colspan="2"><span class="smalltext"><strong>{$lang->option}</strong></span>
|
||||
</td>
|
||||
<tr>
|
||||
{$custom_achivements}
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{$footer}
|
||||
</body>
|
||||
</html>'),
|
||||
"sid" => -1,
|
||||
"version" => 1604,
|
||||
"dateline" => TIME_NOW,
|
||||
);
|
||||
|
||||
$templates[] = array(
|
||||
"title" => 'achivements_modcp_give',
|
||||
"template" => $db->escape_string('<html>
|
||||
<head>
|
||||
<title>{$mybb->settings[\'bbname\']} - {$lang->giveachivements}</title>
|
||||
{$headerinclude}
|
||||
</head>
|
||||
<body>
|
||||
{$header}
|
||||
<table width="100%" border="0" align="center">
|
||||
<tr>
|
||||
{$modcp_nav}
|
||||
<td valign="top">
|
||||
<form action="modcp.php?action=achivements" method="post">
|
||||
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
|
||||
<input type="hidden" name="mod" value="{$mybb->input[\'mod\']}" />
|
||||
<input type="hidden" name="id" value="{$mybb->input[\'id\']}" />
|
||||
<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
|
||||
<tr>
|
||||
<td class="thead" colspan="2"><strong>{$lang->giveuserform}</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="trow1"><strong>{$lang->user}</strong>:</td>
|
||||
<td class="trow2"><input type="text" class="textbox" id="username" name="username" size="40" maxlength="85" tabindex="1" /></td>
|
||||
</table>
|
||||
<br />
|
||||
<div style="text-align:center"><input type="submit" class="button" name="submit" value="{$lang->giveachivements}"/></div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{$footer}
|
||||
<script type="text/javascript" src="jscripts/autocomplete.js?ver=1400"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
if(use_xmlhttprequest == "1")
|
||||
{
|
||||
new autoComplete("username", "xmlhttp.php?action=get_users", {valueSpan: "username"});
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</body>
|
||||
</html>'),
|
||||
"sid" => -1,
|
||||
"version" => 1604,
|
||||
"dateline" => TIME_NOW,
|
||||
);
|
||||
|
||||
$templates[] = array(
|
||||
"title" => 'achivements_modcp_quit',
|
||||
"template" => $db->escape_string('<html>
|
||||
<head>
|
||||
<title>{$mybb->settings[\'bbname\']} - {$lang->quitachivement}</title>
|
||||
{$headerinclude}
|
||||
</head>
|
||||
<body>
|
||||
{$header}
|
||||
<table width="100%" border="0" align="center">
|
||||
<tr>
|
||||
{$modcp_nav}
|
||||
<td valign="top">
|
||||
<form action="modcp.php?action=achivements" method="post">
|
||||
<input type="hidden" name="my_post_key" value="{$mybb->post_code}" />
|
||||
<input type="hidden" name="mod" value="{$mybb->input[\'mod\']}" />
|
||||
<input type="hidden" name="acid" value="{$mybb->input[\'acid\']}" />
|
||||
<table border="0" cellspacing="{$theme[\'borderwidth\']}" cellpadding="{$theme[\'tablespace\']}" class="tborder">
|
||||
<tr>
|
||||
<td class="thead" colspan="2"><strong>{$lang->quitcustom}</strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="trow1"><strong>{$lang->user}</strong>:</td>
|
||||
<td class="trow2"><input type="text" class="textbox" id="username" name="username" size="40" maxlength="85" tabindex="1" /></td>
|
||||
</table>
|
||||
<br />
|
||||
<div style="text-align:center"><input type="submit" class="button" name="submit" value="{$lang->quitachivement}"/></div>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{$footer}
|
||||
<script type="text/javascript" src="jscripts/autocomplete.js?ver=1400"></script>
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
if(use_xmlhttprequest == "1")
|
||||
{
|
||||
new autoComplete("username", "xmlhttp.php?action=get_users", {valueSpan: "username"});
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</body>
|
||||
</html>'),
|
||||
"sid" => -1,
|
||||
"version" => 1604,
|
||||
"dateline" => TIME_NOW,
|
||||
);
|
||||
|
||||
$templates[] = array(
|
||||
"title" => 'achivements_modcp_nav',
|
||||
"template" => $db->escape_string('<tr>
|
||||
<td class="trow1 smalltext">
|
||||
<a href="modcp.php?action=achivements" style="display: block;padding: 1px 0 1px 23px;background: url(inc/plugins/achivements/include/images/modcp.png) no-repeat left center;">{$lang->custom_modules}</a></td>
|
||||
</tr>'),
|
||||
"sid" => -1,
|
||||
"version" => 1604,
|
||||
"dateline" => TIME_NOW,
|
||||
);
|
||||
|
||||
$templates[] = array(
|
||||
"title" => 'achivements_modcp_list',
|
||||
"template" => $db->escape_string('<tr>
|
||||
<td class="{$trow}" align="center"><img src="{$custom[\'image\']}" title="{$custom[\'name\']}" /></td>
|
||||
<td class="{$trow}"><strong>{$custom[\'name\']}</strong><br /><span class="smalltext">{$custom[\'reason\']}</span></td>
|
||||
<td class="{$trow}" width="10%" align="center"><a href="modcp.php?action=achivements&mod=give&id={$custom[\'id\']}" />{$lang->give}</a></td>
|
||||
<td class="{$trow}" width="10%" align="center"><a href="modcp.php?action=achivements&mod=quit&id={$custom[\'id\']}" />{$lang->quit}</a></td>
|
||||
</tr>'),
|
||||
"sid" => -1,
|
||||
"version" => 1604,
|
||||
"dateline" => TIME_NOW,
|
||||
);
|
||||
|
||||
$fields[] = array('table' => 'users', 'column' => 'threads', 'insert' => 'int(11) unsigned NOT NULL default \'0\'');
|
||||
|
||||
function settings_insert()
|
||||
{
|
||||
global $lang;
|
||||
$lang->load('achivements');
|
||||
$settings_achivements[] = array(
|
||||
"name" => "achivements_enable",
|
||||
"title" => $lang->enable,
|
||||
"description" => $lang->enable_des,
|
||||
"optionscode" => "yesno",
|
||||
"value" => "1",
|
||||
"disporder" => 1,
|
||||
"gid" => 0
|
||||
);
|
||||
$settings_achivements[] = array(
|
||||
"name" => "achivements_showachvprofile",
|
||||
"title" => $lang->showachvprofile,
|
||||
"description" => $lang->showachvprofiledes,
|
||||
"optionscode" => "yesno",
|
||||
"value" => "1",
|
||||
"disporder" => 2,
|
||||
"gid" => 0
|
||||
);
|
||||
$settings_achivements[] = array(
|
||||
"name" => "achivements_showachvpostbit",
|
||||
"title" => $lang->showachvpostbit,
|
||||
"description" => $lang->showachvpostbitdes,
|
||||
"optionscode" => "yesno",
|
||||
"value" => "1",
|
||||
"disporder" => 3,
|
||||
"gid" => 0
|
||||
);
|
||||
$settings_achivements[] = array(
|
||||
"name" => "achivements_sendmp",
|
||||
"title" => $lang->sendmpachivements,
|
||||
"description" => $lang->sendmpachivements_des,
|
||||
"optionscode" => "textarea",
|
||||
"value" => "",
|
||||
"disporder" => 4,
|
||||
"gid" => 0
|
||||
);
|
||||
$settings_achivements[] = array(
|
||||
"name" => "achivements_subjectmp",
|
||||
"title" => $lang->titlemp,
|
||||
"description" => $lang->titlempdes,
|
||||
"optionscode" => "textarea",
|
||||
"value" => $lang->subjectvalue,
|
||||
"disporder" => 5,
|
||||
"gid" => 0
|
||||
);
|
||||
$settings_achivements[] = array(
|
||||
"name" => "achivements_bodymp",
|
||||
"title" => $lang->bodymp,
|
||||
"description" => $lang->bodympdes,
|
||||
"optionscode" => "textarea",
|
||||
"value" => $lang->bodyvalue,
|
||||
"disporder" => 6,
|
||||
"gid" => 0
|
||||
);
|
||||
$settings_achivements[] = array(
|
||||
"name" => "achivements_usermp",
|
||||
"title" => $lang->user,
|
||||
"description" => $lang->usersendmp,
|
||||
"optionscode" => "text",
|
||||
"value" => "1",
|
||||
"disporder" => 7,
|
||||
"gid" => 0
|
||||
);
|
||||
$settings_achivements[] = array(
|
||||
"name" => "achivements_rebuild",
|
||||
"title" => $lang->rebuild,
|
||||
"description" => $lang->rebuild,
|
||||
"optionscode" => "yesno",
|
||||
"value" => "0",
|
||||
"disporder" => 8,
|
||||
"gid" => 0
|
||||
);
|
||||
$settings_achivements[] = array(
|
||||
"name" => "achivements_maxpostbit",
|
||||
"title" => $lang->maxpostbit,
|
||||
"description" => $lang->maxpostbitdes,
|
||||
"optionscode" => "text",
|
||||
"value" => "15",
|
||||
"disporder" => 9,
|
||||
"gid" => 0
|
||||
);
|
||||
$settings_achivements[] = array(
|
||||
"name" => "achivements_taskuseroffline",
|
||||
"title" => $lang->taskoffline,
|
||||
"description" => $lang->taskofflinedes,
|
||||
"optionscode" => "yesno",
|
||||
"value" => "1",
|
||||
"disporder" => 10,
|
||||
"gid" => 0
|
||||
);
|
||||
$settings_achivements[] = array(
|
||||
"name" => "achivements_modcp",
|
||||
"title" => $lang->canmodcpachs,
|
||||
"description" => $lang->canmodcpachsdes,
|
||||
"optionscode" => "yesno",
|
||||
"value" => "1",
|
||||
"disporder" => 11,
|
||||
"gid" => 0
|
||||
);
|
||||
$settings_achivements[] = array(
|
||||
"name" => "achivements_showonlycurrent",
|
||||
"title" => $lang->showonlycurrent,
|
||||
"description" => $lang->showonlycurrentdes,
|
||||
"optionscode" => "yesno",
|
||||
"value" => "1",
|
||||
"disporder" => 12,
|
||||
"gid" => 0
|
||||
);
|
||||
return $settings_achivements;
|
||||
}
|
||||
|
||||
function count_threads_update()
|
||||
{
|
||||
global $db;
|
||||
$query = $db->simple_select("users", "uid");
|
||||
while($user = $db->fetch_array($query))
|
||||
{
|
||||
$users[$user['uid']] = $user;
|
||||
}
|
||||
foreach($users as $user)
|
||||
{
|
||||
$query = $db->simple_select("threads", "COUNT(tid) AS threads", "uid = '".$user['uid']."'");
|
||||
$threads_count = intval($db->fetch_field($query, "threads"));
|
||||
$db->update_query("users", array("threads" => $threads_count), "uid = '".$user['uid']."'");
|
||||
}
|
||||
}
|
||||
|
||||
function create_task_tools()
|
||||
{
|
||||
global $db, $lang;
|
||||
$lang->load('achivements');
|
||||
$new_task_achivements = array(
|
||||
"title" => "Achivements",
|
||||
"description" => $lang->desctaks,
|
||||
"file" => "achivements",
|
||||
"minute" => '0',
|
||||
"hour" => '0',
|
||||
"day" => '*',
|
||||
"month" => '*',
|
||||
"weekday" => '*',
|
||||
"nextrun" => TIME_NOW + (1*24*60*60),
|
||||
"enabled" => '0',
|
||||
"logging" => '1'
|
||||
);
|
||||
$db->insert_query("tasks", $new_task_achivements);
|
||||
}
|
||||
?>
|
107
forumplugins/plugins/achivements/include/mp.php
Normal file
|
@ -0,0 +1,107 @@
|
|||
<?php
|
||||
|
||||
|
||||
/**
|
||||
* MyBB 1.6
|
||||
* Copyright 2012 MyBB-Es Team, All Rights Reserved
|
||||
*
|
||||
* Website: http://www.mybb-es.com.com
|
||||
*
|
||||
* $Id: mp.php 2012-05-27 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 get_achivement($table, $id)
|
||||
{
|
||||
global $db;
|
||||
$query = $db->simple_select('achivements_'.$table, '*', $id);
|
||||
$achivement = $db->fetch_array($query);
|
||||
$read = array(
|
||||
"name" => $achivement['name'],
|
||||
"image" => $achivement['image'],
|
||||
"description" => $achivement['description'],
|
||||
"reason" => $achivement['reason']
|
||||
);
|
||||
return $read;
|
||||
}
|
||||
|
||||
function send_mp_achivement_new($uid, $table, $id)
|
||||
{
|
||||
global $mybb;
|
||||
require_once MYBB_ROOT."inc/datahandlers/pm.php";
|
||||
$pmhandler = new PMDataHandler();
|
||||
$user = get_user($uid);
|
||||
switch($table)
|
||||
{
|
||||
case 'posts':
|
||||
$achivement = get_achivement('posts', "apid='".$id."'");
|
||||
break;
|
||||
|
||||
case 'threads':
|
||||
$achivement = get_achivement('threads', "atid='".$id."'");
|
||||
break;
|
||||
|
||||
case 'reputation':
|
||||
$achivement = get_achivement('reputation', "arid='".$id."'");
|
||||
break;
|
||||
|
||||
case 'timeonline':
|
||||
$achivement = get_achivement('timeonline', "toid='".$id."'");
|
||||
break;
|
||||
|
||||
case 'regdate':
|
||||
$achivement = get_achivement('regdate', "rgid='".$id."'");
|
||||
break;
|
||||
|
||||
case 'custom':
|
||||
$achivement = get_achivement('custom', "acid='".$id."'");
|
||||
break;
|
||||
|
||||
case 'achivement':
|
||||
$achivement = get_achivement('achivement', "aaid='".$id."'");
|
||||
break;
|
||||
}
|
||||
$message = $mybb->settings['achivements_bodymp'];
|
||||
$message = str_replace('{user}', $user['username'], $message);
|
||||
$message = str_replace('{bburl}', $mybb->settings['bburl'], $message);
|
||||
$message = str_replace('{bbname}', $mybb->settings['bbname'], $message);
|
||||
$message = str_replace('{name}', $achivement['name'], $message);
|
||||
if($table == 'custom')
|
||||
{
|
||||
$message = str_replace('{description}', $achivement['reason'], $message);
|
||||
}
|
||||
else
|
||||
{
|
||||
$message = str_replace('{description}', $achivement['description'], $message);
|
||||
}
|
||||
$message = str_replace('{image}', "[img]".$mybb->settings['bburl']."/".$achivement['image']."[/img]", $message);
|
||||
|
||||
$pm = array(
|
||||
"subject" => $mybb->settings['achivements_subjectmp'],
|
||||
"message" => $message,
|
||||
"icon" => -1,
|
||||
"fromid" => intval($mybb->settings['achivements_usermp']),
|
||||
"toid" => array($user['uid']),
|
||||
"do" => '',
|
||||
"pmid" => ''
|
||||
);
|
||||
$pm['options'] = array(
|
||||
"signature" => 1,
|
||||
"disablesmilies" => 0,
|
||||
"savecopy" => 0,
|
||||
"readreceipt" => 0
|
||||
);
|
||||
$pm['saveasdraft'] = 0;
|
||||
$pmhandler->admin_override = 1;
|
||||
$pmhandler->set_data($pm);
|
||||
if($pmhandler->validate_pm())
|
||||
{
|
||||
$pmhandler->insert_pm();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
132
forumplugins/plugins/achivements/include/plugin.php
Normal file
|
@ -0,0 +1,132 @@
|
|||
<?php
|
||||
|
||||
|
||||
|
||||
|
||||
if(!defined("IN_MYBB"))
|
||||
{
|
||||
die("Direct initialization of this file is not allowed.<br /><br />Please make sure IN_MYBB is defined.");
|
||||
}
|
||||
|
||||
function achivements_init_info()
|
||||
{
|
||||
global $lang;
|
||||
$lang->load('achivements');
|
||||
return array(
|
||||
"name" => "Achivements",
|
||||
"description" => $lang->achivements_description,
|
||||
"website" => "http://coppertopia.net/",
|
||||
"author" => "genuine",
|
||||
"version" => "1.0",
|
||||
"compatibility" => "16*",
|
||||
);
|
||||
}
|
||||
|
||||
function achivements_init_is_installed()
|
||||
{
|
||||
global $db;
|
||||
if ($db->table_exists('achivements') && $db->table_exists('user_achivements'))
|
||||
{
|
||||
$return = true;
|
||||
}else{
|
||||
$return = false;
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function achivements_init_install()
|
||||
{
|
||||
global $db, $cache;
|
||||
require_once MYBB_ROOT."inc/plugins/achivements/include/install.php";
|
||||
$collation = $db->build_create_table_collation();
|
||||
foreach($tables as $table){
|
||||
if(!$db->table_exists($table['name']))
|
||||
{
|
||||
$db->query($table['insert'].$collation);
|
||||
}
|
||||
}
|
||||
foreach($fields as $field)
|
||||
{
|
||||
if(!$db->field_exists($field['column'], $field['table']))
|
||||
{
|
||||
$db->add_column($field['table'], $field['column'], $field['insert']);
|
||||
}
|
||||
}
|
||||
count_threads_update();
|
||||
if(file_exists(MYBB_ROOT."inc/tasks/achivements.php"))
|
||||
{
|
||||
create_task_tools();
|
||||
}
|
||||
foreach(settings_insert() as $installsettings)
|
||||
{
|
||||
$db->insert_query("settings", $installsettings);
|
||||
}
|
||||
foreach($templates as $template)
|
||||
{
|
||||
$db->insert_query("templates", $template);
|
||||
}
|
||||
rebuildsettings();
|
||||
|
||||
require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
|
||||
find_replace_templatesets('member_profile', '#{\$profilefields}#', '{\$profilefields}<!-- Profile_achivements -->{\$achivementsprofile}<!-- /Profile_achivements -->');
|
||||
find_replace_templatesets('usercp_nav_profile', '#{\$changesigop}#', '{\$changesigop}<!-- usercp_achivements --><div><a href="usercp.php?action=achivements" class="usercp_nav_item" style="padding-left: 40px;background: url(inc/plugins/achivements/include/images/achivements_usercp.png) no-repeat left center;">Achivements</a></div><!-- /usercp_achivements -->');
|
||||
find_replace_templatesets('modcp_nav', '#{\$lang->mcp_nav_editprofile}</a></td></tr>#', '{\$lang->mcp_nav_editprofile}</a></td></tr><!--modcp_achivements-->');
|
||||
find_replace_templatesets('postbit', '#'.preg_quote('{$post[\'user_details\']}').'#', "{\$post['user_details']}<!-- postbit_achivements -->{\$post['achivementspostbit']}<!-- /postbit_achivements -->");
|
||||
find_replace_templatesets('postbit_classic', '#'.preg_quote('{$post[\'user_details\']}').'#', "{\$post['user_details']}<!-- postbit_achivements -->{\$post['achivementspostbit']}<!-- /postbit_achivements -->");
|
||||
|
||||
change_admin_permission("achivements", true, 1);
|
||||
change_admin_permission("achivements", "posts", 0);
|
||||
change_admin_permission("achivements", "threads", 0);
|
||||
change_admin_permission("achivements", "reputation", 0);
|
||||
change_admin_permission("achivements", "timeonline", 0);
|
||||
change_admin_permission("achivements", "regdate", 0);
|
||||
change_admin_permission("achivements", "custom", 0);
|
||||
change_admin_permission("achivements", "achivements", 0);
|
||||
change_admin_permission("achivements", "settings", 0);
|
||||
change_admin_permission("achivements", "extensions", 0);
|
||||
change_admin_permission("achivements", "config", 0);
|
||||
}
|
||||
|
||||
function achivements_init_uninstall()
|
||||
{
|
||||
global $db, $cache;
|
||||
require_once MYBB_ROOT."inc/plugins/achivements/include/install.php";
|
||||
delete_images_unlink();
|
||||
foreach($tables as $table){
|
||||
if($db->table_exists($table['name']))
|
||||
{
|
||||
$db->drop_table($table['name']);
|
||||
}
|
||||
}
|
||||
foreach($fields as $field)
|
||||
{
|
||||
if($db->field_exists($field['column'], $field['table']))
|
||||
{
|
||||
$db->drop_column($field['table'], $field['column']);
|
||||
}
|
||||
}
|
||||
$db->delete_query('tasks', 'file=\'achivements\'');
|
||||
$db->delete_query("settings","name LIKE 'achivements_%'");
|
||||
$db->delete_query("templates","title LIKE 'achivements%'");
|
||||
rebuildsettings();
|
||||
|
||||
require_once MYBB_ROOT."/inc/adminfunctions_templates.php";
|
||||
find_replace_templatesets('member_profile', '#\<!--\sProfile_achivements\s--\>(.+)\<!--\s/Profile_achivements\s--\>#is', '', 0);
|
||||
find_replace_templatesets('usercp_nav_profile', '#\<!--\susercp_achivements\s--\>(.+)\<!--\s/usercp_achivements\s--\>#is', '', 0);
|
||||
find_replace_templatesets('modcp_nav', '#\<!--modcp_achivements-->#is', '', 0);
|
||||
find_replace_templatesets('postbit', '#\<!--\spostbit_achivements\s--\>(.+)\<!--\s/postbit_achivements\s--\>#is', '', 0);
|
||||
find_replace_templatesets('postbit_classic', '#\<!--\spostbit_achivements\s--\>(.+)\<!--\s/postbit_achivements\s--\>#is', '', 0);
|
||||
|
||||
change_admin_permission("achivements", false, -1);
|
||||
change_admin_permission("achivements", "posts", -1);
|
||||
change_admin_permission("achivements", "threads", -1);
|
||||
change_admin_permission("achivements", "reputation", -1);
|
||||
change_admin_permission("achivements", "timeonline", -1);
|
||||
change_admin_permission("achivements", "regdate", -1);
|
||||
change_admin_permission("achivements", "custom", -1);
|
||||
change_admin_permission("achivements", "achivements", -1);
|
||||
change_admin_permission("achivements", "settings", -1);
|
||||
change_admin_permission("achivements", "extensions", -1);
|
||||
change_admin_permission("achivements", "config", -1);
|
||||
}
|
||||
?>
|
BIN
forumplugins/plugins/achivements/upload/Thumbs.db
Normal file
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.1 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 3.2 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.4 KiB |
0
forumplugins/plugins/achivements/upload/index.html
Normal file
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 3.5 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.4 KiB |