<?php
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("forumdisplay_thread", "TitleThreads");
function TitleThreads_info()
{
$Edson = "<a href=mailto:techhangout2010@gmail.com><b>enviraphan</b></a>";
$Mauricio = "<a href=http://www.techhangout.tk target=_blank><b>envira phani</b></a>";
return array(
"name" => "Title Thread",
"description" => "Shows the description of the thread when mouse placed on it",
"website" => "mailto:techhangout2010@gmail.com",
"author" => "".$envira." && ".$phan."",
"authorsite" => "",
"version" => "1.0",
"compatibility" => "16*"
);
}
function TitleThreads_activate(){
global $db;
$TitleThreads = array(
"gid" => "NULL",
"name" => "TitleThreads",
"title" => "Title Threads",
"description" => "Shows the description of the thread when mouse placed on it",
"disporder" => "0",
"isdefault" => "no",
);
$db->insert_query("settinggroups", $TitleThreads);
$gid = $db->insert_id();
$TitleThreads_1 = array(
"sid" => "NULL",
"name" => "TitleThreads_enable",
"title" => "Enable / Disable",
"description" => "Enables or disables Pugin!!",
"optionscode" => "yesno",
"value" => "no",
"disporder" => "1",
"gid" => intval($gid),
);
$TitleThreads_2 = array(
"sid" => "NULL",
"name" => "TitleThreads_num",
"title" => "Character display",
"description" => "Enter the number of letters that were shown to be the name of the topic",
"optionscode" => "text",
"value" => "200",
"disporder" => "2",
"gid" => intval($gid),
);
$db->insert_query("settings", $TitleThreads_1);
$db->insert_query("settings", $TitleThreads_2);
include MYBB_ROOT."/inc/adminfunctions_templates.php";
$find = '#' . preg_quote('class="{$inline_edit_class} {$new_class}"') . '#';
$replace = 'alt="{$titlethread}" title="{$titlethread}"';
find_replace_templatesets('forumdisplay_thread', $find, $replace, 1);
}
function TitleThreads_deactivate(){
global $db;
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='TitleThreads'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='TitleThreads_enable'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='TitleThreads_num'");
include MYBB_ROOT."/inc/adminfunctions_templates.php";
$find = '#' . preg_quote('alt="{$titlethread}" title="{$titlethread}"') . '#';
$replace = 'class="{$inline_edit_class} {$new_class}"';
find_replace_templatesets('forumdisplay_thread', $find, $replace, 0);
}
function TitleThreads(){
global $db,$mybb,$titlethread,$thread;
$substr_num = $mybb->settings['TitleThreads_num'];
$enable = $mybb->settings['TitleThreads_enable'];
if($enable == "0"){return;}
else{
$query = $db->query("SELECT message FROM ".TABLE_PREFIX."posts WHERE tid='".$thread['tid']."'");
$row = $db->fetch_array($query);
$titlethread = substr($row['message'],0,$substr_num) . "......";
}
}
?>
<?php
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("forumdisplay_thread", "TitleThreads");
function TitleThreads_info()
{
$Edson = "<a href=mailto:nicedo_eeos@hotmail.com><b>Edson Ordaz</b></a>";
$Mauricio = "<a href=http://www.fotonaturaleza.net target=_blank><b>Mauricio Calderon</b></a>";
return array(
"name" => "Title Thread",
"description" => "Muestra parte del primer mensaje al situar le mouse sobre el nombre del tema",
"website" => "mailto:nicedo_eeos@hotmail.com",
"author" => "".$Edson." && ".$Mauricio."",
"authorsite" => "",
"version" => "1.0",
"compatibility" => "16*"
);
}
function TitleThreads_activate(){
global $db;
$TitleThreads = array(
"gid" => "NULL",
"name" => "TitleThreads",
"title" => "Title Threads",
"description" => "Muestra parte del mensaje al situarse sobre el nombre del tema",
"disporder" => "0",
"isdefault" => "no",
);
$db->insert_query("settinggroups", $TitleThreads);
$gid = $db->insert_id();
$TitleThreads_1 = array(
"sid" => "NULL",
"name" => "TitleThreads_enable",
"title" => "Habilitar/Deshabilitar",
"description" => "Activa o desactiva el pugin!!",
"optionscode" => "yesno",
"value" => "no",
"disporder" => "1",
"gid" => intval($gid),
);
$TitleThreads_2 = array(
"sid" => "NULL",
"name" => "TitleThreads_num",
"title" => "Caracteres a mostrar",
"description" => "Ingresa el numero de letras que se mostraran al ponerse sobre el nombre del tema",
"optionscode" => "text",
"value" => "200",
"disporder" => "2",
"gid" => intval($gid),
);
$db->insert_query("settings", $TitleThreads_1);
$db->insert_query("settings", $TitleThreads_2);
include MYBB_ROOT."/inc/adminfunctions_templates.php";
$find = '#' . preg_quote('class="{$inline_edit_class} {$new_class}"') . '#';
$replace = 'alt="{$titlethread}" title="{$titlethread}"';
find_replace_templatesets('forumdisplay_thread', $find, $replace, 1);
}
function TitleThreads_deactivate(){
global $db;
$db->query("DELETE FROM ".TABLE_PREFIX."settinggroups WHERE name='TitleThreads'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='TitleThreads_enable'");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name='TitleThreads_num'");
include MYBB_ROOT."/inc/adminfunctions_templates.php";
$find = '#' . preg_quote('alt="{$titlethread}" title="{$titlethread}"') . '#';
$replace = 'class="{$inline_edit_class} {$new_class}"';
find_replace_templatesets('forumdisplay_thread', $find, $replace, 0);
}
function TitleThreads(){
global $db,$mybb,$titlethread,$thread;
$substr_num = $mybb->settings['TitleThreads_num'];
$enable = $mybb->settings['TitleThreads_enable'];
if($enable == "0"){return;}
else{
$query = $db->query("SELECT message FROM ".TABLE_PREFIX."posts WHERE tid='".$thread['tid']."'");
$row = $db->fetch_array($query);
$titlethread = substr($row['message'],0,$substr_num) . "......";
}
}
?>
(20 Dec, 2010, 9:40 am)Maurusky escribió: Suele suceder amigo Edson seguramente el que lo posteó pensó que siendo su foro en otro idioma no nos hibamos a enterar, pero bueno.
PD: Miren el ultimo mensaje posteado en ese tema.
Cita:You're a big stupid son of a bitch, this plugin is not yours Edson Ordaz.
(20 Dec, 2010, 10:38 am)mauro25987 escribió: JAJA Edson yo te reporte este de casualidad lo vi, pero acostumbrate por que te lo van hacer varias personas, pero si lo tienes aprobado en mybb.com no tienes por que preocuparte.