2011-12-08, 05:40 PM
Hiya is there a way on my award page I can have it so like theres a button by each award that users click to request and maybe like sends me a pm when they click it? Cheers
~ David
~ David
(2011-12-08, 05:57 PM)JovanJ. Wrote: [ -> ]Hmm you can on each award make a button with link:
"http://www.yourforum.com/private.php?action=send"
Of course with subject in link and in subject make like this "Request Donator Award", and they write message on they own..
(2011-12-08, 06:32 PM)JovanJ. Wrote: [ -> ]"http://www.yourforum.com/private.php?action=send"&uid=1&subject=SomeAward name&message=Your Message here"
Of course you put your UDI there if you are not a first user of forum also for the concept of the message i think it's possible but it's better for them to make they own message.
And i am not so sure is it possible to make it to send it in one click of button.
<?php
//award
//v2.0
//Nickman
define('IN_MYBB', 1);
require_once './global.php';
$id=intval($mybb->input['id']);
//let's check the ID real quick
if ($db->num_rows($db->simple_select("awards","id","id='$id'")) < 1)
{
unset($id);
}
$aid=intval($mybb->input['aid']);
$act=$mybb->input['act'];
//If we got an id, we're viewing a specific award
if ($id != '')
{
add_breadcrumb("View an award", "awards.php");
$award=$db->fetch_array($db->query("SELECT g.*, a.* FROM ".TABLE_PREFIX."awards_given AS g LEFT JOIN ".TABLE_PREFIX."awards AS a ON(a.id=g.award_id) WHERE g.gid='$id'"));
$user=$db->fetch_array($db->simple_select("users","username,uid","uid='{$award[to_uid]}'"));
$link=build_profile_link($user['username'],$user['uid']);
$date= my_date($mybb->settings['dateformat'],$award[date_given]);
$html="<head>
<title>{$mybb->settings['bbname']} - Awards</title>
{$headerinclude}
</head>
<body>
{$header}<br/>
<table border=\"0\" cellspacing=\"{$theme['borderwidth']}\" cellpadding=\"{$theme['tablespace']}\" class=\"tborder\" width=\"100%\">
<tr>
<td colspan='5' class=\"thead\" colspan=\"$cells\"><strong>{$award[name]}</strong></td></tr>
<tr><td class='tcat'>Award Name</td><td class='tcat'>Image</td><td class='tcat'>Reason</td><td class='tcat'>Given to</td><td class='tcat'>Given On</td></tr>
<tr><td class='trow1'>{$award[name]}</td>
<td class='trow1'><img src='{$mybb->settings['bburl']}/images/awards/{$award[image]}'/></td>
<td class='trow1'>{$award[reason]}</td><td class='trow1'>$link</td><td class='trow1'>$date</td></tr></table>
<td class='trow1'><img src='images/request_button.png'>
{$footer}
</body>
</html>";
output_page($html);
exit();
}
//Otherwise, we're listing all awards
elseif ($mybb->input['act'] == '' && $id =='')
{
add_breadcrumb("Viewing awards", "awards.php");
$awards=$db->simple_select("awards","*");
$i=1;
while ($award=$db->fetch_array($awards))
{
$awardContent.="<tr class='trow$i'><td><a href='awards.php?act=view&aid={$award[id]}' title='{$award['name']}'>{$award[name]}</a></td><td><img src='images/awards/{$award[image]}'/></td></tr>";
if ($i==1)
{
$i=2;
}
else
{$i=1;
}
}
$html="<head>
<title>{$mybb->settings['bbname']} - Awards Listing</title>
{$headerinclude}
</head>
<body>
{$header}<br/>
<table border=\"0\" cellspacing=\"{$theme['borderwidth']}\" cellpadding=\"{$theme['tablespace']}\" class=\"tborder\" width=\"100%\">
<tr>
<td colspan='5' class=\"thead\" colspan=\"$cells\">
<strong>Available {$award[name]}</strong>
</td>
</tr>
<tr>
<td class='tcat'>Award Name</td>
<td class='tcat'>Image</td>
</tr>
{$awardContent}ds","*","id='$aid'"));
add_breadcrumb("Users Awarded {$award['name']}", "awards.php?act=view&aid=$aid");
$get_users=$db->query("SELECT g.*, u.* FROM ".TABLE_PREFIX."awards_given AS g LEFT JOIN ".TABLE_PREFIX."users AS u ON(u.uid=g.to_uid) WHERE g.award_id='$aid'");
$i=1;
while ($user=$db->fetch_array($get_users))
{
$user['date']= my_date($mybb->settings['dateformat'],$user['date_given']);
$usersContent.="
<tr class='trow$i'>
<td><a href='member.php?' title='{$user['to_uid']}'>{$user['username']}</a></td>
<td>{$user['reason']}</td>
<td>{$user['date']}</td>
</tr>";
if ($i==1)
{
$i=2;
}
else
{
$i=1;
}
}
$html="<head>
<title>{$mybb->settings['bbname']} - Members who received {$award['name']}</title>
{$headerinclude}
</head>
<body>
{$header}<br/>
<table border=\"0\" cellspacing=\"{$theme['borderwidth']}\" cellpadding=\"{$theme['tablespace']}\" class=\"tborder\" width=\"100%\">
<tr>
<td colspan='5' class=\"thead\" colspan=\"$cells\">
<strong>{$award['name']} - {$award['description']}</strong>
</td>
</tr>
<tr>
<td class='tcat'>Username</td>
<td class='tcat'>Reason</td>
<td class='tcat'>Given On</td>
</tr>
{$usersContent}</table>
{$footer}
</body>
</html>";
output_page($html);
exit();
}
<INPUT TYPE="BUTTON" VALUE="Private Message Page" ONCLICK="window.location.href='http://www.yourforum.com/private.php?action=send"&uid=1&subject=SomeAward name&message=Your Message here">
?>
<FORM>
<INPUT TYPE="BUTTON" VALUE="Private Message Page" ONCLICK="window.location.href='http://www.yourforum.com/private.php?action=send"&uid=1&subject=SomeAward name&message=Your Message here">
</FORM>
Parse error: syntax error, unexpected T_STRING in /home/habfabco/public_html/forum/awards.php on line 31
etc.