Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites
View Statistics - Next Notice - Previous NoticeDirectory filter : [ all ] / postnuke_official / html / modules / ns-addstory [ view in CVS ]
Date | Directory [filter] | File(s) [view] | Author [filter] |
04 Aug 2002 21:43:31 | postnuke_official/html/modules/ns-addstory | addstory_categories.php,1.16,1.16.2.1 admin.php,1.46.2.10,1.46.2.11 | John Cox |
added new admin |
Update of /home/cvsroot/postnuke_official/html/modules/ns-addstory In directory ns7.hostnuke.net:/tmp/cvs-serv23443/html/modules/ns-addstory Modified Files: Tag: PostNuke_71 addstory_categories.php admin.php Log Message: added new admin Index: addstory_categories.php =================================================================== RCS file: /home/cvsroot/postnuke_official/html/modules/ns-addstory/Attic/addstory_categories.php,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -C2 -d -r1.16 -r1.16.2.1 *** addstory_categories.php 14 Mar 2002 13:24:35 -0000 1.16 --- addstory_categories.php 4 Aug 2002 21:43:29 -0000 1.16.2.1 *************** *** 28,31 **** --- 28,32 ---- // ---------------------------------------------------------------------- + // Notes by AV // OK, the idea is to make 'Categories' manager a bit more intuitive to work with: *************** *** 34,43 **** --- 35,47 ---- // 3. Every 'Category' modification menu contains and/or ends up with further logical actions + if (!eregi($currentFile, $PHP_SELF)) { die ("Access Denied"); } + function _admin_cat_theme_list($selectname, $defaulttheme) { $r = "<select name=\"${selectname}\">"; + $r .= "<option value=\"\""; if ($defaulttheme == "") { *************** *** 46,49 **** --- 50,54 ---- $r .= ">"._CATOVERRIDENONE."</option>"; + $handle = opendir('themes'); $themelist = array(); *************** *** 55,58 **** --- 60,64 ---- closedir($handle); + sort($themelist); for ($i = 0; $i < sizeof($themelist); ++$i) { *************** *** 66,74 **** --- 72,83 ---- } + $r .= "</select>"; + return ($r); } + function AddCategory() { *************** *** 81,84 **** --- 90,94 ---- echo "<br>"; + if (!pnSecAuthAction(0, 'Stories::Category', '::', ACCESS_ADD)) { echo _STORIESADDCATNOAUTH; *************** *** 87,90 **** --- 97,101 ---- } + OpenTable(); echo "<center><font class=\"pn-title\"><b>"._CATEGORYADD."</b></font><br>" *************** *** 100,106 **** --- 111,119 ---- CloseTable(); + include ("footer.php"); } + function EditCategory($catid) { *************** *** 108,114 **** --- 121,129 ---- $opPrefix; + list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); + $catid += 0; $column = &$pntable['stories_cat_column']; *************** *** 117,122 **** --- 132,139 ---- WHERE $column[catid] = '$catid'"); + list($title, $themeoverride) = $result->fields; + include ("header.php"); GraphicAdmin(); *************** *** 126,129 **** --- 143,147 ---- echo "<br>"; + if (!pnSecAuthAction(0, 'Stories::Category', "$title::$catid", ACCESS_EDIT)) { echo _STORIESEDITCATNOAUTH; *************** *** 132,137 **** --- 150,157 ---- } + OpenTable(); + echo "<center><font class=\"pn-title\"><b>"._EDITCATEGORY."</b></font><br>"; if (!$catid) { *************** *** 145,148 **** --- 165,169 ---- // echo "<option name=\"catid\" value=\"0\" $selcat>Articles</option>"; + while(list($catid, $title) = $selcat->fields) { echo "<option name=\"catid\" value=\"$catid\" $selcat>".pnVarPrepForDisplay($title)."</option>"; *************** *** 175,182 **** --- 196,205 ---- echo "</center>"; + CloseTable(); include("footer.php"); } + // we need $catid param to be able to carry on from previous op function DelCategory($cat, $catid) *************** *** 186,192 **** --- 209,217 ---- $ModName; + list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); + include ("header.php"); GraphicAdmin(); *************** *** 196,199 **** --- 221,225 ---- echo "<br>"; + $column = &$pntable['stories_cat_column']; $result = $dbconn->Execute("SELECT $column[title] *************** *** 201,206 **** --- 227,234 ---- WHERE $column[catid]='$cat'"); + list($title) = $result->fields; + if (!pnSecAuthAction(0, 'Stories::Category', "$title::$cat", ACCESS_DELETE)) { echo _STORIESDELCATNOAUTH; *************** *** 209,217 **** --- 237,248 ---- } + OpenTable(); echo "<center><font class=\"pn-title\"><b>"._DELETECATEGORY."</b></font><br>"; + if (isset($catid)) { + $column = &$pntable['stories_cat_column']; $thiscat = $dbconn->Execute( "SELECT $column[catid] *************** *** 220,227 **** --- 251,260 ---- list($thiscat) = $thiscat->fields; + $column = &$pntable['stories_cat_column']; $selcat = $dbconn->Execute("SELECT $column[catid], $column[title] FROM $pntable[stories_cat]"); + echo "<form action=\"$currentFile\" method=\"post\">" ."<table border=\"3\" cellpadding=\"4\"><tr><td>" *************** *** 230,235 **** --- 263,270 ---- ."<select name=\"cat\">"; + while(list($catid, $title) = $selcat->fields) { + if ($catid == $thiscat) { $sel = "selected "; *************** *** 239,242 **** --- 274,278 ---- echo "<option name=\"cat\" value=\"$catid\" $sel>".pnVarPrepForDisplay($title)."</option>"; + $selcat->MoveNext(); } *************** *** 250,253 **** --- 286,290 ---- } else { + /* Get a quick count of the rows - Wandrer */ $column = &$pntable['stories_column']; *************** *** 255,260 **** --- 292,299 ---- WHERE $column[catid]='$cat'"); + list($numrows) = $result2->fields; + if ($numrows == 0) { $temp= &$pntable['stories_cat_column']['catid']; // TRICKY BIT - may need to be changed *************** *** 281,291 **** --- 320,333 ---- } + function YesDelCategory($catid) { global $currentFile; + list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); + $column = &$pntable['stories_cat_column']; $result = $dbconn->Execute("SELECT $column[title] *************** *** 293,298 **** --- 335,342 ---- WHERE $column[catid]='$catid'"); + list($title) = $result->fields; + if (!pnSecAuthAction(0, 'Stories::Category', "$title::$cat", ACCESS_DELETE)) { echo _STORIESDELCATNOAUTH; *************** *** 308,311 **** --- 352,356 ---- } + $column = &$pntable['stories_column']; $result = $dbconn->Execute("SELECT $column[sid] *************** *** 313,316 **** --- 358,362 ---- WHERE $column[catid]='$catid'"); + while(list($sid) = $result->fields) { $results = $dbconn->Execute("DELETE FROM $pntable[stories] *************** *** 346,349 **** --- 392,396 ---- } + function NoMoveCategory($catid, $newcat) { *************** *** 351,357 **** --- 398,406 ---- $opPrefix; + list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); + $column = &$pntable['stories_cat_column']; $result = $dbconn->Execute("SELECT $column[title] *************** *** 359,362 **** --- 408,412 ---- WHERE $column[catid]='$catid'"); + list($title) = $result->fields; include ("header.php"); *************** *** 367,370 **** --- 417,421 ---- echo "<br>"; + if (!pnSecAuthAction(0, 'Stories::Category', "$title::$catid", ACCESS_DELETE)) { echo _STORIESMOVECATNOAUTH; *************** *** 373,376 **** --- 424,428 ---- } + OpenTable(); echo "<center><font class=\"pn-title\"><b>"._MOVESTORIES."</b></font><br><br>"; *************** *** 385,388 **** --- 437,441 ---- // echo "<option name=\"newcat\" value=\"0\">"._ARTICLES."</option>"; + while(list($newcat, $title) = $selcat->fields) { if (pnSecAuthAction(0, 'Stories::Story', ":$title:", ACCESS_ADD)) *************** *** 403,406 **** --- 456,460 ---- WHERE $column[catid]='$catid'"); + while(list($sid) = $resultm->fields) { $column = &$pntable['stories_column']; *************** *** 430,444 **** --- 484,502 ---- } + function SaveEditCategory($catid, $title, $themeoverride) { global $currentFile; + list($title, $themeoverride) = pnVarCleanFromInput('title', 'themeoverride'); + list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); + if (!pnSecAuthAction(0, 'Stories::Category', "$title::$catid", ACCESS_EDIT)) { include 'header.php'; *************** *** 448,453 **** --- 506,513 ---- } + $catid += 0; + $column = &$pntable['stories_cat_column']; $check = $dbconn->Execute("SELECT $column[catid] *************** *** 472,475 **** --- 532,536 ---- } + include ("header.php"); GraphicAdmin(); *************** *** 485,499 **** --- 546,564 ---- } + function SaveCategory($title, $themeoverride) { global $currentFile; + list($title, $themeoverride) = pnVarCleanFromInput('title', 'themeoverride'); + list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); + if (!pnSecAuthAction(0, 'Stories::Category', "$title::", ACCESS_ADD)) { include 'header.php'; *************** *** 503,506 **** --- 568,572 ---- } + $column = &$pntable['stories_cat_column']; $check = $dbconn->Execute("SELECT $column[catid] *************** *** 525,528 **** --- 591,595 ---- } + include ("header.php"); GraphicAdmin(); *************** *** 542,545 **** --- 609,613 ---- } + function SelectCategory($cat) { *************** *** 547,553 **** --- 615,623 ---- $opPrefix; + list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); + $column = &$pntable['stories_cat_column']; $selcat = $dbconn->Execute("SELECT $column[catid], $column[title] *************** *** 555,558 **** --- 625,629 ---- echo "<b>"._CATEGORY."</b> "; + echo "<select name=\"catid\" class=\"pn-text\">"; if ($cat == 0) { *************** *** 565,568 **** --- 636,640 ---- } + while(list($catid, $title) = $selcat->fields) { if ($catid == $cat) { *************** *** 578,588 **** --- 650,664 ---- echo "</select>"; + add_edit_del_category($cat); + } + // below are helper API function for this module // probably they will be made redundant in later releases (AV) + function add_edit_del_category($cat) { *************** *** 590,593 **** --- 666,670 ---- $opPrefix; + if (pnSecAuthAction(0, 'Stories::Category', '::', ACCESS_DELETE)) { echo ' [ <a href="'.$currentFile.'?module='.$GLOBALS["module"].'&op='.$opPrefix.'AddCategory">'._ADD.'</a>'; *************** *** 601,604 **** } } - ?> --- 678,680 ---- Index: admin.php =================================================================== RCS file: /home/cvsroot/postnuke_official/html/modules/ns-addstory/Attic/admin.php,v retrieving revision 1.46.2.10 retrieving revision 1.46.2.11 diff -C2 -d -r1.46.2.10 -r1.46.2.11 *** admin.php 29 Jul 2002 12:27:02 -0000 1.46.2.10 --- admin.php 4 Aug 2002 21:43:29 -0000 1.46.2.11 *************** *** 28,31 **** --- 28,32 ---- // ---------------------------------------------------------------------- + // Modifications by Andy Varganov - the file was almost unmanageable with // more than 2500 lines of code, so I have splitted it in three parts: *************** *** 36,51 **** --- 37,58 ---- [...1269 lines suppressed...] *************** *** 1672,1678 **** } function unnltobr($text) { return (preg_replace('/(<br[ \/]*?>)/i', "", $text)); } ! ?> --- 1859,1867 ---- } + function unnltobr($text) { return (preg_replace('/(<br[ \/]*?>)/i', "", $text)); } ! ! ?> \ No newline at end of file
View Statistics - Next Notice - Previous Notice
Visit Developer Site - Browse CVS Repository |
Syndicate via backend.rss (max. once per hour please) | Powered by CVSNotice 0.1.3 |