phpslash-commit Mailing List for phpSlash (Page 86)
Brought to you by:
joestewart,
nhruby
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(11) |
Nov
(59) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(52) |
Feb
(77) |
Mar
(118) |
Apr
(76) |
May
(106) |
Jun
(145) |
Jul
(9) |
Aug
(15) |
Sep
(78) |
Oct
(83) |
Nov
(105) |
Dec
(51) |
2003 |
Jan
(105) |
Feb
(100) |
Mar
(111) |
Apr
(149) |
May
(95) |
Jun
(56) |
Jul
(8) |
Aug
(2) |
Sep
|
Oct
(22) |
Nov
(117) |
Dec
(6) |
2004 |
Jan
(1) |
Feb
|
Mar
(3) |
Apr
(25) |
May
|
Jun
(11) |
Jul
(26) |
Aug
(85) |
Sep
(119) |
Oct
(312) |
Nov
(271) |
Dec
(5) |
2005 |
Jan
(6) |
Feb
|
Mar
|
Apr
(12) |
May
(7) |
Jun
(8) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Joe S. <joe...@us...> - 2002-06-07 16:24:07
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory usw-pr-cvs1:/tmp/cvs-serv31036/phpslash-ft/class Modified Files: Block.class Block_i.class Block_admin.class Log Message: block admin cleanup Index: Block.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Block.class,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Block.class 11 Mar 2002 16:19:09 -0000 1.13 --- Block.class 7 Jun 2002 16:24:04 -0000 1.14 *************** *** 85,91 **** $this->db->query("INSERT INTO psl_block_type (id, name) VALUES ('$id','$type')"); if ($this->db->affected_rows != 1) { ! echo "Block Type: $type added with an id of: $id"; } else { ! echo "Error entering $type!"; } } --- 85,93 ---- $this->db->query("INSERT INTO psl_block_type (id, name) VALUES ('$id','$type')"); if ($this->db->affected_rows != 1) { ! $this->message = "Block Type: $type added with an id of: $id"; ! return true; } else { ! $this->message = "Error entering $type!"; ! return false; } } *************** *** 122,127 **** $go_ahead = false; $title = $this->db->Record["title"]; ! echo "Sorry, this block_type($type_name) is assigned to this block:"; ! echo "<font color=\"red\">'$title'</font><br />\n"; } --- 124,129 ---- $go_ahead = false; $title = $this->db->Record["title"]; ! $this->message = "Sorry, this block_type($type_name) is assigned to this block:"; ! $this->message .= "<font color=\"red\">'$title'</font><br />\n"; } *************** *** 133,137 **** WHERE name = '$type_name'"; $this->db->query($q); ! echo "<i>Block Type $type_name deleted</i>"; return true; --- 135,139 ---- WHERE name = '$type_name'"; $this->db->query($q); ! $this->message = "<i>Block Type $type_name deleted</i>"; return true; *************** *** 211,215 **** $optionval_ary = $block_array[optionval]; ! for( $i=1 ; $i <= count($block_array[optionname]) ; $i++) { if( $optionname_ary[$i] != "") { $optname = $optionname_ary[$i]; --- 213,217 ---- $optionval_ary = $block_array[optionval]; ! for( $i=0 ; $i < count($block_array[optionname]) ; $i++) { if( $optionname_ary[$i] != "") { $optname = $optionname_ary[$i]; *************** *** 230,234 **** if ($block_array["block_id"] != "") { ! echo "Updating Block " . $block_array["block_id"] . "<br>\n"; $section_del = "DELETE FROM psl_section_block_lut --- 232,236 ---- if ($block_array["block_id"] != "") { ! $this->message = "Updating Block " . $block_array["block_id"] . "<br>\n"; $section_del = "DELETE FROM psl_section_block_lut *************** *** 258,262 **** } else { ! echo "Creating new block from submitted info.<br>\n"; $block_array["block_id"] = generateID("psl_block_seq"); --- 260,264 ---- } else { ! $this->message = "Creating new block from submitted info.<br>\n"; $block_array["block_id"] = generateID("psl_block_seq"); *************** *** 280,284 **** '$block_array[ordernum]', '$serial_opts')"; ! echo "Adding the block to the db...<br>\n"; $this->db->query($query); --- 282,286 ---- '$block_array[ordernum]', '$serial_opts')"; ! $this->message .= "Adding the block to the db...<br>\n"; $this->db->query($query); *************** *** 299,318 **** } } else { ! echo "No section chosen. Block will not be displayed on site till a section is chosen for block: <i>$block_array[block_title]</i><br>\n"; } ! echo "Checking db...<br>\n"; if ($this->db->affected_rows() == 1) { ! echo "Here's a preview...<br>\n"; # $testid = $block_array[block_id]; # echo "<BR><BR><B>Before DoBlock!! -> $testid</B><BR><BR>\n"; logwrite("Block Addition", "Added block " . $block_array['block_id']); ! print $this->doBlock($block_array["block_id"]); } else { ! echo "Error adding block. Query returned multiple results.<br>"; } } else { ! echo "Block::putBlock() received data not in an array.<br>\n"; } } --- 301,323 ---- } } else { ! $this->message .= "No section chosen. Block will not be displayed on site till a section is chosen for block: <i>$block_array[block_title]</i><br>\n"; } ! $this->message .= "Checking db...<br>\n"; if ($this->db->affected_rows() == 1) { ! // $this->message .= "Here's a preview...<br>\n"; # $testid = $block_array[block_id]; # echo "<BR><BR><B>Before DoBlock!! -> $testid</B><BR><BR>\n"; logwrite("Block Addition", "Added block " . $block_array['block_id']); ! $this->message .= $this->doBlock($block_array["block_id"]); } else { ! $this->message .= "Error adding block. Query returned multiple results.<br>"; ! return false; } } else { ! $this->message = "Block::putBlock() received data not in an array.<br>\n"; ! return false; } + return $this->message; } Index: Block_i.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_i.class,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** Block_i.class 1 Jun 2002 15:52:35 -0000 1.18 --- Block_i.class 7 Jun 2002 16:24:04 -0000 1.19 *************** *** 148,162 **** $link = ""; } if (is_array($ary['block_options'])) { ! if (is_string($ary["block_options"]["width"])) { ! $width = $ary["block_options"]["width"]; ! } ! if (is_string($ary["block_options"]["box_type"])) { ! $box_type = $ary["block_options"]["box_type"]; } } // debug("Block_i.class::parseBlock::ary", $ary); ! return getFancyBox($width, $temptitle, $ary["cache_data"],$link, $box_type); } } --- 148,199 ---- $link = ""; } + + $var_ary = ""; + if (is_array($ary['block_options'])) { ! // remove column from array ! unset($ary["block_options"]["column"]); ! while( list( $key, $val) = @each( $ary["block_options"] )) { ! ! switch($key) { ! ! case "width": ! // pass width to getFancyBox ! $width = $ary["block_options"]["width"]; ! // remove width from array ! $ary["block_options"]["width"] = ''; ! break; ! ! case "box_type": ! // pass box_type to getFancyBox ! $box_type = $ary["block_options"]["box_type"]; ! // remove box_type from array ! $ary["block_options"]["box_type"] = ''; ! break; ! ! case "perms": ! // remove perms from array ! $ary["block_options"]["perms"] = ''; ! break; ! ! default: ! // pluggable user defined function ! if ($this->psl['block_options_udf'] != '') { ! $ary = $this->psl['block_options_udf']($key, $value, $ary); ! } ! // let the fancybox template parse any block options left over. ! $var_ary = array(strtoupper($key) => $ary['block_options'][$key]); ! $ary['block_options'][$key] = ''; ! // what is left over? ! // debug("block_options[$key]", $val); ! break; ! ! } } + } // debug("Block_i.class::parseBlock::ary", $ary); ! return getFancyBox($width, $temptitle, $ary["cache_data"],$link, $box_type, $var_ary); } } Index: Block_admin.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_admin.class,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Block_admin.class 1 Jun 2002 16:14:03 -0000 1.1 --- Block_admin.class 7 Jun 2002 16:24:04 -0000 1.2 *************** *** 42,46 **** /* Start Template Object */ ! $this->templ = new Template($this->psl['templatedir']); $this->templ->debug = 0; --- 42,46 ---- /* Start Template Object */ ! $this->templ = new Template($this->psl['templatedir'], "remove"); $this->templ->debug = 0; *************** *** 69,74 **** function newBlock() { - titlebar("100%", "Create a New Block"); - $ary = $this->getTypes(); $this->templ->set_block("newblock","block_type_row","block_type_rows"); --- 69,72 ---- *************** *** 95,112 **** $this->templ->parse("section_rows","section_row",true); } - $this->templ->set_block("newblock","each_option", "options"); - $blockcnt = $this->psl[block_optioncount]; - for ($i =1; $i <= $blockcnt; $i++) { - $this->templ->set_var(array( - 'OPTION_NAME' => "optionname[$i]", - 'OPTION_NAME_VAL' => "", - 'OPTION_VALUE' => "optionval[$i]", - 'OPTION_VALUE_VAL' => "" - )); - $this->templ->parse("options", "each_option", true); - } /* display a blank form */ $this->templ->set_var(array( 'ACTION_URL' => $this->psl['phpself'], 'BLOCK_TITLE' => "", --- 93,100 ---- $this->templ->parse("section_rows","section_row",true); } /* display a blank form */ $this->templ->set_var(array( + 'TITLEBAR' => getTitlebar("100%", "Create a New Block"), 'ACTION_URL' => $this->psl['phpself'], 'BLOCK_TITLE' => "", *************** *** 119,124 **** )); ! $this->templ->parse('OUT',array("newblock")); ! $this->templ->p('OUT'); } --- 107,114 ---- )); ! $this->templ = displayoptions('block', $this->templ, "newblock", ''); ! ! return $this->templ->parse('OUT',array("newblock")); ! // $this->templ->p('OUT'); } *************** *** 133,140 **** function editBlock($id) { - titlebar("100%", "Update a Block"); $this->getBlock($id); - /* * Get the section_id's for this story into an array --- 123,128 ---- *************** *** 154,158 **** $this->templ->set_block("editblock","block_type_row","block_type_rows"); $this->templ->set_block("editblock","section_row","section_rows"); ! $this->templ->set_block("editblock","each_option", "options"); $ary = $this->getTypes(); --- 142,146 ---- $this->templ->set_block("editblock","block_type_row","block_type_rows"); $this->templ->set_block("editblock","section_row","section_rows"); ! // $this->templ->set_block("editblock","each_option", "options"); $ary = $this->getTypes(); *************** *** 194,230 **** reset($temparray); } - $blockcnt = $this->psl['block_optioncount']; - $i = 1; - - if (is_array($temparray)) { - for ($i =1; $i <= count($temparray); $i++) { - $current=each($temparray); - if ($current) { - $this->templ->set_var(array( - 'OPTION_NAME' => "optionname[$i]", - 'OPTION_NAME_VAL' => $current[0], - 'OPTION_VALUE' => "optionval[$i]", - 'OPTION_VALUE_VAL' => $current[1] - )); - } - $this->templ->parse("options", "each_option", true); - } - if( (count($temparray) - $blockcnt) >= 0) { - $blockcnt = $i; // spit out one more; - } - } - - while ($i <= $blockcnt) { - $this->templ->set_var(array( - 'OPTION_NAME' => "optionname[$i]", - 'OPTION_NAME_VAL' => "", - 'OPTION_VALUE' => "optionval[$i]", - 'OPTION_VALUE_VAL' => "" - )); - $this->templ->parse("options", "each_option", true); - $i++; - } $this->templ->set_var(array( 'ACTION_URL' => $this->psl['phpself'], 'BLOCK_TITLE' => $this->block_info["title"], --- 182,188 ---- reset($temparray); } $this->templ->set_var(array( + 'TITLEBAR' => getTitlebar("100%", "Update a Block"), 'ACTION_URL' => $this->psl['phpself'], 'BLOCK_TITLE' => $this->block_info["title"], *************** *** 237,243 **** )); ! $this->templ->parse('OUT',array("editblock")); ! $this->templ->p('OUT'); $this->templ->set_var('OUT',""); } --- 195,204 ---- )); ! $this->templ = displayoptions('block', $this->templ, "editblock", $temparray); ! ! $output = $this->templ->parse('OUT',array("editblock")); ! // $this->templ->p('OUT'); $this->templ->set_var('OUT',""); + return $output; } *************** *** 274,277 **** --- 235,239 ---- $this->templ->set_var(array( + 'TITLEBAR' => getTitlebar("100%", "Update the Current Blocks"), 'MODIFYURL' => $modifyurl, 'DELURL' => $delurl, *************** *** 290,297 **** } ! titlebar("100%", "Update the Current Blocks"); ! ! $this->templ->parse('OUT', array("listblock")); ! $this->templ->p('OUT'); } --- 252,257 ---- } ! return $this->templ->parse('OUT', array("listblock")); ! // $this->templ->p('OUT'); } *************** *** 313,317 **** )); ! titlebar("100%","Manage Block Types"); if( $option == "all") { --- 273,277 ---- )); ! $output = getTitlebar("100%","Manage Block Types"); if( $option == "all") { *************** *** 347,351 **** } - } $this->templ->set_block("listblocktypes","addrow","rows"); --- 307,310 ---- *************** *** 360,365 **** } ! $this->templ->parse('OUT',array("listblocktypes")); ! $this->templ->p('OUT'); } elseif ($option == "add") { $this->putType($name); --- 319,324 ---- } ! $output .= $this->templ->parse('OUT',array("listblocktypes")); ! // $this->templ->p('OUT'); } elseif ($option == "add") { $this->putType($name); *************** *** 369,374 **** $this->listBlockTypes("all"); } else { ! echo "<A HREF=" . $this->psl['phpself'] . "?submit=display" . $this->psl['amp'] . "option=all>[Add or Remove Block Types]</A>"; } } --- 328,334 ---- $this->listBlockTypes("all"); } else { ! $output .= "<A HREF=" . $this->psl['phpself'] . "?submit=display" . $this->psl['amp'] . "option=all>[Add or Remove Block Types]</A>"; } + return $output; } |
From: Joe S. <joe...@us...> - 2002-06-07 16:24:07
|
Update of /cvsroot/phpslash/phpslash-ft In directory usw-pr-cvs1:/tmp/cvs-serv31036/phpslash-ft Modified Files: CHANGES Log Message: block admin cleanup Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.509 retrieving revision 1.510 diff -C2 -d -r1.509 -r1.510 *** CHANGES 3 Jun 2002 18:38:13 -0000 1.509 --- CHANGES 7 Jun 2002 16:24:04 -0000 1.510 *************** *** 13,16 **** --- 13,23 ---- 9 - Removal of something (kill -9 :) + 2002-June-07 11:00AM CDT Joe Stewart <joe...@us...> + [WT] - Block.class, Block_i.class, Block_admin.class, blockAdmin.php3, + blockList.tpl, blockEdit.tpl - block action methods return message + and status to caller. + [W] - authorAdmin.php3, login.php3, slash-all.sql - sections tweak. + [D] - phpslash.sgml - updated the changed templates. + 2002-June-03 1:00PM CDT Joe Stewart <joe...@us...> [B] - authorAdmin.php3 - column tweak. |
From: Joe S. <joe...@us...> - 2002-06-03 18:38:16
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/admin In directory usw-pr-cvs1:/tmp/cvs-serv31078/phpslash-ft/public_html/admin Modified Files: authorAdmin.php3 Log Message: column tweak Index: authorAdmin.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/admin/authorAdmin.php3,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** authorAdmin.php3 3 Jun 2002 18:11:01 -0000 1.8 --- authorAdmin.php3 3 Jun 2002 18:38:13 -0000 1.9 *************** *** 102,113 **** if (empty($rightblocks)) { // $centerblocks = $block->getBlocks($ary); ! // $tplfile = "index1col.tpl"; ! // default to 2 column for transparent upgrade ! if(empty($centerblocks)) { ! $rightblocks = $block->getBlocks($ary); ! $tplfile = 'index2colright.tpl'; ! } else { ! $tplfile = 'index3col.tpl'; ! } } else { $tplfile = 'index2colright.tpl'; --- 102,106 ---- if (empty($rightblocks)) { // $centerblocks = $block->getBlocks($ary); ! $tplfile = "index1col.tpl"; } else { $tplfile = 'index2colright.tpl'; |
From: Joe S. <joe...@us...> - 2002-06-03 18:38:16
|
Update of /cvsroot/phpslash/phpslash-ft In directory usw-pr-cvs1:/tmp/cvs-serv31078/phpslash-ft Modified Files: CHANGES Log Message: column tweak Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.508 retrieving revision 1.509 diff -C2 -d -r1.508 -r1.509 *** CHANGES 3 Jun 2002 18:19:39 -0000 1.508 --- CHANGES 3 Jun 2002 18:38:13 -0000 1.509 *************** *** 13,16 **** --- 13,18 ---- 9 - Removal of something (kill -9 :) + 2002-June-03 1:00PM CDT Joe Stewart <joe...@us...> + [B] - authorAdmin.php3 - column tweak. 2002-June-03 1:00PM CDT Joe Stewart <joe...@us...> |
From: Joe S. <joe...@us...> - 2002-06-03 18:19:42
|
Update of /cvsroot/phpslash/phpslash-ft In directory usw-pr-cvs1:/tmp/cvs-serv25165/phpslash-ft Modified Files: CHANGES Log Message: config.php3 typo Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.507 retrieving revision 1.508 diff -C2 -d -r1.507 -r1.508 *** CHANGES 3 Jun 2002 18:11:00 -0000 1.507 --- CHANGES 3 Jun 2002 18:19:39 -0000 1.508 *************** *** 13,16 **** --- 13,20 ---- 9 - Removal of something (kill -9 :) + + 2002-June-03 1:00PM CDT Joe Stewart <joe...@us...> + [B] - config.php3 - typo. + 2002-June-03 1:00PM CDT Joe Stewart <joe...@us...> [B] - slashAuthCR.tpl - tweak to login for user accounts using older perms. |
From: Joe S. <joe...@us...> - 2002-06-03 18:19:42
|
Update of /cvsroot/phpslash/phpslash-ft/public_html In directory usw-pr-cvs1:/tmp/cvs-serv25165/phpslash-ft/public_html Modified Files: config.php3 Log Message: config.php3 typo Index: config.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/config.php3,v retrieving revision 1.143 retrieving revision 1.144 diff -C2 -d -r1.143 -r1.144 *** config.php3 1 Jun 2002 16:11:46 -0000 1.143 --- config.php3 3 Jun 2002 18:19:40 -0000 1.144 *************** *** 444,448 **** require($_PSL['classdir'] . "/Story_base.class"); require($_PSL['classdir'] . "/Story.class"); ! require($_PSL['classdir'] . "/Story_admin.class" } --- 444,448 ---- require($_PSL['classdir'] . "/Story_base.class"); require($_PSL['classdir'] . "/Story.class"); ! require($_PSL['classdir'] . "/Story_admin.class"); } |
From: Joe S. <joe...@us...> - 2002-06-03 18:11:04
|
Update of /cvsroot/phpslash/phpslash-ft In directory usw-pr-cvs1:/tmp/cvs-serv21615/phpslash-ft Modified Files: CHANGES Log Message: author admin method cleanup Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.506 retrieving revision 1.507 diff -C2 -d -r1.506 -r1.507 *** CHANGES 3 Jun 2002 18:04:54 -0000 1.506 --- CHANGES 3 Jun 2002 18:11:00 -0000 1.507 *************** *** 33,37 **** to generalized function displayOptions. - >>>>>>> 1.505 2002-May-31 2:00PM CDT Joe Stewart <joe...@us...> [FTD] - functions.inc - new function, emailNotify. General function to --- 33,36 ---- |
From: Joe S. <joe...@us...> - 2002-06-03 18:11:04
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/admin In directory usw-pr-cvs1:/tmp/cvs-serv21615/phpslash-ft/public_html/admin Modified Files: authorAdmin.php3 Log Message: author admin method cleanup Index: authorAdmin.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/admin/authorAdmin.php3,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** authorAdmin.php3 3 Jun 2002 18:04:55 -0000 1.7 --- authorAdmin.php3 3 Jun 2002 18:11:01 -0000 1.8 *************** *** 22,26 **** case "delete": ! if ($perm->have_perm("deleteAuthor")) { $success = $author->deleteAuthor($id, $auth->auth["uid"]); if($success) { --- 22,26 ---- case "delete": ! if ($perm->have_perm("authorDelete")) { $success = $author->deleteAuthor($id, $auth->auth["uid"]); if($success) { *************** *** 46,50 **** break; case "lostpw": ! if ($perm->have_perm("authorLostPW")) { $success = $author->lostpw($HTTP_GET_VARS, $auth->auth["uid"]); if($success) { --- 46,51 ---- break; case "lostpw": ! // if ($perm->have_perm("authorLostPW")) { ! if ($perm->have_perm("authorList")) { $success = $author->lostpw($HTTP_GET_VARS, $auth->auth["uid"]); if($success) { |
From: Joe S. <joe...@us...> - 2002-06-03 18:04:58
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/templates/en/default In directory usw-pr-cvs1:/tmp/cvs-serv19295/phpslash-ft/public_html/templates/en/default Modified Files: authorNew.tpl authorList.tpl Log Message: author admin method cleanup Index: authorNew.tpl =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/templates/en/default/authorNew.tpl,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** authorNew.tpl 31 May 2002 16:45:56 -0000 1.10 --- authorNew.tpl 3 Jun 2002 18:04:55 -0000 1.11 *************** *** 1,3 **** --- 1,4 ---- <!-- authorNew.tpl --> + {TITLEBAR} <FORM ACTION="{ACTION_URL}" METHOD=POST> <TABLE BORDER=0> Index: authorList.tpl =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/templates/en/default/authorList.tpl,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** authorList.tpl 20 May 2002 19:54:17 -0000 1.8 --- authorList.tpl 3 Jun 2002 18:04:55 -0000 1.9 *************** *** 1,3 **** --- 1,4 ---- <!-- authorList.tpl --> + {TITLEBAR} <FORM ACTION="{ACTION_URL}" METHOD=POST> <TABLE border=0 cellpadding=3 cellspacing=0> |
From: Joe S. <joe...@us...> - 2002-06-03 18:04:58
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/templates/en/basic In directory usw-pr-cvs1:/tmp/cvs-serv19295/phpslash-ft/public_html/templates/en/basic Modified Files: authorNew.tpl authorList.tpl Log Message: author admin method cleanup Index: authorNew.tpl =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/templates/en/basic/authorNew.tpl,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** authorNew.tpl 31 May 2002 16:45:56 -0000 1.4 --- authorNew.tpl 3 Jun 2002 18:04:55 -0000 1.5 *************** *** 1,4 **** --- 1,5 ---- <!-- start authorNew.tpl --> <div id="authorNew"> + {TITLEBAR} <form action="{ACTION_URL}" method="post"> <table border="0"> Index: authorList.tpl =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/templates/en/basic/authorList.tpl,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** authorList.tpl 20 May 2002 19:54:17 -0000 1.3 --- authorList.tpl 3 Jun 2002 18:04:55 -0000 1.4 *************** *** 1,5 **** <!-- start authorList.tpl --> <div id="authorList"> ! <form action="{ACTION_URL}" method="post"> <table border="0" cellpadding="3" cellspacing="0"> --- 1,5 ---- <!-- start authorList.tpl --> <div id="authorList"> ! {TITLEBAR} <form action="{ACTION_URL}" method="post"> <table border="0" cellpadding="3" cellspacing="0"> |
From: Joe S. <joe...@us...> - 2002-06-03 18:04:58
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/admin In directory usw-pr-cvs1:/tmp/cvs-serv19295/phpslash-ft/public_html/admin Modified Files: authorAdmin.php3 Log Message: author admin method cleanup Index: authorAdmin.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/admin/authorAdmin.php3,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** authorAdmin.php3 20 May 2002 19:54:17 -0000 1.6 --- authorAdmin.php3 3 Jun 2002 18:04:55 -0000 1.7 *************** *** 13,83 **** *****************************/ ! $auth->login_if(!$perm->have_perm('author')); ! ! slashhead($pagetitle,$xsiteobject); ! ! /* DEBUG */ ! ! debug("HTTP_POST_VARS", $HTTP_POST_VARS); ! debug("HTTP_GET_VARS", $HTTP_GET_VARS); ! debug("author_id_ary", $author_id_ary); ! debug("author_name_ary", $author_name_ary); ! debug("real_name_ary", $author_name_ary); ! debug("email", $email); ! debug("quote", $quote); ! debug("password", $password); ! debug("permission", $permission); ! /* DEBUG */ $author = new Author; ! if ($perm->have_perm("author")) { ! switch ($submit) { ! case "delete": ! $success = $author->deleteAuthor($id, $auth->auth["uid"]); ! if($success) { ! echo message( pslgetText($author->message)); ! } else { ! error( pslgetText($author->message)); } - $author->newAuthor(); - $author->listAuthor(); break; case "edit": ! $author->editAuthor($id); ! $author->listAuthor(); ! break; case "lostpw": ! $success = $author->lostpw($HTTP_GET_VARS, $auth->auth["uid"]); ! if($success) { ! echo message( pslgetText($author->message)); ! } else { ! error( pslgetText($author->message)); } ! $author->newAuthor(); ! $author->listAuthor(); ! break; case "update": case "new": ! $success = $author->saveAuthor($HTTP_POST_VARS); ! if(isset($success)) { ! echo message( pslgetText($author->message)); ! } else { ! error( pslgetText($author->message)); } default: ! $author->newAuthor(); ! $author->listAuthor(); } } else { ! titlebar("100%","Error! Invalid Privileges"); ! echo "Sorry. You do not have the necessary privilege to view this page."; } ! slashfoot(); page_close(); --- 13,148 ---- *****************************/ ! $auth->login_if(!$perm->have_perm('authorList')); ! $content = ''; $author = new Author; ! switch ($submit) { ! case "delete": ! if ($perm->have_perm("deleteAuthor")) { ! $success = $author->deleteAuthor($id, $auth->auth["uid"]); ! if($success) { ! $content .= getMessage( pslgetText($author->message)); ! } else { ! $content .= getError( pslgetText($author->message)); ! } ! } ! if ($perm->have_perm("authorNew")) { ! $content .= $author->newAuthor(); ! } ! if ($perm->have_perm("authorList")) { ! $content .= $author->listAuthor(); } break; case "edit": ! if ($perm->have_perm("authorEdit")) { ! $content .= $author->editAuthor($id); ! } ! if ($perm->have_perm("authorList")) { ! $content .= $author->listAuthor(); ! } ! break; case "lostpw": ! if ($perm->have_perm("authorLostPW")) { ! $success = $author->lostpw($HTTP_GET_VARS, $auth->auth["uid"]); ! if($success) { ! $content .= getMessage( pslgetText($author->message)); ! } else { ! $content .= getError( pslgetText($author->message)); ! } } ! if ($perm->have_perm("authorNew")) { ! $content .= $author->newAuthor(); ! } ! if ($perm->have_perm("authorList")) { ! $content .= $author->listAuthor(); ! } ! break; case "update": case "new": ! if ($perm->have_perm("authorSave")) { ! $success = $author->saveAuthor($HTTP_POST_VARS); ! if(isset($success)) { ! $content .= getMessage( pslgetText($author->message)); ! } else { ! $content .= getError( pslgetText($author->message)); ! } } default: ! if ($perm->have_perm("authorNew")) { ! $content .= $author->newAuthor(); ! } ! if ($perm->have_perm("authorList")) { ! $content .= $author->listAuthor(); ! } } + if($content == '') { + $content = getTitlebar("100%","Error! Invalid Privileges"); + $content .= "Sorry. You do not have the necessary privilege to view this page."; + } + + $block = new Block_i; + $ary['section'] = "Admin"; + + $breadcrumb = breadcrumb($ary); + + $_PSL['metatags']['object'] = $xsiteobject; + + slashhead($pagetitle,$_PSL['metatags']); + + $leftblocks = $block->getBlocks($ary, "leftadmin"); + $centerblocks = $block->getBlocks($ary, "centeradmin"); + $rightblocks = $block->getBlocks($ary, "rightadmin"); + + if (empty($leftblocks)) { + if (empty($rightblocks)) { + // $centerblocks = $block->getBlocks($ary); + // $tplfile = "index1col.tpl"; + // default to 2 column for transparent upgrade + if(empty($centerblocks)) { + $rightblocks = $block->getBlocks($ary); + $tplfile = 'index2colright.tpl'; + } else { + $tplfile = 'index3col.tpl'; + } + } else { + $tplfile = 'index2colright.tpl'; + } + } elseif (empty($rightblocks)) { + $tplfile = 'index2colleft.tpl'; } else { ! $tplfile = 'index3col.tpl'; } ! $template = new Template($_PSL['templatedir']); ! $template->debug = 0; ! $template->set_file(array( ! 'index' => $tplfile //"index3col.tpl" ! )); + if( !empty($GLOBALS['QUERY_STRING'])) { + $QUERY_STRING = '?'.$GLOBALS['QUERY_STRING']; + } else { + $QUERY_STRING = ''; + } + + $template->set_var(array( + 'QUERYSTRING' => $QUERY_STRING, + 'ROOTDIR' => $_PSL['rooturl'], + 'IMAGEDIR' => $_PSL['imageurl'], + 'BREADCRUMB' => $breadcrumb, + 'STORY_COLUMN' => $content, + 'LEFT_BLOCK_COLUMN' => $leftblocks, + 'CENTER_BLOCK_COLUMN' => $centerblocks, + 'RIGHT_BLOCK_COLUMN' => $rightblocks + )); + + $template->parse('OUT','index'); + $template->p('OUT'); + + slashfoot(); page_close(); |
From: Joe S. <joe...@us...> - 2002-06-03 18:04:57
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory usw-pr-cvs1:/tmp/cvs-serv19295/phpslash-ft/class Modified Files: functions.inc Author.class Log Message: author admin method cleanup Index: functions.inc =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/functions.inc,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** functions.inc 1 Jun 2002 15:05:39 -0000 1.105 --- functions.inc 3 Jun 2002 18:04:54 -0000 1.106 *************** *** 4,17 **** /*************************************************************************** ! function : error -> Outputs a template with $msg Parameters : $msg -> The message you want to return to someone ****************************************************************************/ ! function error ($msg) { ! echo message( $msg, "error"); } /*************************************************************************** ! function : message -> Outputs a template with $msg Parameters : $msg -> The message you want to return to someone $tpl -> template to use ( "$tpl + ".tpl") --- 4,17 ---- /*************************************************************************** ! function : getError -> returns a template with $msg Parameters : $msg -> The message you want to return to someone ****************************************************************************/ ! function getError ($msg) { ! getMessage( $msg, "error"); } /*************************************************************************** ! function : getMessage -> return a template with $msg Parameters : $msg -> The message you want to return to someone $tpl -> template to use ( "$tpl + ".tpl") *************** *** 19,23 **** ! function message($msg, $tpl="") { global $_PSL; --- 19,23 ---- ! function getMessage($msg, $tpl="") { global $_PSL; *************** *** 46,49 **** --- 46,71 ---- /*************************************************************************** + function : error -> Outputs a template with $msg + Parameters : $msg -> The message you want to return to someone + ****************************************************************************/ + function error ($msg) { + + echo getMessage( $msg, "error"); + } + + /*************************************************************************** + function : message -> Outputs a template with $msg + Parameters : $msg -> The message you want to return to someone + $tpl -> template to use ( "$tpl + ".tpl") + ****************************************************************************/ + + + function message($msg, $tpl="") { + + return getMessage( $msg, $tpl); + } + + + /*************************************************************************** function : arg_separator -> call this function to get the current arg separator default & and make it RFC1866 *************** *** 842,846 **** $string = htmlentities($pslstrings[$string]); } elseif (($_PSL['debug']) AND ($pslstrings)) { ! $string = message( $string, "messageStrike"); } return $string; --- 864,868 ---- $string = htmlentities($pslstrings[$string]); } elseif (($_PSL['debug']) AND ($pslstrings)) { ! $string = getMessage( $string, "messageStrike"); } return $string; Index: Author.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Author.class,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Author.class 1 Jun 2002 15:05:39 -0000 1.25 --- Author.class 3 Jun 2002 18:04:55 -0000 1.26 *************** *** 72,77 **** $this->db->query($q); - titlebar("100%","Existing Authors"); - $this->author_templ->set_block("listauthor","row","rows"); $this->author_templ->set_block("listauthor","row2","rows2"); --- 72,75 ---- *************** *** 84,87 **** --- 82,86 ---- $this->author_templ->set_var(array( + 'TITLEBAR' => getTitlebar("100%","Existing Authors"), 'ACTION_URL' => $this->psl['phpself'], 'AUTHOR_ID' => $author_id, *************** *** 102,107 **** $count++; }; ! $this->author_templ->parse('OUT',array("listauthor")); ! $this->author_templ->p('OUT'); } --- 101,107 ---- $count++; }; ! ! return $this->author_templ->parse('OUT',array("listauthor")); ! // $this->author_templ->p('OUT'); } *************** *** 407,412 **** function newAuthor() { - titlebar("100%","Add a new Author"); - $this->author_templ->set_block("newauthor","perm_row","perm_rows"); $this->author_templ->set_block("newauthor","permhave_row","permhave_rows"); --- 407,410 ---- *************** *** 426,429 **** --- 424,428 ---- $this->author_templ->set_var(array( + 'TITLEBAR' => getTitlebar("100%","Add a new Author"), 'ACTION_URL' => $this->psl['phpself'], 'AUTHOR_ID' => "", *************** *** 439,444 **** $this->author_templ = displayoptions('author', $this->author_templ, "newauthor", ''); ! $this->author_templ->parse('OUT',array("newauthor")); ! $this->author_templ->p('OUT'); } --- 438,443 ---- $this->author_templ = displayoptions('author', $this->author_templ, "newauthor", ''); ! return $this->author_templ->parse('OUT',array("newauthor")); ! // $this->author_templ->p('OUT'); } *************** *** 471,476 **** } - titlebar("100%","Update Author ($id)"); - $q = "SELECT * FROM psl_author --- 470,473 ---- *************** *** 489,492 **** --- 486,490 ---- $this->author_templ->set_var(array( + 'TITLEBAR' => getTitlebar("100%","Update Author ($id)"), 'ACTION_URL' => $this->psl['phpself'], 'AUTHOR_ID' => $author_id, *************** *** 525,536 **** if($i == 0) { - //debug("this->db->Record[perms]", $this->db->Record['perms']); - //$tauthor_perms = explode(',',$this->db->Record['perms'] ); - debug ("tauthor_perms", $tauthor_perms); while(list($k, $v) = each($tauthor_perms)) { $author_perms[$v] = true; } } ! debug ("author_perms", $author_perms); while(list($k, $v) = each($allperms_ary)) { if(is_array($v)) { --- 523,531 ---- if($i == 0) { while(list($k, $v) = each($tauthor_perms)) { $author_perms[$v] = true; } } ! while(list($k, $v) = each($allperms_ary)) { if(is_array($v)) { *************** *** 556,561 **** $this->author_templ = displayoptions('author', $this->author_templ, $template, $temparray); ! $this->author_templ->parse('OUT',$template); ! $this->author_templ->p('OUT'); } --- 551,556 ---- $this->author_templ = displayoptions('author', $this->author_templ, $template, $temparray); ! return $this->author_templ->parse('OUT',$template); ! // $this->author_templ->p('OUT'); } |
From: Joe S. <joe...@us...> - 2002-06-03 18:04:57
|
Update of /cvsroot/phpslash/phpslash-ft In directory usw-pr-cvs1:/tmp/cvs-serv19295/phpslash-ft Modified Files: CHANGES Log Message: author admin method cleanup Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.505 retrieving revision 1.506 diff -C2 -d -r1.505 -r1.506 *** CHANGES 1 Jun 2002 16:11:46 -0000 1.505 --- CHANGES 3 Jun 2002 18:04:54 -0000 1.506 *************** *** 13,16 **** --- 13,24 ---- 9 - Removal of something (kill -9 :) + 2002-June-03 1:00PM CDT Joe Stewart <joe...@us...> + [B] - slashAuthCR.tpl - tweak to login for user accounts using older perms. + [W] - functions.inc - wrapped error and message functions to getError and + getMessage. + [WT] - Author.class, authorAdmin.php3, authorNew.tpl, authorList.tpl - + Author methods return output to caller, authorAdmin uses index + templates. + 2002-June-1 11:00AM CDT Joe Stewart <joe...@us... [W] - Story.class, Story_admin.class, storyAdmin.php3, config.php3 - *************** *** 25,28 **** --- 33,37 ---- to generalized function displayOptions. + >>>>>>> 1.505 2002-May-31 2:00PM CDT Joe Stewart <joe...@us...> [FTD] - functions.inc - new function, emailNotify. General function to |
From: Joe S. <joe...@us...> - 2002-06-01 16:14:06
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory usw-pr-cvs1:/tmp/cvs-serv2052/phpslash-ft/class Added Files: Block_admin.class Log Message: Block_admin class --- NEW FILE: Block_admin.class --- <?php /* Block_admin.class -> Admin Interface to class Block */ /* $Id: Block_admin.class,v 1.1 2002/06/01 16:14:03 joestewart Exp $ */ /* First let's bring in my parent class */ // require($_PSL['classdir'] . '/Block.class'); /** * Interface Level access to the PHPSlash Block Engine. * * This object is how we provide the interface for block management. * */ class Block_admin extends Block_i { /* Declare properties for class Block_admin */ var $psl, $templ, $debug, $argv_ary; /* * class Block also defines the following properties: * psl, db, block_info, parser, parsedData */ /** * Block_admin - constructor for the Block_admin class * */ function Block_admin() { /* Constructor: Create sub-objects here, etc... */ $this->Block(); /* Calls the contructor for the parent class */ /* Here starts Block_i specfic construction */ global $_PSL; $this->psl = $_PSL; $this->argv_ary = ""; /* Do we debug? [Boolean] */ $this->debug = 1; /* Start Template Object */ $this->templ = new Template($this->psl['templatedir']); $this->templ->debug = 0; /* Setup the files array */ $this->templ->set_file(array( 'listblock' => "blockList.tpl", 'newblock' => "blockEdit.tpl", 'editblock' => "blockEdit.tpl" )); /* Setup the template vars. We need these in all our templates */ $this->templ->set_var( array( 'ROOTDIR' => $this->psl['rooturl'], 'IMAGEDIR' => $this->psl['imageurl'] )); } /** * newBlock - Create a New Block * * Displays the form for entry of block info * * @access private */ function newBlock() { titlebar("100%", "Create a New Block"); $ary = $this->getTypes(); $this->templ->set_block("newblock","block_type_row","block_type_rows"); while ( list( $key, $val ) = each( $ary ) ) { $this->templ->set_var(array( 'BLOCK_TYPE_ID' => $key, 'SELECTED' => "", 'BLOCK_TYPE_NAME' => $val )); $this->templ->parse("block_type_rows","block_type_row",true); } $this->templ->set_block("newblock","section_row","section_rows"); $this->db->query("SELECT section_id, section_name FROM psl_section ORDER BY section_name"); while ($this->db->next_record()) { $this->templ->set_var(array( 'SECTION_ID' => $this->db->Record[section_id], 'SELECTED' => "", 'SECTION_NAME' => $this->db->Record[section_name] )); $this->templ->parse("section_rows","section_row",true); } $this->templ->set_block("newblock","each_option", "options"); $blockcnt = $this->psl[block_optioncount]; for ($i =1; $i <= $blockcnt; $i++) { $this->templ->set_var(array( 'OPTION_NAME' => "optionname[$i]", 'OPTION_NAME_VAL' => "", 'OPTION_VALUE' => "optionval[$i]", 'OPTION_VALUE_VAL' => "" )); $this->templ->parse("options", "each_option", true); } /* display a blank form */ $this->templ->set_var(array( 'ACTION_URL' => $this->psl['phpself'], 'BLOCK_TITLE' => "", 'LOCATION' => "", 'SOURCE_URL' => "", 'EXPIRE_LENGTH' => "", 'CACHE_DATA' => "", 'BLOCK_ID' => "", 'ORDERNUM' => "" )); $this->templ->parse('OUT',array("newblock")); $this->templ->p('OUT'); } /** * editBlock - Update a New Block * * displays the form for block edits * * @param integer id * @access private */ function editBlock($id) { titlebar("100%", "Update a Block"); $this->getBlock($id); /* * Get the section_id's for this story into an array */ $q = "SELECT psl_section.section_id FROM psl_section,psl_section_block_lut WHERE psl_section_block_lut.block_id = '$id' AND psl_section.section_id = psl_section_block_lut.section_id"; $this->db->query($q); $i = 0; while ($this->db->next_record()) { $section_ary[$i] = $this->db->Record[section_id]; $i++; } $this->templ->set_block("editblock","block_type_row","block_type_rows"); $this->templ->set_block("editblock","section_row","section_rows"); $this->templ->set_block("editblock","each_option", "options"); $ary = $this->getTypes(); while ( list( $key, $val ) = each( $ary ) ) { $this->templ->set_var(array( 'BLOCK_TYPE_ID' => $key, 'SELECTED' => "", 'BLOCK_TYPE_NAME' => $val )); if ($key == $this->block_info["type_id"]) { $this->templ->set_var(array( 'SELECTED' => "SELECTED" )); } $this->templ->parse("block_type_rows","block_type_row",true); } $this->db->query("SELECT section_id, section_name FROM psl_section ORDER BY section_name"); while ($this->db->next_record()) { $this->templ->set_var(array( 'SECTION_ID' => $this->db->Record['section_id'], 'SECTION_NAME' => $this->db->Record['section_name'] )); $this->templ->set_var(SELECTED,""); for ($i = 0 ; $i < count($section_ary) ; $i++) { if ($section_ary[$i] == $this->db->Record[section_id]) { $this->templ->set_var(SELECTED,"SELECTED"); } } $this->templ->parse("section_rows","section_row",true); } $temparray=$this->block_info["block_options"]; if (is_array($temparray)) { reset($temparray); } $blockcnt = $this->psl['block_optioncount']; $i = 1; if (is_array($temparray)) { for ($i =1; $i <= count($temparray); $i++) { $current=each($temparray); if ($current) { $this->templ->set_var(array( 'OPTION_NAME' => "optionname[$i]", 'OPTION_NAME_VAL' => $current[0], 'OPTION_VALUE' => "optionval[$i]", 'OPTION_VALUE_VAL' => $current[1] )); } $this->templ->parse("options", "each_option", true); } if( (count($temparray) - $blockcnt) >= 0) { $blockcnt = $i; // spit out one more; } } while ($i <= $blockcnt) { $this->templ->set_var(array( 'OPTION_NAME' => "optionname[$i]", 'OPTION_NAME_VAL' => "", 'OPTION_VALUE' => "optionval[$i]", 'OPTION_VALUE_VAL' => "" )); $this->templ->parse("options", "each_option", true); $i++; } $this->templ->set_var(array( 'ACTION_URL' => $this->psl['phpself'], 'BLOCK_TITLE' => $this->block_info["title"], 'LOCATION' => $this->block_info["location"], 'SOURCE_URL' => $this->block_info["source_url"], 'EXPIRE_LENGTH' => $this->block_info["expire_length"], 'CACHE_DATA' => $this->block_info["cache_data"], 'ORDERNUM' => $this->block_info["ordernum"], 'BLOCK_ID' => $id )); $this->templ->parse('OUT',array("editblock")); $this->templ->p('OUT'); $this->templ->set_var('OUT',""); } /** * listBlock - list all blocks * * displays the complete list of blocks * * @access private */ function listBlock() { $query = "SELECT block.id, title, location, source_url, type.name AS type FROM psl_block block, psl_block_type type WHERE type.id = block.type ORDER BY title "; $this->db->query($query); $this->templ->set_block("listblock", "row", "rows"); $this->templ->set_block("listblock", "row2", "rows2"); while ($this->db->next_record()) { $block_id = $this->db->f("id"); $modifyurl = $this->psl['adminurl'] ."/blockAdmin.php3?submit=edit&id=". $block_id; $delurl = $this->psl['adminurl'] ."/blockAdmin.php3?submit=delete&id=". $block_id; $viewurl = $this->psl['adminurl'] ."/blockAdmin.php3?submit=view&id=". $block_id; $this->templ->set_var(array( 'MODIFYURL' => $modifyurl, 'DELURL' => $delurl, 'VIEWURL' => $viewurl, 'TITLE' => $this->db->f("title"), 'URL' => $this->db->f("location"), 'SOURCE_URL' => $this->db->f("source_url"), 'TYPE' => $this->db->f("type") )); if ($i%2 == 0) { $this->templ->parse("rows","row","true"); } else { $this->templ->parse("rows","row2","true"); } $i++; } titlebar("100%", "Update the Current Blocks"); $this->templ->parse('OUT', array("listblock")); $this->templ->p('OUT'); } /** * listBlockTypes - display a list of all available block types * * displays the complete list of available block types * Used only by admin * * @param string option * @access public */ function listBlockTypes($option="", $name="") { $this->templ = new Template($this->psl['templatedir']); $this->templ->debug = 0; $this->templ->set_file(array( listblocktypes => "blocktypeList.tpl" )); titlebar("100%","Manage Block Types"); if( $option == "all") { $fulldirlist = dir($this->psl['classdir']); $i=1; while( $eachfile = $fulldirlist->read()) { $each = $this->psl['classdir'] . "/" . $eachfile; if( (is_file($each)) AND ( preg_match('/Block_render_/i', $each)) ) { $eachtype = str_replace("Block_render_", "", $eachfile); $eachtype = str_replace(".class", "", $eachtype); $avail_ary[$eachtype] = $i; $i++; } } $current_types = $this->getTypes(); $this->templ->set_block("listblocktypes", "removerow", "removerows"); while( list($key, $val) = each($current_types) ) { $current_type = $val; $this->templ->set_var(array( REMOVENAME => $current_type, REMOVEURL => $this->psl['phpself'] ."?option=delete". $this->psl['amp'] ."name=". $current_type )); $this->templ->parse("removerows","removerow",true); if( isset($avail_ary[$current_type])) { unset($avail_ary[$current_type]); } } $this->templ->set_block("listblocktypes","addrow","rows"); while( list($key, $val) = each($avail_ary) ) { $this->templ->set_var(array( 'ADDNAME' => $key, 'ADDURL' => $this->psl[phpself] ."?option=add". $this->psl[amp] ."name=". $key )); $this->templ->parse("rows","addrow",true); } $this->templ->parse('OUT',array("listblocktypes")); $this->templ->p('OUT'); } elseif ($option == "add") { $this->putType($name); $this->listBlockTypes("all"); } elseif ($option == "delete") { $this->deleteType($name); $this->listBlockTypes("all"); } else { echo "<A HREF=" . $this->psl['phpself'] . "?submit=display" . $this->psl['amp'] . "option=all>[Add or Remove Block Types]</A>"; } } } /* End class Block_i */ ?> |
From: Joe S. <joe...@us...> - 2002-06-01 16:11:49
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory usw-pr-cvs1:/tmp/cvs-serv1464/phpslash-ft/class Modified Files: Story.class Added Files: Story_admin.class Log Message: Story_admin class --- NEW FILE: Story_admin.class --- <?php /* $Id: Story_admin.class,v 1.1 2002/06/01 16:11:46 joestewart Exp $ */ /* * Class: Story_admin * * Layer: Final (Admin) * Desc.: An Administraion class for Story * * NOTES/TO-DO: * - Inherited member variables are optional; I left them in as a * reminder -- Costas */ /* First let's bring in my parent class - moved to config.php3 jvs 11/11/2001 */ // require($_PSL[classdir] . '/Story_base.class'); class Story_admin extends Story_base { /* * MEMBER VARIABLES */ var $parent_name = "Story_base"; var $template; // var $db; var $auth; var $perm; var $psl; /* * CONSTRUCTORS */ function Story_admin () { global $auth, $perm, $_PSL; // call base class constructor $this->Story_base(); // $this->db = new slashDB; $this->perm = $perm; $this->auth = $auth; $this->psl = $_PSL; /* * Templates */ $template_ary = array( "printStory" => "story.tpl", "liststory" => "storyList.tpl", "newstory" => "storyNew.tpl", "indexstory" => "storyIndex.tpl", "relatedlinks" => "storyRelated.tpl" ); $this->template = new Template($this->psl['templatedir'], "remove"); $this->template->debug = 0; $this->template->set_file($template_ary); // $this->template->set_unknowns("comment"); $this->template->halt_on_error = "report"; $this->template->set_var( array( 'ROOTDIR' => $this->psl['rooturl'], 'IMAGEDIR' => $this->psl['imageurl'] )); } /* * METHODS */ function deleteStory($story_id) { // gotta get the story user_id $story_ary = $this->extractStory($story_id, "Full"); $user_id = $story_ary['user_id']; if((!$this->perm->have_perm('story,storyeditor')) AND ( $user_id != $this->auth->auth['uid'])) { return false; } echo "The storyid is: $story_id<BR>\n"; $comment = new Comment; $deleted_comments = $comment->delete("0",$story_id); echo "You deleted $deleted_comments comments<BR>\n"; $section_del = "DELETE FROM psl_section_lut WHERE story_id = '$story_id'"; $topic_del = "DELETE FROM psl_topic_lut WHERE story_id = '$story_id'"; $story_del = "DELETE FROM psl_story WHERE story_id = '$story_id'"; if ($this->db->query($section_del)) { $section_count = $this->db->affected_rows(); echo "removed $section_count section pointer(s)<BR>\n"; } if ($this->db->query($topic_del)) { $topic_count = $this->db->affected_rows(); echo "removed $topic_count topic pointer(s)<BR>\n"; } if ($this->db->query($story_del)) { $story_count = $this->db->affected_rows(); echo "removed the story<BR>\n"; } return true; } /* function to allow a story Preview */ function showStory($ary) { $story = new Story; $titlebar = getTitlebar("100%",$ary[title]); /* assume only one topic */ $this->template->set_var(array( 'rows' => "", 'alsoblock' => "" )); if ($this->template->get_var("row") == "") { $this->template->set_block("printStory","row","rows"); $this->template->set_block("printStory","alsotext","alsoblock"); } /* need to get story author_name as it's not passed in array */ $q = "SELECT psl_author.author_name FROM psl_author WHERE psl_author.author_id = '$ary[author_id]'"; $this->db->query($q); $this->db->next_record(); $story_author_name = $this->db->Record['author_name']; $ary['title'] = clean($ary['title']); /* * we get the time from the array if it's valid. else we generate it. */ if ($ary['datetime'] == "") { if( $ary['story_date'] ) { $ary['datetime'] = implode( '-', $ary['story_date']) ." ". implode( ':',$ary['story_time']); } else { $ary['datetime'] = date("Y-m-d H:i:s"); } } $q = "SELECT date_format('$ary[datetime]',$this->article_dateformat) AS datef"; $this->db->query($q); $this->db->next_record(); $datef = $this->db->f("datef"); if (!$datef) { $datef = date( "l F j @ h:i A"); } /* only the topic_id is passed in the topic_id_ary * so we need to get the other topic info */ $topic_id_ary = $ary['topic_id_ary']; $i = 0; $q = "SELECT psl_topic.topic_name, psl_topic.image, psl_topic.width, psl_topic.height, psl_topic.alt_text FROM psl_topic WHERE psl_topic.topic_id = '$topic_id_ary[$i]'"; $this->db->query($q); $this->db->next_record(); # set the formatting options for display only if ($ary['content'] == "exttrans") { $ary['intro_text'] = htmlentities($ary['intro_text']); $ary['body_text'] = htmlentities($ary['body_text']); } if ($ary['content'] == "plain" or $ary['content'] == "exttrans") { $ary['intro_text'] = nl2br($ary['intro_text']); $ary['intro_text'] = ereg_replace("<br><br>","<br>",$ary['intro_text']); $ary['body_text'] = nl2br($ary['body_text']); $ary['body_text'] = ereg_replace("<br><br>","<br>",$ary['body_text']); } $this->template->set_var(array( 'TITLEBAR' => $titlebar, 'TITLE' => stripslashes($ary['title']), 'INTRO_TEXT' => stripslashes($ary['intro_text']), 'BODY_TEXT' => stripslashes($ary['body_text']), 'DEPT' => $ary['dept'], 'URL' => $ary['url'], 'NAME' => $story_author_name, 'DATEF' => $datef, # 'TOPIC_ID' => urlencode($ary['topic_name']), 'TOPIC_ID' => $topic_id_ary[0], 'TOPIC_NAME' => $this->db->Record['topic_name'], 'TOPICIMAGE' => $this->db->Record['image'], 'TOPICWIDTH' => $this->db->Record['width'], 'TOPICHEIGHT' => $this->db->Record['height'], 'ALTTEXT' => $this->db->Record['alt_text'], 'ARROWS' => "" )); if (is_array($topic_id_ary)) { if( count($topic_id_ary) > 1) { $this->template->parse("alsoblock", "alsotext", true); } for ($i = 1 ; $i < count($topic_id_ary) ; $i++) { $q = "SELECT psl_topic.topic_name, psl_topic.image, psl_topic.width, psl_topic.height, psl_topic.alt_text FROM psl_topic WHERE psl_topic.topic_id = '$topic_id_ary[$i]'"; $this->db->query($q); $this->db->next_record(); $list_topic_name = $this->db->Record['topic_name']; $this->template->set_var(array( 'LIST_TOPIC_ID' => $topic_id_ary[$i], 'LIST_TOPIC_NAME' => $list_topic_name, 'LIST_TOPIC_URL' => $topic_id_ary[$i] )); $this->template->parse("rows", "row", true); } } $this->template->parse('OUT', "printStory"); $this->template->p('OUT'); $this->template->set_var(array( 'rows' => "", 'alsoblock' => "" )); } /* * Displays a list of stories * Do we need this anywhere outside of admin???? */ function listStory($ary, $first) { $author_id = $ary['author_id']; $topic_id = $ary['topic_id']; $section_id = $ary['section_id']; $cmt_list = 10; /* num of stories to display before the "more" link */ $q = "SELECT story.hits, story.story_id, story.title, author.author_name, commentcount.count AS commentcount, date_format(time,$this->admin_dateformat) AS df FROM psl_story story, psl_author author,"; if ($topic_id) { $q .= " psl_topic_lut, "; } if ($section_id) { $q .= " psl_section_lut, "; } $q .= " psl_commentcount commentcount WHERE story.story_id = commentcount.count_id AND author.author_id = story.user_id "; $user_id = $this->auth->auth[uid]; // if you're not a storyeditor, then you can only view your own stories. if (!$this->perm->have_perm("story,storyeditor")) { $q .= "AND '$user_id' = story.user_id AND '$user_id' = author.author_id "; } if ($author_id) { $q .= "AND '$author_id' = story.user_id "; } if ($topic_id) { $q .= "AND story.story_id = psl_topic_lut.story_id "; $q .= "AND '$topic_id' = psl_topic_lut.topic_id "; } if ($section_id) { $q .= "AND story.story_id = psl_section_lut.story_id "; $q .= "AND '$section_id' = psl_section_lut.section_id "; } $q .= "ORDER BY time DESC"; $this->db->query($q); $count = 0; $this->template->set_block("liststory", "row", "rows"); $this->template->set_block("liststory", "row2", "rows2"); $author = new Author; $topic = new Topic; $section = new Section; $author_array = $author->getAuthors(); $topic_array = $topic->getTopics(); $section_array = $section->getSections(); $this->template->set_block("liststory", "each_author", "authors"); $this->template->set_var(array( "AUTHOR_ID" => "", "AUTHOR_NAME" => "".pslgetText("All Authors")."", "SELECTED" => "" )); $this->template->parse("authors", "each_author", "true"); while (list(, $cur_Author) = @each($author_array)) { $this->template->set_var(array( "AUTHOR_ID" => $cur_Author['id'], "AUTHOR_NAME" => $cur_Author['name'], "SELECTED" => "" )); if ($author_id == $cur_Author['id']) { $this->template->set_var(array( "SELECTED" => "selected=\"selected\"" )); } $this->template->parse("authors", "each_author", "true"); } $this->template->set_block("liststory", "each_topic", "topics"); $this->template->set_var(array( "TOPIC_ID" => "", "TOPIC_NAME" => "".pslgetText("All Topics")."", "SELECTED" => "" )); $this->template->parse("topics", "each_topic", "true"); while (list(, $cur_Topic) = each($topic_array)) { $this->template->set_var(array( "TOPIC_NAME" => $cur_Topic[name], "TOPIC_ID" => $cur_Topic[id], "SELECTED" => "" )); if ($cur_Topic[id] == $topic_id) { $this->template->set_var(array( "SELECTED" => "selected=\"selected\"" )); } $this->template->parse("topics", "each_topic", "true"); } $this->template->set_block("liststory", "each_section", "sections"); $this->template->set_var(array( "SECTION_ID" => "", "SECTION_NAME" => "".pslgetText("All Sections")."", "SELECTED" => "" )); $this->template->parse("sections", "each_section", "true"); while (list(, $cur_Section) = each($section_array)) { $this->template->set_var(array( "SECTION_NAME" => $cur_Section[name], "SECTION_ID" => $cur_Section[id], "SELECTED" => "" )); if ($cur_Section['id'] == $section_id) { $this->template->set_var(array( "SELECTED" => "selected=\"selected\"" )); } $this->template->parse("sections", "each_section", "true"); } $this->template->set_var(array( 'ACTION_URL' => $this->psl['phpself'], 'TOPIC_SELECT' => $topic_select_html, 'SECTION_SELECT' => $section_select_html, 'AUTHOR_SELECT' => $author_select_html )); while ($this->db->next_record()) { $story_id = $this->db->Record["story_id"]; $count++; if ( ($count > $first) and ($count <= ($first+$cmt_list)) ) { $view_url = $this->psl['rooturl'] . "/article.php3?story_id=$story_id"; $modify_url = $this->psl['adminurl'] . "/storyAdmin.php3?submit=edit&story_id=$story_id"; $delete_url = $this->psl['adminurl'] . "/storyAdmin.php3?submit=delete&story_id=$story_id"; $this->template->set_var(array( 'COUNT' => $count, 'VIEWURL' => $view_url, 'MODIFYURL' => $modify_url, 'DELETEURL' => $delete_url, 'TITLE' => $this->db->Record["title"], 'AUTHOR' => $this->db->Record["author_name"], 'HITS' => $this->db->Record["hits"], 'COMMENTCOUNT' => $this->db->Record["commentcount"], 'DATE' => $this->db->Record["df"] )); if ($i%2 == 0) { $this->template->parse("rows","row","true"); } else { $this->template->parse("rows","row2","true"); } $i++; } } $first += $cmt_list; $left = $count - $first; $this->template->set_var(array( 'MORE_LINK' => "" )); if ($count > $first) { $this->template->set_var(array( 'MORE_LINK' => "<a href=\"" . $this->psl['phpself'] . "?submit=modify" . $this->psl['amp'] . "author_id=" . $author_id . $this->psl['amp'] . "topic_id=" . $topic_id . $this->psl['amp'] . "section_id=" . $section_id . $this->psl['amp'] . "next=$first\">$left " . pslgetText("More")."</a>" )); } $this->template->parse('OUT', array("liststory")); $this->template->p('OUT'); } function newStory($ary,$data_source) { global $author_id,$author_name; # global $debug; # $debug = true; # debug("Story::newStory", $ary); # debug("Story::newStory::topic_ary", $ary[topic_id_ary]); # debug("Story::newStory::section_ary", $ary[section_id_ary]); // echo "<B>Data_Source: $data_source</B><BR><BR>\n"; $this->template->set_block("newstory","topic_row","topic_rows"); $this->template->set_block("newstory","section_row","section_rows"); $this->template->set_block("newstory","author_row","author_rows"); $story_id = $ary['story_id']; // echo "We're in newStory. Story_id: $story_id<BR>\n"; $this->template->set_var('PLAIN_CHKBOX',""); $this->template->set_var('HTML_CHKBOX',"CHECKED"); $this->template->set_var('EXTTRANS_CHKBOX',""); $this->template->set_block("newstory","datetime_row","datetime_rows"); $this->template->set_block("newstory","year_row","year_rows"); $this->template->set_block("newstory","month_row","month_rows"); $this->template->set_block("newstory","day_row","day_rows"); $this->template->set_block("newstory","hour_row","hour_rows"); $this->template->set_block("newstory","minute_row","minute_rows"); $this->template->set_block("newstory","second_row","second_rows"); $this->template->set_block("newstory","datetimeset_row","datetimeset_rows"); if ($data_source == "array") { /* this is what happens during a preview */ // clean() is supposed to handle arrays, but the topic/section arrays // always got mangled after the clean function. so we're doing one by one. $ary['dept'] = clean($ary['dept']); $ary['intro_text'] = clean($ary['intro_text']); $ary['body_text'] = clean($ary['body_text']); $ary['title'] = clean($ary['title']); if( $ary['story_date'] ) { $ary['datetime'] = implode( '-', $ary['story_date']) ." ". implode( ':',$ary['story_time']); } else { $ary['datetime'] = date("Y-m-d H:i:s"); } $this->template->set_var(array( 'DEPT' => $ary['dept'], 'INTROTEXT' => $ary['intro_text'], 'BODYTEXT' => $ary['body_text'], 'TITLE' => $ary['title'], 'TIME' => $ary['datetime'], 'AUTHOR_ID' => $author_id, 'AUTHOR_NAME' => $author_name )); // $this->template->set_block("newstory","datetime_row","datetime_rows"); if (!$this->perm->have_perm("story,storyeditor")) { $this->template->set_var(array( 'TYPE' => "hidden", 'TIME_VALUE' => $ary['datetime'] )); $this->template->parse("datetime_rows","datetime_row",true); } else { $datetime = split( ' ', $ary['datetime']); $story_date = split( '-', $datetime[0]); $story_time = split( ':', $datetime[1]); // setup year select box for( $i=1998; $i<2009; $i++) { $this->template->set_var(array( 'SELECTED' => '', 'STORYYEAR' => $i )); if( $i == $story_date[0]) { $this->template->set_var('SELECTED', "selected=\"selected\""); } $this->template->parse("year_rows","year_row",true); } // setup month select box for( $i=1; $i<=12; $i++) { $this->template->set_var(array( 'SELECTED' => '', 'STORYMONTH' => sprintf( "%02d", $i) )); if( $i == $story_date[1]) { $this->template->set_var('SELECTED', "selected=\"selected\""); } $this->template->parse("month_rows","month_row",true); } // setup day select box for( $i=1; $i<=31; $i++) { $this->template->set_var(array( 'SELECTED' => '', 'STORYDAY' => sprintf( "%02d", $i) )); if( $i == $story_date[2]) { $this->template->set_var('SELECTED', "selected=\"selected\""); } $this->template->parse("day_rows","day_row",true); } // setup hour select box for( $i=1; $i<=24; $i++) { $this->template->set_var(array( 'TYPE' => 'select', 'SELECTED' => '', 'STORYHOUR' => $i )); if( $i == $story_time[0]) { $this->template->set_var('SELECTED', "selected=\"selected\""); } $this->template->parse("hour_rows","hour_row",true); } // setup minute select box for( $i=1; $i<=60; $i++) { $this->template->set_var(array( 'TYPE' => 'select', 'SELECTED' => '', 'STORYMINUTE' => sprintf( "%02d", $i) )); if( $i == $story_time[1]) { $this->template->set_var('SELECTED', "selected=\"selected\""); } $this->template->parse("minute_rows","minute_row",true); } // setup seconds select box for( $i=1; $i<=60; $i++) { $this->template->set_var(array( 'TYPE' => 'select', 'SELECTED' => '', 'STORYSECOND' => sprintf( "%02d", $i) )); if( $i == $story_time[2]) { $this->template->set_var('SELECTED', "selected=\"selected\""); } $this->template->parse("second_rows","second_row",true); } $this->template->parse("datetimeset_rows","datetimeset_row",true); } if ($ary['content'] == "plain") { $this->template->set_var('PLAIN_CHKBOX',"CHECKED"); $this->template->set_var('HTML_CHKBOX',""); $this->template->set_var('EXTTRANS_CHKBOX',""); } elseif ($ary['content'] == "exttrans") { $this->template->set_var('PLAIN_CHKBOX',""); $this->template->set_var('HTML_CHKBOX',""); $this->template->set_var('EXTTRANS_CHKBOX',"CHECKED"); } else { $this->template->set_var('PLAIN_CHKBOX',""); $this->template->set_var('HTML_CHKBOX',"CHECKED"); $this->template->set_var('EXTTRANS_CHKBOX',""); } $topic_ary = $ary['topic_id_ary']; $section_ary = $ary['section_id_ary']; $user_id = $this->auth->auth['uid']; if ( $ary['author_id'] != "") { $user_id = $ary['author_id']; } } elseif ($data_source == "database") { /* this is a story from the DB */ /* * Get the topic_id's for this story into an array */ $q = "SELECT psl_topic.topic_id FROM psl_topic,psl_topic_lut WHERE psl_topic_lut.story_id = '$story_id' AND psl_topic.topic_id = psl_topic_lut.topic_id"; $this->db->query($q); $i = 0; while ($this->db->next_record()) { $topic_ary[$i] = $this->db->Record['topic_id']; // echo "ARY[ $i ] : $topic_ary[$i]<BR>\n"; $i++; } /* * Get the section_id's for this story into an array */ $q = "SELECT psl_section.section_id FROM psl_section,psl_section_lut WHERE psl_section_lut.story_id = '$story_id' AND psl_section.section_id = psl_section_lut.section_id"; $this->db->query($q); $i = 0; while ($this->db->next_record()) { $section_ary[$i] = $this->db->Record['section_id']; $i++; } /* Trying to save a query, I pulled this from outside this if statement */ $this->db->query("SELECT * from psl_story WHERE story_id = '$story_id'"); $this->db->next_record(); $this->template->set_var(array( 'DEPT' => stripslashes($this->db->Record['dept']), 'INTROTEXT' => htmlspecialchars(stripslashes($this->db->Record['intro_text'])), 'BODYTEXT' => htmlspecialchars(stripslashes($this->db->Record['body_text'])), 'TITLE' => stripslashes($this->db->Record['title']), 'TIME' => $this->db->Record['time'], 'AUTHOR_ID' => $this->db->Record['user_id'] # 'AUTHOR_NAME' => $author_name, )); $user_id = $this->db->Record['user_id']; // Normal users can't edit another user's stories if((!$this->perm->have_perm('story,storyeditor')) AND ( $user_id != $this->auth->auth['uid'])) { return false; } /* if storyeditor, enable setting of date, otherwise display date */ if (!$this->perm->have_perm("story,storyeditor")) { $this->template->set_var(array( 'TYPE' => "hidden", 'TIME_VALUE' => $this->db->Record['time'] )); $this->template->parse("datetime_rows","datetime_row",true); } else { $datetime = split( ' ', $this->db->Record['time']); $story_date = split( '-', $datetime[0]); $story_time = split( ':', $datetime[1]); // setup year select box for( $i=1998; $i<2009; $i++) { $this->template->set_var(array( 'SELECTED' => '', 'STORYYEAR' => $i )); if( $i == $story_date[0]) { $this->template->set_var('SELECTED', "selected=\"selected\""); } $this->template->parse("year_rows","year_row",true); } // setup month select box for( $i=1; $i<=12; $i++) { $this->template->set_var(array( 'TYPE' => 'select', 'SELECTED' => '', 'STORYMONTH' => sprintf( "%02d", $i) )); if( $i == $story_date[1]) { $this->template->set_var('SELECTED', "selected=\"selected\""); } $this->template->parse("month_rows","month_row",true); } // setup day select box for( $i=1; $i<=31; $i++) { $this->template->set_var(array( 'TYPE' => 'select', 'SELECTED' => '', 'STORYDAY' => sprintf( "%02d", $i) )); if( $i == $story_date[2]) { $this->template->set_var('SELECTED', "selected=\"selected\""); } $this->template->parse("day_rows","day_row",true); } // setup hour select box for( $i=1; $i<=24; $i++) { $this->template->set_var(array( 'TYPE' => 'select', 'SELECTED' => '', 'STORYHOUR' => $i )); if( $i == $story_time[0]) { $this->template->set_var('SELECTED', "selected=\"selected\""); } $this->template->parse("hour_rows","hour_row",true); } // setup minute select box for( $i=1; $i<=60; $i++) { $this->template->set_var(array( 'TYPE' => 'select', 'SELECTED' => '', 'STORYMINUTE' => sprintf( "%02d", $i) )); if( $i == $story_time[1]) { $this->template->set_var('SELECTED', "selected=\"selected\""); } $this->template->parse("minute_rows","minute_row",true); } // setup seconds select box for( $i=1; $i<=60; $i++) { $this->template->set_var(array( 'TYPE' => 'select', 'SELECTED' => '', 'STORYSECOND' => sprintf( "%02d", $i) )); if( $i == $story_time[2]) { $this->template->set_var('SELECTED', "selected=\"selected\""); } $this->template->parse("second_rows","second_row",true); } $this->template->parse("datetimeset_rows","datetimeset_row",true); } } $this->template->set_var(array( 'ACTION_URL' => "storyAdmin.php3", # 'AUTHOR_ID' => $author_id, # 'AUTHOR_NAME' => $author_name, 'STORY_ID' => $story_id )); $this->db->query("SELECT topic_id, topic_name FROM psl_topic ORDER BY topic_name"); while ($this->db->next_record()) { $this->template->set_var(array( 'TOPIC_ID' => $this->db->Record['topic_id'], 'TOPIC_NAME' => $this->db->Record['topic_name'] )); $this->template->set_var('SELECTED',""); for ($i = 0 ; $i < count($topic_ary) ; $i++) { $array = $topic_ary[$i]; $dbname = $this->db->Record['topic_id']; if ($topic_ary[$i] == $this->db->Record['topic_id']) { $this->template->set_var('SELECTED',"SELECTED"); } } $this->template->parse("topic_rows","topic_row",true); } $this->db->query("SELECT section_id, section_name FROM psl_section ORDER BY section_name"); while ($this->db->next_record()) { $this->template->set_var(array( 'SECTION_ID' => $this->db->Record['section_id'], 'SECTION_NAME' => $this->db->Record['section_name'] )); $this->template->set_var('SELECTED',""); for ($i = 0 ; $i < count($section_ary) ; $i++) { if ($section_ary[$i] == $this->db->Record['section_id']) { $this->template->set_var('SELECTED',"SELECTED"); } } $this->template->parse("section_rows","section_row",true); } if (!$this->perm->have_perm("story,storyeditor")) { $this->template->set_var(array( 'AUTHOR_ID' => $this->auth->auth['uid'], 'AUTHOR_NAME' => $this->auth->auth['uname'] )); # $this->template->set_var('AUTHOR_SELECTED',""); $this->template->set_var('AUTHOR_SELECTED',"SELECTED"); $this->template->parse("author_rows","author_row",true); } else { $q = "SELECT author_id, author_name FROM psl_author "; $q .= " ORDER BY author_name "; $this->db->query($q); while ($this->db->next_record()) { $this->template->set_var(array( AUTHOR_ID => $this->db->Record['author_id'], AUTHOR_NAME => $this->db->Record['author_name'] )); $this->template->set_var('AUTHOR_SELECTED',""); if ($this->db->Record['author_id'] == $user_id ){ $this->template->set_var('AUTHOR_SELECTED',"SELECTED"); } $this->template->parse("author_rows","author_row",true); } } $description = sprintf( "%s (%s) added new story %s as userid %s", $this->auth->auth['uname'], $this->auth->auth['uid'], $story_id, $user_id); logwrite("Story Admin", $description); $this->template->parse('OUT',array("newstory")); $this->template->p('OUT'); return true; } } ?> Index: Story.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Story.class,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** Story.class 22 Apr 2002 14:56:09 -0000 1.34 --- Story.class 1 Jun 2002 16:11:46 -0000 1.35 *************** *** 10,14 **** * * NOTES/TO-DO: - * - All globals must go. * - Inherited member variables are optional; I left them in as a * reminder -- Costas --- 10,13 ---- *************** *** 555,741 **** } /* end of function getStories */ - - function deleteStory($story_id) { - - // gotta get the story user_id - $story_ary = $this->extractStory($story_id, "Full"); - $user_id = $story_ary['user_id']; - - if((!$this->perm->have_perm('story,storyeditor')) AND - ( $user_id != $this->auth->auth['uid'])) { - return false; - } - - echo "The storyid is: $story_id<BR>\n"; - $comment = new Comment; - $deleted_comments = $comment->delete("0",$story_id); - echo "You deleted $deleted_comments comments<BR>\n"; - - $section_del = "DELETE - FROM psl_section_lut - WHERE story_id = '$story_id'"; - - $topic_del = "DELETE - FROM psl_topic_lut - WHERE story_id = '$story_id'"; - - $story_del = "DELETE - FROM psl_story - WHERE story_id = '$story_id'"; - - if ($this->db->query($section_del)) { - $section_count = $this->db->affected_rows(); - echo "removed $section_count section pointer(s)<BR>\n"; - } - if ($this->db->query($topic_del)) { - $topic_count = $this->db->affected_rows(); - echo "removed $topic_count topic pointer(s)<BR>\n"; - } - if ($this->db->query($story_del)) { - $story_count = $this->db->affected_rows(); - echo "removed the story<BR>\n"; - } - return true; - } - - /* function to allow a story Preview */ - - function showStory($ary) { - - $story = new Story; - - $titlebar = getTitlebar("100%",$ary[title]); - - /* assume only one topic */ - $this->template->set_var(array( - 'rows' => "", - 'alsoblock' => "" - )); - - - if ($this->template->get_var("row") == "") { - $this->template->set_block("printStory","row","rows"); - $this->template->set_block("printStory","alsotext","alsoblock"); - } - - /* need to get story author_name as it's not passed in array */ - $q = "SELECT psl_author.author_name - FROM psl_author - WHERE psl_author.author_id = '$ary[author_id]'"; - - $this->db->query($q); - $this->db->next_record(); - - $story_author_name = $this->db->Record['author_name']; - $ary['title'] = clean($ary['title']); - - /* - * we get the time from the array if it's valid. else we generate it. - */ - if ($ary['datetime'] == "") { - if( $ary['story_date'] ) { - $ary['datetime'] = implode( '-', $ary['story_date']) ." ". implode( ':',$ary['story_time']); - } else { - $ary['datetime'] = date("Y-m-d H:i:s"); - } - } - - $q = "SELECT date_format('$ary[datetime]',$this->article_dateformat) AS datef"; - $this->db->query($q); - $this->db->next_record(); - $datef = $this->db->f("datef"); - - if (!$datef) { - $datef = date( "l F j @ h:i A"); - - } - - /* only the topic_id is passed in the topic_id_ary - * so we need to get the other topic info - */ - $topic_id_ary = $ary['topic_id_ary']; - - $i = 0; - - $q = "SELECT psl_topic.topic_name, - psl_topic.image, - psl_topic.width, - psl_topic.height, - psl_topic.alt_text - FROM psl_topic - WHERE psl_topic.topic_id = '$topic_id_ary[$i]'"; - - $this->db->query($q); - $this->db->next_record(); - - # set the formatting options for display only - if ($ary['content'] == "exttrans") { - $ary['intro_text'] = htmlentities($ary['intro_text']); - $ary['body_text'] = htmlentities($ary['body_text']); - } - - if ($ary['content'] == "plain" or $ary['content'] == "exttrans") { - $ary['intro_text'] = nl2br($ary['intro_text']); - $ary['intro_text'] = ereg_replace("<br><br>","<br>",$ary['intro_text']); - $ary['body_text'] = nl2br($ary['body_text']); - $ary['body_text'] = ereg_replace("<br><br>","<br>",$ary['body_text']); - } - - - $this->template->set_var(array( - 'TITLEBAR' => $titlebar, - 'TITLE' => stripslashes($ary['title']), - 'INTRO_TEXT' => stripslashes($ary['intro_text']), - 'BODY_TEXT' => stripslashes($ary['body_text']), - 'DEPT' => $ary['dept'], - 'URL' => $ary['url'], - 'NAME' => $story_author_name, - 'DATEF' => $datef, - # 'TOPIC_ID' => urlencode($ary['topic_name']), - 'TOPIC_ID' => $topic_id_ary[0], - 'TOPIC_NAME' => $this->db->Record['topic_name'], - 'TOPICIMAGE' => $this->db->Record['image'], - 'TOPICWIDTH' => $this->db->Record['width'], - 'TOPICHEIGHT' => $this->db->Record['height'], - 'ALTTEXT' => $this->db->Record['alt_text'], - 'ARROWS' => "" - )); - - if (is_array($topic_id_ary)) { - - if( count($topic_id_ary) > 1) { - $this->template->parse("alsoblock", "alsotext", true); - } - for ($i = 1 ; $i < count($topic_id_ary) ; $i++) { - - $q = "SELECT psl_topic.topic_name, - psl_topic.image, - psl_topic.width, - psl_topic.height, - psl_topic.alt_text - FROM psl_topic - WHERE psl_topic.topic_id = '$topic_id_ary[$i]'"; - - $this->db->query($q); - $this->db->next_record(); - $list_topic_name = $this->db->Record['topic_name']; - $this->template->set_var(array( - 'LIST_TOPIC_ID' => $topic_id_ary[$i], - 'LIST_TOPIC_NAME' => $list_topic_name, - 'LIST_TOPIC_URL' => $topic_id_ary[$i] - )); - $this->template->parse("rows", "row", true); - } - } - $this->template->parse('OUT', "printStory"); - $this->template->p('OUT'); - - $this->template->set_var(array( - 'rows' => "", - 'alsoblock' => "" - )); - - } - function emailStory($story_id, $action) { --- 554,557 ---- *************** *** 825,1419 **** return $emailform; } - - /* - * Displays a list of stories - * Do we need this anywhere outside of admin???? - */ - function listStory($ary, $first) { - - $author_id = $ary['author_id']; - $topic_id = $ary['topic_id']; - $section_id = $ary['section_id']; - - $cmt_list = 10; /* num of stories to display before the "more" link */ - - $q = "SELECT story.hits, - story.story_id, - story.title, - author.author_name, - commentcount.count AS commentcount, - date_format(time,$this->admin_dateformat) AS df - FROM psl_story story, - psl_author author,"; - if ($topic_id) { - $q .= " psl_topic_lut, "; - } - if ($section_id) { - $q .= " psl_section_lut, "; - } - $q .= " psl_commentcount commentcount - WHERE story.story_id = commentcount.count_id - AND author.author_id = story.user_id "; - - $user_id = $this->auth->auth[uid]; - // if you're not a storyeditor, then you can only view your own stories. - if (!$this->perm->have_perm("story,storyeditor")) { - $q .= "AND '$user_id' = story.user_id - AND '$user_id' = author.author_id "; - } - if ($author_id) { - $q .= "AND '$author_id' = story.user_id "; - } - if ($topic_id) { - $q .= "AND story.story_id = psl_topic_lut.story_id "; - $q .= "AND '$topic_id' = psl_topic_lut.topic_id "; - } - if ($section_id) { - $q .= "AND story.story_id = psl_section_lut.story_id "; - $q .= "AND '$section_id' = psl_section_lut.section_id "; - } - $q .= "ORDER BY time DESC"; - - $this->db->query($q); - - $count = 0; - $this->template->set_block("liststory", "row", "rows"); - $this->template->set_block("liststory", "row2", "rows2"); - - - $author = new Author; - $topic = new Topic; - $section = new Section; - $author_array = $author->getAuthors(); - $topic_array = $topic->getTopics(); - $section_array = $section->getSections(); - - - - $this->template->set_block("liststory", "each_author", "authors"); - $this->template->set_var(array( - "AUTHOR_ID" => "", - "AUTHOR_NAME" => "".pslgetText("All Authors")."", - "SELECTED" => "" - )); - $this->template->parse("authors", "each_author", "true"); - while (list(, $cur_Author) = @each($author_array)) { - $this->template->set_var(array( - "AUTHOR_ID" => $cur_Author['id'], - "AUTHOR_NAME" => $cur_Author['name'], - "SELECTED" => "" - )); - if ($author_id == $cur_Author['id']) { - $this->template->set_var(array( - "SELECTED" => "selected=\"selected\"" - )); - } - $this->template->parse("authors", "each_author", "true"); - } - - $this->template->set_block("liststory", "each_topic", "topics"); - $this->template->set_var(array( - "TOPIC_ID" => "", - "TOPIC_NAME" => "".pslgetText("All Topics")."", - "SELECTED" => "" - )); - $this->template->parse("topics", "each_topic", "true"); - while (list(, $cur_Topic) = each($topic_array)) { - $this->template->set_var(array( - "TOPIC_NAME" => $cur_Topic[name], - "TOPIC_ID" => $cur_Topic[id], - "SELECTED" => "" - )); - if ($cur_Topic[id] == $topic_id) { - $this->template->set_var(array( - "SELECTED" => "selected=\"selected\"" - )); - } - $this->template->parse("topics", "each_topic", "true"); - } - - $this->template->set_block("liststory", "each_section", "sections"); - $this->template->set_var(array( - "SECTION_ID" => "", - "SECTION_NAME" => "".pslgetText("All Sections")."", - "SELECTED" => "" - )); - $this->template->parse("sections", "each_section", "true"); - while (list(, $cur_Section) = each($section_array)) { - $this->template->set_var(array( - "SECTION_NAME" => $cur_Section[name], - "SECTION_ID" => $cur_Section[id], - "SELECTED" => "" - )); - if ($cur_Section['id'] == $section_id) { - $this->template->set_var(array( - "SELECTED" => "selected=\"selected\"" - )); - } - $this->template->parse("sections", "each_section", "true"); - } - - $this->template->set_var(array( - 'ACTION_URL' => $this->psl['phpself'], - 'TOPIC_SELECT' => $topic_select_html, - 'SECTION_SELECT' => $section_select_html, - 'AUTHOR_SELECT' => $author_select_html - )); - - while ($this->db->next_record()) { - - $story_id = $this->db->Record["story_id"]; - $count++; - - if ( ($count > $first) and ($count <= ($first+$cmt_list)) ) { - - $view_url = $this->psl['rooturl'] . "/article.php3?story_id=$story_id"; - $modify_url = $this->psl['adminurl'] . "/storyAdmin.php3?submit=edit&story_id=$story_id"; - $delete_url = $this->psl['adminurl'] . "/storyAdmin.php3?submit=delete&story_id=$story_id"; - - $this->template->set_var(array( - 'COUNT' => $count, - 'VIEWURL' => $view_url, - 'MODIFYURL' => $modify_url, - 'DELETEURL' => $delete_url, - 'TITLE' => $this->db->Record["title"], - 'AUTHOR' => $this->db->Record["author_name"], - 'HITS' => $this->db->Record["hits"], - 'COMMENTCOUNT' => $this->db->Record["commentcount"], - 'DATE' => $this->db->Record["df"] - )); - if ($i%2 == 0) { - $this->template->parse("rows","row","true"); - } else { - $this->template->parse("rows","row2","true"); - } - $i++; - } - } - - $first += $cmt_list; - $left = $count - $first; - $this->template->set_var(array( - 'MORE_LINK' => "" - )); - if ($count > $first) { - $this->template->set_var(array( - 'MORE_LINK' => "<a href=\"" . $this->psl['phpself'] . "?submit=modify" . $this->psl['amp'] . - "author_id=" . $author_id . $this->psl['amp'] . - "topic_id=" . $topic_id . $this->psl['amp'] . - "section_id=" . $section_id . $this->psl['amp'] . - "next=$first\">$left " . pslgetText("More")."</a>" - )); - } - - $this->template->parse('OUT', array("liststory")); - $this->template->p('OUT'); - - } - - - function newStory($ary,$data_source) { - - global $author_id,$author_name; - - # global $debug; - # $debug = true; - # debug("Story::newStory", $ary); - # debug("Story::newStory::topic_ary", $ary[topic_id_ary]); - # debug("Story::newStory::section_ary", $ary[section_id_ary]); - - // echo "<B>Data_Source: $data_source</B><BR><BR>\n"; - - $this->template->set_block("newstory","topic_row","topic_rows"); - $this->template->set_block("newstory","section_row","section_rows"); - $this->template->set_block("newstory","author_row","author_rows"); - - $story_id = $ary['story_id']; - - // echo "We're in newStory. Story_id: $story_id<BR>\n"; - - $this->template->set_var('PLAIN_CHKBOX',""); - $this->template->set_var('HTML_CHKBOX',"CHECKED"); - $this->template->set_var('EXTTRANS_CHKBOX',""); - - $this->template->set_block("newstory","datetime_row","datetime_rows"); - $this->template->set_block("newstory","year_row","year_rows"); - $this->template->set_block("newstory","month_row","month_rows"); - $this->template->set_block("newstory","day_row","day_rows"); - $this->template->set_block("newstory","hour_row","hour_rows"); - $this->template->set_block("newstory","minute_row","minute_rows"); - $this->template->set_block("newstory","second_row","second_rows"); - $this->template->set_block("newstory","datetimeset_row","datetimeset_rows"); - - if ($data_source == "array") { /* this is what happens during a preview */ - - // clean() is supposed to handle arrays, but the topic/section arrays - // always got mangled after the clean function. so we're doing one by one. - $ary['dept'] = clean($ary['dept']); - $ary['intro_text'] = clean($ary['intro_text']); - $ary['body_text'] = clean($ary['body_text']); - $ary['title'] = clean($ary['title']); - if( $ary['story_date'] ) { - $ary['datetime'] = implode( '-', $ary['story_date']) ." ". implode( ':',$ary['story_time']); - } else { - $ary['datetime'] = date("Y-m-d H:i:s"); - } - $this->template->set_var(array( - 'DEPT' => $ary['dept'], - 'INTROTEXT' => $ary['intro_text'], - 'BODYTEXT' => $ary['body_text'], - 'TITLE' => $ary['title'], - 'TIME' => $ary['datetime'], - 'AUTHOR_ID' => $author_id, - 'AUTHOR_NAME' => $author_name - )); - // $this->template->set_block("newstory","datetime_row","datetime_rows"); - if (!$this->perm->have_perm("story,storyeditor")) { - $this->template->set_var(array( - 'TYPE' => "hidden", - 'TIME_VALUE' => $ary['datetime'] - )); - $this->template->parse("datetime_rows","datetime_row",true); - } else { - $datetime = split( ' ', $ary['datetime']); - $story_date = split( '-', $datetime[0]); - $story_time = split( ':', $datetime[1]); - - // setup year select box - for( $i=1998; $i<2009; $i++) { - $this->template->set_var(array( - 'SELECTED' => '', - 'STORYYEAR' => $i - )); - if( $i == $story_date[0]) { - $this->template->set_var('SELECTED', "selected=\"selected\""); - } - $this->template->parse("year_rows","year_row",true); - } - // setup month select box - for( $i=1; $i<=12; $i++) { - $this->template->set_var(array( - 'SELECTED' => '', - 'STORYMONTH' => sprintf( "%02d", $i) - )); - if( $i == $story_date[1]) { - $this->template->set_var('SELECTED', "selected=\"selected\""); - } - $this->template->parse("month_rows","month_row",true); - } - - // setup day select box - for( $i=1; $i<=31; $i++) { - $this->template->set_var(array( - 'SELECTED' => '', - 'STORYDAY' => sprintf( "%02d", $i) - )); - if( $i == $story_date[2]) { - $this->template->set_var('SELECTED', "selected=\"selected\""); - } - $this->template->parse("day_rows","day_row",true); - } - - // setup hour select box - for( $i=1; $i<=24; $i++) { - $this->template->set_var(array( - 'TYPE' => 'select', - 'SELECTED' => '', - 'STORYHOUR' => $i - )); - if( $i == $story_time[0]) { - $this->template->set_var('SELECTED', "selected=\"selected\""); - } - $this->template->parse("hour_rows","hour_row",true); - } - - // setup minute select box - for( $i=1; $i<=60; $i++) { - $this->template->set_var(array( - 'TYPE' => 'select', - 'SELECTED' => '', - 'STORYMINUTE' => sprintf( "%02d", $i) - )); - if( $i == $story_time[1]) { - $this->template->set_var('SELECTED', "selected=\"selected\""); - } - $this->template->parse("minute_rows","minute_row",true); - } - - // setup seconds select box - for( $i=1; $i<=60; $i++) { - $this->template->set_var(array( - 'TYPE' => 'select', - 'SELECTED' => '', - 'STORYSECOND' => sprintf( "%02d", $i) - )); - if( $i == $story_time[2]) { - $this->template->set_var('SELECTED', "selected=\"selected\""); - } - $this->template->parse("second_rows","second_row",true); - } - $this->template->parse("datetimeset_rows","datetimeset_row",true); - } - - if ($ary['content'] == "plain") { - $this->template->set_var('PLAIN_CHKBOX',"CHECKED"); - $this->template->set_var('HTML_CHKBOX',""); - $this->template->set_var('EXTTRANS_CHKBOX',""); - } elseif ($ary['content'] == "exttrans") { - $this->template->set_var('PLAIN_CHKBOX',""); - $this->template->set_var('HTML_CHKBOX',""); - $this->template->set_var('EXTTRANS_CHKBOX',"CHECKED"); - } else { - $this->template->set_var('PLAIN_CHKBOX',""); - $this->template->set_var('HTML_CHKBOX',"CHECKED"); - $this->template->set_var('EXTTRANS_CHKBOX',""); - } - - $topic_ary = $ary['topic_id_ary']; - $section_ary = $ary['section_id_ary']; - - $user_id = $this->auth->auth['uid']; - if ( $ary['author_id'] != "") { - $user_id = $ary['author_id']; - } - } elseif ($data_source == "database") { /* this is a story from the DB */ - - /* - * Get the topic_id's for this story into an array - */ - $q = "SELECT psl_topic.topic_id - FROM psl_topic,psl_topic_lut - WHERE psl_topic_lut.story_id = '$story_id' - AND psl_topic.topic_id = psl_topic_lut.topic_id"; - $this->db->query($q); - $i = 0; - while ($this->db->next_record()) { - $topic_ary[$i] = $this->db->Record['topic_id']; - // echo "ARY[ $i ] : $topic_ary[$i]<BR>\n"; - $i++; - } - - /* - * Get the section_id's for this story into an array - */ - $q = "SELECT psl_section.section_id - FROM psl_section,psl_section_lut - WHERE psl_section_lut.story_id = '$story_id' - AND psl_section.section_id = psl_section_lut.section_id"; - $this->db->query($q); - $i = 0; - - while ($this->db->next_record()) { - $section_ary[$i] = $this->db->Record['section_id']; - $i++; - } - - /* Trying to save a query, I pulled this from outside this if statement */ - $this->db->query("SELECT * from psl_story WHERE story_id = '$story_id'"); - $this->db->next_record(); - - $this->template->set_var(array( - 'DEPT' => stripslashes($this->db->Record['dept']), - 'INTROTEXT' => htmlspecialchars(stripslashes($this->db->Record['intro_text'])), - 'BODYTEXT' => htmlspecialchars(stripslashes($this->db->Record['body_text'])), - 'TITLE' => stripslashes($this->db->Record['title']), - 'TIME' => $this->db->Record['time'], - 'AUTHOR_ID' => $this->db->Record['user_id'] - # 'AUTHOR_NAME' => $author_name, - - )); - $user_id = $this->db->Record['user_id']; - - // Normal users can't edit another user's stories - if((!$this->perm->have_perm('story,storyeditor')) AND - ( $user_id != $this->auth->auth['uid'])) { - return false; - } - - /* if storyeditor, enable setting of date, otherwise display date */ - if (!$this->perm->have_perm("story,storyeditor")) { - $this->template->set_var(array( - 'TYPE' => "hidden", - 'TIME_VALUE' => $this->db->Record['time'] - )); - $this->template->parse("datetime_rows","datetime_row",true); - } else { - $datetime = split( ' ', $this->db->Record['time']); - $story_date = split( '-', $datetime[0]); - $story_time = split( ':', $datetime[1]); - - // setup year select box - for( $i=1998; $i<2009; $i++) { - $this->template->set_var(array( - 'SELECTED' => '', - 'STORYYEAR' => $i - )); - - if( $i == $story_date[0]) { - $this->template->set_var('SELECTED', "selected=\"selected\""); - } - $this->template->parse("year_rows","year_row",true); - } - - // setup month select box - for( $i=1; $i<=12; $i++) { - $this->template->set_var(array( - 'TYPE' => 'select', - 'SELECTED' => '', - 'STORYMONTH' => sprintf( "%02d", $i) - )); - if( $i == $story_date[1]) { - $this->template->set_var('SELECTED', "selected=\"selected\""); - } - $this->template->parse("month_rows","month_row",true); - } - - // setup day select box - for( $i=1; $i<=31; $i++) { - $this->template->set_var(array( - 'TYPE' => 'select', - 'SELECTED' => '', - 'STORYDAY' => sprintf( "%02d", $i) - )); - if( $i == $story_date[2]) { - $this->template->set_var('SELECTED', "selected=\"selected\""); - } - $this->template->parse("day_rows","day_row",true); - } - - // setup hour select box - for( $i=1; $i<=24; $i++) { - $this->template->set_var(array( - 'TYPE' => 'select', - 'SELECTED' => '', - 'STORYHOUR' => $i - )); - if( $i == $story_time[0]) { - $this->template->set_var('SELECTED', "selected=\"selected\""); - } - $this->template->parse("hour_rows","hour_row",true); - } - - // setup minute select box - for( $i=1; $i<=60; $i++) { - $this->template->set_var(array( - 'TYPE' => 'select', - 'SELECTED' => '', - 'STORYMINUTE' => sprintf( "%02d", $i) - )); - if( $i == $story_time[1]) { - $this->template->set_var('SELECTED', "selected=\"selected\""); - } - $this->template->parse("minute_rows","minute_row",true); - } - - // setup seconds select box - for( $i=1; $i<=60; $i++) { - $this->template->set_var(array( - 'TYPE' => 'select', - 'SELECTED' => '', - 'STORYSECOND' => sprintf( "%02d", $i) - )); - if( $i == $story_time[2]) { - $this->template->set_var('SELECTED', "selected=\"selected\""); - } - $this->template->parse("second_rows","second_row",true); - } - $this->template->parse("datetimeset_rows","datetimeset_row",true); - } - - } - - $this->template->set_var(array( - 'ACTION_URL' => "storyAdmin.php3", - # 'AUTHOR_ID' => $author_id, - # 'AUTHOR_NAME' => $author_name, - 'STORY_ID' => $story_id - )); - - - $this->db->query("SELECT topic_id, - topic_name - FROM psl_topic - ORDER BY topic_name"); - while ($this->db->next_record()) { - $this->template->set_var(array( - 'TOPIC_ID' => $this->db->Record['topic_id'], - 'TOPIC_NAME' => $this->db->Record['topic_name'] - )); - - $this->template->set_var('SELECTED',""); - for ($i = 0 ; $i < count($topic_ary) ; $i++) { - - $array = $topic_ary[$i]; - $dbname = $this->db->Record['topic_id']; - - if ($topic_ary[$i] == $this->db->Record['topic_id']) { - $this->template->set_var('SELECTED',"SELECTED"); - } - } - - $this->template->parse("topic_rows","topic_row",true); - } - - $this->db->query("SELECT section_id, - section_name - FROM psl_section - ORDER BY section_name"); - while ($this->db->next_record()) { - $this->template->set_var(array( - 'SECTION_ID' => $this->db->Record['section_id'], - 'SECTION_NAME' => $this->db->Record['section_name'] - )); - - $this->template->set_var('SELECTED',""); - for ($i = 0 ; $i < count($section_ary) ; $i++) { - if ($section_ary[$i] == $this->db->Record['section_id']) { - $this->template->set_var('SELECTED',"SELECTED"); - } - } - - $this->template->parse("section_rows","section_row",true); - } - - if (!$this->perm->have_perm("story,storyeditor")) { - $this->template->set_var(array( - 'AUTHOR_ID' => $this->auth->auth['uid'], - 'AUTHOR_NAME' => $this->auth->auth['uname'] - )); - - # $this->template->set_var('AUTHOR_SELECTED',""); - $this->template->set_var('AUTHOR_SELECTED',"SELECTED"); - $this->template->parse("author_rows","author_row",true); - - } else { - $q = "SELECT author_id, - author_name - FROM psl_author "; - $q .= " ORDER BY author_name "; - - $this->db->query($q); - - while ($this->db->next_record()) { - $this->template->set_var(array( - AUTHOR_ID => $this->db->Record['author_id'], - AUTHOR_NAME => $this->db->Record['author_name'] - )); - $this->template->set_var('AUTHOR_SELECTED',""); - if ($this->db->Record['author_id'] == $user_id ){ - $this->template->set_var('AUTHOR_SELECTED',"SELECTED"); - } - - $this->template->parse("author_rows","author_row",true); - } - - } - $description = sprintf( "%s (%s) added new story %s as userid %s", $this->auth->auth['uname'], $this->auth->auth['uid'], $story_id, $user_id); - logwrite("Story Admin", $description); - $this->template->parse('OUT',array("newstory")); - $this->template->p('OUT'); - return true; - } - } ?> --- 641,644 ---- |
From: Joe S. <joe...@us...> - 2002-06-01 16:11:49
|
Update of /cvsroot/phpslash/phpslash-ft/public_html In directory usw-pr-cvs1:/tmp/cvs-serv1464/phpslash-ft/public_html Modified Files: config.php3 Log Message: Story_admin class Index: config.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/config.php3,v retrieving revision 1.142 retrieving revision 1.143 diff -C2 -d -r1.142 -r1.143 *** config.php3 1 Jun 2002 15:52:35 -0000 1.142 --- config.php3 1 Jun 2002 16:11:46 -0000 1.143 *************** *** 444,447 **** --- 444,448 ---- require($_PSL['classdir'] . "/Story_base.class"); require($_PSL['classdir'] . "/Story.class"); + require($_PSL['classdir'] . "/Story_admin.class" } |
From: Joe S. <joe...@us...> - 2002-06-01 16:11:49
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/admin In directory usw-pr-cvs1:/tmp/cvs-serv1464/phpslash-ft/public_html/admin Modified Files: storyAdmin.php3 Log Message: Story_admin class Index: storyAdmin.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/admin/storyAdmin.php3,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** storyAdmin.php3 14 Mar 2002 20:38:18 -0000 1.9 --- storyAdmin.php3 1 Jun 2002 16:11:46 -0000 1.10 *************** *** 19,23 **** slashhead($pagetitle,$xsiteobject); ! $story = new Story; if ($perm->have_perm("story")) { --- 19,23 ---- slashhead($pagetitle,$xsiteobject); ! $story = new Story_admin; if ($perm->have_perm("story")) { |
From: Joe S. <joe...@us...> - 2002-06-01 16:11:49
|
Update of /cvsroot/phpslash/phpslash-ft In directory usw-pr-cvs1:/tmp/cvs-serv1464/phpslash-ft Modified Files: CHANGES Log Message: Story_admin class Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.504 retrieving revision 1.505 diff -C2 -d -r1.504 -r1.505 *** CHANGES 1 Jun 2002 15:52:35 -0000 1.504 --- CHANGES 1 Jun 2002 16:11:46 -0000 1.505 *************** *** 13,16 **** --- 13,20 ---- 9 - Removal of something (kill -9 :) + 2002-June-1 11:00AM CDT Joe Stewart <joe...@us... + [W] - Story.class, Story_admin.class, storyAdmin.php3, config.php3 - + moved story administration methods to Story_admin class. + 2002-June-1 10:00AM CDT Joe Stewart <joe...@us... [W] - Block_i.class, Block_admin.class, blockAdmin.php3, config.php3 - |
From: Joe S. <joe...@us...> - 2002-06-01 15:52:39
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/admin In directory usw-pr-cvs1:/tmp/cvs-serv29745/phpslash-ft/public_html/admin Modified Files: blockAdmin.php3 Log Message: Block_admin class Index: blockAdmin.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/admin/blockAdmin.php3,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** blockAdmin.php3 1 Feb 2002 21:38:57 -0000 1.3 --- blockAdmin.php3 1 Jun 2002 15:52:35 -0000 1.4 *************** *** 16,20 **** /* Start Block Object */ ! $block = new Block_i; /***************************** --- 16,20 ---- /* Start Block Object */ ! $block = new Block_admin; /***************************** |
From: Joe S. <joe...@us...> - 2002-06-01 15:52:39
|
Update of /cvsroot/phpslash/phpslash-ft/public_html In directory usw-pr-cvs1:/tmp/cvs-serv29745/phpslash-ft/public_html Modified Files: config.php3 Log Message: Block_admin class Index: config.php3 =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/config.php3,v retrieving revision 1.141 retrieving revision 1.142 diff -C2 -d -r1.141 -r1.142 *** config.php3 23 May 2002 18:38:54 -0000 1.141 --- config.php3 1 Jun 2002 15:52:35 -0000 1.142 *************** *** 463,467 **** --- 463,469 ---- if ($_PSL['module']['Block']) { + require($_PSL['classdir'] . "/Block.class"); require($_PSL['classdir'] . "/Block_i.class"); + require($_PSL['classdir'] . "/Block_admin.class"); } |
From: Joe S. <joe...@us...> - 2002-06-01 15:52:38
|
Update of /cvsroot/phpslash/phpslash-ft In directory usw-pr-cvs1:/tmp/cvs-serv29745/phpslash-ft Modified Files: CHANGES Log Message: Block_admin class Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.503 retrieving revision 1.504 diff -C2 -d -r1.503 -r1.504 *** CHANGES 1 Jun 2002 15:05:38 -0000 1.503 --- CHANGES 1 Jun 2002 15:52:35 -0000 1.504 *************** *** 13,16 **** --- 13,20 ---- 9 - Removal of something (kill -9 :) + 2002-June-1 10:00AM CDT Joe Stewart <joe...@us... + [W] - Block_i.class, Block_admin.class, blockAdmin.php3, config.php3 - + moved block administration methods to Block_admin class. + 2002-June-1 9:00AM CDT Joe Stewart <joe...@us...> [WT] - functions.inc, Author.class, authorProfile.tpl - moved options display |
From: Joe S. <joe...@us...> - 2002-06-01 15:52:38
|
Update of /cvsroot/phpslash/phpslash-ft/class In directory usw-pr-cvs1:/tmp/cvs-serv29745/phpslash-ft/class Modified Files: Block_i.class Log Message: Block_admin class Index: Block_i.class =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/class/Block_i.class,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Block_i.class 20 Mar 2002 22:16:42 -0000 1.17 --- Block_i.class 1 Jun 2002 15:52:35 -0000 1.18 *************** *** 5,9 **** /* First let's bring in my parent class */ ! require($_PSL['classdir'] . '/Block.class'); /** --- 5,9 ---- /* First let's bring in my parent class */ ! // require($_PSL['classdir'] . '/Block.class'); /** *************** *** 15,19 **** */ class Block_i extends Block { ! /* Decare properties for class Block_i*/ var $psl, $templ, $debug, $argv_ary; --- 15,19 ---- */ class Block_i extends Block { ! /* Declare properties for class Block_i*/ var $psl, $templ, $debug, $argv_ary; *************** *** 60,300 **** } - - /** - * newBlock - Create a New Block - * - * Displays the form for entry of block info - * - * @access private - */ - function newBlock() { - - titlebar("100%", "Create a New Block"); - - $ary = $this->getTypes(); - $this->templ->set_block("newblock","block_type_row","block_type_rows"); - while ( list( $key, $val ) = each( $ary ) ) { - $this->templ->set_var(array( - 'BLOCK_TYPE_ID' => $key, - 'SELECTED' => "", - 'BLOCK_TYPE_NAME' => $val - )); - $this->templ->parse("block_type_rows","block_type_row",true); - } - - $this->templ->set_block("newblock","section_row","section_rows"); - $this->db->query("SELECT section_id, - section_name - FROM psl_section - ORDER BY section_name"); - while ($this->db->next_record()) { - $this->templ->set_var(array( - 'SECTION_ID' => $this->db->Record[section_id], - 'SELECTED' => "", - 'SECTION_NAME' => $this->db->Record[section_name] - )); - $this->templ->parse("section_rows","section_row",true); - } - $this->templ->set_block("newblock","each_option", "options"); - $blockcnt = $this->psl[block_optioncount]; - for ($i =1; $i <= $blockcnt; $i++) { - $this->templ->set_var(array( - 'OPTION_NAME' => "optionname[$i]", - 'OPTION_NAME_VAL' => "", - 'OPTION_VALUE' => "optionval[$i]", - 'OPTION_VALUE_VAL' => "" - )); - $this->templ->parse("options", "each_option", true); - } - - /* display a blank form */ - $this->templ->set_var(array( - 'ACTION_URL' => $this->psl['phpself'], - 'BLOCK_TITLE' => "", - 'LOCATION' => "", - 'SOURCE_URL' => "", - 'EXPIRE_LENGTH' => "", - 'CACHE_DATA' => "", - 'BLOCK_ID' => "", - 'ORDERNUM' => "" - )); - - $this->templ->parse('OUT',array("newblock")); - $this->templ->p('OUT'); - } - - /** - * editBlock - Update a New Block - * - * displays the form for block edits - * - * @param integer id - * @access private - */ - function editBlock($id) { - - titlebar("100%", "Update a Block"); - $this->getBlock($id); - - - /* - * Get the section_id's for this story into an array - */ - $q = "SELECT psl_section.section_id - FROM psl_section,psl_section_block_lut - WHERE psl_section_block_lut.block_id = '$id' - AND psl_section.section_id = psl_section_block_lut.section_id"; - $this->db->query($q); - $i = 0; - - while ($this->db->next_record()) { - $section_ary[$i] = $this->db->Record[section_id]; - $i++; - } - - $this->templ->set_block("editblock","block_type_row","block_type_rows"); - $this->templ->set_block("editblock","section_row","section_rows"); - $this->templ->set_block("editblock","each_option", "options"); - - $ary = $this->getTypes(); - while ( list( $key, $val ) = each( $ary ) ) { - $this->templ->set_var(array( - 'BLOCK_TYPE_ID' => $key, - 'SELECTED' => "", - 'BLOCK_TYPE_NAME' => $val - )); - if ($key == $this->block_info["type_id"]) { - $this->templ->set_var(array( - 'SELECTED' => "SELECTED" - )); - } - $this->templ->parse("block_type_rows","block_type_row",true); - } - - $this->db->query("SELECT section_id, - section_name - FROM psl_section - ORDER BY section_name"); - while ($this->db->next_record()) { - $this->templ->set_var(array( - 'SECTION_ID' => $this->db->Record['section_id'], - 'SECTION_NAME' => $this->db->Record['section_name'] - )); - - $this->templ->set_var(SELECTED,""); - for ($i = 0 ; $i < count($section_ary) ; $i++) { - if ($section_ary[$i] == $this->db->Record[section_id]) { - $this->templ->set_var(SELECTED,"SELECTED"); - } - } - - $this->templ->parse("section_rows","section_row",true); - } - $temparray=$this->block_info["block_options"]; - if (is_array($temparray)) { - reset($temparray); - } - $blockcnt = $this->psl['block_optioncount']; - $i = 1; - - if (is_array($temparray)) { - for ($i =1; $i <= count($temparray); $i++) { - $current=each($temparray); - if ($current) { - $this->templ->set_var(array( - 'OPTION_NAME' => "optionname[$i]", - 'OPTION_NAME_VAL' => $current[0], - 'OPTION_VALUE' => "optionval[$i]", - 'OPTION_VALUE_VAL' => $current[1] - )); - } - $this->templ->parse("options", "each_option", true); - } - if( (count($temparray) - $blockcnt) >= 0) { - $blockcnt = $i; // spit out one more; - } - } - - while ($i <= $blockcnt) { - $this->templ->set_var(array( - 'OPTION_NAME' => "optionname[$i]", - 'OPTION_NAME_VAL' => "", - 'OPTION_VALUE' => "optionval[$i]", - 'OPTION_VALUE_VAL' => "" - )); - $this->templ->parse("options", "each_option", true); - $i++; - } - - $this->templ->set_var(array( - 'ACTION_URL' => $this->psl['phpself'], - 'BLOCK_TITLE' => $this->block_info["title"], - 'LOCATION' => $this->block_info["location"], - 'SOURCE_URL' => $this->block_info["source_url"], - 'EXPIRE_LENGTH' => $this->block_info["expire_length"], - 'CACHE_DATA' => $this->block_info["cache_data"], - 'ORDERNUM' => $this->block_info["ordernum"], - 'BLOCK_ID' => $id - )); - - $this->templ->parse('OUT',array("editblock")); - $this->templ->p('OUT'); - $this->templ->set_var('OUT',""); - - } - - /** - * listBlock - list all blocks - * - * displays the complete list of blocks - * - * @access private - */ - function listBlock() { - - $query = "SELECT block.id, - title, - location, - source_url, - type.name AS type - FROM psl_block block, - psl_block_type type - WHERE type.id = block.type - ORDER BY title "; - $this->db->query($query); - - $this->templ->set_block("listblock", "row", "rows"); - $this->templ->set_block("listblock", "row2", "rows2"); - - while ($this->db->next_record()) { - - $block_id = $this->db->f("id"); - $modifyurl = $this->psl['adminurl'] ."/blockAdmin.php3?submit=edit&id=". $block_id; - $delurl = $this->psl['adminurl'] ."/blockAdmin.php3?submit=delete&id=". $block_id; - $viewurl = $this->psl['adminurl'] ."/blockAdmin.php3?submit=view&id=". $block_id; - - $this->templ->set_var(array( - 'MODIFYURL' => $modifyurl, - 'DELURL' => $delurl, - 'VIEWURL' => $viewurl, - 'TITLE' => $this->db->f("title"), - 'URL' => $this->db->f("location"), - 'SOURCE_URL' => $this->db->f("source_url"), - 'TYPE' => $this->db->f("type") - )); - if ($i%2 == 0) { - $this->templ->parse("rows","row","true"); - } else { - $this->templ->parse("rows","row2","true"); - } - $i++; - } - - titlebar("100%", "Update the Current Blocks"); - - $this->templ->parse('OUT', array("listblock")); - $this->templ->p('OUT'); - } - /** * getAllBlocksForIndex - wrapper to getBlocks --- 60,63 ---- *************** *** 398,479 **** } } - - /** - * listBlockTypes - display a list of all available block types - * - * displays the complete list of available block types - * Used only by admin - * - * @param string option - * @access public - */ - function listBlockTypes($option="", $name="") { - - $this->templ = new Template($this->psl['templatedir']); - $this->templ->debug = 0; - $this->templ->set_file(array( - listblocktypes => "blocktypeList.tpl" - )); - - titlebar("100%","Manage Block Types"); - - if( $option == "all") { - - $fulldirlist = dir($this->psl['classdir']); - $i=1; - while( $eachfile = $fulldirlist->read()) { - $each = $this->psl['classdir'] . "/" . $eachfile; - if( (is_file($each)) AND - ( preg_match('/Block_render_/i', $each)) ) { - - $eachtype = str_replace("Block_render_", "", $eachfile); - $eachtype = str_replace(".class", "", $eachtype); - $avail_ary[$eachtype] = $i; - $i++; - } - } - - $current_types = $this->getTypes(); - - $this->templ->set_block("listblocktypes", "removerow", "removerows"); - - while( list($key, $val) = each($current_types) ) { - $current_type = $val; - $this->templ->set_var(array( - REMOVENAME => $current_type, - REMOVEURL => $this->psl['phpself'] ."?option=delete". $this->psl['amp'] ."name=". $current_type - - )); - $this->templ->parse("removerows","removerow",true); - if( isset($avail_ary[$current_type])) { - unset($avail_ary[$current_type]); - - } - - } - $this->templ->set_block("listblocktypes","addrow","rows"); - while( list($key, $val) = each($avail_ary) ) { - - $this->templ->set_var(array( - 'ADDNAME' => $key, - 'ADDURL' => $this->psl[phpself] ."?option=add". $this->psl[amp] ."name=". $key - )); - $this->templ->parse("rows","addrow",true); - - } - - $this->templ->parse('OUT',array("listblocktypes")); - $this->templ->p('OUT'); - } elseif ($option == "add") { - $this->putType($name); - $this->listBlockTypes("all"); - } elseif ($option == "delete") { - $this->deleteType($name); - $this->listBlockTypes("all"); - } else { - echo "<A HREF=" . $this->psl['phpself'] . "?submit=display" . $this->psl['amp'] . "option=all>[Add or Remove Block Types]</A>"; - } - } - } /* End class Block_i */ --- 161,164 ---- |
From: Joe S. <joe...@us...> - 2002-06-01 15:05:42
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/templates/en/basic In directory usw-pr-cvs1:/tmp/cvs-serv20464/phpslash-ft/public_html/templates/en/basic Modified Files: authorProfile.tpl Log Message: displayOptions Index: authorProfile.tpl =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/templates/en/basic/authorProfile.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** authorProfile.tpl 31 May 2002 16:45:56 -0000 1.2 --- authorProfile.tpl 1 Jun 2002 15:05:39 -0000 1.3 *************** *** 36,39 **** --- 36,41 ---- <td class="descr"><input type="text" name="{DOPTION_VALUE}" value="{DOPTION_VALUE_VAL}" size="20" /></td> <!-- END each_default_option --> + <!-- BEGIN each_option --> + <!-- END each_option --> <tr> </table> |
From: Joe S. <joe...@us...> - 2002-06-01 15:05:42
|
Update of /cvsroot/phpslash/phpslash-ft/public_html/templates/en/default In directory usw-pr-cvs1:/tmp/cvs-serv20464/phpslash-ft/public_html/templates/en/default Modified Files: authorProfile.tpl Log Message: displayOptions Index: authorProfile.tpl =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/public_html/templates/en/default/authorProfile.tpl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** authorProfile.tpl 31 May 2002 16:45:56 -0000 1.2 --- authorProfile.tpl 1 Jun 2002 15:05:39 -0000 1.3 *************** *** 38,41 **** --- 38,43 ---- </TR> <!-- END each_default_option --> + <!-- BEGIN each_option --> + <!-- END each_option --> </TABLE> <INPUT type="hidden" name="author_id" value="{AUTHOR_ID}"> |
From: Joe S. <joe...@us...> - 2002-06-01 15:05:41
|
Update of /cvsroot/phpslash/phpslash-ft In directory usw-pr-cvs1:/tmp/cvs-serv20464/phpslash-ft Modified Files: CHANGES Log Message: displayOptions Index: CHANGES =================================================================== RCS file: /cvsroot/phpslash/phpslash-ft/CHANGES,v retrieving revision 1.502 retrieving revision 1.503 diff -C2 -d -r1.502 -r1.503 *** CHANGES 31 May 2002 19:29:24 -0000 1.502 --- CHANGES 1 Jun 2002 15:05:38 -0000 1.503 *************** *** 13,16 **** --- 13,20 ---- 9 - Removal of something (kill -9 :) + 2002-June-1 9:00AM CDT Joe Stewart <joe...@us...> + [WT] - functions.inc, Author.class, authorProfile.tpl - moved options display + to generalized function displayOptions. + 2002-May-31 2:00PM CDT Joe Stewart <joe...@us...> [FTD] - functions.inc - new function, emailNotify. General function to |