includes/pageutils.php
changeset 78 4df25dfdde63
parent 73 0a74676a2f2f
child 81 d7fc25acd3f3
equal deleted inserted replaced
77:63ca29eda873 78:4df25dfdde63
   836     if($n < 1)
   836     if($n < 1)
   837     {
   837     {
   838       $_ob .= '<p>There are currently no comments on this '.strtolower($namespace).'';
   838       $_ob .= '<p>There are currently no comments on this '.strtolower($namespace).'';
   839       if($namespace != 'Article') $_ob .= ' page';
   839       if($namespace != 'Article') $_ob .= ' page';
   840       $_ob .= '.</p>';
   840       $_ob .= '.</p>';
   841     } else $_ob .= '<p>There '.$s.' on this article.</p>';
   841     } else $_ob .= '<p>There '.$s.' on this article.';
   842     if($session->get_permissions('mod_comments') && $num_unapp > 0) $_ob .= ' <span style="color: #D84308">'.$num_unapp.' of those are unapproved.</span>';
   842     if($session->get_permissions('mod_comments') && $num_unapp > 0) $_ob .= ' <span style="color: #D84308">'.$num_unapp.' of those are unapproved.</span>';
   843     elseif(!$session->get_permissions('mod_comments') && $num_unapp > 0) { $u = ($num_unapp == 1) ? "is $num_unapp comment" : "are $num_unapp comments"; $_ob .= ' However, there ' . $u . ' awating approval.'; }
   843     elseif(!$session->get_permissions('mod_comments') && $num_unapp > 0) { $u = ($num_unapp == 1) ? "is $num_unapp comment" : "are $num_unapp comments"; $_ob .= ' However, there ' . $u . ' awating approval.'; }
       
   844     $_ob .= '</p>';
   844     $list = 'list = { ';
   845     $list = 'list = { ';
   845     // _die(htmlspecialchars($ttext));
   846     // _die(htmlspecialchars($ttext));
   846     $i = -1;
   847     $i = -1;
   847     while($row = $db->fetchrow($lq))
   848     while($row = $db->fetchrow($lq))
   848     {
   849     {
   893         $strings['DATA'] = RenderMan::render($row['comment_data']);
   894         $strings['DATA'] = RenderMan::render($row['comment_data']);
   894         
   895         
   895         if($session->get_permissions('edit_comments'))
   896         if($session->get_permissions('edit_comments'))
   896         {
   897         {
   897           // Edit link
   898           // Edit link
   898           $strings['EDIT_LINK'] = '<a href="'.makeUrlNS($namespace, $page_id, 'do=comments&amp;sub=editcomment&amp;id='.$row['comment_id']).'" onclick="editComment(\''.$i.'\'); return false;" id="editbtn_'.$i.'">edit</a>';
   899           $strings['EDIT_LINK'] = '<a href="'.makeUrlNS($namespace, $page_id, 'do=comments&amp;sub=editcomment&amp;id='.$row['comment_id']).'" id="editbtn_'.$i.'">edit</a>';
   899         
   900         
   900           // Delete link
   901           // Delete link
   901           $strings['DELETE_LINK'] = '<a href="'.makeUrlNS($namespace, $page_id, 'do=comments&amp;sub=deletecomment&amp;id='.$row['comment_id']).'" onclick="ajaxDeleteComment(\''.$i.'\'); return false;">delete</a>';
   902           $strings['DELETE_LINK'] = '<a href="'.makeUrlNS($namespace, $page_id, 'do=comments&amp;sub=deletecomment&amp;id='.$row['comment_id']).'">delete</a>';
   902         }
   903         }
   903         else
   904         else
   904         {
   905         {
   905           // Edit link
   906           // Edit link
   906           $strings['EDIT_LINK'] = '';
   907           $strings['EDIT_LINK'] = '';
   915         // Add Buddy link
   916         // Add Buddy link
   916         $strings['ADD_BUDDY_LINK'] = ( $session->user_logged_in && $row['user_id'] > 0 ) ? '<a href="'.makeUrlNS('Special', 'PrivateMessages/FriendList/Add/'.$row['name']).'">Add to buddy list</a>' : '';
   917         $strings['ADD_BUDDY_LINK'] = ( $session->user_logged_in && $row['user_id'] > 0 ) ? '<a href="'.makeUrlNS('Special', 'PrivateMessages/FriendList/Add/'.$row['name']).'">Add to buddy list</a>' : '';
   917         
   918         
   918         // Mod links
   919         // Mod links
   919         $applink = '';
   920         $applink = '';
   920         $applink .= '<a href="'.makeUrlNS($namespace, $page_id, 'do=comments&amp;sub=admin&amp;action=approve&amp;id='.$row['comment_id']).'" onclick="ajaxCommentAdmin(\'approve\', \''.$i.'\'); return false;" id="mdgApproveLink'.$i.'">';
   921         $applink .= '<a href="'.makeUrlNS($namespace, $page_id, 'do=comments&amp;sub=admin&amp;action=approve&amp;id='.$row['comment_id']).'" id="mdgApproveLink'.$i.'">';
   921         if($row['approved']) $applink .= 'Unapprove';
   922         if($row['approved']) $applink .= 'Unapprove';
   922         else $applink .= 'Approve';
   923         else $applink .= 'Approve';
   923         $applink .= '</a>';
   924         $applink .= '</a>';
   924         $strings['MOD_APPROVE_LINK'] = $applink; unset($applink);
   925         $strings['MOD_APPROVE_LINK'] = $applink; unset($applink);
   925         $strings['MOD_DELETE_LINK'] = '<a href="'.makeUrlNS($namespace, $page_id, 'do=comments&amp;sub=admin&amp;action=delete&amp;id='.$row['comment_id']).'" onclick="ajaxCommentAdmin(\'delete\', \''.$i.'\'); return false;">Delete</a>';
   926         $strings['MOD_DELETE_LINK'] = '<a href="'.makeUrlNS($namespace, $page_id, 'do=comments&amp;sub=admin&amp;action=delete&amp;id='.$row['comment_id']).'">Delete</a>';
   926         
   927         
   927         // Signature
   928         // Signature
   928         $strings['SIGNATURE'] = '';
   929         $strings['SIGNATURE'] = '';
   929         if($row['signature'] != '') $strings['SIGNATURE'] = RenderMan::render($row['signature']);
   930         if($row['signature'] != '') $strings['SIGNATURE'] = RenderMan::render($row['signature']);
   930         
   931