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?

Error after editing profile

Asked Modified Viewed 2,048 times
A
AK
A
AK 10
  • Member, joined since
  • Contributed 50 posts on the community forums.
  • Started 15 threads in the forums
  • Started this discussions
asked
Member

Hi,
After I edite profile and press save, I get this error:

Your profile is updated

To be able to change your password, or email
you have to write your current password

Fatal error: Cannot redeclare grabaward() in /home/maskinde/public_html/includes/user_fields/user_awards_include.php on line 19

Here is a screenshot

peecee.dk/uploads/042013/error.png



Can anyone help me solve it please?
Edited by AK on 21-04-2013 16:07,
0 replies

7 posts

N
NetriX
N
NetriX 10
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Mon-Thurs. Send me a PM if urgent.
  • Senior Member, joined since
  • Contributed 566 posts on the community forums.
  • Started 93 threads in the forums
answered
Senior Member

It means you've already created a class.

For instance:

class grabaward {}

// some code here

class grabaward {}

That second instance would throw the error.

All you need to do is:

if(class_exists('grabaward') != true)
{
   //put class here
}


Or remove the duplicate class in /home/maskinde/public_html/includes/user_fields/user_awards_include.php on line 19.
0 replies
J
JoiNNN
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
answered
Veteran Member

Or the file which contains that class is included twice while running a script.
Search for include ... and replace with require_once ...
0 replies
A
AK
A
AK 10
  • Member, joined since
  • Contributed 50 posts on the community forums.
  • Started 15 threads in the forums
  • Started this discussions
answered
Member

Thanks for your replay,

I didnt create any new class/reward. I used the pre ones. And i got the error.
I then removed the assigned reward. And still getting the same error.


Im not sure if I understand what you mean. I have deleted
class grabaward {}
and added
if(class_exists('grabaward') != true)
{
But it gave me errors and etc. so i restored the old file.


And here is the whole infusion if necessary
Edited by AK on 21-04-2013 18:25,
AK attached the following file:
user-award-2.zip [No information available / 220 Downloads]
0 replies
T
Tyler
T
Tyler 10
Helping, would be pointing you in the right direction, not doing it all for you.
  • Member, joined since
  • Contributed 198 posts on the community forums.
  • Started 3 threads in the forums
answered
Member

No, don't delete class grabaward {}.

You need to place this before it

if(!class_exists('grabaward')){


and this following character after

0 replies
A
AK
A
AK 10
  • Member, joined since
  • Contributed 50 posts on the community forums.
  • Started 15 threads in the forums
  • Started this discussions
answered
Member

So it have to look like this?

<?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).
+--------------------------------------------------------*/
if(class_exists('grabaward') != true)
}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 so, im getting this error
Parse error: syntax error, unexpected '}' in /home/maskinde/public_html/includes/user_fields/user_awards_include.php on line 20
0 replies
T
Tyler
T
Tyler 10
Helping, would be pointing you in the right direction, not doing it all for you.
  • Member, joined since
  • Contributed 198 posts on the community forums.
  • Started 3 threads in the forums
answered
Member

That won't work. I've never used that addon so I have no clue of what the code consists of. This is what you need. And in the future if you can just post the entire code so we don't have to guess or do more work to help...
<?php
/*-------------------------------------------------------+
| PHPFusion Content Management System
| Copyright © 2002 - 2008 Nick Jones
| http://www.php-fu...
+--------------------------------------------------------+
| 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/licen... Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if(!function_exists('grabaward')){
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
A
AK
A
AK 10
  • Member, joined since
  • Contributed 50 posts on the community forums.
  • Started 15 threads in the forums
  • Started this discussions
answered
Member

:G Sure thing, I will do that in future
I have replaced the code, and every thing is fine now. Thank you for your help :)
0 replies

Category Forum

Panels and Infusions

Labels

None yet

Statistics

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

4 participants

N
N
NetriX 10
Need help? Having trouble?
» View our Documentation for guides, functions and more - including the Getting Started section!
» Attach Log Files and Screenshots when reporting issues
» My support days are usually Mon-Thurs. Send me a PM if urgent.
  • Senior Member, joined since
  • Contributed 566 posts on the community forums.
  • Started 93 threads in the forums
J
J
JoiNNN 10
  • Veteran Member, joined since
  • Contributed 850 posts on the community forums.
  • Started 100 threads in the forums
T
T
Tyler 10
Helping, would be pointing you in the right direction, not doing it all for you.
  • Member, joined since
  • Contributed 198 posts on the community forums.
  • Started 3 threads in the forums
A
A
AK 10
  • Member, joined since
  • Contributed 50 posts on the community forums.
  • Started 15 threads in the forums
  • Started this discussions

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet