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] |
06 Aug 2002 00:31:01 | postnuke_official/html/modules/ns-addstory | admin.php,1.46.2.12,1.46.2.13 | judgej |
Bug 588086 - detect block-html and suppress nl2br if present. Provide means for admin to over-ride this. |
Update of /home/cvsroot/postnuke_official/html/modules/ns-addstory In directory ns7.hostnuke.net:/tmp/cvs-serv5947/html/modules/ns-addstory Modified Files: Tag: PostNuke_71 admin.php Log Message: Bug 588086 - detect block-html and suppress nl2br if present. Provide means for admin to over-ride this. Index: admin.php =================================================================== RCS file: /home/cvsroot/postnuke_official/html/modules/ns-addstory/Attic/admin.php,v retrieving revision 1.46.2.12 retrieving revision 1.46.2.13 diff -C2 -d -r1.46.2.12 -r1.46.2.13 *** admin.php 4 Aug 2002 22:07:22 -0000 1.46.2.12 --- admin.php 6 Aug 2002 00:30:59 -0000 1.46.2.13 *************** *** 71,75 **** $bgcolor2, $currentFile, ! $opPrefix, $ihome, $comm, --- 71,75 ---- $bgcolor2, $currentFile, ! $opPrefix, $ihome, $comm, *************** *** 114,120 **** $topic = 1; } echo "<br><br>"; ! storyPreview($subject, $story, $bodytext, $notes="", $topic); ! storyEdit($subject, $story, $bodytext, $notes="", $topic, $ihome="", $catid, $alanguage, $comm, $aid="", $informant=""); buildProgramStoryMenu($automated); buildCalendarMenu(false, $year, $day, $month, $hour, $min); --- 114,125 ---- $topic = 1; } + + // Guess the format type. + $format_type = defaultFormatType($story, $bodytext); + echo "<br><br>"; ! // Pass in format_type=0 at this stage to assume format is text. ! storyPreview($subject, $story, $bodytext, $notes="", $topic, $format_type); ! storyEdit($subject, $story, $bodytext, $notes="", $topic, $ihome="", $catid, $alanguage, $comm, $aid="", $informant="", $format_type); buildProgramStoryMenu($automated); buildCalendarMenu(false, $year, $day, $month, $hour, $min); *************** *** 161,165 **** $ihome, $alanguage, ! $comm) = pnVarCleanFromInput('automated', 'year', 'day', --- 166,173 ---- $ihome, $alanguage, ! $comm, ! $format_type, ! $format_type_home, ! $format_type_body) = pnVarCleanFromInput('automated', 'year', 'day', *************** *** 178,189 **** 'ihome', 'alanguage', ! 'comm'); global $boxstuff, $bgcolor1, $bgcolor2, ! $currentFile, $opPrefix; list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); --- 186,208 ---- 'ihome', 'alanguage', ! 'comm', ! 'format_type', ! 'format_type_home', ! 'format_type_body'); global $boxstuff, $bgcolor1, $bgcolor2, ! $currentFile, $opPrefix; + if (!isset($format_type)) { + $format_type = 0; + } + + if (isset($format_type_home) && isset($format_type_body)) { + $format_type = ($format_type_body%4)*4 + $format_type_home%4; + } + list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); *************** *** 218,223 **** } echo "<br><br>"; ! storyPreview($subject, $hometext, $bodytext, $notes, $topic); ! storyEdit($subject, $hometext, $bodytext, $notes, $topic, $ihome, $catid, $alanguage, $comm, $uid, $author); echo "<input type=\"hidden\" NAME=\"qid\" size=\"50\" value=\"$qid\">" ."<input type=\"hidden\" NAME=\"uid\" size=\"50\" value=\"$uid\">"; --- 237,242 ---- } echo "<br><br>"; ! storyPreview($subject, $hometext, $bodytext, $notes, $topic, $format_type); ! storyEdit($subject, $hometext, $bodytext, $notes, $topic, $ihome, $catid, $alanguage, $comm, $uid, $author, $format_type); echo "<input type=\"hidden\" NAME=\"qid\" size=\"50\" value=\"$qid\">" ."<input type=\"hidden\" NAME=\"uid\" size=\"50\" value=\"$uid\">"; *************** *** 264,268 **** $ihome, $alanguage, ! $comm) = pnVarCleanFromInput('automated', 'year', 'day', --- 283,289 ---- $ihome, $alanguage, ! $comm, ! $format_type_home, ! $format_type_body) = pnVarCleanFromInput('automated', 'year', 'day', *************** *** 281,285 **** 'ihome', 'alanguage', ! 'comm'); global $currentFile, $opPrefix; --- 302,308 ---- 'ihome', 'alanguage', ! 'comm', ! 'format_type_home', ! 'format_type_body'); global $currentFile, $opPrefix; *************** *** 302,305 **** --- 325,339 ---- } + if (!isset($format_type_home)) { + $format_type_home = 0; + } + + if (!isset($format_type_body)) { + $format_type_body = 0; + } + + // Lowest two bits is the home format type, next two bits is the body format type. + $format_type = (($format_type_body%4)*4) + ($format_type_home%4); + // Get category from catID - needed for authorisation $column = &$pntable['stories_cat_column']; *************** *** 324,329 **** } ! $hometext = nl2br($hometext); ! $bodytext = nl2br($bodytext); $notes = nl2br($notes); --- 358,371 ---- } ! // Only add br tags if the format type is text. ! ! if ($format_type_home == 0) { ! $hometext = nl2br($hometext); ! }; ! ! if ($format_type_body == 0) { ! $bodytext = nl2br($bodytext); ! } ! $notes = nl2br($notes); *************** *** 358,362 **** '" . pnVarPrepForStore($ihome) . "', '" . pnVarPrepForStore($alanguage) . "', ! '" . pnVarPrepForStore($comm) . "')"); if ($result === false) { error_log("DB ERROR: can not add story " . $dbconn->ErrorMsg()); --- 400,405 ---- '" . pnVarPrepForStore($ihome) . "', '" . pnVarPrepForStore($alanguage) . "', ! " . pnVarPrepForStore($comm) . ")"); ! if ($result === false) { error_log("DB ERROR: can not add story " . $dbconn->ErrorMsg()); *************** *** 393,397 **** $column[informant], $column[notes], $column[ihome], $column[themeoverride], $column[alanguage], ! $column[withcomm]) VALUES (" . pnVarPrepForStore($nextid) . ", " . pnVarPrepForStore($catid) . ", --- 436,440 ---- $column[informant], $column[notes], $column[ihome], $column[themeoverride], $column[alanguage], ! $column[withcomm], $column[format_type]) VALUES (" . pnVarPrepForStore($nextid) . ", " . pnVarPrepForStore($catid) . ", *************** *** 409,413 **** '', '" . pnVarPrepForStore($alanguage) . "', ! '" . pnVarPrepForStore($comm) . "')"); if ($result === false) { error_log("ERROR: add Story, can not add story" . $dbconn->ErrorMsg()); --- 452,457 ---- '', '" . pnVarPrepForStore($alanguage) . "', ! '" . pnVarPrepForStore($comm) . "', ! '" . pnVarPrepForStore($format_type) . "')"); if ($result === false) { error_log("ERROR: add Story, can not add story" . $dbconn->ErrorMsg()); *************** *** 486,490 **** {$column['topic']}, {$column['notes']}, {$column['ihome']}, {$column['alanguage']}, {$column['withcomm']}, {$column['aid']}, ! {$column['informant']} FROM {$pntable['stories']} WHERE {$column['sid']}=$sid"); --- 530,534 ---- {$column['topic']}, {$column['notes']}, {$column['ihome']}, {$column['alanguage']}, {$column['withcomm']}, {$column['aid']}, ! {$column['informant']}, {$column['format_type']} FROM {$pntable['stories']} WHERE {$column['sid']}=$sid"); *************** *** 503,507 **** } ! list($catid, $subject, $hometext, $bodytext, $topic, $notes, $ihome, $alanguage, $comm, $aid, $informant) = $result->fields; $result->Close(); $result = $dbconn->Execute("SELECT {$catcolumn['title']} --- 547,551 ---- } ! list($catid, $subject, $hometext, $bodytext, $topic, $notes, $ihome, $alanguage, $comm, $aid, $informant, $format_type) = $result->fields; $result->Close(); $result = $dbconn->Execute("SELECT {$catcolumn['title']} *************** *** 525,532 **** OpenTable(); echo "<center><font class=\"pn-title\"><b>"._EDITARTICLE."</b></font></center><br>"; ! storyPreview($subject, pnVarPrepForDisplay(unnltobr($hometext)), pnVarPrepForDisplay(unnltobr($bodytext)), pnVarPrepForDisplay(unnltobr($notes)), $topic); echo "<form action=\"$currentFile\" method=\"post\">"; ! storyEdit($subject, $hometext, $bodytext, $notes, $topic, $ihome, $catid, $alanguage, $comm, $aid, $informant); echo "<input type=\"hidden\" NAME=\"sid\" size=\"50\" value=\"$sid\">" --- 569,578 ---- OpenTable(); echo "<center><font class=\"pn-title\"><b>"._EDITARTICLE."</b></font></center><br>"; ! ! // judgej - Removed pre-processing of strings to preview. ! storyPreview($subject, $hometext, $bodytext, unnltobr($notes), $topic, $format_type); echo "<form action=\"$currentFile\" method=\"post\">"; ! storyEdit($subject, $hometext, $bodytext, $notes, $topic, $ihome, $catid, $alanguage, $comm, $aid, $informant, $format_type); echo "<input type=\"hidden\" NAME=\"sid\" size=\"50\" value=\"$sid\">" *************** *** 657,661 **** $ihome, $alanguage, ! $comm) = pnVarCleanFromInput('sid', 'subject', 'hometext', --- 703,709 ---- $ihome, $alanguage, ! $comm, ! $format_type_home, ! $format_type_body) = pnVarCleanFromInput('sid', 'subject', 'hometext', *************** *** 666,674 **** 'ihome', 'alanguage', ! 'comm'); global $currentFile, $opPrefix; list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); --- 714,734 ---- 'ihome', 'alanguage', ! 'comm', ! 'format_type_home', ! 'format_type_body'); global $currentFile, $opPrefix; + if (!isset($format_type_home)) { + $format_type_home = 0; + } + + if (!isset($format_type_body)) { + $format_type_body = 0; + } + + $format_type = (($format_type_body%4)*4) + ($format_type_home%4); + list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); *************** *** 690,695 **** $result->Close(); ! $hometext = nl2br($hometext); ! $bodytext = nl2br($bodytext); $notes = nl2br($notes); --- 750,762 ---- $result->Close(); ! // TODO: handle these. ! if ($format_type_home == 0) ! { ! $hometext = nl2br($hometext); ! } ! if ($format_type_body == 0) ! { ! $bodytext = nl2br($bodytext); ! } $notes = nl2br($notes); *************** *** 713,717 **** $column[ihome]='" . pnVarPrepForStore($ihome) . "', $column[alanguage]='" . pnVarPrepForStore($alanguage) . "', ! $column[withcomm]='" . pnVarPrepForStore($comm) . "' WHERE $column[sid]=" . pnVarPrepForStore($sid)); if ($result === false) { --- 780,785 ---- $column[ihome]='" . pnVarPrepForStore($ihome) . "', $column[alanguage]='" . pnVarPrepForStore($alanguage) . "', ! $column[withcomm]='" . pnVarPrepForStore($comm) . "', ! $column[format_type]='" . pnVarPrepForStore($format_type) . "' WHERE $column[sid]=" . pnVarPrepForStore($sid)); if ($result === false) { *************** *** 756,760 **** ."<form action=\"$currentFile\" method=\"post\">"; ! storyEdit($subject="", $hometext="", $bodytext="", $notes="", $topic, $ihome, $catid="", $alanguage="", $comm, $aid="", $informant=""); buildProgramStoryMenu($automated); buildCalendarMenu(false, $year, $day, $month, $hour, $min); --- 824,828 ---- ."<form action=\"$currentFile\" method=\"post\">"; ! storyEdit($subject="", $hometext="", $bodytext="", $notes="", $topic, $ihome, $catid="", $alanguage="", $comm, $aid="", $informant="", defaultFormatType("", "")); buildProgramStoryMenu($automated); buildCalendarMenu(false, $year, $day, $month, $hour, $min); *************** *** 802,806 **** $alanguage, $notes, ! $comm) = pnVarCleanFromInput('automated', 'year', 'day', --- 870,876 ---- $alanguage, $notes, ! $comm, ! $format_type_home, ! $format_type_body) = pnVarCleanFromInput('automated', 'year', 'day', *************** *** 816,820 **** 'alanguage', 'notes', ! 'comm'); global $bgcolor1, --- 886,892 ---- 'alanguage', 'notes', ! 'comm', ! 'format_type_home', ! 'format_type_body'); global $bgcolor1, *************** *** 825,828 **** --- 897,910 ---- $opPrefix; + if (!isset($format_type_home)) { + $format_type_home = 0; + } + + if (!isset($format_type_body)) { + $format_type_body = 0; + } + + $format_type = (($format_type_body%4)*4) + ($format_type_home%4); + list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); *************** *** 845,850 **** echo "<center><font class=\"pn-title\"><b>"._PREVIEWSTORY."</b></font></center><br><br>" ."<form action=\"$currentFile\" method=\"post\">"; ! storyPreview($subject, $hometext, $bodytext, $notes, $topic); ! storyEdit($subject, $hometext, $bodytext, $notes, $topic, $ihome, $catid, $alanguage, $comm, $aid="", $informant=""); buildProgramStoryMenu($automated); buildCalendarMenu(true, $year, $day, $month, $hour, $min); --- 927,932 ---- echo "<center><font class=\"pn-title\"><b>"._PREVIEWSTORY."</b></font></center><br><br>" ."<form action=\"$currentFile\" method=\"post\">"; ! storyPreview($subject, $hometext, $bodytext, $notes, $topic, $format_type); ! storyEdit($subject, $hometext, $bodytext, $notes, $topic, $ihome, $catid, $alanguage, $comm, $aid="", $informant="", $format_type); buildProgramStoryMenu($automated); buildCalendarMenu(true, $year, $day, $month, $hour, $min); *************** *** 885,889 **** $alanguage, $notes, ! $comm) = pnVarCleanFromInput('automated', 'year', 'day', --- 967,973 ---- $alanguage, $notes, ! $comm, ! $format_type_home, ! $format_type_body) = pnVarCleanFromInput('automated', 'year', 'day', *************** *** 899,907 **** 'alanguage', 'notes', ! 'comm'); list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); global $currentFile, $opPrefix; --- 983,1003 ---- 'alanguage', 'notes', ! 'comm', ! 'format_type_home', ! 'format_type_body'); list($dbconn) = pnDBGetConn(); $pntable = pnDBGetTables(); + if (!isset($format_type_home)) { + $format_type_home = 0; + } + + if (!isset($format_type_body)) { + $format_type_body = 0; + } + + $format_type = (($format_type_body%4)*4) + ($format_type_home%4); + global $currentFile, $opPrefix; *************** *** 929,934 **** // appropriate translation (and some translation handlers) ! $hometext = nl2br($hometext); ! $bodytext = nl2br($bodytext); $notes = nl2br($notes); --- 1025,1036 ---- // appropriate translation (and some translation handlers) ! if ($format_type_home == 0) ! { ! $hometext = nl2br($hometext); ! } ! if ($format_type_body == 0) ! { ! $bodytext = nl2br($bodytext); ! } $notes = nl2br($notes); *************** *** 997,1001 **** $column[themeoverride], $column[alanguage], ! $column[withcomm]) VALUES ( " . pnVarPrepForStore($nextid) . ", --- 1099,1104 ---- $column[themeoverride], $column[alanguage], ! $column[withcomm], ! $column[format_type]) VALUES ( " . pnVarPrepForStore($nextid) . ", *************** *** 1014,1018 **** '', '" . pnVarPrepForStore($alanguage) . "', ! '" . pnVarPrepForStore($comm) . "')"); if ($result === false) { error_log("stories->postAdminStory: " . $dbconn->ErrorMsg()); --- 1117,1123 ---- '', '" . pnVarPrepForStore($alanguage) . "', ! '" . pnVarPrepForStore($comm) . "', ! '" . pnVarPrepForStore($format_type) . "')"); ! if ($result === false) { error_log("stories->postAdminStory: " . $dbconn->ErrorMsg()); *************** *** 1118,1122 **** $bgcolor2, $HTTP_POST_VARS, ! $user, $currentFile, $opPrefix; --- 1223,1227 ---- $bgcolor2, $HTTP_POST_VARS, ! $user, $currentFile, $opPrefix; *************** *** 1171,1178 **** echo "<center><font class=\"pn-title\"><b>"._AUTOSTORYEDIT."</b></font></center><br><br>"; ! storyPreview($title, $hometext, $bodytext, $notes, $topic ); echo "<form action=\"$currentFile\" method=\"post\">"; ! storyEdit($title, $hometext, $bodytext, $notes, $topic, $ihome, $catid, $alanguage, $comm, $aid, $informant); // echo "<br><b>"._CHNGPROGRAMSTORY."</b><br><br>"; buildCalendarMenu(true, $year, $day, $month, $hour, $min); --- 1276,1285 ---- echo "<center><font class=\"pn-title\"><b>"._AUTOSTORYEDIT."</b></font></center><br><br>"; ! $format_type = defaultFormatType($hometext, $bodytext); ! ! storyPreview($title, $hometext, $bodytext, $notes, $topic, $format_type); echo "<form action=\"$currentFile\" method=\"post\">"; ! storyEdit($title, $hometext, $bodytext, $notes, $topic, $ihome, $catid, $alanguage, $comm, $aid, $informant, $format_type); // echo "<br><b>"._CHNGPROGRAMSTORY."</b><br><br>"; buildCalendarMenu(true, $year, $day, $month, $hour, $min); *************** *** 1199,1202 **** --- 1306,1310 ---- } } + function autoSaveEdit() { *************** *** 1219,1223 **** $ihome, $alanguage, ! $comm) = pnVarCleanFromInput('anid', 'year', 'day', --- 1327,1333 ---- $ihome, $alanguage, ! $comm, ! $format_type_home, ! $format_type_body) = pnVarCleanFromInput('anid', 'year', 'day', *************** *** 1233,1241 **** 'ihome', 'alanguage', ! 'comm'); ! $hometext = nl2br($hometext); ! $bodytext = nl2br($bodytext); $notes = nl2br($notes); --- 1343,1368 ---- 'ihome', 'alanguage', ! 'comm', ! 'format_type_home', ! 'format_type_body'); + if (!isset($format_type_home)) { + $format_type_home = 0; + } ! if (!isset($format_type_body)) { ! $format_type_body = 0; ! } ! ! $format_type = (($format_type_body%4)*4) + ($format_type_home%4); ! ! if ($format_type_home == 0) ! { ! $hometext = nl2br($hometext); ! } ! if ($format_type_body == 0) ! { ! $bodytext = nl2br($bodytext); ! } $notes = nl2br($notes);
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 |