[geeklog-cvs] geeklog-1.3/public_html article.php,1.56,1.57

dhaun at iowaoutdoors.org dhaun at iowaoutdoors.org
Sat Jan 1 10:41:13 EST 2005


Update of /var/cvs/geeklog-1.3/public_html
In directory www:/tmp/cvs-serv19009/public_html

Modified Files:
	article.php 
Log Message:
Save one SQL request for the printable view;
Added some permission checking for the story / poll id.


Index: article.php
===================================================================
RCS file: /var/cvs/geeklog-1.3/public_html/article.php,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** article.php	2 Oct 2004 13:28:31 -0000	1.56
--- article.php	1 Jan 2005 15:41:10 -0000	1.57
***************
*** 92,98 ****
  
  if ($type == 'poll') {
!     $result = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['pollquestions']} WHERE qid = '$story'");
  } else {
!     $result = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['stories']} WHERE sid = '$story'");
  }
  $A = DB_fetchArray($result);
--- 92,98 ----
  
  if ($type == 'poll') {
!     $result = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['pollquestions']} WHERE qid = '$story'" . COM_getPermSql ('AND'));
  } else {
!     $result = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['stories']} WHERE sid = '$story'" . COM_getPermSql ('AND'));
  }
  $A = DB_fetchArray($result);
***************
*** 131,135 ****
              if ($_CONF['contributedbyline'] == 1) {
                  $story_template->set_var('lang_contributedby', $LANG01[1]);
!                 $story_template->set_var('story_author', DB_getItem($_TABLES['users'],'username',"uid = '{$A['uid']}'"));
              }
              if ($A['postmode'] == 'html') {
--- 131,135 ----
              if ($_CONF['contributedbyline'] == 1) {
                  $story_template->set_var('lang_contributedby', $LANG01[1]);
!                 $story_template->set_var('story_author', $A['username']);
              }
              if ($A['postmode'] == 'html') {




More information about the geeklog-cvs mailing list