<?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("postbit", "sanime_run");
$plugins->add_hook("postbit_pm", "sanime_run");
$plugins->add_hook("postbit_announcement", "sanime_run");
$plugins->add_hook("postbit_prev", "sanime_run");
$plugins->add_hook("misc_start", "sanime_page");
function sanime_info()
{
return array('name' => 'SA_My anime',
'description' => 'Permite buscar a los usuarios por el anime que eligieron',
'website' => 'http://mybb-es.com',
'author' => 'Himura modificacion Sahashi',
'authorsite' => 'http://mybb-es.com .. http://xtreme-animetv.allalla.com/board',
'version' => '1.1',
'compatibility' => '*'
);
}
function sanime_activate()
{
global $db;
$animelist = array('name' => 'Anime',
'description' => 'Seleciona tu anime favorito',
'disporder' => '5',
'type' => 'select\n\nCode Geass
Pokemon
Angel Beats
Air gear
Hellsing
Ao no exorcist
Rosario+vampire
Kuroshitsuji
Death Note
Black Rock Shooter
DBZ
Working
Toradora
Monster
Gurren Lagan
Psyren
Mm
Gintama
Avatar
Bleach
Naruto
One Piece
Vampire Kinght
D.Gray Man
Kobato
Kimi ni Todoke
Ikkitousen
Zombie loan
FMA
',
'length' => '0',
'maxlength' => '200',
'required' => 1,
'editable' => 1,
'hidden' => 0,
);
$db->insert_query('profilefields', $animelist);
$pfid=$db->query("SELECT fid FROM ".TABLE_PREFIX."profilefields WHERE name='Anime'");
$pfids = $db->fetch_array($pfid);
$db->query("ALTER TABLE ".TABLE_PREFIX."userfields ADD fid".$pfids[fid]." TEXT");
$db->free_result($pfid);
}
function sanime_deactivate()
{
global $db;
$dpfid=$db->query("SELECT fid FROM ".TABLE_PREFIX."profilefields WHERE name='Anime'");
$dpfids = $db->fetch_array($dpfid);
$db->query("DELETE FROM ".TABLE_PREFIX."profilefields WHERE fid='$dpfids[fid]' ");
$db->query("ALTER TABLE ".TABLE_PREFIX."userfields DROP fid".$dpfids[fid]."");
$db->free_result($dpfid);
}
function sanime_run($post)
{
global $db;
$hmfid=$db->query("SELECT fid FROM ".TABLE_PREFIX."profilefields WHERE name='Anime'");
$hmfids = $db->fetch_array($hmfid);
$cppid=$hmfids[fid];
if(!$post["fid".$cppid.""]){}
$db->free_result($hmfid);
}
function sanime_page()
{
Global $mybb, $db, $theme, $headerinclude, $language;
if($_GET[action]=="sanime")
{
$query = $db->query("SELECT u.*, u.username AS userusername, f.*
FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (g.gid=u.usergroup)
WHERE fid".$_GET[pf]."='".$_GET[cnam]."'");
while ($userlist = $db->fetch_array($query))
{
$users['username'] = format_name($userlist['username'], $userlist['usergroup'], $userlist['displaygroup']);
$users['profilelink'] = build_profile_link($users['username'], $userlist['uid']);
$lista.="<tr><td class=\"trow1\" align=\"center\"><img src=\"{$userlist['avatar']}\" title=\"avatar de {$userlist
[username]}\" alt=\"\" width=\"80\" height=\"80\"></td>
<td class=\"trow1\" align=\"left\"></b>{$users['profilelink']}</b><br /><span class=\"smalltext\">
<a href=\"{$mybb->settings[bburl]}/private.php?action=send&uid={$userlist[uid]}\" target=\"_blank\" title=\"Enviar un
mensaje privado a {$userlist[username]}\">Enviar un mensaje privado a {$userlist[username]}</a><br />
<a href=\"http://localhost/forum/usercp.php?action=do_editlists&my_post_key={$mybb->post_code}&add_username=
{$userlist[username]}\" title=\"Agregar a {$userlist[username]} a tu lista de Amigos\" target=\"_blank\">Agregar a
{$userlist[username]} a tu lista de Amigos</a>
</span></td><td class=\"trow1\" align=\"center\">{$userlist['postnum']}</td></tr>";
}
$page = "<html><head><title>Lista de Miembros de {$_GET[cnam]}</title>
{$headerinclude}</head><body align=\"left\">
<table class=\"tborder\" border=\"0\" cellpadding=\"{$theme['tablespace']}\" cellspacing=\"{$theme['borderwidth']}\" style=
\"width:95%\">
<tbody><tr>
<td class=\"thead\" colspan=\"3\" align=\"left\"><strong>Lista de Miembros de {$_GET[cnam]}</strong></td>
</tr>
<tr>
<td class=\"tcat\"><span class=\"smalltext\"><strong>Avatar</strong></span></td>
<td class=\"tcat\" align=\"left\"><span class=\"smalltext\"><strong>Nombre de Usuario</strong></span></td>
<td class=\"tcat\" align=\"center\" width=\"10%\"><span class=\"smalltext\"><strong>Mensajes</strong></span></td>
</tr>
{$lista}
</table></body></html>";
output_page($page);
$db->free_result($query);
}
}
<?php
<a href="javascript:;"
onclick="MyBB.popupWindow('misc.php?action=sanime&cnam=$memprofile[fid8]&pf=8', 'sanime', 450, 500);"><img src="images/anime/$memprofile[fid8].gif" alt="$memprofile[fid8]" title="$memprofile[fid8]" ><br/><span style="color:#1a1a1a">Click para ver lista de miembros</span></a>
<?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("postbit", "sanime_run");
$plugins->add_hook("postbit_pm", "sanime_run");
$plugins->add_hook("postbit_announcement", "sanime_run");
$plugins->add_hook("postbit_prev", "sanime_run");
$plugins->add_hook("misc_start", "sanime_page");
function sanime_info()
{
return array('name' => 'SA_My anime',
'description' => 'Permite buscar a los usuarios por el anime que eligieron',
'website' => 'http://mybb-es.com',
'author' => 'Himura modificacion Sahashi',
'authorsite' => 'http://mybb-es.com .. http://xtreme-animetv.allalla.com/board',
'version' => '1.1',
'compatibility' => '*'
);
}
function sanime_activate()
{
global $db;
$animelist = array('name' => 'Anime',
'description' => 'Seleciona tu anime favorito',
'disporder' => '5',
'type' => 'select\n\nAngelbeats
AngelBeats
Air gear
Hellsing
Ao no exorcist
Tayutama
Rosario vampire
',
'length' => '0',
'maxlength' => '200',
'required' => 1,
'editable' => 1,
'hidden' => 0,
);
$db->insert_query('profilefields', $animelist);
$pfid=$db->query("SELECT fid FROM ".TABLE_PREFIX."profilefields WHERE name='Anime'");
$pfids = $db->fetch_array($pfid);
$db->query("ALTER TABLE ".TABLE_PREFIX."userfields ADD fid".$pfids[fid]." TEXT");
$db->free_result($pfid);
}
function sanime_deactivate()
{
global $db;
$dpfid=$db->query("SELECT fid FROM ".TABLE_PREFIX."profilefields WHERE name='Anime'");
$dpfids = $db->fetch_array($dpfid);
$db->query("DELETE FROM ".TABLE_PREFIX."profilefields WHERE fid='$dpfids[fid]' ");
$db->query("ALTER TABLE ".TABLE_PREFIX."userfields DROP fid".$dpfids[fid]."");
$db->free_result($dpfid);
}
function sanime_run($post)
{
global $db;
$hmfid=$db->query("SELECT fid FROM ".TABLE_PREFIX."profilefields WHERE name='Anime'");
$hmfids = $db->fetch_array($hmfid);
$cppid=$hmfids[fid];
if(!$post["fid".$cppid.""]){}else{
$post['user_details'].= "<br /><a href=\"javascript:;\" onclick=\"MyBB.popupWindow('misc.php?action=sanime&cnam={$post["fid".$cppid.""]}&pf={$cppid}', 'sanime', 450, 500);\"><img src=\"images/anime/{$post["fid".$cppid.""]}.gif\" alt=\"{$post["fid".$cppid.""]}\" title=\"{$post["fid".$cppid.""]}\" width=\"30\" height=\"33\">";
}
$db->free_result($hmfid);
}
function sanime_page()
{
Global $mybb, $db, $theme, $headerinclude, $language;
if($_GET[action]=="sanime")
{
$query = $db->query("SELECT u.*, u.username AS userusername, f.*
FROM ".TABLE_PREFIX."users u
LEFT JOIN ".TABLE_PREFIX."userfields f ON (f.ufid=u.uid)
LEFT JOIN ".TABLE_PREFIX."usergroups g ON (g.gid=u.usergroup)
WHERE fid".$_GET[pf]."='".$_GET[cnam]."'");
while ($userlist = $db->fetch_array($query))
{
$users['username'] = format_name($userlist['username'], $userlist['usergroup'], $userlist['displaygroup']);
$users['profilelink'] = build_profile_link($users['username'], $userlist['uid']);
$lista.="<tr><td class=\"trow1\" align=\"center\"><img src=\"{$userlist['avatar']}\" title=\"avatar de {$userlist[username]}\" alt=\"\" width=\"80\" height=\"80\"></td>
<td class=\"trow1\" align=\"left\"></b>{$users['profilelink']}</b><br /><span class=\"smalltext\">
<a href=\"{$mybb->settings[bburl]}/private.php?action=send&uid={$userlist[uid]}\" target=\"_blank\" title=\"Enviar un mensaje privado a {$userlist[username]}\">Enviar un mensaje privado a {$userlist[username]}</a><br />
<a href=\"http://localhost/forum/usercp.php?action=do_editlists&my_post_key={$mybb->post_code}&add_username={$userlist[username]}\" title=\"Agregar a {$userlist[username]} a tu lista de Amigos\" target=\"_blank\">Agregar a {$userlist[username]} a tu lista de Amigos</a>
</span></td><td class=\"trow1\" align=\"center\">{$userlist['postnum']}</td></tr>";
}
$page = "<html><head><title>Lista de Miembros de {$_GET[cnam]}</title>
{$headerinclude}</head><body align=\"left\">
<table class=\"tborder\" border=\"0\" cellpadding=\"{$theme['tablespace']}\" cellspacing=\"{$theme['borderwidth']}\" style=\"width:95%\">
<tbody><tr>
<td class=\"thead\" colspan=\"3\" align=\"left\"><strong>Lista de Miembros de {$_GET[cnam]}</strong></td>
</tr>
<tr>
<td class=\"tcat\"><span class=\"smalltext\"><strong>Avatar</strong></span></td>
<td class=\"tcat\" align=\"left\"><span class=\"smalltext\"><strong>Nombre de Usuario</strong></span></td>
<td class=\"tcat\" align=\"center\" width=\"10%\"><span class=\"smalltext\"><strong>Mensajes</strong></span></td>
</tr>
{$lista}
</table></body></html>";
output_page($page);
$db->free_result($query);
}
}
Cita:porque si te fijas en el enlace que dice agrear a xxxx a tu lista de amigos esta malo dice localhost fue un error que me quedo en la version anterior, en la ultima te dice cuantos usuarios de ese lo que sea hay, y permite ordenarlos por algunos criterios...
<?php
$memprofile[fidx]
<?php
{$userfields[fidx]}
<?php
$plugins->add_hook("postbit", "sanime_run");
$plugins->add_hook("postbit_pm", "sanime_run");
$plugins->add_hook("postbit_announcement", "sanime_run");
$plugins->add_hook("postbit_prev", "sanime_run");
<?php
function sanime_run($post)
{
}