<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fusion.co.uk/
+--------------------------------------------------------+
| Filename: user_awards_include.php
| Author: Ugleh
| Site: http://www.ugleh.com
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
function grabaward($awards_id){
$result = dbquery("SELECT * FROM ".DB_PREFIX."award_system"." WHERE awards_id = '$awards_id' LIMIT 1");
$data = dbarray($result);
return "<td width='1%' class='tbl2' style='white-space:nowrap'><strong>".$data['awards_title']."</strong></td>\n
<td width='1%' class='tbl2' style='white-space:nowrap'><strong><img src=\"".IMAGES."awards/".$data['awards_imageurl']."\" alt=\"".$data['awards_title']."\" title=\"".$data['awards_title']."\"></strong></td>\n
<td class='tbl2'>".$data['awards_description']."</td>";
}
if (!defined("IN_FUSION")) { die("Access Denied"); }
if ($profile_method == "input") {
//Nothing here
} elseif ($profile_method == "display") {
echo "<tr>\n";
echo "<td colspan=\"2\" class=\"tbl2\"><strong>".$locale['user_awards_name']."</strong></td>\n";
echo "</tr>\n";
$user_id = $user_data['user_id'];
$result = dbquery("SELECT * FROM ".DB_PREFIX."award_users"." WHERE user_id = '".$user_id."' ORDER BY award_time");
if (dbrows($result)) {
echo "<td width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['user_awards_002']."</strong></td>\n";
echo "<td width='1%' class='tbl2' style='white-space:nowrap'><strong>".$locale['user_awards_003']."</strong></td>\n";
echo "<td class='tbl2'><strong>".$locale['user_awards_004']."</strong></td>\n";
echo "</tr>\n";
while ($data = dbarray($result)) {
echo "<tr>";
echo "".grabaward($data['awards_id'])."";
echo "</tr>\n";
}
}else{
echo $locale['user_awards_005'];
}
echo "</tr>\n";
} elseif ($profile_method == "validate_insert") {
//Nothing here
} elseif ($profile_method == "validate_update") {
//Nothing here
}
?>
if(FUSION_SELF == "profile.php" && isset($_GET['lookup']) && isnum($_GET['lookup'])){
$result = dbquery("SELECT * FROM ".DB_PREFIX."award_users"." WHERE user_id = '".$_GET['lookup']."' ORDER BY award_time");
$awa = dbarray(dbquery("SELECT user_name FROM ".DB_USERS." WHERE user_id='".$_GET['lookup']."'"));
if (dbrows($result)) {
opentable($awa['user_name']."s Awards");
echo "<table cellpadding='0' cellspacing='1' width='600' class='center'>\n<tr>\n";
echo "<td class='tbl2'> </td>\n";
echo "<td class='tbl2' style='text-align:left;white-space:nowrap'><strong>Award Title</strong></td>\n";
echo "<td class='tbl2' style='text-align:left;white-space:nowrap'><strong>Award Description</strong></td>\n";;
echo "</tr>\n";
$aw = 0;
while ($data = dbarray($result)) {
$row_color = ($aw % 2 == 0 ? "tbl1" : "tbl2");
$result2 = dbquery("SELECT * FROM ".DB_PREFIX."award_system"." WHERE awards_id = '".$data['awards_id']."' LIMIT 1");
$data2 = dbarray($result2);
echo "<tr><td style='text-align: center;' class='".$row_color."'><strong><img style='border: 0px; vertical-align: middle;' src='".IMAGES."awards/".$data2['awards_imageurl']."' alt='".$data2['awards_title']."' title='".$data2['awards_title']."'></strong></td>\n";
echo "<td class='".$row_color."'><strong>".$data2['awards_title']."</strong></td>\n";
echo "<td class='".$row_color."'>".$data2['awards_description']."</td>";
echo "</tr>";
$aw++;
}
echo "</table>";
} else {
opentable($awa['user_name']."s Awards");
echo $awa['user_name']." has no awards yet";
}
closetable();
}
Quote
DrunkeN wrote:
Have you link to the download?
EDIT:If you use http://www.php-fusion.co.uk/infusions...don_id=513
Open infusion.php
Find thisCode Download source$inf_newtable[1] = DB_AWARDS_TABLE." (
awards_id
INT( 11 ) NOT NULL auto_increment,awards_imageurl
VARCHAR( 255 ) NOT NULL,awards_title
VARCHAR( 255 ) NOT NULL,awards_description
VARCHAR( 255 ) NOT NULL,make_public
INT( 11 ) NOT NULL default '1',
PRIMARY KEY(awards_id
)
) TYPE=MyISAM;";
$inf_newtable[2] = DB_AWARDSUSER_TABLE." (increment_id
INT( 11 ) NOT NULL auto_increment,user_id
INT( 11 ) NOT NULL,admin_id
INT( 11 ) NOT NULL,awards_id
INT( 11 ) NOT NULL,award_time
INT( 12 ) NOT NULL,
PRIMARY KEY(increment_id
)
) TYPE=MyISAM;";
Replace with thisCode Download source$inf_newtable[1] = DB_AWARDS_TABLE." (
awards_id INT(11) NOT NULL auto_increment,
awards_imageurl VARCHAR(255) NOT NULL,
awards_title VARCHAR(255) NOT NULL,
awards_description VARCHAR(255) NOT NULL,
make_public INT(11) NOT NULL default '1',
PRIMARY KEY(awards_id)
) ENGINE = MyISAM;";
$inf_newtable[2] = DB_AWARDSUSER_TABLE." (
increment_id INT(11) NOT NULL auto_increment,
user_id INT(11) NOT NULL,
admin_id INT(11) NOT NULL,
awards_id INT(11) NOT NULL,
award_time INT(12) NOT NULL,
PRIMARY KEY(increment_id)
) ENGINE = MyISAM;";
Upload and replace infusion.php and Defuse the infusion and infuse it
<td class="profile_category_name tbl2" colspan="2">
$inf_newtable[1] = DB_AWARDS_TABLE." (
awards_id
INT( 11 ) NOT NULL auto_increment,
awards_imageurl
VARCHAR( 255 ) NOT NULL,
awards_title
VARCHAR( 255 ) NOT NULL,
awards_description
VARCHAR( 255 ) NOT NULL,
make_public
INT( 11 ) NOT NULL default '1',
PRIMARY KEY(awards_id
)
) TYPE=MyISAM;";
$inf_newtable[2] = DB_AWARDSUSER_TABLE." (
increment_id
INT( 11 ) NOT NULL auto_increment,
user_id
INT( 11 ) NOT NULL,
admin_id
INT( 11 ) NOT NULL,
awards_id
INT( 11 ) NOT NULL,
award_time
INT( 12 ) NOT NULL,
PRIMARY KEY(increment_id
)
) TYPE=MyISAM;";
$inf_newtable[1] = DB_AWARDS_TABLE." (
awards_id INT(11) NOT NULL auto_increment,
awards_imageurl VARCHAR(255) NOT NULL,
awards_title VARCHAR(255) NOT NULL,
awards_description VARCHAR(255) NOT NULL,
make_public INT(11) NOT NULL default '1',
PRIMARY KEY(awards_id)
) ENGINE = MyISAM;";
$inf_newtable[2] = DB_AWARDSUSER_TABLE." (
increment_id INT(11) NOT NULL auto_increment,
user_id INT(11) NOT NULL,
admin_id INT(11) NOT NULL,
awards_id INT(11) NOT NULL,
award_time INT(12) NOT NULL,
PRIMARY KEY(increment_id)
) ENGINE = MyISAM;";
function grabaward($awards_id){
$result = dbquery("SELECT * FROM ".DB_PREFIX."award_system"." WHERE awards_id = '$awards_id' LIMIT 1");
$data = dbarray($result);
return "<td width='1%' class='tbl1' style='white-space:nowrap'><strong>".$data['awards_title']."</strong></td>\n
<td width='1%' class='tbl1' style='white-space:nowrap'><strong><img src=\"".IMAGES."awards/".$data['awards_imageurl']."\" alt=\"".$data['awards_title']."\" title=\"".$data['awards_title']."\"></strong></td>\n
<td class='tbl1'>".$data['awards_description']."</td>";
}
Category Forum
Panels and InfusionsLabels
None yet
Statistics
3 participants
Notifications
You are not receiving notifications from this thread.
Related Questions