MyBB Community Forums

Full Version: Awards page "Request award"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
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
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, 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..

Is there a way for you to have it so the message already contains say the template like "I am owed (This award)" and the subject already filled with like award request? Also is it possible to send it without clicking sen so just clicking that buttoon? Cheers

~ David
"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 Smile 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.
(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 Smile 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.

This sounds quite good but I really need to have like a button that pms me when a user clicks that button with a preset message and subject. Cheers

~ David
You put that code in html button on awards page it's simple.

<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>

Only thing is that they just need to click after this button on Send button that's it.
Any idea where i would put this in the coding? Cheers

~ David
Hmm where ever you want, somewhere near your award image.
My php code is:
<?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">

?>

Wherever I add the code:
<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>


I keep getting the error code:
Parse error: syntax error, unexpected T_STRING in /home/habfabco/public_html/forum/awards.php on line 31
etc.

Cheers,

~ David
^ the given code is supposed to be added on a template from which you show
the available awards . it cannot be directly added to a php file (see this)
Pages: 1 2 3 4