Posted by topusers Sun 18th Mar 2007 21:04 - Syntax is PHP - 45 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers
PHP parser reported the following syntax error in this post:
Parse error: syntax error, unexpected '<' in post on line 1
  1. {#PLIGG_Visual_TopUsers_Statistics#}

  2.  
  3. {php}
  4. global $db, $globals, $main_smarty, $offset, $from_where, $top_users_size, $items, $order_by, $select;
  5. echo '
    ';
  6.  
  7. // Print headers
  8. for($i=0; $i($items); $i++) {
  9.     echo '
  10. ';
  11. }
  12.  
  13. echo '
  14. ';
  15.  
  16. $user = new User;
  17. $rows = $db->get_var("select count(*) as count $from_where $order_by");
  18. $users = $db->get_results("$select $from_where $order_by LIMIT $offset,$top_users_size");
  19. if ($users) {
  20.     foreach($users as $dbuser) {
  21.         $user->id=$dbuser->user_id;
  22.         $user->read();
  23.         $user->all_stats();
  24.        
  25.         $main_smarty->assign('user_userlink', getmyurl("user", $user->username));
  26.         $main_smarty->assign('user_username', $user->username);
  27.         $main_smarty->assign('user_total_links', $user->total_links);
  28.         $main_smarty->assign('user_published_links', $user->published_links);
  29.         if($user->total_links>0)
  30.             $main_smarty->assign('user_published_links_percent', intval($user->published_links/$user->total_links*100));
  31.         else
  32.             $main_smarty->assign('user_published_links_percent', '');
  33.         $main_smarty->assign('user_total_comments', $user->total_comments);
  34.         $main_smarty->assign('user_total_votes', $user->total_votes);
  35.         $main_smarty->assign('user_published_votes', $user->published_votes);
  36.         if($user->total_votes>0)
  37.             $main_smarty->assign('user_published_votes_percent', intval($user->published_votes/$user->total_votes*100));
  38.         else
  39.             $main_smarty->assign('user_published_votes_percent', '');
  40.         $main_smarty->assign('user_karma', $user->karma);
  41.        
  42.         $main_smarty->assign('user_avatar', get_avatar('large', $user->username, $user->email));
  43.        
  44.         $main_smarty->display(The_Template . "/topusers_data.tpl");
  45.  
  46.     }
  47. }
  48.  
  49. echo "
  50. ';
  51.     if($i==$_GET['sortby'])
  52.         echo ''.$items[$i].'';
  53.     else
  54.         echo '$_SERVER['PHP_SELF'].'?sortby='.$i.'">'.$items[$i].'';
  55.     echo '
  56. '.$main_smarty->get_config_vars('PLIGG_Visual_TopUsers_TH_Karma').'

    "
    ;
  57. do_pages($rows, $top_users_size, "topusers"); // show the "page" buttons at the bottom
  58. {/php}

PermaLink to this entry https://pastebin.co.uk/12008
Posted by topusers Sun 18th Mar 2007 21:04 - Syntax is PHP - 45 viewsRun this post in the PHP shell
Download | New Post | Modify | Hide line numbers

 

Comments: 0