11.10.2009, 02:10
Hab jetzt schon beim zweiten Plugin dieses "&" im aufgerufenen Link.
Normalerweise müsste der Link so aussehen:
.../member.php?action=profile&uid=1
sieht aber so aus:
.../member.php?action=profile&uid=1
Hier mal die php:
Dadurch wird natürlich immer die selbe ID aufgerufen, egal auf welches
Usrprofil der Link eigentlich leiten sollte.
Woran liegt das wohl?
Normalerweise müsste der Link so aussehen:
.../member.php?action=profile&uid=1
sieht aber so aus:
.../member.php?action=profile&uid=1
Hier mal die php:
PHP-Code:
<?php
/*
* Reported Posts In Thread For MyBB 1.4
* By: LeX-
* Website: http://www.thingiej.be
* Version: 1.0
*/
$plugins->add_hook('report_do_report_end', 'report_thread_report');
function report_thread_info()
{
return array(
'name' => 'Reported Posts In Thread',
'description' => 'Option To Create A New Thread When A Post Gets Reported. So Moderators Can Discuss The Post ...!',
'website' => 'http://www.thingiej.be/',
'author' => 'LeX-',
'authorsite' => 'http://www.thingiej.be/',
'version' => '1.0',
'compatibitlity' => "14*"
);
}
function report_thread_is_installed()
{
global $db;
$query = $db->simple_select("settings", "name", "name='rt_status'", array('limit' => 1));
if($db->fetch_field($query, "name"))
{
return true;
}
return false;
}
function report_thread_install()
{
global $db, $mybb;
$db->write_query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN(
'rt_status',
'rt_fid',
'rt_uid'
)");
$db->delete_query("settinggroups", "name = 'rt_options'");
$rt_group = array(
"name" => "rt_options",
"title" =>"Report Thread Settings",
"description" => "Settings for the Report Thread Plugin.",
"disporder" => "30",
"isdefault" => "no",
);
$group['gid'] = $db->insert_query("settinggroups", $rt_group);
$mybb->rt_insert_gid = $group['gid'];
$new_setting = array(
'name' => 'rt_status',
'title' => 'Report Thread__ Status',
'description' => 'Enable/Disable Report Thread Plugin.',
'optionscode' => 'onoff',
'value' => '1',
'disporder' => '1',
'gid' => intval($group['gid']),
);
$db->insert_query('settings', $new_setting);
$new_setting = array(
'name' => 'rt_fid',
'title' => 'Report Thread__ ForumID',
'description' => 'Where Should The Threads Be Created ? In What Forum ? Enter a single FID.',
'optionscode' => 'text',
'value' => '',
'disporder' => '2',
'gid' => intval($group['gid']),
);
$db->insert_query('settings', $new_setting);
$new_setting = array(
'name' => 'rt_uid',
'title' => 'Report Thread__ UserID',
'description' => 'Who Should Post The Threads ? Enter A UserID (uid). By Default its 1 ! Should Be The BoardOwner.',
'optionscode' => 'text',
'value' => '1',
'disporder' => '3',
'gid' => intval($group['gid']),
);
$db->insert_query('settings', $new_setting);
rebuild_settings();
}
function report_thread_uninstall()
{
global $db;
$db->write_query("DELETE FROM ".TABLE_PREFIX."settings WHERE name IN(
'rt_status',
'rt_fid',
'rt_uid'
)");
$db->delete_query("settinggroups", "name = 'rt_options'");
}
function report_thread_report()
{
global $db, $mybb, $cache, $lang;
if($mybb->settings['rt_status'] == 0)
{
return;
}
$lang->load("report_thread");
$pid = intval($mybb->input['pid']);
$reason = $db->escape_string(htmlspecialchars_uni($mybb->input['reason']));
$fid = intval($mybb->settings['rt_fid']);
$posteruid = intval($mybb->input['rt_uid']);
if(!$posteruid)
{
$posteruid = 1;
}
$forums = $cache->read("forums");
if($forums[$fid])
{
$postinfo = get_post($pid);
$postinfo['subject'] = str_replace("RE:", "", $postinfo['subject']);
$postlink = "[url={$mybb->settings['bburl']}/".get_post_link($postinfo['pid'], $postinfo['tid'])."#pid{$postinfo['pid']}]Goto[/url]";
$userinfo = get_user($posteruid);
$poster = "[url={$mybb->settings['bburl']}/".get_profile_link($postinfo['uid'])."]{$postinfo['username']}[/url]";
$reporter = "[url={$mybb->settings['bburl']}/".get_profile_link($mybb->user['uid'])."]{$mybb->user['username']}[/url]";
$subject = $lang->sprintf($lang->report_thread_subject, $postinfo['subject']);
$message = $lang->sprintf($lang->report_thread_message, $reporter, $reason, $poster, $postlink, $postinfo['message']);
$new_thread = array(
"fid" => $fid,
"subject" => $db->escape_string($subject),
"icon" => -1,
"uid" => intval($userinfo['uid']),
"username" => htmlspecialchars_uni($db->escape_string($userinfo['username'])),
"dateline" => TIME_NOW,
"lastpost" => TIME_NOW,
"lastposter" => htmlspecialchars_uni($db->escape_string($userinfo['username'])),
"lastposteruid" => intval($userinfo['uid']),
"views" => 0,
"replies" => 0,
"visible" => 1
);
$db->insert_query("threads", $new_thread);
$tid = $db->insert_id();
$new_post = array(
"tid" => $tid,
"fid" => $fid,
"subject" => $db->escape_string($subject),
"icon" => -1,
"uid" => intval($userinfo['uid']),
"username" => htmlspecialchars_uni($db->escape_string($userinfo['username'])),
"dateline" => TIME_NOW,
"message" => $db->escape_string($message),
"ipaddress" => $userinfo['regip'],
"includesig" => 0,
"smilieoff" => 0,
"visible" => 1
);
$db->insert_query("posts", $new_post);
$pid = $db->insert_id();
$firstpostup['firstpost'] = $pid;
$db->update_query("threads", $firstpostup, "tid='{$tid}'");
update_forum_counters($fid, array('threads' => '+1', 'posts' => '+1'));
}
}
?>
Dadurch wird natürlich immer die selbe ID aufgerufen, egal auf welches
Usrprofil der Link eigentlich leiten sollte.
Woran liegt das wohl?