Xbox Gamercard im Postbit - CARL - 07.03.2010
Hallo Leute
ich habe es heute geschafft ein Xbox GamerCard im postbit angezeigt zu bekommen über ein eigenes Profilfeld nur habe ich jetzt das problem das wen Leute die nichts in diesem Profilfeld stehen haben ein "Seite nicht gefunden" anzeige bekommen
wie kann ich dieses besagte Problem beheben das diese User die nichts in diesem Feld stehen haben nicht diese Nachricht bekommen ??
eingebunden ist es per iframe so wie es bei Microsoft auf der Homepage gezeigt ist
das andere wäre noch wie bekomme ich diese gamercard im neuen vertikalen Layout neben Beiträge, Registriert seit und Bewertung steht
link zum forum: http://forzamotorsport.kilu.de/forum
greetz
CARL
RE: Xbox Gamercard im Postbit - Falkenauge Mihawk - 07.03.2010
Kannst dir ja mal das Steam-Plugin anschauen, dort sollte es so sein, wie du willst.
RE: Xbox Gamercard im Postbit - CARL - 07.03.2010
kenne mich mit php leider nicht aus deshalb bräuchte ich da etwas Hilfe
RE: Xbox Gamercard im Postbit - CARL - 08.03.2010
sorry für Doppelpost
So ich habe es geschafft indem ich ein Plugin umgeschrieben habe
nur habe ich jetzt ein anderes Problem ich möchte das die Gamercard unter der Signatur im Profil des User angezeigt wird
etwa so
aber momentan sieht es bei mir so aus
RE: Xbox Gamercard im Postbit - Michael - 08.03.2010
Überprüfe mal den HTML-Code. Das sieht so aus, als gäb es ein Problem mit den Tabellen (Tags nicht richtig geschlossen?).
RE: Xbox Gamercard im Postbit - CARL - 09.03.2010
Code: <br />
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder">
<tr>
<td class="thead"><strong>$faceid :</strong></td>
</tr>
<tr>
<td class="trow1">{$memprofile["xlg"]}</td>
</tr>
</table>
hier ist der Inhalt der Datei
ich habe es vom Signatur template übernommen und einfach die Sachen geändert damit die Gamercard angezeigt wird
RE: Xbox Gamercard im Postbit - Michael - 09.03.2010
Das sieht erstmal korrekt aus. Kannst du den Inhalt des ganzen Templates posten? Wie genau sieht der Code aus, der für $memprofile["xlg"] eingesetzt wird?
RE: Xbox Gamercard im Postbit - CARL - 10.03.2010
dafür gibt es kein template das geht aller über ein plugin
und zwar das Profile and Postbit Xbox Live Gamertag (1.5) Plugin
Code: <?php
// 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("datahandler_user_update", "profilexlg_update");
$plugins->add_hook('postbit', 'profilexlg_parse');
$plugins->add_hook('postbit_pm', 'profilexlg_parse');
$plugins->add_hook('postbit_announcement', 'profilexlg_parse');
$plugins->add_hook('postbit_prev', 'profilexlg_parse');
$plugins->add_hook('usercp_profile_start', 'profilexlg_templateupdate');
$plugins->add_hook('member_profile_end', 'profilexlg_profile');
function profilexlg_info()
{
return array(
"name" => "Profile and Postbit Xbox Live Gamertag",
"description" => "Adds a Profile Xbox Live Gamertag to the Profile and User PostBit",
"website" => "http://www.xpresionzone.net/",
"author" => "Walkman 5.0",
"authorsite" => "http://www.xpresionzone.net/",
"version" => "1.5",
"guid" => "a2ab1c6951e53e14ca6528fc61fe2d50",
"compatibility" => "14*"
);
}
function profilexlg_install ()
{
global $db;
$db->delete_query("templates", "title='xlg_usercp'"); //delete old templates with this name
//insert the template for rules
$xlgusrcp = array(
"title" => "xlg_usercp",
"template" => "<br />
<fieldset class=\"trow2\">
<legend><strong>Xbox Live Gamertag</strong></legend>
<table cellspacing=\"0\" cellpadding=\"{\$theme[tablespace]}\" width=\"100%\">
<tr>
<td valign=\"top\" width=\"1\"><input type=\"checkbox\" class=\"checkbox\" name=\"xlgno\" id=\"xlgno\" {\$fb_selected} value=\"1\" /></td>
<td><span class=\"smalltext\"><label for=\"invisible\">Xbox Live Gamertag</label></span></td>
</tr>
<tr>
<td colspan=\"2\"><span class=\"smalltext\">Xbox Live Gamertag</span></td>
</tr>
<tr>
<td colspan=\"2\" ><input type=\"text\" class=\"textbox\" name=\"xlg\" size=\"30\" value=\"{\$mybb->user[\'xlg\']}\" /></td>
</tr>
</table>
</fieldset>
",
"sid" => '-1',
"version" => '',
"dateline" => TIME_NOW
);
$db->insert_query("templates", $xlgusrcp);
// definizione variabili di configurazione plugin
$db->query("ALTER TABLE ".TABLE_PREFIX."users ADD xlgno INT(1) NOT NULL AFTER msn");
$db->query("ALTER TABLE ".TABLE_PREFIX."users ADD xlg VARCHAR(50) NOT NULL AFTER xlgno");
}
function profilexlg_is_installed()
{
global $db;
if($db->field_exists("xlg", "users"))
{
return true;
}
return false;
}
function profilexlg_activate()
{
global $db;
include MYBB_ROOT.'/inc/adminfunctions_templates.php';
find_replace_templatesets("usercp_profile", "#".preg_quote('{$awaysection}')."#i", '{$xlgusercp}{$awaysection}');
find_replace_templatesets("postbit", "#".preg_quote('{$post[\'user_details\']}')."#i", '{$post[\'user_details\']} <br />{$post[\'iconxlg\']}');
find_replace_templatesets("postbit_classic", "#".preg_quote('{$post[\'user_details\']}')."#i", '{$post[\'user_details\']} <br />{$post[\'iconxlg\']}');
find_replace_templatesets("member_profile", "#".preg_quote('<td class="trow2"><a href="javascript:;" onclick="MyBB.popupWindow(\'misc.php?action=imcenter&imtype=msn&uid={$uid}\', \'imcenter\', 450, 300);">{$memprofile[\'msn\']}</a></td>')."#i", '<td class="trow2"><a href="javascript:;" onclick="MyBB.popupWindow(\'misc.php?action=imcenter&imtype=msn&uid={$uid}\', \'imcenter\', 450, 300);">{$memprofile[\'msn\']}</a></td>{$faceprofile}');
// update plugin from v.2.0 to v.2.1 add a field privacy to setting if not exist
$query = $db->simple_select("settings", "*", "name='xlgprivacy'");
$result = $db->num_rows($query);
if($result)
{
return true;
} else
{
$insertArray = array('name' => 'xlgprivacy',
'title' => 'xlg privacy',
'description' => 'If yes the groups id 1 - 5 - 7 can not see the user profile xlg ',
'optionscode' => 'yesno',
'value' => 'yes',
'disporder' => 100,
'gid' => 9
);
$db->insert_query('settings', $insertArray);
rebuild_settings();
}
}
function profilexlg_deactivate()
{
global $db;
// pulizia template da variazioni
include MYBB_ROOT."/inc/adminfunctions_templates.php";
find_replace_templatesets("usercp_profile", "#".preg_quote('{$xlgusercp}')."#i", '', 0);
find_replace_templatesets("postbit", "#".preg_quote('<br />{$post[\'iconxlg\']}')."#i", '', 0);
find_replace_templatesets("postbit_classic", "#".preg_quote('<br />{$post[\'iconxlg\']}')."#i", '', 0);
find_replace_templatesets("member_profile", "#".preg_quote('{$faceprofile}')."#i", '', 0);
}
function profilexlg_uninstall()
{
global $db;
// pulizia tabelle settinggroups e setting
$db->query("ALTER TABLE ".TABLE_PREFIX."users DROP COLUMN xlgno");
$db->query("ALTER TABLE ".TABLE_PREFIX."users DROP COLUMN xlg");
$db->query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN('xlgprivacy')");
rebuild_settings();
}
function profilexlg_update()
{
global $mybb, $db;
if ($mybb->input['xlgno'] == "1")
{
$temp_query = " xlgno = '1', ";
}else{
$temp_query = " xlgno = '0', ";
}
$temp_query = $temp_query . "xlg = '" . $db->escape_string($mybb->input['xlg']) . "'";
$db->query("UPDATE ".TABLE_PREFIX."users SET " . $temp_query . " WHERE uid = " . $mybb->user['uid']);
}
function profilexlg_parse($post)
{
global $mybb;
$a = array(1, 5, 7);
if ($post["xlg"] != '')
{
if($post["xlgno"] != 0)
{
if($mybb->settings['xlgprivacy']==1)
{
if(!in_array($mybb->user['usergroup'],$a, true))
{
$post["iconxlg"] = '<iframe src="http://gamercard.xbox.com/' . $post["xlg"] .'.card" scrolling="no" frameBorder="0" height="140" width="204">' . $post["xlg"] .'</iframe>';
} else
{
}
} else {
$post["iconxlg"] = '<iframe src="http://gamercard.xbox.com/' . $post["xlg"] .'.card" scrolling="no" frameBorder="0" height="140" width="204">' . $post["xlg"] .'</iframe>';
}
}
else
{
if($mybb->settings['xlgprivacy']==1)
{
if(!in_array($mybb->user['usergroup'],$a, true))
{
$post["iconxlg"] = '<<iframe src="http://gamercard.xbox.com/' . $post["xlg"] .'.card" scrolling="no" frameBorder="0" height="140" width="204">' . $post["xlg"] .'</iframe>';
} else {
}
} else {
$post["iconxlg"] = '<iframe src="http://gamercard.xbox.com/' . $post["xlg"] .'.card" scrolling="no" frameBorder="0" height="140" width="204">' . $post["xlg"] .'</iframe>';
}
}
}
else { }
}
function profilexlg_templateupdate()
{
global $mybb, $templates, $theme, $xlgusercp,$xlgno,$xlg;
if ($mybb->user['xlgno'] == "1") {
$fb_selected = " checked ";
}else{
$fb_selected = " ";
}
eval("\$xlgusercp = \"".$templates->get("xlg_usercp")."\";");
}
function profilexlg_profile()
{
global $mybb, $memprofile, $faceprofile;
if ($memprofile["xlg"] != '')
{
if($memprofile["xlgno"] != 0)
{
$faceid= 'Gamercard';
$profilexlg = '<iframe src="http://gamercard.xbox.com/' . $memprofile["xlg"] . '.card" scrolling="no" frameBorder="0" height="140" width="204">' . $memprofile["xlg"] . '</iframe>';
}
else
{
$faceid= 'ID';
$profilexlg = '<iframe src="http://gamercard.xbox.com/' . $memprofile["xlg"] . '.card" scrolling="no" frameBorder="0" height="140" width="204">' . $memprofile["xlg"] . '</iframe>';
}
if($mybb->settings['xlgprivacy']==1)
{
$a = array(1, 5, 7);
if(!in_array($mybb->user['usergroup'],$a, true))
{
$faceprofile="</tr><tr><td class=\"trow1\"><strong>$faceid :</strong></td><td class=\"trow1\">$profilexlg</td>";
} else {
}
} else {
$faceprofile="</tr><tr><td class=\"trow1\"><strong>$faceid :</strong></td><td class=\"trow1\">$profilexlg</td>";
}
}
else { }
}
?>
das ist der Inhalt des plugins
RE: Xbox Gamercard im Postbit - Michael - 10.03.2010
(09.03.2010, 21:50)Michael schrieb: Kannst du den Inhalt des ganzen Templates posten?
RE: Xbox Gamercard im Postbit - CARL - 11.03.2010
das in Beitrag 6 ist das ganze Templates mehr gibst da nicht
in den anderen Templates steht nur {$post['iconxlg']} und damit erscheint dann die Gamercard
|