Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

User Award System 2 breaks userfields

Asked Modified Viewed 4,204 times
S
supr3m3-dalek
S
  • Junior Member, joined since
  • Contributed 11 posts on the community forums.
  • Started 4 threads in the forums
  • Started this discussions
asked
Junior Member

i have installed User Award System 2 only the included userfield is broken.
When placed it will make all userfields under it vanish?

Can someone take a look at this code and tell me whats wrong with it?
I tried to contact the creator but no response.


<?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
}
?>
0 replies

7 posts

K
Kaav
K
Kaav 10
  • Junior Member, joined since
  • Contributed 28 posts on the community forums.
  • Started 5 threads in the forums
answered
Junior Member

s21.postimg.org/mu4hpdopz/Untitled_1.png


Mine does the same jumpy thing as shown on the picture. But the panel fix did not work for me. I'm using "award system 2". Anybody know what I can do?

http://www.php-fusion.co.uk/infusions...don_id=513
0 replies
— 6 months earlier —
S
supr3m3-dalek
S
  • Junior Member, joined since
  • Contributed 11 posts on the community forums.
  • Started 4 threads in the forums
  • Started this discussions
answered
Junior Member

Thanx this works like a charm.
0 replies
D
DrunkeN
D
  • Member, joined since
  • Contributed 161 posts on the community forums.
  • Started 18 threads in the forums
answered
Member

Edit: Go to System Admin > Panels > Lower Center [New Panel] > Name the panel > Remove the content in Panel content and replace with code below > Tick > Display on all pages > Save the panel and go back to Panels and enable it

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'>&nbsp;</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();
}
Edited by DrunkeN on 27-09-2013 22:03,
0 replies
S
supr3m3-dalek
S
  • Junior Member, joined since
  • Contributed 11 posts on the community forums.
  • Started 4 threads in the forums
  • Started this discussions
answered
Junior Member

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


Yes thats to one i downloaded
And the TYPE ENGINE is the first thing i look for lol

no the code in the user field is messing things up

when i turn on the user field it breaks the page everything below the user award dispersers
s21.postimg.org/mu4hpdopz/Untitled_1.png


if you look at the image you see the user field categories namen
<td class="profile_category_name tbl2" colspan="2">
is not showing correct. i cant find out why it breaks i cant see any left open tags in the user field file.
Any help would be appreciated
0 replies
D
DrunkeN
D
  • Member, joined since
  • Contributed 161 posts on the community forums.
  • Started 18 threads in the forums
answered
Member

Have you link to the download?

EDIT:If you use http://www.php-fusion.co.uk/infusions...don_id=513

Open infusion.php

Find this
$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 this
$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
Edited by DrunkeN on 22-09-2013 18:18,
0 replies
S
supr3m3-dalek
S
  • Junior Member, joined since
  • Contributed 11 posts on the community forums.
  • Started 4 threads in the forums
  • Started this discussions
answered
Junior Member

the profile page loads it only dosn't show the user field below the award user fields

there is no error in the error logs

using latest version of php fusion


also when i try th edit a profile is save but the page is not loading the rest of the template so header footer and side panels center panels wont show up


i narrowd it dow to this pse of code from the file if i remove it there is no error

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>";
}


now to find out whats broke about it
Edited by supr3m3-dalek on 22-09-2013 17:51,
0 replies
D
DrunkeN
D
  • Member, joined since
  • Contributed 161 posts on the community forums.
  • Started 18 threads in the forums
answered
Member

Hi. What happen? Nothing displays? Profile page error? What PHP Fusion version do you use? Is there any Errors in Error Log from the user field?
0 replies

Category Forum

Panels and Infusions

Labels

None yet

Statistics

  • Views 0 views
  • Posts 7 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

K
K
Kaav 10
  • Junior Member, joined since
  • Contributed 28 posts on the community forums.
  • Started 5 threads in the forums
D
D
  • Member, joined since
  • Contributed 161 posts on the community forums.
  • Started 18 threads in the forums
S
S
  • Junior Member, joined since
  • Contributed 11 posts on the community forums.
  • Started 4 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet